window.onload = initLinks;

var landscape = new Array("landscape/fear_and_loathing_detail","landscape/The_start_of_the_race","landscape/Banjo_pier_at_paling_dawn","landscape/Looe_bridge_in_water_colour","landscape/Looe_river");
var landscape_description = new Array();
var landscape_price = new Array();
	
var signature = new Array("signature/options_possibility_and_coincidence","signature/a_shell_of_a_former_self","signature/subjects_that_change","signature/an_edge_of_reason","signature/a_twist_of_fate","signature/a_simple_twist_of_fate","signature/distance","signature/side","signature/inside_out","signature/down","signature/up","signature/yin","signature/yang","signature/tbc_1","signature/tbc_2","signature/tbc_3","signature/tbc_4","signature/tbc_5","signature/tbc_6");
var signature_description = new Array();
var signature_price = new Array();

var earth_sea_sky = new Array("earth_sea_sky/earth_sea_and_sky_large","earth_sea_sky/reflections_on_a_sunny_day","earth_sea_sky/clear_reflections_on_a_sunny_day","earth_sea_sky/earth_sea_and_sky_1of2","earth_sea_sky/earth_sea_and_sky_2of2","earth_sea_sky/earth_sea_and_sky","earth_sea_sky/lamanna1of3","earth_sea_sky/lamanna2of3","earth_sea_sky/lamanna3of3","earth_sea_sky/red_sky_at_night");
var earth_sea_sky_description = new Array();
var earth_sea_sky_price = new Array();

var blue_view = new Array("blue_view/blue_view");
var blue_view_description = new Array();
var blue_view_price = new Array();

var black_and_white = new Array("black_and_white/chairoscurro_cornwall","black_and_white/chairoscurro_cornwall_1");
var black_and_white_description = new Array();
var black_and_white_price = new Array();

var this_pic = -1;



function initLinks()
{
	document.getElementById("itsMe").onclick = showChris;
	var name = location.toString();
	if(name.indexOf('gallery') != -1)
	{
		document.getElementById("prevlink").onclick = previous;
		document.getElementById("nextlink").onclick = next;
		document.getElementById("details").onclick = details;
		document.getElementById("selection").onchange = thumbs;
		document.getElementById("selection").selectedIndex = 0;
	}
}	

function measurements()
{
	document.getElementById("width").innerHTML = document.documentElement.clientWidth+" Height = "+document.documentElement.clientHeight+"-----"+screen.availHeight;
}


function showChris()
{
	var my_win = window.open('','myPage','width=400, height=300');
	var my_doc = my_win.document;

	my_doc.title = "The work of Chris Mitchell";
	my_doc.bgColor = "#000000";
	my_doc.fgColor = "#ffffff";
	my_doc.body.innerHTML = "<h2>'Art by Valerio' has been developed by Chris Mitchell</h2><br /><p>I am currently studying for a degree in IT(e-commerce). If you require a website for a fraction of the price that you would pay an established company, or if you have any enquiries, feel free to email me at:<br /><br /> milchardo@hotmail.co.uk</p>";
	return false;
}

