/*


		                       __                                                __     
		                      /\ \                  __                          /\ \   
		  ___ ___      __     \_\ \      __  __  __/\_\  ____      __     _ __  \_\ \    ____  
		/' __` __`\  /'__`\   /'_` \    /\ \/\ \/\ \/\ \/\_ ,`\  /'__`\  /\`'__\/'_` \  /',__\ 
		/\ \/\ \/\ \/\ \_\.\_/\ \_\ \   \ \ \_/ \_/ \ \ \/_/  /_/\ \_\.\_\ \ \//\ \_\ \/\__, `\
		\ \_\ \_\ \_\ \__/.\_\ \___,_\   \ \___¤___/'\ \_\/\____\ \__/.\_\\ \_\\ \___,_\/\____/
		 \/_/\/_/\/_/\/__/\/_/\/__,_ /    \/__//__/   \/_/\/____/\/__/\/_/ \/_/ \/__,_ /\/___/ 
  <===========[CopyRight: http://cyber-web.biz 2004-2006]=============[Code:Vidar Larsen]==========>




*/

ie = document.all;
ns = document.layers;
ns6 = document.getElementById;


//---------------[AccessCSS]---------------------------------------,
function accessCSS(layerID)																			 //
{    																														//
  if(ns6){ return document.getElementById(layerID).style;}     //
   else if(ie){ return document.all[layerID].style; }         //
    else if(ns){ return document.layers[layerID]; }          //
}//---------------------------------------------------------//



//========================[Sound variables - checking for sound] ===================================//
var NSsound = navigator.plugins && navigator.plugins["LiveAudio"];  
var IEsound = navigator.plugins && document.all;		   						 
var audioEnabled = NSsound || IEsound;				  									



function newContent(layernm,content) { 
	if (ns6) document.getElementById(layernm).innerHTML=content;
	else if (ie) document.all[layernm].innerHTML=content;
	else if (ns) {					
    eval('  document.layers["'+layernm+'"].document.open();');			
    eval("  document.layers['"+layernm+"'].document.write('"+content+"');");     
    eval('  document.layers["'+layernm+'"].document.close();');		     
  } 
}

//========[crossbrowser init sound]==============//
function makeSoundDiv(soundname,newInnerHTML) {
    var oDiv = document.createElement ("DIV");
    oDiv.id = soundname;
 		oDiv.style.position = "absolute";
		oDiv.style.left=-2000;
    oDiv.innerHTML=newInnerHTML;
    document.body.appendChild (oDiv);
    delete oDiv; }
//==================================[crossbrowser init sound]========================================//
function init(soundfile,autostart,loopit) {
	soundname=soundfile;
	var buff='';
	if (loopit==null) loopit=false;
	
	if (audioEnabled) {

				if (autostart==null) autostart=false;
				buff+='<embed name="obj_'+soundname+'" src='+soundfile+' autoplay="'+autostart+'" AUTOSTART="'+autostart+'" loop="'+loopit+'" hidden="true" volume="80%" > ';
				buff+='<NOEMBED><BGSOUND src='+soundfile+'></NOEMBED>';
			  buff+='</embed> ';
	} 
	
	else { // try something else
	
		

			if (autostart==true) autostart=1; else autostart=0;
			if (loopit==true) loopit=1; else loopit=0;			
			buff+='<object type="application/x-mplayer2" ';
			buff+=' pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" ';
			buff+=' Name="obj_'+soundname+'" src='+soundfile+' AutoStart='+autostart+' ShowStatusBar=1 volume=-1 loop='+loopit+' >';
  		buff+=' </object> ';
  
  		

  		
  		
	}
	

	makeSoundDiv(soundname,"");
	makeSoundDiv(soundname+"_buffer",buff);
}


function play(soundname,loopit) {
	if (document.getElementById(soundname)) newContent(soundname,document.getElementById(soundname+"_buffer").innerHTML); 
	else init(soundname,true,loopit);
}







document.write('<div style="position:absolute;left:0;top:0;width:100%;height:30px;text-align:right;z-index:0;">');
document.write('<a href="http://site-city.net"><img src="../websys/bilder/site-city-net.gif" border="0" title="free website"></a>');
document.write('</div>');




function buttonOn(obj,count,soundNm) {

	//alert("button on "+obj+"  "+count);
//	accessCSS("buttonback"+count).backgroundImage="url(../websys/designs/images/"+obj+"_b.gif);";
//	accessCSS("buttonback"+count).backgroundImage="url(../websys/designs/images/b1_b.gif);";
//	document.getElementById("buttonback2").style.backgroundImage="url(../websys/designs/images/b1_b.gif);";
	//this.style.backgroundImage='url(sphere.jpeg)'
	accessCSS("buttonback"+count).backgroundImage='url(../websys/designs/images/'+obj+'_b.gif)';
	play("../websys/designs/sounds/"+soundNm,false);

}

function buttonOff(obj,count) {
		//alert("button off "+obj+"  "+count);
	//	accessCSS("buttonback"+count).backgroundImage="url(../websys/designs/images/"+obj+".gif);";
	accessCSS("buttonback"+count).backgroundImage='url(../websys/designs/images/'+obj+'.gif)';
}