var hoverImage=new Image();hoverImage.src="img/start_hover.png";var startImage=new Image();startImage.src="img/start_button.png";var closeHover=new Image();closeHover.src="img/close_hover.png";var closeNormal=new Image();closeNormal.src="img/close_but.png";var backGroundImages=new Array();backGroundImages[0]=new Image();backGroundImages[0].src="img/index1.jpg";backGroundImages[1]=new Image();backGroundImages[1].src="img/index2.jpg";backGroundImages[2]=new Image();backGroundImages[2].src="img/index3.jpg";backGroundImages[3]=new Image();backGroundImages[3].src="img/index4.jpg";backGroundImages[4]=new Image();backGroundImages[4].src="img/index5.jpg";backGroundImages[5]=new Image();backGroundImages[5].src="img/index6.jpg";var currentImage=Math.floor((backGroundImages.length)*Math.random());var bugurl="http://www.6tunes.com/server/add_bug.php";var morebugs="";var lang="en";sixTLanguage=new Array();sixTLanguage["nl"]=new Array();sixTLanguage["en"]=new Array();sixTLanguage["nl"][0]="Bedankt voor je feedback!<br><br>Klik ";sixTLanguage["nl"][1]="hier";sixTLanguage["nl"][2]=" om meer feedback te geven.";sixTLanguage["en"][0]="Thanks for your feedback!<br><br>Click ";sixTLanguage["en"][1]="here";sixTLanguage["en"][2]=" to add more.";function init(language){if(language){lang=language;}
$('bkgrnd_image').src=backGroundImages[currentImage].src;fadeIn("bkgrnd_image",0);}
function setOpacity(id,opacity){$(id).style.filter="alpha(opacity:"+opacity+")";$(id).style.KHTMLOpacity=opacity/100;$(id).style.MozOpacity=opacity/100;$(id).style.opacity=opacity/100;}
function nextImage(){fadeOut('bkgrnd_image',100);}
function fadeIn(id,opacity){if(opacity<=100){this.setOpacity(id,opacity);opacity+=10;setTimeout("fadeIn('"+id+"', "+opacity+")",100);}else{setTimeout("nextImage()",10000);}}
function fadeOut(id,opacity){if(opacity>=0){this.setOpacity(id,opacity);opacity-=10;setTimeout("fadeOut('"+id+"', "+opacity+")",50);}else{currentImage++;if(currentImage>=backGroundImages.length){currentImage=0;}
$('bkgrnd_image').src=backGroundImages[currentImage].src;fadeIn("bkgrnd_image",0);}}
function $(id){return docuement.getElementById(id);}
function $show(id){$(id).style.display="block";}
function $hide(id){$(id).style.display="none";}
function navigate(dest){switch(dest){case"about":$show("text");$show("about");$hide("feedback");$hide("contact");break;case"contact":$show("text");$show("contact");$hide("feedback");$hide("about");break;case"feedback":$show("text");$show("feedback");$hide("contact");$hide("about");break;}}
function openMinimized(){var Player=window.open('player.html?language='+lang,'6tunesPlayer','height = 740, width = 725,  top = 100, left = 350, status = no, toolbar = no, location = no, menubar = no, directories = no, resizable = no, scrollbars = no');}
function send_bug(){var args="mail="+$value('bug_email')+"&bugs="+$value('bug_message');$ajaxPost(bugurl,args,bug_uploaded);}
function bug_uploaded(response){morebugs=$('bug_report').innerHTML;$('bug_report').innerHTML="<br><br>"+sixTLanguage[lang][0]+"<a href='#' onclick='return more_bugs();'>"+sixTLanguage[lang][1]+"</a> "+sixTLanguage[lang][2];}
function $(id){return document.getElementById(id);}
function $value(id){return $(id).value;}
function $ajaxPost(url,args,fname){if(args==null){args=""};var xmlHttp;xmlHttp=null;try{xmlHttp=new XMLHttpRequest();}
catch(e){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e){try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
catch(e){alert("Your browser does not support AJAX!\nThis site will not function properly...");return false;}}}
xmlHttp.onreadystatechange=function(){if(xmlHttp.readyState==4){fname(xmlHttp.responseText);}}
xmlHttp.open("POST",url,true);xmlHttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");xmlHttp.setRequestHeader("Content-length",args.length);xmlHttp.setRequestHeader("Connection","close");xmlHttp.send(args);}
function $html(id,html){document.getElementById(id).innerHTML=html;}
function more_bugs(){$('bug_report').innerHTML=morebugs;return false;}