function previous()
{
	var temp = document.getElementById("selection");
	var choice = temp.options[temp.selectedIndex].value;
	
	document.getElementById("moreInfo").innerHTML = "Click on the image for more information";
	
	if(choice == "#")
	{
		alert("Please select a gallery to view from the drop-down menu");
	}
		
	if(choice == "landscape")
	{

		if(this_pic != -1)
		{
			if (this_pic == 0)
			{
				this_pic = landscape.length;
			}
			this_pic--;
			document.getElementById("main_pic").src = "images/"+landscape[this_pic]+".jpg";

			var current = this_pic + 1;
			var para = document.getElementById("currentNum");
			var title = landscape[current-1].substring(landscape[current-1].indexOf("/")+1,landscape[current-1].length);
		
			while(title.indexOf("_") != -1)
			{
				var title = title.replace("_"," ");
			}
			para.innerHTML = '<p>'+current+' of '+landscape.length+'</p><p>Title: '+title+'</p>';
		
		}
		else
		{
			alert ("You must use the 'next' button initially");
		}
	}
	else if(choice == "signature")
	{
		if(this_pic != -1)
		{
			if (this_pic == 0)
			{
				this_pic = signature.length;
			}
			this_pic--;
			document.getElementById("main_pic").src = "images/"+signature[this_pic]+".jpg";

			var current = this_pic + 1;
			var para = document.getElementById("currentNum");
			var title = signature[current-1].substring(signature[current-1].indexOf("/")+1,signature[current-1].length);
			while(title.indexOf("_") != -1)
			{
				var title = title.replace("_"," ");
			}
			para.innerHTML = '<p>'+current+' of '+signature.length+'</p><p>Title: '+title+'</p>';	
		}
		else
		{
			alert ("You must use the 'next' button initially");
		}
	}
	else if(choice == "earth_sea_sky")
	{
		if(this_pic != -1)
		{
			if (this_pic == 0)
			{
				this_pic = earth_sea_sky.length;
			}
			this_pic--;
			document.getElementById("main_pic").src = "images/"+earth_sea_sky[this_pic]+".jpg";

			var current = this_pic + 1;
			var para = document.getElementById("currentNum");
			var title = earth_sea_sky[current-1].substring(earth_sea_sky[current-1].indexOf("/")+1,earth_sea_sky[current-1].length);
			while(title.indexOf("_") != -1)
			{
				var title = title.replace("_"," ");
			}
			para.innerHTML = '<p>'+current+' of '+earth_sea_sky.length+'</p><p>Title: '+title+'</p>';		
		}
	}
	else if(choice == "blue_view")
	{
		if(this_pic != -1)
		{
			if (this_pic == 0)
			{
				this_pic = blue_view.length;
			}
			this_pic--;
			document.getElementById("main_pic").src = "images/"+blue_view[this_pic]+".jpg";

			var current = this_pic + 1;
			var para = document.getElementById("currentNum");
			var title = blue_view[current-1].substring(blue_view[current-1].indexOf("/")+1,blue_view[current-1].length);
			while(title.indexOf("_") != -1)
			{
				var title = title.replace("_"," ");
			}
			para.innerHTML = '<p>'+current+' of '+blue_view.length+'</p><p>Title: '+title+'</p>';		
		}
		else
		{
			alert ("You must use the 'next' button initially");
		}
	}
	else if(choice == "black_and_white")
	{
		if(this_pic != -1)
		{
			if (this_pic == 0)
			{
				this_pic = black_and_white.length;
			}
			this_pic--;
			document.getElementById("main_pic").src = "images/"+black_and_white[this_pic]+".jpg";

			var current = this_pic + 1;
			var para = document.getElementById("currentNum");
			var title = black_and_white[current-1].substring(black_and_white[current-1].indexOf("/")+1,black_and_white[current-1].length);
			while(title.indexOf("_") != -1)
			{
				var title = title.replace("_"," ");
			}
			para.innerHTML = '<p>'+current+' of '+black_and_white.length+'</p><p>Title: '+title+'</p>';		
		}
		else
		{
			alert ("You must use the 'next' button initially");
		}
	}
	return false;
}


