function SetBGImage(){
var BGImages= new Array('1.jpg','2.jpg','3.jpg','4.jpg','5.jpg'); 
var BGImagesCnt = BGImages.length; // Count the number of images
var randomNum = Math.floor ((Math.random() * BGImagesCnt));
//document.write(BGImages[randomNum]);
var layer = document.getElementById('content_wrapper');
layer.style.background='url(images/backgrounds/'+BGImages[randomNum]+') #999999';
}

function ShowCart(){
	document.ShowCart.submit();
}

function AddToCart(){
	alert('Postage is calculated for UK delivery only, if you are outside the UK we may need to contact you for an individual price.');
	document.addtocart.submit();
}

function DisplayLarge(){
	var layer = document.getElementById('popcover');
	layer.style.visibility='visible';
}
function HideLarge(div){
	var layer = document.getElementById(div);
	layer.style.visibility='hidden';
}

function ClearDiv(div, div2){
	var layer = document.getElementById(div2);
	layer.innerHTML = '';
	var layer = document.getElementById(div);
	layer.style.visibility='hidden';
}

function video_viewer(video, title, type) {
var layer = document.getElementById('videoPlayerInner');
var content = '';
if (type == 'mov'){
content = content +	'<div align=\"center\">\n';
content = content +	'<param name=\"controller\" value=\"TRUE\" />\n';
content = content +	'<param name=\"KIOSKMODE\" value=\"TRUE\" />\n';
content = content +	'<param name=\"type\" value=\"video/quicktime\" />\n';
content = content +	'<param name=\"autoplay\" value=\"true\" />\n';
content = content +	'<param name=\"saveable\" value=\"false\" /\n';
content = content +	'<param name=\"target\" value=\"myself\" />\n';
content = content +	'<param name=\"src\" value=\"video/'+ video +'\" />\n';
content = content +	'<param name=\"pluginspage\" value=\"http://www.apple.com/quicktime/download/index.html\" />\n';
content = content +	'<embed src=\"video/'+ video +'\" width=\"289\" height=\"234\" controller=\"TRUE\" target=\"myself\" saveable=\"false\" type=\"video/quicktime\" kioskmode=\"true\" pluginspage=\"http://www.apple.com/quicktime/download/index.html\" autoplay=\"true\"></embed>\n';
content = content +	'</object>\n';
content = content +	'<a href="javascript:ClearDiv(\'videoPlayer\', \'videoPlayerInner\');">Close</a>\n';
} else {
content = content +	'<div align=\"center\">\n';
content = content +	'<object id=\"MediaPlayer1\" classid=\"CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95\" codebase=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701\" standby=\"Loading Microsoft Windows® Media Player components...\" type=\"application/x-oleobject\" width=\"384\" height=\"288\">\n';
content = content +	'<param name=\"fileName\" value=\"video/"+ video +"\">\n';
content = content +	'<param name=\"animationatStart\" value=\"true\">\n';
content = content +	'<param name=\"transparentatStart\" value=\"true\">\n';
content = content +	'<param name=\"autoStart\" value=\"true\">\n';
content = content +	'<param name=\"showControls\" value=\"true\">\n';
content = content +	'<param name=\"Volume\" value=\"-450\">\n';
content = content +	'<embed type=\"application/x-mplayer2\" pluginspage=\"http://www.microsoft.com/Windows/MediaPlayer/\" src=\"video/'+ video +'\" name=\"MediaPlayer1\" width=300 height=288 autostart=1 showcontrols=1 volume=-450>\n';
content = content +	'</object>\n';
content = content +	'<a href="javascript:ClearDiv(\'videoPlayer\', \'videoPlayerInner\');">Close</a>\n';
}
layer.innerHTML = content;
var layer = document.getElementById('videoPlayer');
layer.style.visibility='visible';
}
/*	var layer = document.getElementById('popcover');
	layer.style.visibility='hidden';
videoViewer = window.open("", "videoViewer" , "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,copyhistory=0,width=380,height=450");
videoViewer.document.open();
videoViewer.document.write("<html><head>");
videoViewer.document.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />");
videoViewer.document.write("<title>"+ title +"</title>");
videoViewer.document.write("<style type=\"text/css\">");
videoViewer.document.write("<!--");
videoViewer.document.write("body {");
videoViewer.document.write("	background-color: #C0DCED;");
videoViewer.document.write("	margin-left: 0px;");
videoViewer.document.write("	margin-top: 0px;");
videoViewer.document.write("	margin-right: 0px;");
videoViewer.document.write("	margin-bottom: 0px;");
videoViewer.document.write("}");
videoViewer.document.write("-->");
videoViewer.document.write("</style>");
videoViewer.document.write("<link href=\"../../styles.css\" rel=\"stylesheet\" type=\"text/css\" />");
videoViewer.document.write("</head>");

videoViewer.document.write("<body>");
videoViewer.document.write("<table width=\"368\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
videoViewer.document.write("  <tr>");
videoViewer.document.write("    <td width=\"368\"><img src=\"../../images/video_player_top.gif\" width=\"380\" height=\"83\" /></td>");
videoViewer.document.write("  </tr>");
videoViewer.document.write("  <tr>");
videoViewer.document.write("    <td>&nbsp;</td>");
videoViewer.document.write("  </tr>");
videoViewer.document.write("  <tr>");
videoViewer.document.write("    <td><div align=\"center\">");
videoViewer.document.write("     <object classid=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\" codebase=\"http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0\" width=\"289\" height=\"234\">");
videoViewer.document.write("       <param name=\"controller\" value=\"TRUE\" />");
videoViewer.document.write("       <param name=\"KIOSKMODE\" value=\"TRUE\" />");
videoViewer.document.write("        <param name=\"type\" value=\"video/quicktime\" />");
videoViewer.document.write("        <param name=\"autoplay\" value=\"true\" />");
videoViewer.document.write("        <param name=\"saveable\" value=\"false\" />");
videoViewer.document.write("        <param name=\"target\" value=\"myself\" />");
videoViewer.document.write("        <param name=\"src\" value=\"../../video/"+ video +"\" />");
videoViewer.document.write("       <param name=\"pluginspage\" value=\"http://www.apple.com/quicktime/download/index.html\" />");
videoViewer.document.write("        <embed src=\"../../video/"+ video +"\" width=\"289\" height=\"234\" controller=\"TRUE\" target=\"myself\" saveable=\"false\" type=\"video/quicktime\" kioskmode=\"true\" pluginspage=\"http://www.apple.com/quicktime/download/index.html\" autoplay=\"true\"></embed>");
videoViewer.document.write("      </object>");
videoViewer.document.write("      <br />");
videoViewer.document.write("      <a href=\"javascript:window.close();\" class=\"bodygrey\"><span class=\"bodygrey\">close window</span></a> </div></td>");
videoViewer.document.write("  </tr>");
videoViewer.document.write("</table>");
videoViewer.document.write("</body>");
videoViewer.document.write("</html>");
videoViewer.document.close();
    }
	
	function video_viewer_wmv(video, title) {
videoViewerwmv = window.open("", "videoViewer" , "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,copyhistory=0,width=380,height=450");
videoViewerwmv.document.open();
videoViewerwmv.document.write("<html><head>");
videoViewerwmv.document.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />");
videoViewerwmv.document.write("<title>"+ title +"</title>");
videoViewerwmv.document.write("<style type=\"text/css\">");
videoViewerwmv.document.write("<!--");
videoViewerwmv.document.write("body {");
videoViewerwmv.document.write("	background-color: #C0DCED;");
videoViewerwmv.document.write("	margin-left: 0px;");
videoViewerwmv.document.write("	margin-top: 0px;");
videoViewerwmv.document.write("	margin-right: 0px;");
videoViewerwmv.document.write("	margin-bottom: 0px;");
videoViewerwmv.document.write("}");
videoViewerwmv.document.write("-->");
videoViewerwmv.document.write("</style>");
videoViewerwmv.document.write("<link href=\"../../styles.css\" rel=\"stylesheet\" type=\"text/css\" />");
videoViewerwmv.document.write("</head>");
videoViewerwmv.document.write("<body>");
videoViewerwmv.document.write("<table width=\"368\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
videoViewerwmv.document.write("  <tr>");
videoViewerwmv.document.write("    <td width=\"368\"><img src=\"../../images/video_player_top.gif\" width=\"380\" height=\"83\" /></td>");
videoViewerwmv.document.write("  </tr>");
videoViewerwmv.document.write("  <tr>");
videoViewerwmv.document.write("    <td>&nbsp;</td>");
videoViewerwmv.document.write("  </tr>");
videoViewerwmv.document.write("  <tr>");
videoViewerwmv.document.write("    <td><div align=\"center\">");
videoViewerwmv.document.write("     <object id=\"MediaPlayer1\" classid=\"CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95\" codebase=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701\"");
videoViewerwmv.document.write("standby=\"Loading Microsoft Windows® Media Player components...\" type=\"application/x-oleobject\" width=\"384\" height=\"288\">");
videoViewerwmv.document.write("                  <param name=\"fileName\" value=\"../../video/"+ video +"\">");
videoViewerwmv.document.write("                  <param name=\"animationatStart\" value=\"true\">");
videoViewerwmv.document.write("                  <param name=\"transparentatStart\" value=\"true\">");
videoViewerwmv.document.write("                  <param name=\"autoStart\" value=\"true\">");
videoViewerwmv.document.write("                  <param name=\"showControls\" value=\"true\">");
videoViewerwmv.document.write("                  <param name=\"Volume\" value=\"-450\">");
videoViewerwmv.document.write("                  <embed type=\"application/x-mplayer2\" pluginspage=\"http://www.microsoft.com/Windows/MediaPlayer/\" src=\"../../video/"+ video +"\" name=\"MediaPlayer1\" width=300 height=288 autostart=1 showcontrols=1 volume=-450>");
videoViewerwmv.document.write("                      </object>");
videoViewerwmv.document.write("      <br />");
videoViewerwmv.document.write("      <a href=\"javascript:window.close();\" class=\"bodygrey\"><span class=\"bodygrey\">close window</span></a> </div></td>");
videoViewerwmv.document.write("  </tr>");
videoViewerwmv.document.write("</table>");
videoViewerwmv.document.write("</body>");
videoViewerwmv.document.write("</html>");
videoViewerwmv.document.close();
    }*/
	function page_viewer(page) {
imageViewer = window.open(page, "small" , "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=200,height=400");
    }
	
	


