function redirectPage(url, msg, time){
   var TARG_ID = "REDIRECT_ID";
   var DEF_MSG = "Lade Folgeseite...";
   var TIME    = 1000;

   if( ! msg ){
      msg = DEF_MSG;
   }

   if( ! url ){
      throw new Error('Keine URL gefunden');
   }
   
   if ( ! time ){
    time = TIME;
   }


   var e = document.getElementById(TARG_ID);

   if( ! e ){
      throw new Error('REDIRECT_ID nicht gefunden');
   }

   var cTicks = parseInt(e.innerHTML);

   var timer = setInterval(function(){
      if( cTicks ){
         e.innerHTML = --cTicks;
      }else{
         clearInterval(timer);
         //document.body.innerHTML = msg;
         location = url;	  
      }

   }, time);
}

function setCookie(_cookieName,_cookieValue,_x) {
  var today = new Date();
  var expire = new Date();
  if (_x==null || _x==0) _x=1;
  /*
  Cookie wird gesetzt fÃ¼r x Tage
  FÃ¼r x Stunden * 24 lÃ¶schen
  FÃ¼r x Minuten * 60 * 24 lÃ¶schen
  (_x * 1000 * 60 * 60 * 24)
  */
  expire.setTime(today.getTime() + (_x * 1000 * 60 * 60));
  document.cookie = _cookieName+"="+escape(_cookieValue)+ ";expires="+expire.toGMTString()+ ";path=/";
  if(_x>0) return getCookie(_cookieName);
}

function getCookie(_cookieName){
  thisCookie = document.cookie.split("; ")
  for (i=0; i<thisCookie.length; i++) {
    if (_cookieName == thisCookie[i].split("=")[0]) {
      _cookieValue=thisCookie[i].split("=")[1];
      return unescape(_cookieValue);
    }
  }
  return;
}

function switchImage(_we_objectID, imgSrc, imgTitle){
  imgName='add_'+_we_objectID;
  if (document.images){
    if (imgSrc != "none"){
      document.images[imgName].src = imgSrc;
      if (imgTitle != ""){
        document.images[imgName].title = imgTitle;
      }
    }
  }
}

function call_xAddItemToBasket(_we_objectID){
  startAnim();
  // IE braucht eine VerzÃ¶gerung
  window.setTimeout(function(){ xajax_xAddItemToBasket(_we_objectID, xajax.getFormValues('form_product_ids')); }, 60); 
  return false;
}

function addObj(_we_objectID, _mode, _showDetail){

  if(!_mode || _mode=='') _mode='de';
  
  if(_showDetail && _showDetail!=''){
    return document.write('<a href="javascript:void(0);" onclick="return call_xAddItemToBasket(' + _we_objectID + ');"><img id="add_' + _we_objectID + '" src="/2011/images/in-den-warenkorb.png" border="0" title=" In den Warenkorb "></a>');
    
  }else{
    return document.write('<a href="javascript:void(0);" onclick="xajax_xAddItemToBasket('+_we_objectID+', xajax.getFormValues(\'form_product_ids\')); return false;"><img id="add_' + _we_objectID + '" src="/2011/images/add.png" border="0" title=" In den Warenkorb "></a>');  
  }
}

function showList(_we_objectID, _weC_objectID, _mode, _print){
  // console.log('showList(' + _we_objectID +','+ _weC_objectID +','+ _mode +','+ _print + ')');
  return true;
}
/*****************************************************************************************************
**
** TOOL - FLASH CHECK V2
**
** Dateiname:			flcheck_v2.js
** Letzte Änderung:		19.02.2009 (Ilja Leipold)
**
*****************************************************************************************************
**
** INFOMATION
**
** Vielen Dank an Colin Moock (moock.org). Von ihm stammt das eigentliche Grundgerüst dieses Scriptes.
** erste Anpassung, Abänderung bzw. Modifizierung wurden von Heiko Pfefferkorn durchgeführt.
** Heiko Pfefferkorn (o2cell.com) (work: i-fabrik.de)
**
****************************************************************************************************/