function next(thumbNum,valid)
{
	document.getElementById("moreInfo").innerHTML = "<p>Click on the image for more information</p>";

	var temp = document.getElementById("selection");
	var choice = temp.options[temp.selectedIndex].value;

	if(valid == true)
	{
		this_pic= thumbNum-1;
	}

	if(choice == "#")
	{
		alert("Please select a gallery to view from the drop-down menu");
	}


	if (choice == "landscape")
	{
		this_pic++;	
		if (this_pic == landscape.length)
		{
			this_pic = 0;
		}

		document.getElementById("main_pic").src = "images/"+landscape[this_pic]+".jpg";

		var current = this_pic + 1;
		var para = document.getElementById("currentNum");
		var title = landscape[current-1].substring(landscape[current-1].indexOf("/")+1,landscape[current-1].length);
		
		while(title.indexOf("_") != -1)
			{
			var title = title.replace("_"," ");
			}
		para.innerHTML = '<p>'+current+' of '+landscape.length+'</p><p>Title: '+title+'</p>';
	}
	else if(choice == "signature")
	{
		this_pic++;	
		if (this_pic == signature.length)
		{
			this_pic = 0;
		}

		document.getElementById("main_pic").src = "images/"+signature[this_pic]+".jpg";

		var current = this_pic + 1;
		var para = document.getElementById("currentNum");
		var title = signature[current-1].substring(signature[current-1].indexOf("/")+1,signature[current-1].length);
		while(title.indexOf("_") != -1)
		{
			var title = title.replace("_"," ");
		}
		para.innerHTML = '<p>'+current+' of '+signature.length+'</p><p>Title: '+title+'</p>';	
	}
	else if(choice == "earth_sea_sky")
	{
		this_pic++;	
		if (this_pic == earth_sea_sky.length)
		{
			this_pic = 0;
		}

		document.getElementById("main_pic").src = "images/"+earth_sea_sky[this_pic]+".jpg";

		var current = this_pic + 1;
		var para = document.getElementById("currentNum");
		var title = earth_sea_sky[current-1].substring(earth_sea_sky[current-1].indexOf("/")+1,earth_sea_sky[current-1].length);
			while(title.indexOf("_") != -1)
			{
				var title = title.replace("_"," ");
			}
			para.innerHTML = '<p>'+current+' of '+earth_sea_sky.length+'</p><p>Title: '+title+'</p>';	
	}
	else if(choice == "blue_view")
	{
		this_pic++;	
		if (this_pic == blue_view.length)
		{
			this_pic = 0;
		}

		document.getElementById("main_pic").src = "images/"+blue_view[this_pic]+".jpg";

		var current = this_pic + 1;
		var para = document.getElementById("currentNum");
		var title = blue_view[current-1].substring(blue_view[current-1].indexOf("/")+1,blue_view[current-1].length);
			while(title.indexOf("_") != -1)
			{
				var title = title.replace("_"," ");
			}
			para.innerHTML = '<p>'+current+' of '+blue_view.length+'</p><p>Title: '+title+'</p>';	
	}
	else if(choice == "black_and_white")
	{
		this_pic++;	
		if (this_pic == black_and_white.length)
		{
			this_pic = 0;
		}

		document.getElementById("main_pic").src = "images/"+black_and_white[this_pic]+".jpg";

		var current = this_pic + 1;
		var para = document.getElementById("currentNum");
		var title = black_and_white[current-1].substring(black_and_white[current-1].indexOf("/")+1,black_and_white[current-1].length);
			while(title.indexOf("_") != -1)
			{
				var title = title.replace("_"," ");
			}
			para.innerHTML = '<p>'+current+' of '+black_and_white.length+'</p><p>Title: '+title+'</p>';	
	}
	return false;
}