//
//
// ***** Video selection function called from Javascript in HTML *****
//
//
function playvideo(id,title){
	// Call the Actionscript 'checkVideo' function inside the Flash movie with the ID 'base'
	thisMovie("base").checkVideo(id);
	document.getElementById('TextDisplay').innerHTML = title;

}
//
//
// ***** Standard function to get Flash movie's ID *****
//
//
function thisMovie(movieName) {
	// Return a reference to the requested Flash movie
    if (navigator.appName.indexOf("Microsoft") != -1) {
       return window[movieName];
    } else {
       return document[movieName];
    }
}





function playPrev(video,Name){
	
	var dv;
	var content ='';
	document.onmousemove=followmouse;

	content = content +	'<div id=\"VideoWrap\">\n';
	content = content +	'<param name=\"controller\" value=\"false\" />\n';
	content = content +	'<param name=\"KIOSKMODE\" value=\"false\" />\n';
	content = content +	'<param name=\"type\" value=\"video/quicktime\" />\n';
	content = content +	'<param name=\"autoplay\" value=\"true\" />\n';
	content = content +	'<param name=\"saveable\" value=\"false\" /\n';
	content = content +	'<param name=\"target\" value=\"myself\" />\n';
	content = content +	'<param name=\"src\" value=\"video/'+ video +'\" />\n';
	content = content +	'<param name=\"pluginspage\" value=\"http://www.apple.com/quicktime/download/index.html\" />\n';
	content = content +	'<embed src=\"video/'+ video +'\" width=\"289\" height=\"234\" controller=\"false\" target=\"myself\" saveable=\"false\" type=\"video/quicktime\" kioskmode=\"false\" pluginspage=\"http://www.apple.com/quicktime/download/index.html\" autoplay=\"true\"></embed>\n';
	content = content +	'</object>\n';
	content = content +	'</div><div id=\"VideoWrapText\">'+Name+'</div>\n';	


	dv = document.createElement('div');
	dv.setAttribute('id',"trailimageid");
	
	dv.innerHTML=content;
	document.body.appendChild(dv);
	gettrailobj().display="inline";
	
	}
	
	function closePrev(){
		//removeChildgettrailobj().innerHTML = " ";
	gettrailobj().display="none"
	document.onmousemove=""
	gettrailobj().left="-500px"
		var dv;
		dv = document.getElementById('trailimageid');
		document.body.removeChild(dv );

	}