/*****************************************************************************************************
** ANWENDUNG:
**
** Benutze folgenden Codeblock (von "<script language="JavaScript">" bis "</noscript>")
** um Flash oder um einen selbstdefinierbaren "No-Flash-Standard-String" oder einen
** selbstdefinierbaren "No-Script-String" anzuzeigen!
*****************************************************************************************************
** BLOCK:
**
** <script language="JavaScript">
** var flashVersion = 5;
** var stringFlash = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" '
** 			    + 'width="200" height="170" id="yourID" align=""> '
** 			    + '<param name="movie" value="your.swf"> '
** 				+ '<param name="flashvars" value="varName=varValue"> '
** 			    + '<param name="loop" value="false"> '
** 			    + '<param name="menu" value="false"> '
** 	    		+ '<param name="quality" value="best"> '
** 			    + '<param name="bgcolor" value="#ffffff"> '
** 			    + '<embed type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" '
** 				+ 'src="your.swf" '
** 			    + 'width="200" height="170" '
** 				+ 'flashvars="varName=varValue" '
** 			    + 'loop="false" '
** 				+ 'menu="false" '
** 				+ 'quality="best" '
** 				+ 'bgcolor="#ffffff" '
** 				+ 'name="yourID" align=""> '
** 				+ '</embed></object>';
**
** var stringNoFlash = '<font face="Verdana" size="1" color="#cccccc">'
** 				+ '<b>You don not have the actuell Macromedia Flash Plugin</b>'
** 				+ '</font>';
**
** writeFlash(stringFlash, stringNoFlash, flashVersion);
** </script>
** <noscript>Javascript not supported</noscript>
**
*****************************************************************************************************
** flashVersion		= die Flashversion die das aktuelle SWF-File hat bzw. die Version ab der sie
**					  das Flash anzeigen wollen. Geben Sie zum Beispiel als Version max. 5 an und
**					  haben Ihr SWF aber mit Version 6 veröffentlicht dann steht das meisten noch
**					  mit im "object" - Tag.
**					  Sind also die "2" Flashversionen unterschiedlich dann wird immer autom. die
**					  genommen die im "object" - Tag steht
** stringFlash		= der string der ausgegeben wird wenn die Flashversion bei dem User
**					  korrekt ist (flashVersion)
** stringNoFlash	= der string der ausgegeben wird wenn die Flashversion bei dem User nicht mit
**					  "flashVersion" übereinstimmt bzw. kein Flash erkannt wurde
** noScript-Tag		= das müsste ja wohl jeder wissen :-)
****************************************************************************************************/

var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;    	// TRUE wenn IE
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false; // TRUE wenn auf Windows
var installedVersion=-1;