function details()
{
	var temp = document.getElementById("selection");
	var choice = temp.options[temp.selectedIndex].value;

	if (choice == "landscape")
	{
		
		var pic_name = landscape[this_pic].substring(landscape[this_pic].indexOf("/")+1,landscape[this_pic].length);
		
		while(pic_name.indexOf("_") != -1)
			{
			var pic_name = pic_name.replace("_"," ");
			}

		var newWin = window.open('','details','height=700, width=760,scrollbars=yes'); 
		var newDoc= newWin.document;
		
		newDoc.title = pic_name;
		newDoc.bgColor = "#000000";
		newDoc.fgColor = "#ffffff";
		var picture = parent.document.getElementById("main_pic").src;
		//var words = landscape_description[this_pic];
		//var amount = landscape_price[this_pic];
		newDoc.body.innerHTML ='<table align="center" border="0" cellspacing="10"><tr><td><img src="'+picture+'"width="700px" border="0"></a><br />&nbsp<br /></td></tr><tr><td>Title: '+pic_name+'</td></tr><tr><td><p>Coming soon - descriptions, prices and a facility to buy online through paypal.<br />If you require more information, or if you are interested in purchasing some artwork, please email us at: theartshole@hotmail.co.uk</p></td></tr></table>';
		return false;
		
	}
	else if(choice =="signature")
	{
		var pic_name = signature[this_pic].substring(signature[this_pic].indexOf("/")+1,signature[this_pic].length);
		
		while(pic_name.indexOf("_") != -1)
			{
			var pic_name = pic_name.replace("_"," ");
			}
		var newWin = window.open('','details','height=700, width=760,scrollbars=yes'); 
		var newDoc= newWin.document;
		
		newDoc.title = pic_name;
		newDoc.bgColor = "#000000";
		newDoc.fgColor = "#ffffff";
		var picture = parent.document.getElementById("main_pic").src;
		//var words = signature_description[this_pic];
		//var amount = signature_price[this_pic];
		newDoc.body.innerHTML ='<table align="center" border="0" cellspacing="10"><tr><td><img src="'+picture+'"width="700px" height="600" border="0"></a><br />&nbsp<br /></td></tr><tr><td>Title: '+pic_name+'</td></tr><tr><td><p>Coming soon - descriptions, prices and a facility to buy online through paypal.<br />If you require more information, or if you are interested in purchasing some artwork, please email us at: theartshole@hotmail.co.uk</p></td></tr></table>';
		return false;
	}
	else if(choice =="earth_sea_sky")
	{
		var pic_name = earth_sea_sky[this_pic].substring(earth_sea_sky[this_pic].indexOf("/")+1,earth_sea_sky[this_pic].length);
		
		while(pic_name.indexOf("_") != -1)
			{
			var pic_name = pic_name.replace("_"," ");
			}
		var newWin = window.open('','details','height=700, width=760,scrollbars=yes'); 
		var newDoc= newWin.document;
		
		newDoc.title = pic_name;
		newDoc.bgColor = "#000000";
		newDoc.fgColor = "#ffffff";
		var picture = parent.document.getElementById("main_pic").src;
		//var words = earth_sea_sky_description[this_pic];
		//var amount = earth_sea_sky_price[this_pic];
		newDoc.body.innerHTML ='<table align="center" border="0" cellspacing="10"><tr><td><img src="'+picture+'"width="700px" border="0"></a><br />&nbsp<br /></td></tr><tr><td>Title: '+pic_name+'</td></tr><tr><td><p>Coming soon - descriptions, prices and a facility to buy online through paypal.<br />If you require more information, or if you are interested in purchasing some artwork, please email us at: theartshole@hotmail.co.uk</p></td></tr></table>';
		return false;
	}
	else if(choice =="blue_view")
	{
		var pic_name = blue_view[this_pic].substring(blue_view[this_pic].indexOf("/")+1,blue_view[this_pic].length);
		
		while(pic_name.indexOf("_") != -1)
			{
			var pic_name = pic_name.replace("_"," ");
			}
		var newWin = window.open('','details','height=700, width=760,scrollbars=yes'); 
		var newDoc= newWin.document;
		
		newDoc.title = pic_name;
		newDoc.bgColor = "#000000";
		newDoc.fgColor = "#ffffff";
		var picture = parent.document.getElementById("main_pic").src;
		//var words = blue_view_description[this_pic];
		//var amount = blue_view_price[this_pic];
		newDoc.body.innerHTML ='<table align="center" border="0" cellspacing="10"><tr><td><img src="'+picture+'"width="700px" border="0"></a><br />&nbsp<br /></td></tr><tr><td>Title: '+pic_name+'</td></tr><tr><td><p>Coming soon - descriptions, prices and a facility to buy online through paypal.<br />If you require more information, or if you are interested in purchasing some artwork, please email us at: theartshole@hotmail.co.uk</p></td></tr></table>';

		return false;
	}
	else if(choice =="black_and_white")
	{
		var pic_name = black_and_white[this_pic].substring(black_and_white[this_pic].indexOf("/")+1,black_and_white[this_pic].length);
		
		while(pic_name.indexOf("_") != -1)
			{
			var pic_name = pic_name.replace("_"," ");
			}
		var s_name = black_and_white[this_pic].indexOf("/"+1);
	
		var newWin = window.open('','details','height=700, width=760,scrollbars=yes'); 
		var newDoc= newWin.document;
		
		newDoc.title = pic_name;
		newDoc.bgColor = "#000000";
		newDoc.fgColor = "#ffffff";
		var picture = parent.document.getElementById("main_pic").src;
		//var words = black_and_white_description[this_pic];
		//var amount = black_and_white_price[this_pic];
		newDoc.body.innerHTML ='<table align="center" border="0" cellspacing="10"><tr><td><img src="'+picture+'"width="700px" border="0"></a><br />&nbsp<br /></td></tr><tr><td>Title: '+pic_name+'</td></tr><tr><td><p>Coming soon - descriptions, prices and a facility to buy online through paypal.<br />If you require more information, or if you are interested in purchasing some artwork, please email us at: theartshole@hotmail.co.uk</p></td></tr></table>';
		return false;
	}
	else
	{
		if (this_pic == -1)
		{
			alert("Please select a gallery to view from the drop-down menu");
		}	
	}

}	


