var state = 'none';

function showhide(layer_ref) {

if (state == 'block') {
state = 'none';
}
else {
state = 'block';
}
if (document.all) { //IS IE 4 or 5 (or 6 beta)
eval( "document.all." + layer_ref + ".style.display = state");
}
if (document.layers) { //IS NETSCAPE 4 or below
document.layers[layer_ref].display = state;
}
if (document.getElementById &&!document.all) {
hza = document.getElementById(layer_ref);
hza.style.display = state;
}
} 

function show_txt(layer_ref) {
state = 'block';

if (document.all) { //IS IE 4 or 5 (or 6 beta)
eval( "document.all." + layer_ref + ".style.display = state");
}
if (document.layers) { //IS NETSCAPE 4 or below
document.layers[layer_ref].display = state;
}
if (document.getElementById &&!document.all) {
hza = document.getElementById(layer_ref);
hza.style.display = state;
}
} 
function hide_txt(layer_ref) {
state = 'none';

if (document.all) { //IS IE 4 or 5 (or 6 beta)
eval( "document.all." + layer_ref + ".style.display = state");
}
if (document.layers) { //IS NETSCAPE 4 or below
document.layers[layer_ref].display = state;
}
if (document.getElementById &&!document.all) {
hza = document.getElementById(layer_ref);
hza.style.display = state;
}
} 

function displayRow(infoID, imageID){
var row = document.getElementById(infoID);
var image = document.getElementById(imageID);

if (row.style.display == ''){ 
	row.style.display = 'none'; 
	image.src = '/images/toggle-small.png'
} else { 
	row.style.display = ''; 
	image.src = '/images/toggle-small-collapse.png'
	}

}
function gameForm (premium, basic) {

	var prelink = document.getElementById('premiumlink');
	var basiclink = document.getElementById('basiclink');
	var discountdiv = document.getElementById('dis_level');
	var period = document.getElementById('period').options[document.getElementById('period').selectedIndex].value;
	var startlink = "https://client.clanplanetservers.com/cart.php?a=add&pid=";
	var finlink = "&systpl=cpuk&carttpl=cporder&billingcycle=";

	
	switch(period) {
		case "1":
			discountdiv.innerHTML="None";
			prelink.href=startlink+premium+finlink+"monthly";
			basiclink.href=startlink+basic+finlink+"monthly";
		break;
		case "3":
			discountdiv.innerHTML='<strong>From 5% Discount</strong>';
			prelink.href=startlink+premium+finlink+"quarterly";
			basiclink.href=startlink+basic+finlink+"quarterly";
		break;
		case "6":
			discountdiv.innerHTML="<strong>From 10% Discount</strong>";
			prelink.href=startlink+premium+finlink+"semiannually";
			basiclink.href=startlink+basic+finlink+"semiannually";
		break;
		case "12":
			discountdiv.innerHTML="<strong>From 15% Discount</strong>";
			prelink.href=startlink+premium+finlink+"annually";
			basiclink.href=startlink+basic+finlink+"annually";
		break;
		default: 
			discountdiv.innerHTML="Not Found";
		
	}
		
}
