//Scripts ©2001 - 2008 Charles Houghton-Webb and all those who inspired me greatly :-)
var PicArray = new Array();wid=624;hei=440;col=16;brStrN="document."; brStrO="document.all.";
var nav="x"; docstr="document.";objstr="";st0="hide";st1="show";stimer='';ftimer='';ttimer='';thetimer='';initmsg="Welcome to BW Music";var slideArray=new Array(); slideCount=-2; totSlides=0;flashcnt=0;flashend=8;
var curr=0;strg='';themsg='';cnt=0;strg="";TheHelpBox='';newWindow='';newwin='';ret=0;spd=25;timeInterval=1000;
//-----------------------
function checkbrowser(){
if(document.getElementById) TheHelpBox=document.getElementById('help');
else if(document.all) TheHelpBox=help;
wid=screen.width;hei=screen.height;col=screen.colorDepth;
bName = navigator.appName;
docstr="document."
if(bName == "Netscape") {nav="N"
} else if(bName=="Microsoft Internet Explorer") {nav="E"; docstr="document.all.";objstr=".style";st0="hidden";st1="visible"
} else {nav="x"
}return nav;
}
//-----------------------
function mailwin(who,addr,where,dom,lang,y,x){
var x = x+100, y = y+100;
var ltext1="";ltext2="";ltext3="";ltext4="";
  if(lang==1) {
	  ltext1="To send an e-mail to ";
	  ltext2="CLICK HERE!";
	  ltext3="If you have changed your mind";
	  ltext4="or";
  }else{
	  ltext1="Pour envoyer un courriel &agrave ";
	  ltext2="CLIQUEZ ICI!";
	  ltext3="Si vous avez chang&eacute; d'avis";
	  ltext4="ou";
  }
var params='width=280,height=180,top='+y+',screenY='+y+',left='+x+',screenX='+x+',alwaysRaised=yes,menubar=no,location=no,resizable=no,scrollbars=yes,alwaysRaised=yes';
newwin=window.open("","displayWindow",params);
var text="<html><head><title>BW Mail</title><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'></head><body bgcolor=000000><table width='260' border='4' cellspacing='0' cellpadding='6'><tr><td>";
var temp=addr + String.fromCharCode(64) + where + String.fromCharCode(46) + dom;
newwin.document.write(text);
bodystr1='<p align="center"><form name=\'\' action=../Common/\'\' style="text-align:center"><a href="mail' + 'to:' + temp + '" style="text-decoration:none; color:#CC9900" onMouseOver="this.style.color=\'#00FF00\'" onMouseOut="this.style.color=\'#CC9900\'" onClick="window.close()"><b>' + ltext1 + who + '<br>(' + temp + ')<br>' + ltext2 + '</b></a></form></p>' + ltext4 + '...<br>'
bodystr2='<p align="center"><a href="#" style="text-decoration:none; color:#0000FF" onMouseOver="this.style.color=\'#FF0000\'" onMouseOut="this.style.color=\'#0000FF\'" onClick="window.close()"><b>' + ltext3 + '<br>' + ltext2 + '</b></a></p>';
closestr='</td></tr></table></body></html>';
newwin.document.write(bodystr1);
newwin.document.write(bodystr2);
newwin.document.write(closestr);
}
//-----------------------
function smsg(n) {
if(n=="def") n=initmsg;
window.status=n;
document.retval=true;
}
//-----------------------
function doBgImg(rowID,state) {
newImage = "url(Common/rowbg" + state + ".png)";
document.getElementById(rowID.id).style.backgroundImage = newImage;
}
//-----------------------
function Goto(address) {
document.location.href = address;
}
//-----------------------
function groll(nme,pic,n){
i=(pic-1)*2+n;
theimg=String(nme);
eval(docstr+nme).src=PicArray[i].src;
}
//-----------------------
function helptxt(n){
	clearInterval(stimer);
	clearInterval(ttimer);
	clearInterval(ftimer);
	if(n=='') n=' ';
	if(n!=="def"){
	n='<div align="center" class=Help_Style><font color="#663300"><b>' + n + '</b></font></div>';
	document.getElementById("help").innerHTML=n;
	}
	else {n=initmsg;
		ripple(n);
	}
}
//-----------------------