function mouseOver(picture)
{
	document.getElementById(picture).src = "images/"+picture+"_mouse.jpg";
}

function mouseOut(picture)
{
	document.getElementById(picture).src = "images/"+picture+"_norm.jpg";
}

function mouseClick(picture)
{
	document.getElementById(picture).src = "images/"+picture+"_click.jpg";
}




function thumbs()
{
	this_pic = -1;
	var main = document.getElementById("main_pic").src;
	main = "images/black(1).jpg";
	
	var display = document.getElementById("thumbnails");
	var temp = document.getElementById("selection");
	var choice = temp.options[temp.selectedIndex].value;
	var count = 0;

	var waste = document.getElementsByTagName("p");
	while (waste.length!= 0)
	{
		
		for (countx =0;countx<= waste.length;countx++)
		{
			var bin = document.getElementsByTagName("p")[count];
			bin.parentNode.removeChild(bin);
		}

		document.getElementById("main_pic").src= "images/black(1).jpg";
	}

	if(choice == "landscape")
	{
		document.getElementById("main_pic").src = "images/landscape/landscapeIntro.jpg";
		while (count < landscape.length)
		{ 
			var newGraf = document.createElement("p");
			display.appendChild(newGraf);				

			var text = document.getElementsByTagName("p")[count];
			text.innerHTML = '<img src="images/thumbs/'+landscape[count]+'.jpg" width="150px" onClick=viewThumb("'+count+'")>';
			
			count++;
		}
	}
	else if(choice == "signature")
	{
		document.getElementById("main_pic").src = "images/signature/signatureIntro.jpg";
		while (count < signature.length)
		{ 
			var newGraf = document.createElement("p");
			display.appendChild(newGraf);				

			var text = document.getElementsByTagName("p")[count];
			text.innerHTML = '<img src="images/thumbs/'+signature[count]+'.jpg" width="150px" onClick=viewThumb("'+count+'")>';
			
			count++;
		}
	}
	else if(choice == "earth_sea_sky")
	{
		while (count < earth_sea_sky.length)
		{ 
			var newGraf = document.createElement("p");
			display.appendChild(newGraf);				

			var text = document.getElementsByTagName("p")[count];
			text.innerHTML = '<img src="images/thumbs/'+earth_sea_sky[count]+'.jpg" width="150px" onClick=viewThumb("'+count+'")>';
			
			count++;
		}
	}
	else if(choice == "blue_view")
	{
		document.getElementById("main_pic").src = "images/blue_view/blue_viewIntro.jpg";
		while (count < blue_view.length)
		{ 
			var newGraf = document.createElement("p");
			display.appendChild(newGraf);				

			var text = document.getElementsByTagName("p")[count];
			text.innerHTML = '<img src="images/thumbs/'+blue_view[count]+'.jpg" width="150px" onClick=viewThumb("'+count+'")>';
			
			count++;
		}
	}
	else if(choice == "black_and_white")
	{
		document.getElementById("main_pic").src = "images/black_and_white/black_and_whiteIntro.jpg";
		while (count < black_and_white.length)
		{ 
			var newGraf = document.createElement("p");
			display.appendChild(newGraf);				

			var text = document.getElementsByTagName("p")[count];
			text.innerHTML = '<img src="images/thumbs/'+black_and_white[count]+'.jpg" width="150px" onClick=viewThumb("'+count+'")>';
			
			count++;
		}
	}

}

