<!-- hide from old browsers

function toggleNav(theid) {
	if (document.getElementById(theid)) {
		if (document.getElementById(theid).style.display == "none") {
			document.getElementById(theid).style.display = "block";
		}else{
			document.getElementById(theid).style.display = "none";
		}
	}
	return false;
}

function switchImg(theID) {
	document.getElementById('enID').value = theID;
	document.getElementById('ProdImg').src = "/prodbig/" + theID + ".jpg";
	return false;
}


function popCols(theval,theout) {
	var xmlhttp = false;
	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)
	// JScript gives us Conditional compilation, we can cope with old IE versions.
	// and security blocked creation of the objects.
	try {
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			xmlhttp = false;
		}
	}
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	var returnText;


	uri = "/x_colours.asp?variantid=" + theval + "&theout="+theout+"&d=" + new Date().getTime();

	xmlhttp.open("GET", uri ,true);
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4) {
			returnText = xmlhttp.responseText;

			if (returnText == "EOF") {
				newText = "All Types";
			} else {
				newText = returnText;
				eval(returnText);
			}

		}
	}

	xmlhttp.send(null);
	return false;

}

	function fadeImg(theimg,thealt,thefolder) {
	
	if (thealt!='') {
		d = document.getElementById('prodpageleft').getElementsByTagName('img');
		for(i=0;i<d.length;i++){
			if(d[i].className == 'altimg active'){
				d[i].className = 'altimg';
			}
		}
		document.getElementById(thealt).className='altimg active';

		thefolder1 = thefolder + "big";
		thefolder2 = thefolder + "huge";		
		
		document.getElementById('enID').value = "/" + thefolder2 + "/" + theimg;
		document.getElementById('overimg').src = "/" + thefolder1 + "/" + theimg;
		document.getElementById('overimg').style.display='block';		
		opacity('overdiv',0,100,500,theimg,thefolder1);
		
	
	}else{

	// DO THE XMLHTTP STUFF HERE //
		var xmlhttp = false;
		/*@cc_on @*/
		/*@if (@_jscript_version >= 5)
		// JScript gives us Conditional compilation, we can cope with old IE versions.
		// and security blocked creation of the objects.
		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (E) {
				xmlhttp = false;
			}
		}
		@end @*/
		if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
			xmlhttp = new XMLHttpRequest();
		}
		var returnText;
		uri = "/x_pics.asp?theimg=" + theimg + "&thefolder="+thefolder;

		xmlhttp.open("GET", uri ,true);
		xmlhttp.onreadystatechange=function() {
			if (xmlhttp.readyState==4) {
				returnText = xmlhttp.responseText;

				if (returnText == "EOF") {
					newText = "All Types";
				} else {
					newText = returnText;
					
					eval(returnText);
					
					thefolder1 = thefolder + "big";
					thefolder2 = thefolder + "huge";
					
					document.getElementById('enID').value = "/" + thefolder2 + "/" + theimg;
					document.getElementById('overimg').src = "/" + thefolder1 + "/" + theimg;
					document.getElementById('overimg').style.display='block';		
					opacity('overdiv',0,100,500,theimg,thefolder1);
				}
			}
		}

		xmlhttp.send(null);
	// --------------------- //
	
		if (document.getElementById('ColourID').value!="" && document.getElementById('ColourID').value!="0" && document.getElementById('ColourID').value!="-") {
			document.getElementById('addtocart').src='/images/addtocart.gif';
			document.getElementById('addtocart').disabled='';
		}	
	}


		







	}

function opacity(id, opacStart, opacEnd, millisec,theimg,thefolder) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "','" + theimg + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++) {
            setTimeout("changeOpac(" + i + ",'" + id + "','" + theimg + "','"+thefolder+"')",(timer * speed));
            timer++;
        }
    }

}

//change the opacity for different browsers
function changeOpac(opacity, id, theimg,thefolder) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
    if (opacity==100) {

		document.getElementById('mainimg').src = "/" + thefolder +"/" + theimg;
		opacity = 0;
		object.opacity = (opacity / 100);
		object.MozOpacity = (opacity / 100);
		object.KhtmlOpacity = (opacity / 100);
		object.filter = "alpha(opacity=" + opacity + ")";
		document.getElementById('overimg').style.display='none';

    }
}


function formVal(thefields) {
	thereturn = true;
	fparts = thefields.split(",");
	for (i = 0; i < fparts.length; i++) {
		if (document.getElementById(fparts[i]).value=='') {
			document.getElementById(fparts[i]).style.background='#ff0000';
			thereturn = false;
		}else{
			document.getElementById(fparts[i]).style.background='#ffffff';
		}
	}
	if (thereturn==false) { alert('You must complete all required fields'); }
	return thereturn;
}

function checkcols() {
	colourid = document.getElementById('ColourID').value;
	if (colourid!=0) {
		document.getElementById('addtocart').src='/images/addtocart.gif';
		document.getElementById('addtocart').disabled='';
	}
}

function checkProd(theform) {
	thereturn = true;
	prodid = document.getElementById('ProdID').value;
	variantid = 0
	radioObj = theform.VariantID
	if(radioObj.type!="hidden") {
		radioLength = radioObj.length;
		for(var i = 0; i < radioLength; i++) {
			if(radioObj[i].checked) {
				variantid = radioObj[i].value;
			}
		}
	}else{
		variantid = radioObj.value
	}

	colourid = document.getElementById('ColourID').value;
	
	
	if (variantid==0) { alert("Select an option"); thereturn=false; }
	if (colourid==0) { alert("Select a colour"); thereturn=false; }
	
	return thereturn;

}


function heartbeat() {
	$.get("keepalive.asp");
}

$(document).ready(function() {
 setInterval("heartbeat()",600000);
});

// - end hiding -->