// constants
clrBlack = "000000"
clrWhite = "FFFFFF"
clrOrange = "ff6600"
clrYellow = "ffCC00"
clrLtOrange = "ff3300"
clrMaroon = "993300"

clrBkgd0 = clrOrange
clrText0 = clrMaroon
clrBkgd1 = clrLtOrange
clrText1 = clrBlack
clrBkgd2 = clrYellow
clrText2 = clrOrange
clrBkgd3 = clrYellow
clrText3 = clrWhite
clrBkgd4 = clrBlack
clrText4 = "aaaaaa"
clrText6 = "00bbbb"

function setstyle(id,n){

   var version = browserGetVersion();
   // handle ID
   if( version != 0 )   {
      if( document.all.item(id) == null ) {
      //alert("oops: " + id);
         return;
      }
      if(version >= n ){
         switch( n ){
         case 0:
         default:
            document.all.item(id).style.color=clrText0;
            document.all.item(id).style.borderColor=clrText0;
            document.all.item(id).style.backgroundColor=clrBkgd0;
            break;
         case 1: 
            document.all.item(id).style.color=clrText1;
            document.all.item(id).style.backgroundColor=clrBkgd1;
            document.all.item(id).style.borderColor=clrText1;
            document.all.item(id).style.cursor="hand";
            break;
         case 2:
            document.all.item(id).style.color=clrText2;
            document.all.item(id).style.backgroundColor=clrBkgd2;
            document.all.item(id).style.borderColor=clrBkgd2;
            document.all.item(id).style.cursor="hand";
            break;
         case 3:
            document.all.item(id).style.color=clrText3;
            document.all.item(id).style.backgroundColor=clrBkgd3;
            document.all.item(id).style.borderColor=clrText3;
            document.all.item(id).style.cursor="hand";
            break;
         case 4: 
            document.all.item(id).style.color=clrText4;
            document.all.item(id).style.backgroundColor=clrBkgd4;
            document.all.item(id).style.borderColor=clrText4;
            document.all.item(id).style.cursor="hand";
            break;
         case 5: 
            document.all.item(id).style.color=clrWhite;
            document.all.item(id).style.cursor="hand";
            break;
         case 6: 
            document.all.item(id).style.color=clrText6;
            document.all.item(id).style.cursor="hand";
            break;
         }
      }
   }
}

function popup(page){
   w = window.open( "./" + page + ".html", 'waltersargent', 'toolbar=no,location=no,width=0,height=0,scrollbars=yes,resizable=yes' );
   if( null != w )
      w.focus();
}

function sizem(w,h){
   window.resizeTo(w,h);
}

function launch( url ){
   w = window.open( "http://" + url );
   if( null != w )
      w.focus();
}

function ss(index, style )
{
   setstyle('txt'+index.toString(),style);
   setstyle('btn'+index.toString(),style);
}

function swap(index, img )
{
   if( document.images["btn"+index.toString()] ){
      document.images["btn"+index.toString()].src= "images/" + img + ".gif";
   }
}

function mo(index, style )
{
   setstyle('txt'+index.toString(),style);
}

function mout(index, style )
{
   setstyle('txt'+index.toString(),style);
}

function iswap(i, filename)
{
   if( document.images[i] ){
      document.images[i].src= "images/" + filename;
   }
}

function gif(i, filename){
   iswap(i, filename + ".gif");
}

function dlMp3(file){
   alert("This music is for personal use only. By downloading this file, you agree not to use it for any commercial purpose, including but not limited to selling, distributing, and publishing.");
   if( "" != file ) {
      w = window.open( "mp3/" + file + ".mp3", "mp3", 'toolbar=no,location=no,width=500,height=400,scrollbars=no,resizable=no' );
      if( null != w )
         w.focus();
   }
}

function popup(file,caption,w,h){
   w = window.open( "/" + file + ".html", caption, 'toolbar=no,location=no,width=w,height=h,scrollbars=yes,resizable=yes' );
   if( null != w )
      w.focus();
}

var aCH = new Array();
aCH[0] = "adman1.gif";
aCH[1] = "cereal.gif";
aCH[2] = "charlie.gif";
aCH[3] = "cokedealercom.gif";
aCH[4] = "drool.gif";
aCH[5] = "embezzlement.gif";
aCH[6] = "euthanasia.jpg";
aCH[7] = "malpractice.gif";
aCH[8] = "satanism.gif";
aCH[9] = "shallow.gif";


function setChickenheadImage(){

	if( document.images ){
		var index = Math.floor(Math.random()*9);
		document.chickenhead.src="chickenhead/"+aCH[index];
	}
}


function writeMsg(){
	var index = Math.floor(Math.random()*9);
	var msg="";
	switch(index){
	case 0:
		msg="Gravitas et stultitia arte separare non possunt"; break;
	case 1:
		msg="&quot;I am not a dope&quot; &#8211; John Duns Scotus 1654"; break;
	case 2:
		msg="Remember to smile and act natural!"; break;
	case 3:
		msg="This CD begins and ends in the key of D &#8211; just like the word &quot;Dunderhead&quot;"; break;
	case 4:
		msg="I&rsquo;m blue, not green."; break;
	case 5:
		msg="St. Frank was right. Stupidity is more common than hydrogen."; break;
	case 6:
		msg="Dunderheadquarters is brought to you by the number orange."; break;
	case 7:
		msg="Songs are like fish. They aren&rsquo;t real if they don&rsquo;t have guts."; break;
	case 8:
		msg="If at first you don't succeed, skydiving is not for you."; break;
	case 9:
	default:
		msg="Seriousness and Silliness can not be Artificially Separated";break;
	}
	document.write(msg);
}

function writeReview(){
	var index = Math.floor(Math.random()*6);

	var msg="&quot;Laced with humor at every turn. Eerie.&quot;&nbsp;<em>Gajoob zine</em>";
	switch(index){
	case 0:
		msg="&quot;This will perk up your ears. The sense of amusement rampant throughout the disc is pretty well addicting.&quot; - Aiding & Abetting Vol IV, No. 13</em>"; break;
	case 1:"&quot;Unique. Full of radio-friendly singles. Worth checking out.&quot;&nbsp;<em>Ogyr Network Series 4/Issue 3</em>"; break;
	case 2:
	msg="&quot;Laced with humor at every turn. Eerie.&quot;&nbsp;<em>Gajoob zine</em>"; break;
	case 3:
	msg="&quot;A recording that warrents repeat listenings.&quot;&nbsp;<em>Factsheet 5 No. 57</em>"; break;
	case 4:
	msg="&quot;Unique. Quick and well-produced.&quot;&nbsp;<em>Good Times</em>"; break;
	case 5:
	default:
	msg="&quot;Sublimely creative and incredibly catchy. Everything had a beautiful patina of intelligent understatement.&quot;&nbsp;<em>Ned Dexter</em>"; break;
	}
	document.write(msg);
}

function spon(id){
	ss(id,3);
	gif("ispkr"+id, "speakermo");
}
function spoff(id){
	ss(id,2);
	gif("ispkr"+id, "speaker");
}