function flashit(){
if(document.getElementById||document.all){
	FlashThis=document.getElementById('flash');
	if(Math.round(flashcnt/2)==flashcnt/2){
FlashThis.innerHTML='<div class=Help_Style><font color="#FF6600"><b><u>'+strg+'</u></b></font></div>';
	}
	else{FlashThis.innerHTML='<div class=Help_Style><b>'+strg+'</b></div>';
	}
}else{
	FlashThis=flash;
	if(Math.round(flashcnt/2)==flashcnt/2){
ns4tw.document.write('<div class=Help_Style><font color="#FF6600"><b><u>'+strg+'</b></u></font></div>');ns4tw.document.close();
}
	else{ns4tw.document.write('<div class=Help_Style><b>'+strg+'</b></div>');ns4tw.document.close();
	}
}
flashcnt+=1;
if(flashcnt>=flashend){
	flashcnt=0;
	clearInterval(ftimer);
	flashend=Math.floor(Math.random()*20);
	timeInterval=Math.floor(Math.random()*2000);
	setTimeout("setftimer(timeInterval);", 100);
}
}
//-----------------------
function Doflash(msg){
	strg=msg;
	flashcnt=0;
	flashend=12;
	clearInterval(ftimer);
	setftimer(200);
}
//-----------------------
function setftimer(theperiod){
	ftimer = setInterval("flashit();",theperiod);
}
//-----------------------
function sweep(){
	if((curr<=themsg.length && ret==0) || (curr>=0 && ret==1)){
	strg='';
	for(var lp=0;lp<themsg.length;lp++){
		if(lp==curr) strg+='<font color="#FFFF00">'+themsg.charAt(curr)+'</font>'; else strg+=themsg.charAt(lp);
		}
	if(document.getElementById||document.all) TheHelpBox.innerHTML='<div class=Help_Style><b>'+strg+'</b></div>';
	else{
	ns4tw.document.write('<div class=Help_Style><b>'+strg+'</b></div>');ns4tw.document.close();
	}
		if(ret==0) {
			if(curr<themsg.length) curr++; else {
				clearInterval(ttimer);
				curr=themsg.length-1;
				ret=1;
				ttimer=setInterval("sweep();",spd);
			}
		} else {
			if(curr>0) curr--; else {
				clearInterval(ttimer);
				curr=themsg.length;
				curr=0;
				ret=0;
				ttimer=setInterval("sweep();",spd);
			}
		}
	}
}
//-----------------------
function ripple(n){
if(n==""){helptxt(n);smsg(n);return true;}
clearInterval(ttimer);
ret=0;
curr=0;
themsg=n;
smsg(n);
	if( n=='' || n==' ') {
		if(document.getElementById||document.all) {
			TheHelpBox.innerHTML='<div class=Help_Style><b>�</div>';
			} else {
			ns4tw.document.write('<div class=Help_Style><b>�</b></div>');ns4tw.document.close();
			}
	} else {
		ttimer=setInterval("sweep();",spd);
	}
}
//-----------------------
function plpics(){
ln=arguments.length-1;
var pth=arguments[0];
	for(i=0;i<ln;i++){
		j=2*i;
		SplitString = arguments[i+1].split(".",2);
		var suff=SplitString[1];
		if(suff!=null){suff="."+suff;}else{suff="";}
		var pth0=pth + SplitString[0] + "0" + suff;
		var pth1=pth + SplitString[0] + "1" + suff;
		PicArray[j]=new Image();
		PicArray[j].src=pth0;
		PicArray[j+1]=new Image();
		PicArray[j+1].src=pth1;
	}
}
//-----------------------
function doScroll(){
strg=strg+themsg.charAt(cnt);
if(document.getElementById||document.all)TheHelpBox.innerHTML='<div class=Help_Style><b>'+strg+'</b></div>';
else{ns4tw.document.write('<div class=Help_Style><b>'+strg+'</b></div>');ns4tw.document.close();}
if(cnt<themsg.length)cnt++;
else {clearInterval(ftimer);
		anim(1,0);
		ripple(initmsg);
		}
}
//-----------------------
function initScroll(n){
themsg=n;
initmsg=n;
cnt=0;
stimer=setInterval("doScroll();",100);
}
//-----------------------
function closeit(){this.window.close();}
//-----------------------
function reinit(){
this.window.captureEvents(Event.CLICK);
this.window.onclick = window.close;
}
//-----------------------
function pictwin(capn, pth, wdth, hght,y,x) {
var x = x+100, y = y+100;
if (wdth< 115) {wwdth=140}else{wwdth=wdth+30};
if (hght< 100) {whght=152}else{whght=hght+94};
if (wwdth> wid) {wwdth=wid-24};
if (whght> hei) {whght=hei-40};
paramstr="window.open('','','top="+y+",left="+x+",screenY="+y+",screenX="+x+",width=" + String(wwdth) + ",height=" + String(whght) + ",menubar=no,scrollbars=yes,resizable=yes,location=no,alwaysRaised=yes')";
initstr="<html><head><title>BW Music</title></head><body bgcolor=#000000><p><center>";
pictstr='<a href="#" onClick="window.close()"><img src="' + pth + '" border="0" width="'+ wdth + '" height="' + hght + '"></a>';
textstr='<br><br><font color="#FFFFFF">' + capn + '<br></font><font color="#CCCCCC"><i>(Click on picture to close - Cliquez sur l\'image pour fermer)</i></font>';
closestr='</center></body></html>';
newwin = eval(paramstr);
if (nav=="N"){
	newwin.captureEvents(Event.RESIZE);
	newwin.onresize=reinit;}
if (!newwin.opener) newwin.opener = self;
with (newwin.document) {
open();
write(initstr);
write(pictstr);
write(textstr);
write(closestr);
close();
   }
}
//-----------------------
function pictwin1(capn,pth,lang,y,x) {
var x = x+100, y = y+100;
if(lang==1) {
	ltext1="(Click on the picture to close)";
}else{
	ltext1="(Cliquez sur l\'image pour fermer)";
}
paramstr="window.open('','','top="+y+",left="+x+",screenY="+y+",screenX="+x+",width=502,height=566,menubar=no,scrollbars=yes,resizable=yes,location=no,alwaysRaised=yes')";
initstr="<html><head><title>BW Music</title></head><body bgcolor=#000000><p><center>";
pictstr='<a href="#" onClick="window.close()"><img src="' + pth + '" border="0" width="472" height="472"></a>';
textstr='<br><br><font color="#FFFFFF">' + capn + '<br></font><font color="#CCCCCC"><i>'+ ltext1 +'</i></font>';
closestr='</center></body></html>';
newwin = eval(paramstr);
if (nav=="N"){
	newwin.captureEvents(Event.RESIZE);
	newwin.onresize=reinit;}
if (!newwin.opener) newwin.opener = self;
with (newwin.document) {
open();
write(initstr);
write(pictstr);
write(textstr);
write(closestr);
close();
   }
}
//-----------------------
function quickwin(addr,winName){
if (!newWindow || newWindow.closed) {
newWindow=window.open(addr,winName, "top=0,left=0,width=680,height=680,menubar=yes,scrollbars=yes,resizable=yes,location=yes,toolbar=yes");}
if (window.focus) {newWindow.focus();}
}
//-----------------------

