//Create global variables attached to the window for the MP3 to use
var titleglobal = '';
var asinglobal = '';
var mp3_byrds = 12; // no of mp3 layers minus 1
var mp3_doors = 6;
var mp3_ccr = 6; 
var mp3_vf = 4;
var mp3_allmans = 7; 
var mp3_lynyrd = 5;
var mp3_steely = 6; 
var mp3_lizzy = 10;
var mp3_blue_nile = 3;
var mp3_kraftwerk = 5;
var mp3_heads = 4;
var mp3_zz = 2;
//Preload the navigation buttons backgrounds
nav = new Image();
nav.src = "graphics/nav.jpg";
nav2 = new Image();
nav2.src = "graphics/nav2.jpg";
hor = new Image();
hor.src = "graphics/hor.gif";
hor_over = new Image();
hor_over.src = "graphics/hor.gif";
//Check browser type
var isnav=false;
var isiex=false;
var nav4=false;
var oper=false;
var browser='';
var version=parseInt(navigator.appVersion);
if (navigator.appName=="Netscape") {
	isnav=true;
	browser='nav';
	}else{
	isiex=true;
	browser='iex';
}
//check for Opera
if (navigator.userAgent.indexOf("Opera") > -1){
	oper=true;
	browser='nav';
}
var res="";
if (screen.width > 800){
	res="1024";
	}
var tag="div";
if (isnav && version == 4){
	tag="layer";
	nav4=true;
	}
document.write('<LINK REL="StyleSheet" HREF="liquid_'+browser+res+'.css" TYPE="text/css">');
var tag="div";
function get_object(obj){
	if (typeof obj=="string"){
	if (isnav==true && version>=5){
	theobj=eval('document.getElementById("'+obj+'").style');
			}
	if (isnav==true && version==4){
	theobj=eval(container+'document.'+obj);
			}
	if (isiex==true){
	theobj=eval("document.all."+obj+".style");
			}
	} else {
		theobj=obj;
	}
	return theobj
}
function show(obj){
	var theobj=get_object(obj);
	theobj.visibility="visible";
}
function hide(obj){
	var theobj=get_object(obj);
	theobj.visibility="hidden";
}
function shift_to(obj,x,y){
	var theobj=get_object(obj);
	if (isnav==true && version>=5){
		theobj.left=x+"px";
		theobj.top=y+"px";
	}
	if (isnav==true && version==4){
		theobj.moveTo(x,y);
	}
	if (isiex==true){
		theobj.pixelLeft+=x;
		theobj.pixelTop+=y;
	}
}
function shift_by(obj,x,y){
	var theobj=get_object(obj);
	if (isnav==true && version>=5){
		theobj.left=parseInt(theobj.left)+x+"px";
		theobj.top=parseInt(theobj.top)+y+"px";
		}
	if (isnav==true && version==4){
			theobj.moveBy(x,y);
		}
	if (isiex==true){
			theobj.pixelLeft+=x;
			theobj.pixelTop+=y;
		}
}
function get_left(obj){
	var theobj=get_object(obj);
	if (isnav==true && version>=5){
		return parseInt(theobj.left);
	}
	if (isnav==true && version==4){
		return theobj.left;
	}
	if (isiex==true){
		return theobj.pixelLeft;
	}
}
function get_top(obj){
	var theobj=get_object(obj);
	if (isnav==true && version>=5){
		return parseInt(theobj.top);
	}
	if (isnav==true && version==4){
		return theobj.top;
	}
	if (isiex==true){
		return theobj.pixelTop;
	}
}	
function get_width(obj){
	var theobj=get_object(obj);
	if (isnav==true && version>=5){
		return parseInt(theobj.width);

	}
	if (isnav==true && version==4){
		return theobj.width;
	}
	if (isiex==true){
		return theobj.pixelWidth;
	}
}
function get_height(obj){
	var theobj=get_object(obj);
	if (isnav==true && version>=5){
		return parseInt(theobj.height);
	}
	if (isnav==true && version==4){
		return theobj.height;
	}
	if (isiex==true){
		return theobj.pixelHeight;
	}
}	
function set_clip(obj,top,right,bottom,left){
	var theobj=get_object(obj);
	if (isnav==true && version==4){
		theobj.clip.left=left;
		theobj.clip.top=top;
		theobj.clip.right=right;
		theobj.clip.bottom=bottom;
	}
	if (isiex==true || (isnav==true && version>=5)){
		theobj.clip='rect('+top+'px '+right+'px '+bottom+'px '+left+'px)';

	}
}
function put(obj,contents){
	if (isiex==true){
	var theobj=eval("document.all."+obj);
	theobj.innerHTML=contents;				
	}
	if (isnav==true && version>=5){
	var theobj=eval('document.getElementById("'+obj+'")');
	theobj.innerHTML=contents;	
	}
	if (isnav==true && version==4){
	theobj=eval("document."+obj+".document");
	theobj.write(contents);
	theobj.close();
	}
}
function change_bgc(obj,color){
	var theobj=get_object(obj);
	if (isnav==true && version==4){
		theobj.bgColor=color;
	}
	if (isiex==true || (isnav==true && version>=5)){
		theobj.backgroundColor=color;
	}

}
function set_index(outframe,inframe,zorder){
	var theobj=get_object(inframe);
	if (isiex==true || (isnav==true && version>=5)){
		theobj.zIndex=zorder;
	}
	if (isnav==true && version==4){
document.layers[outframe].document.layers[inframe].zIndex=zorder;
	}
}
function set_height(obj,this_height,width){
	var theobj=get_object(obj);
	if (isnav==true && version>=5){
		theobj.height=this_height;
		//theobj.borderWidth=width;
	}
	if (isnav==true && version==4){
		theobj.height=this_height;
		//theobj.borderWidth=width;
	}
	if (isiex==true){
		theobj.pixelHeight=this_height;
		//theobj.borderWidth=width;
	}
}
function close_mp3(layer){
	set_height(layer,0,0);
	//set_height(frame,0,0);
}
function show_mp3(layer,title,asin){
	set_height(layer,336,280);

	//set_height(frame,336,280);
	put(layer,'<a href="javascript://" onclick="close_mp3('+layer+')"><b>Close</b></a><br>');
	//show(layer);
}
//AJAX
var response; //Declare response as a global for AJAX output
function getanswer(str,url)
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
} 
url=url+"?q="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 

xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{ 
document.getElementById(response).innerHTML=xmlHttp.responseText
} 
} 

function GetXmlHttpObject()
{ 
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
}
function close_mp3(no){
	set_height('legend'+no,'0','0');
	put('legend'+no,'');
}
function display_mp3(number,layer,title,asin){
	//First close all MP3 Layers
	for(counter=0;counter<=number;counter++){
		set_height('legend'+counter,'0','0');
		put('legend'+counter,'');
	}
	set_height('legend'+layer,'310','100%');
	put('legend'+layer,'<table width="100%"><tr><td><b>'+title+'</b></td><td align="right"><a href="javascript://" onclick="close_mp3('+layer+')">Close MP3</a></td></tr></table><iframe name="player" class="mp3_frame" src="mp3.php" scrolling="no" frameborder="0"></iframe>');
	titleglobal=title;
	asinglobal=asin;
}