/* Detect Flash
---------------*/
function detectFlash(flV) {
  if(isIE && isWin){
  	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
  	document.write('on error resume next \n');
    for (var i = 0; i <= flV; i++) {
      document.write('if IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+i+'")) then installedVersion = '+i+'  \n');
    }
    document.write('</SCR' + 'IPT\> \n');
  }else{
    if (navigator.plugins) {
      var parseRevisionStrToInt = function(str){
    		return parseInt(str.replace(/[a-zA-Z]/g, ""), 10) || -1;
    	};
    	var parseStandardVersion = function(str){
    		var descParts = str.split(/ +/);
    		var majorMinor = descParts[2].split(/\./);
    		var revisionStr = descParts[3];
    		return {
    			"raw":str,
    			"major":parseInt(majorMinor[0], 10),
    			"minor":parseInt(majorMinor[1], 10), 
    			"revisionStr":revisionStr,
    			"revision":parseRevisionStrToInt(revisionStr)
    		};
    	};

      for (var i = 0; i <= navigator.plugins.length; i++) {
        //for (var Eigenschaft in navigator.plugins[i])
        //  if(Eigenschaft == 'description' && navigator.plugins[i][Eigenschaft].indexOf("Flash")!=-1)
        //    console.log(Eigenschaft + ": " + navigator.plugins[i][Eigenschaft] + "\n");
        if(navigator.plugins[i] && navigator.plugins[i]['description'] && navigator.plugins[i]['description'].indexOf("Flash")!=-1){
          var version = navigator.plugins[i]['description'];
          var versionObj = parseStandardVersion(version);
          //console.log(version + "\n");
          //console.log(versionObj);
          installedVersion = versionObj.major;
        }
    	}
    }
  }
  return installedVersion;
}
  


/* Schreibe Flash
-----------------*/
function writeFlash(strFlash, strNoFlash, flVersion) {
	/* steht in "strFlash" im object-Tag eine Version und diese ist ungleich
	** mit der bereits angegebenen Version in "flVersion" dann wird "flVersion"
	** auf die Version aus dem object-Tag gesetzt
	--------------------------------------------------------------------------*/
  var Ausdruck = /#version=([^,]+),/;
  Ausdruck.exec(strFlash);
  var objectTagVersion = RegExp.$1;
  if (objectTagVersion != flVersion) {
    flVersion = objectTagVersion;
  }

	// detect flash version
	var detectedFlash = detectFlash(flVersion);

  //console.log('Benötigte Flash Version:'+flVersion+' installierte:'+detectedFlash);
	//alert('Benötigte Flash Version:'+flVersion+' installierte:'+detectedFlash);
	
  if(detectedFlash>=flVersion) {
		// schreibe flash-string
		document.write(strFlash);
	} else {
		// schreibe kein-Flash-String
		document.write(strNoFlash);
	}
}
function resizeModalWin(sWinContentId){

  var modalWin = document.getElementById('modal_win_' + sWinContentId);
  if(!modalWin) var modalWin = document.getElementById("modal_win");
  
  sWidth  = modalWin.style.width;
  sHeight = modalWin.style.height;

  sWidth  = sWidth.replace('px','');
  sHeight = sHeight.replace('px','');
  
  var modalWinContent = document.getElementById('rsid_' + sWinContentId);
  
  modalWinContent.style.width = sWidth + 'px';
  modalWinContent.style.height = sHeight + 'px';
  
  sTop = modalWinContent.parentNode.style.top;
  sLeft = modalWinContent.parentNode.style.left;

  sTop  = sTop.replace('px','');
  
  sLeft = sLeft.replace('px','');
  
  iTop = parseInt(sTop) - (parseInt(sHeight) / 2);
  iLeft = parseInt(sLeft) - (parseInt(sWidth) / 2);
  
  if(iTop<20) iTop=20;
  
  
  modalWinContent.parentNode.style.top = iTop + 'px';
  modalWinContent.parentNode.style.left = iLeft + 'px';

  modalWin.style.width = '';
}
var now = new Date();
var year = now.getYear();
if (year < 1900) {
  year += 1900;
}

function toSt2(n) {
  s = "";
  if (n < 10) s += "0";
  return (s + n).toString();
}

function toSt3(n) {
  s = "";
  if (n < 10) s += "00";
  else if (n < 100) s += "0";
  return (s + n).toString();
}

function formatTimestamp(stamp){
  d = new Date(stamp);
  return toSt2('Aktion endet am ' + d.getDate()) + '.' + toSt2(1+d.getMonth()) + '.' + d.getFullYear() + ' um ' + d.getHours() + ':' + d.getMinutes() + ' Uhr';
}

function countdown(startTime, endTime, campaignName, campaingnID) {
  if(!document.getElementById('c1')) return;
  
  if(startTime==0 && endTime==0){
    document.getElementById('aktionscounter').style.display='none';
    return;
  }
  
  document.getElementById('aktionscounter').style.display='';
  document.getElementById('c1').style.color = '#5F5F5F';
  
  d = new Date();
  count = Math.floor(endTime - d.getTime());
  
  if(count > 0) {
    miliseconds = toSt3(count%1000); count = Math.floor(count/1000);
    seconds = toSt2(count%60); count = Math.floor(count/60);
    minutes = toSt2(count%60); count = Math.floor(count/60);
    hours = toSt2(count%24); count = Math.floor(count/24);
    days = count;
    /* document.getElementById('c1').innerHTML = days + ' : ' + hours + ' : ' + minutes + ' : ' + seconds; */
    document.getElementById('c1').innerHTML = days + ' : ' + hours + ' : ' + minutes;
    document.getElementById('c2').innerHTML = formatTimestamp(endTime);
    document.getElementById('c3').innerHTML = '(' + campaignName + ')';
    setTimeout(function(){ countdown(startTime, endTime, campaignName); }, 50);
  }else if(campaignName!=''){
    /* document.getElementById('c1').innerHTML = '00 : 00 : 00 : 00'; */
    document.getElementById('c1').innerHTML = '00 : 00 : 00';
    document.getElementById('c2').innerHTML = formatTimestamp(endTime);
    document.getElementById('c3').innerHTML = '(' + campaignName + ')';
  }else{
    document.getElementById('c1').innerHTML = 'Unbekannte Laufzeit';
    document.getElementById('c2').innerHTML = '';
    document.getElementById('c3').innerHTML = 'Bitte rufen Sie die AktionsÃ¼bersicht auf.';
  }
}
// executes an onchange function after 750ms (or specified delay)
function safeOnChange( code, delay ) {
  delay = delay || 750;  
  window.clearTimeout( soc_id );  
  soc_id = window.setTimeout( code, delay );
}
// global timer ID for the safeOnChange1 function.
var soc_id = null;
function setCursor(oElement, iStart, iEnd) {
  if(typeof(oElement.value) == "undefined") return;
  if(iEnd<0) iEnd=oElement.value.length;
  if(iEnd==0) oElement.focus();
  if(oElement.setSelectionRange) {
    oElement.focus();
    oElement.setSelectionRange(iStart, iEnd);
  }
  else {
    if(oElement.createTextRange) {
      oRange=oElement.createTextRange();
      oRange.collapse(true);
      oRange.moveEnd('character', iEnd);
      oRange.moveStart('character', iStart);
      oRange.select();
    }
  }
}
var infoWin;
function showPopup(url, name) {
  var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1 ;
  var is_opera  = navigator.userAgent.toLowerCase().indexOf('opera') > -1 ;
  if (infoWin && is_opera) infoWin.close () ;

  if(!infoWin || infoWin.closed){
    infoWin = window.open(url, name, "width=450,height=500,location=no,menubar=yes,toolbar=no,resizable=yes,scrollbars=yes");
  }else{
    infoWin.location.href = url;
  }
  if (window.focus) infoWin.focus();
  return infoWin;
}
function addOnload(onloadFunc) {
  // based on http://answers.google.com/answers/threadview?id=510976
  if(this.addEventListener) {
    this.addEventListener("load", onloadFunc, false);
  } else if(this.attachEvent) {
    this.attachEvent("onload", onloadFunc);
  } else {
    var onloadOld = this.onload;
    this.onload = function() { onloadOld(); onloadFunc(); }
  }
}
  /////////////////////////////////////////////////////////////////////////////
 /////////////////////////   Magic Animation 1.0   ///////////////////////////
/////////////////////////////////////////////////////////////////////////////

// Animation styles used in Magic /////////////////////////////////////////////

function styleLinear(x) { return x; }
function styleSin(x) { return Math.sin(x*Math.PI/2); }
function stylePulse(x) { return (Math.sin(x*2*Math.PI) + 1) / 2; }
function styleBounce(x) { return (x == 0) ? 0 : (((-Math.sin(x*25)/(x*25))+1)*(1-x))+x; }
function styleBounceLess(x) { return (x == 0) ? 0 : (((-Math.sin(x*15)/(x*15))+1)*(1-x))+x; }
function styleBounceMore(x) { return (x == 0) ? 0 : (((-Math.sin(x*35)/(x*35))+1)*(1-x))+x; }

// Magic Animation Core ///////////////////////////////////////////////////////

magic = new function ()
{
	this.effects = [];
	this.interval;
	this.frequency = 30;
	
	this.remove = function(effect)
	{
		var i = 0;
		while (i < this.effects.length) 
			if (this.effects[i] == effect) 
				this.effects.splice(i, 1);
			else i++;
				
		if (this.effects.length == 0) 
			window.clearInterval(this.interval);
	}
	
	this.tick = function()
	{
		for (var i=0; i<this.effects.length; i++)			
			this.effects[i].tick();
	}

	this.add = function(effect)
	{
		this.effects.push(effect);
		if (this.effects.length == 1)
			this.interval = window.setInterval(function() {magic.tick();}, this.frequency);	
	}
}


function effectObject(elementId, ticksToStart, speed, action, style, loop, coAction, endAction) 
{		
	this.elementId = elementId;
	this.ticksToStart = (ticksToStart == undefined) ? 0 : ticksToStart;
	this.speed = speed;
	this.now = 0;
	this.action = action;
	this.coAction = coAction;
	this.endAction = endAction;
	this.loop = (loop == undefined) ? false : loop;
	this.style = (style == undefined) ? styleSin : style;
	this.tick = function()
	{
		if (this.ticksToStart > 0)
		{
			this.ticksToStart--;
			return;
		}
		
		if (this.now > 100)
		{
			if (this.loop)
				this.now = 0;
			else
			{
				magic.remove(this);				
				if (this.endAction != undefined) 
					this.endAction();
			}
		}
		else
		{
			if (typeof elementId == 'string' && document.getElementById(elementId) == null)
			{
				magic.remove(this);
				return;
			}			
			this.action();
			
			if (this.coAction != undefined)
				this.coAction();
			
			this.now += this.speed;
			if (this.now > 100) this.now = 101;			
		}
	}
	
	magic.add(this);
}

// Magic Effects //////////////////////////////////////////////////////////////


function changeNumber(element, what, suffix, value1, value2, speed, ticksToStart, style, loop, coAction, endAction)
{
	action = function()
	{
		if(!this.element) return;
    this.element.style[this.what] = Math.round(this.value1 + this.style(this.now/100)*(value2-value1)) + suffix;
	}
	effect = new effectObject(element, ticksToStart, speed, action, style, loop, coAction, endAction);
	effect.element = (typeof element == 'string') ? document.getElementById(element) : element;
	effect.what = what;
	effect.value1 = value1;
	effect.value2 = value2;
}

function fade(element, opacity1, opacity2, speed, ticksToStart, style, loop, coAction, endAction)
{
	action = function()
	{		
		this.element.style.opacity = this.opacity1 + this.style(this.now/100) * (this.opacity2-this.opacity1);
		this.element.style.filter = "alpha(opacity=" + this.element.style.opacity*100 + ")";
	}
	effect = new effectObject(element, ticksToStart, speed, action, style, loop, coAction, endAction);
	effect.element = (typeof element == 'string') ? document.getElementById(element) : element;
	effect.opacity1 = opacity1;
	effect.opacity2 = opacity2;
}

function move(element, top1, left1, top2, left2, speed, ticksToStart, style, loop, coAction, endAction)
{	
	changeNumber(element, "top", "px", top1, top2, speed, ticksToStart, style, loop, coAction, endAction);
	changeNumber(element, "left", "px", left1, left2, speed, ticksToStart, style, loop);
}

function scale(element, width1, height1, width2, height2, speed, ticksToStart, style, loop, coAction, endAction)
{
	changeNumber(element, "width", "px", width1, width2, speed, ticksToStart, style, loop, coAction, endAction);
	changeNumber(element, "height", "px", height1, height2, speed, ticksToStart, style, loop);
}

function morph(element1, element2, width1, height1, width2, height2, speed, ticksToStart, style, loop, coAction, endAction)
{
	scale(element1, width1, height1, width2, height2, speed, ticksToStart, style, loop, coAction, endAction);
	scale(element2, width1, height1, width2, height2, speed, ticksToStart, style, loop);
	fade(element1, 1, 0, speed, ticksToStart, style, loop);
	fade(element2, 0, 1, speed, ticksToStart, style, loop);
}

 /////////////////////////  (c) Miso Antonic 2007  ///////////////////////////
/*
Copyright (c) 2006, Gustavo Ribeiro Amigo
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
    * Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

*/

    function Sound(options) {
        
        this.options = options;
        if(this.options == undefined) this.options = new Object();
        
        if(!this.options.swfLocation) {
            this.options.swfLocation = "/SoundBridge.swf";
        }
    
        if(Sound.id_count == undefined) {
            Sound.id_count = 1;
        } else {
            Sound.id_count ++;
        }
        
        if(Sound.instances == undefined) {
            Sound.instances = new Object();
        }
        
        this.object_id = 'object_id_' + Sound.id_count;
        
        Sound.instances[this.object_id] = this;
        
        movie_swf = this.options.swfLocation;
        movie_id = this.object_id;
        
        movie_element = "";
        movie_element += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="0" height="0"'; 
        movie_element += ' id="' + movie_id+ '"'; 
        movie_element += ' align="middle">';
        movie_element += '<param name="movie" value="'+movie_swf+'" />';
        movie_element += '<param name="quality" value="high" />';
        movie_element += '<param name="bgcolor" value="#ffffff" />';
        movie_element += '<param name="FlashVars" value="id='+ movie_id +'"/>';
        movie_element += '<param name="allowScriptAccess" value="always"/>';
        movie_element += '<embed src="'+movie_swf+'" FlashVars="id='+ movie_id +'"'; 
        movie_element += ' allowScriptAccess="always" quality="high" bgcolor="#ffffff" width="0" height="0"'; 
        movie_element += ' name="' + movie_id + '" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
        movie_element += '</object>';    

        if( document.getElementById('__sound_flash__') == undefined) {
            var element = document.createElement("div");
            element.id = "__sound_flash__";
            document.body.appendChild(element);
        }
        
        document.getElementById('__sound_flash__').innerHTML += movie_element; 
        
    }
    
    Sound.prototype.loadSound = function(url, streaming) {
        return Sound.__call('loadSound',this.object_id, url, streaming);
    }
    
    Sound.prototype.start= function() {
        return Sound.__call('start', this.object_id);
    }

    Sound.prototype.stop = function() {
        return Sound.__call('stop', this.object_id);
    }
    
    Sound.prototype.getId3 = function() {
        return Sound.__call('id3', this.object_id);
    }
    
	Sound.prototype.getPan = function() {
    	return Sound.__call('getPan', this.object_id);
	}
	
	Sound.prototype.getTransform = function() {
		return Sound.__call('getTransform', this.object_id);
	}
	
	Sound.prototype.getVolume = function(){
		return Sound.__call('getVolume', this.object_id);
	}
	
	Sound.prototype.setPan = function(value){
    	return Sound.__call('setPan', this.object_id, value);	
	}
	
	Sound.prototype.setTransform = function(transformObject){
    	return Sound.__call('setTransform', this.object_id, transformObject);		
	}
	
	Sound.prototype.setVolume = function(value){
    	return Sound.__call('setVolume', this.object_id, value);			
	}
	
	Sound.prototype.start = function(secondOffset, loops){
	    return Sound.__call('start', this.object_id, secondOffset, loops);
	}
	
	Sound.prototype.getDuration = function(){
	    return Sound.__call('getDuration', this.object_id);
	}
	
	Sound.prototype.setDuration = function(value){
	    return Sound.__call('setDuration', this.object_id, value);	
	}
	
	Sound.prototype.getPosition = function(){
        return Sound.__call('getPosition', this.object_id);		
	}
	
	Sound.prototype.setPosition = function(value){
	    return Sound.__call('setPosition', this.object_id, value);		
	}

	Sound.prototype.getBytesLoaded = function(){
	    return Sound.__call('getBytesLoaded', this.object_id);		
	}
	
	Sound.prototype.getBytesTotal = function(){
        return Sound.__call('getBytesTotal', this.object_id);			
	}
	
	Sound.prototype.onLoad = function(success){
        Sound.trace('Sound:onLoad('+success+') event triggered');
	}	
    
    Sound.onLoad = function(object_id, success) {
        //Sound.trace('Sound.onLoad('+success+') object_id=' + object_id);
        Sound.instances[object_id].onLoad(success);
    }
    
	Sound.prototype.onSoundComplete = function(){
        Sound.trace('Sound:onSoundComplete() event triggered');
	}	    
    
    Sound.onSoundComplete = function(object_id) {
        Sound.instances[object_id].onSoundComplete;
    }   
    
	Sound.prototype.onID3 = function(){
        Sound.trace('Sound:onID3() event triggered');
	}	    
    
    Sound.onID3 = function(object_id) {
        Sound.instances[object_id].onID3();        
    }    
    
    Sound.trace = function(value, isJavascript) {
        if(document.getElementById('sound_tracer') != undefined) {
            if(isJavascript == undefined || isJavascript == true) {
                document.getElementById('sound_tracer').value += 'Javascript: ' + value + '\n';            
            } else {
                document.getElementById('sound_tracer').value += value + '\n';            
            }
        }
    }  
    
    Sound.__thisMovie = function(movieName) {
        if (navigator.appName.indexOf("Microsoft") != -1) {
            return window[movieName]
        }
        else {
            return document[movieName]
        }
    }
    
    Sound.__call = function () {
        Sound.trace('Sound.__call '+ arguments[0]+ ' on object_id ' + arguments[1] );    
        var functionname = arguments[0];
        var object_id = arguments[1];        
        var justArgs = new Array();
        if (arguments.length > 1)   {
           for (var i = 2; i < arguments.length; i++ ) {
             justArgs.push(arguments[i]);
           }
        }        
        return Sound.__thisMovie(object_id).proxyMethods(functionname, justArgs);
    } 