function viewThumb(number)
{
	next(number,true);
}



//----------------------
//shop
/*
function order()
{
	
	for(count=0;count<document.forms.length;count++)
	{
		product = document.forms[count];
		if(product.check.checked && product.quantity.value != "")
		{
			document.cookie = "product["+count+"] = "+product.name.value+", "+product.price.value+", "+product.quantity.value;
		}
	
	}
}

function readCookie()
{
	if(document.cookie.length>0)
	{
		thisCookie = document.cookie.split("; ");
		var total= 0;
	
		for(count=0;count<thisCookie.length;count++)
		{
			if(!thisCookie[count].match('total'))
			{
			var start = thisCookie[count].indexOf("=");
			var firstComma = thisCookie[count].indexOf(",");
			var lastComma = thisCookie[count].lastIndexOf(",");
			
			var product = thisCookie[count].slice(start+1,firstComma);
			var price = thisCookie[count].slice(firstComma+3,lastComma); 
			var quantity = thisCookie[count].slice(lastComma+1,thisCookie[count].length); 
			
			var runningTotal = quantity*price;
			
			var para = document.createElement("p");
			document.getElementById("order").appendChild(para);
			thisPara = document.getElementsByTagName("p").length;
		
			if(quantity != 0)
			{
				document.getElementsByTagName("p")[thisPara-1].innerHTML = "<table cellspacing='10' width='80%'><tr><td width='22%'>"+quantity+"</td><td width='38%'>"+product+"</td><td width='15%'>&pound;"+price+"</td><td width='25%'>&pound;"+runningTotal+"</td></tr></table>";

			}

			var total = total + runningTotal;
			}
		}
		var para = document.createElement("p");
		document.getElementById("order").appendChild(para);
		thisPara = document.getElementsByTagName("p").length;
		document.getElementsByTagName("p")[thisPara-1].innerHTML = "<table width='60%'><td class='right'>Total to pay --------- &pound;"+total+"</td><table>";
		document.cookie = "total ="+total+",";
	}
	payment();
}

function showQuant(formNo,paragraph)
{
	if(document.forms[formNo].check.checked)
	{
		document.getElementsByTagName("p")[paragraph].style.visibility = 'visible';
		
	}
	else
	{
		document.getElementsByTagName("p")[paragraph].style.visibility = 'hidden';
		
	//this is an addition because setting the expiry date does not instantly delete session cookies in IE 
		if(navigator.appname="microsoft internet explorer")
		{
			document.cookie = "product["+formNo+"] = "+document.forms[formNo].name.value+", "+document.forms[formNo].price.value+", 0";
		}
		showBasket();
	}
		
	
}

function showBasket()
{
	enterDetails();
	var items = 0;
	for(count=0;count<document.forms.length;count++)
	{
		var product = document.forms[count];
		if(product.check.checked && product.quantity.value != "")
		{			
			var regExp = /^[0-9]+$/;
			
			if(regExp.test(product.quantity.value)&&product.quantity.value<=250)
			{ 
				var items = items + parseInt(product.quantity.value);
			}
			else
			{
				alert("Please enter a quantity between 0 - 250");
				product.quantity.value = "";	
			}
		}
		document.getElementById("basket").innerHTML = "You have "+items+" item(s) in your basket - ";
	}	
}

function payment()
{
	//var start = document.cookie.indexOf('total=');
	//var amount = document.cookie.substring(start+6,document.cookie.indexOf(",",start));
	
	if(document.cookie.length>0)
	{alert("hi")
		temp = document.cookie.slice(0,document.cookie.indexOf("total="))
		temp2 = document.cookie.slice(document.cookie.indexOf(";",document.cookie.indexOf("total=")),document.cookie.length);
		temp = temp.concat(temp2.slice(1,temp2.length));

		thisCookie = temp.split(";");
		
	tempStore = " ";
		for(count=0;count<thisCookie.length-1;count++)
		{
			var name = thisCookie[count].slice(thisCookie[count].indexOf("=")+1,thisCookie[count].indexOf(","));
			temp = thisCookie[count].slice(thisCookie[count].indexOf(","),thisCookie[count].lastIndexOf(","))
			var theprice = temp.slice(3,temp.length);
			var quantity = thisCookie[count].slice(thisCookie[count].lastIndexOf(",")+1,thisCookie[count].length);

			total = theprice * quantity;
			

			item=count+1;
			
			tempStore = tempStore+'<input type="hidden" name="item_name_'+item+'" value="'+name+'">'
			tempStore = tempStore+'<input type="hidden" name="amount_'+item+'" value="'+total+'">'
			tempStore = tempStore+'<input type="hidden" name="quantity_'+item+'" value="'+quantity+'">'
						

		}
	}
	
	document.getElementById("cart").innerHTML = ''+tempStore+''
}

function goBack()
{

	window.history.go(-1);

}

function display()
{
	if(document.cookie.length>0)
	{
		thisCookie = document.cookie.split("; ");
	
		for(count=0;count<thisCookie.length;count++)
		{
			document.cookie = thisCookie[count]+"; expires=1 january 2001";

		}
	}
	for(count=0;count<=document.forms.length;count++)
	{
		if(document.forms[count].check.checked)
		{
			document.getElementById(count).style.visibility = 'visible';
		}
	}

}

function enterDetails()
{
	document.getElementById("prod1").innerHTML='<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post"><input type="image" src="http://images.paypal.com/en_US/i/btn/x-click-but22.gif" border="0" name="submit" width="87" height="23" alt="Make payments with PayPal - it\'s fast, free and secure!"><img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"><input type="hidden" name="add" value="1"><input type="hidden" name="cmd" value="_cart"><input type="hidden" name="quantity" value="5"><input type="hidden" name="business" value="theartshole@hotmail.co.uk"><input type="hidden" name="item_name" value="item one"><input type="hidden" name="amount" value="5.00"><input type="hidden" name="currency_code" value="GBP"><input type="hidden" name="tax" value="0"><input type="hidden" name="bn" value="IC_Sample"></form>'
}*/

