function launch(url,wdh,hgt)
{
	window.open(url,'newwindow','toolbar=0,status=1,menubar=0,scrollbars=1,resizable=1,width='+wdh+',height='+hgt);
}

function loadNav()
{
	sfHover = function() {
		var sfEls = document.getElementById("nav").getElementsByTagName("li");
		for (var i=0; i<sfEls.length; i++) {
			sfEls[i].onmouseover=function() {
				this.className+=" sfhover";
			}
			sfEls[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
			}
		}
	}
	if (window.attachEvent) window.attachEvent("onload", sfHover);
}

function checkRadio(){
	if(document.getElementById('ctl00_ContentPlaceHolder1_Login1_yes').checked == false){
		document.getElementById('ctl00_ContentPlaceHolder1_Login1_yes').checked = true;
	}
	
}

function displayBlock(a,b) {
	var element = document.getElementById(a);
	if (b==1) {
		element.style.display = 'block';
	} else {
		element.style.display = 'none';
	}
}

function confirmmsg() {
    if (confirm("Press the OK button to confirm your DELETE request, or Cancel")==true) 
		return true; 
	else 
 		return false; 
}

function selectOption(obj, optionNo) {
	document.getElementById(obj)
	selectcard = document.getElementById(obj);
	selectcard.selectedIndex = optionNo;
}

function cardtype(cardselection){
	if (cardselection.options[cardselection.selectedIndex].value == 'switch')
	document.getElementById('issuenumber').style.visibility='visible';
	else
	document.getElementById('issuenumber').style.visibility='hidden';
}

function selectStock(swatchID)
{
	if(document.getElementById)
	{
		var stock=document.getElementById("ctl00_ContentPlaceHolder1_ddlColour");
		for(var i=0;i<stock.options.length;i++)
		{
			if(stock.options[i].value==swatchID)
			{
				document.getElementById("productprice").innerHTML=price[swatchID];
			
				stock.selectedIndex=i;
				break;
			}
		}
	}
}




function showStock(swatchClass)
{
	if(document.getElementById)
	{
		var swatchID=swatchClass.replace(/swt_/,'');//remove swt_ from the swatch class
		document.getElementById("ctl00_ContentPlaceHolder1_stocklevel").innerHTML=stock[swatchID];
		document.getElementById("ctl00_ContentPlaceHolder1_imgProductImage").src=picture[swatchID];
		document.getElementById("ctl00_ContentPlaceHolder1_hlMainImageEnlarge").href=document.getElementById("ctl00_ContentPlaceHolder1_hdnImageEnlargeUrl").value + swatchID;
		document.getElementById("ctl00_ContentPlaceHolder1_hlEnlargeImage").href=document.getElementById("ctl00_ContentPlaceHolder1_hdnImageEnlargeUrl").value + swatchID;
		selectStock(swatchID);
	}
}   

//surpress JAVASCRIPT errors for the popup window
function blockError(){
return true;
}
window.onerror = blockError;