function quickwin1(addr,winName,w,h){
if (!newWindow || newWindow.closed) {
	var paramStr = "top=0,left=0,width=" + w + ",height=" + h + ",menubar=yes,scrollbars=yes, resizable=yes,location=yes,toolbar=yes" 
newWindow=window.open(addr,winName,paramStr);}
if (window.focus) {newWindow.focus();}
}



function unesc(str){
  var unescped = str.split("'");
  unescped = unescped.join("'");
  return unescped;
}
//-----------------------
function audwin(capn, pictpth, trackname, audiopth, lang, y, x) {
var x = x+100, y = y+100;
wwdth=280;
whght=420;
if(lang==1) {
	ltext1="(Click on the picture to close)";
}else{
	ltext1="(Cliquez sur l\'image pour fermer)";
}
if (newwin && newwin.open && !newwin.closed) newwin.close();
if  (trackname.length<19) {while (trackname.length<37) {trackname=" "+trackname+" ";}}
paramstr="window.open('','','top="+y+",left="+x+",screenY="+y+",screenX="+x+",width=" + String(wwdth) + ",height=" + String(whght) + ",menubar=no,scrollbars=yes,resizable=yes,location=no,alwaysRaised=yes')";
initstr='<html><head><title>BW Music</title></head><body bgcolor=000000><p><center>'
pictstr='<a href="#" onClick="window.close()"><img src="../' + pictpth + '" border="0" width="250" height="250"></a>';
audstr='<p><font color="#FFFF00">' + trackname + '</p><embed src="../' + audiopth + '" autostart=true loop=false kioskmode="true" volume=100 width="240" height="44"></embed>'
textstr='<br><font color="#FFFFFF" size="-2">' + capn + '</font><br><font color="#FF9999"><i>'+ltext1+'</i></font>'
closestr='</center></body></html>'
newwin = eval(paramstr);
if (nav=="N"){
	newwin.captureEvents(Event.RESIZE);
	newwin.onresize=reinit;}
if (!newwin.opener) newwin.opener = self;
with (newwin.document) {
open();
write(initstr);
write(pictstr);
write(audstr);
write(textstr);
write(closestr);
close();
   }
}
//<<<<<<<<<<<<<<<<<---------------------------->>>>>>>>>>>>>>>>>>>
function rollover(nom, OverSrc) {
var img = eval((nav == 'N') ? brStrN+nom : brStrO+nom);

	if (img) {
		img.OrigSrc = img.src;
		img.src = OverSrc;
	}
}
//<<<<<<<<<<<<<<<<<---------------------------->>>>>>>>>>>>>>>>>>>
function rollout(nom) {
var img = eval((nav == 'N') ? brStrN+nom : brStrO+nom);
	if (img && img.OrigSrc) {
		img.src = img.OrigSrc;
		img.OrigSrc = null;
	}
}
//<<<<<<<<<<<<<<<<<---------------------------->>>>>>>>>>>>>>>>>>>
function NoConfirm () {
win = top;
win.opener = top;
win.close ();
}
//*************************************************************************//
function opacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
}
//*************************************************************************//
//change the opacity for different browsers
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}
//*************************************************************************//
function blendimage(divID, imageid, imagefile, millisec){
var speed = Math.round(millisec / 10);
var timer = 0;
//set the current image as background
document.getElementById(divID).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")";
//make image transparent
changeOpac(0, imageid);
//make new image
document.getElementById(imageid).src = imagefile;
//fade in image
for(i = 0; i <= 100; i++)
  {
  setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed));
  timer++;
  }
}
//*************************************************************************//
function SlideEm(divID,imageid,Disptime) {
  if(slideCount==totSlides-2){slideCount=-1;}else{slideCount+=1;}
  var nextImage=slideArray[slideCount+1].src;
  changeOpac(0, imageid);
  blendimage(divID,imageid,nextImage,200);
  setTimeout("SlideEm('"+divID+"','"+imageid+"',"+Disptime+")",Disptime);
}
//*************************************************************************//
function sroll(divID,pic){
eval(docstr+divID).src=slideArray[pic].src;
}
//*************************************************************************//
function plslides(){
totSlides=arguments.length-1;
var pth=arguments[0];
	for(i=0;i<totSlides;i++){
		pthEnd = arguments[i+1];
		thePath = pth + pthEnd;
		slideArray[i]=new Image();
		slideArray[i].src=thePath;
	}
	//alert(totSlides);
}
//*************************************************************************//
function DHTMLSound(surl) {
  document.getElementById("dummyspan").innerHTML=
	"<embed src='"+surl+"' hidden=true autostart=true loop=false>";
}
//*************************************************************************//

function DHTMLStopSound(surl) {
  document.getElementById("dummyspan").innerHTML=
	"<embed src='"+surl+"' hidden=true autostart=false loop=false>";
}