function checkout(formNo,name,amount)
{
	if(document.forms[formNo].check.checked)
	{
		value = name.slice(0,name.indexOf(" -"));
		nameValue = value+"Name";
		amountValue = value+"Amount";
		if(formNo == 21 || formNo == 22)
		{
			nameValue = nameValue+"2";
			amountValue = amountValue+"2";
		}
		if(formNo == 24 || formNo == 25)
		{
			nameValue = nameValue+"3";
			amountValue = amountValue+"3";
		}
		if(formNo == 33 || formNo == 34)
		{
			nameValue = nameValue+"4";
			amountValue = amountValue+"4";
		}
		
		document.getElementById(nameValue).innerHTML='<input type="hidden" name="item_name" value="'+name+'">';
		document.getElementById(amountValue).innerHTML='<input type="hidden" name="amount" value="'+amount+'">';
	}
	else
	{

		document.getElementById(nameValue).innerHTML='<input type="hidden" name="item_name" value="">';
		document.getElementById(amountValue).innerHTML='<input type="hidden" name="amount" value="">';
	}
	
}

function showShopPic(name)
{
	title = name.replace("_"," ");
	while(title.indexOf("_") != -1)
	{
		title = title.replace("_"," ");
		
	}
	newWin = window.open('','','height=500, width=650, location=0,resizable=0, status=0,toolbar=0,');
	newWin = newWin.document;
	
	newWin.title = ''+title+''
	
	picture = parent.document.getElementById(''+name+'').src;
	
	temp = picture.slice(0,picture.lastIndexOf("."))
	
	temp += "L.jpg";
	
	newWin.body.innerHTML = '<p><img src="'+temp+'" height=490 width=640></p>';
}

//GOOGLE ANALYTICS:
 var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-17459669-2']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
