
// CSS HANDLER 

/*document.write("<LINK REL=STYLESHEET HREF=/new/css/lookandfeel.css TYPE=TEXT/CSS>")

window.parent.name = 'launcher';
*/

// WINDOW OPENER
var highlightcolor="red"
var ns6=document.getElementById&&!document.all
var previous=''
var eventobj

//Regular expression to highlight only form elements
var intended=/INPUT|TEXTAREA|SELECT|OPTION/

//Function to check whether element clicked is form element
function checkel(which){
if (which.style&&intended.test(which.tagName)){
if (ns6&&eventobj.nodeType==3)
eventobj=eventobj.parentNode.parentNode
return true
}
else
return false
}


//Function to highlight form element
function highlight(e){
eventobj=ns6? e.target : event.srcElement
if (previous!=''){
if (checkel(previous))
previous.style.backgroundColor=''
previous=eventobj
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
}
else{
if (checkel(eventobj))
eventobj.style.backgroundColor=highlightcolor
previous=eventobj
}
}

  //Sets the error into blank..
    function SetBlankImage(oImg,sImageName)
    {
	    oImg.onerror = null;
	    oImg.src = '/Images/shared/' + sImageName;
    }

 function EnlargeImage(ImageToEnlarge)
 {
	if (ImageToEnlarge != "NO_IMAGE")
		window.open("/popup.htm?"+ImageToEnlarge, "", "resizable=1,HEIGHT=200,WIDTH=200");
 }

function bookmark()
{
  var url = this.location; 
  var title= document.title; 
  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) 
  {
    window.external.AddFavorite(url,title);
  } 
  else if (navigator.appName == "Netscape") 
  {
    window.sidebar.addPanel(title,url,"");
  } 
  else 
  {
    alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
  }
} 

function openWindow(winURL,winName,features) {
  window.open(winURL,winName,features);
}

function SetBlankImage(oImg,sImageName)
{
	oImg.onerror = null;
	oImg.src = '/Images/shared/' + sImageName;
}

function SwapMainImage(oImg,sImageFullPath)
{
	oImg.onerror = null;
	oImg.src = sImageFullPath;
}


function ReloadPage(maincatid,subcatid,subsubcatid,productid,productsizeid,productsizecolorid)
{
	var str;
	str = '';
	str = '/products/default.aspx?pid=' + productid + '&';
	str += 'cid=' + maincatid + '&';
	str += 'scid=' + subcatid + '&';
	//str += 'sscid-' + subsubcatid + '/';
	str += 'psid=' + productsizeid + '&';
	str += 'pscid=' + productsizecolorid;
	document.location.href = str;
}

function ReloadCurtainCatPage(maincatid,colorid)
{
	var str;
	str = '';
	str = '/category/subcategory.aspx?cid=' + 0 + '&';
	str += 'scid=' + maincatid + '&';
	str += 'pcid=' + colorid;
	document.location.href = str;
}

function ReloadPageSpecial(maincatid,subcatid,subsubcatid,productid,productsizeid,productsizecolorid)
{
	var str;
	str = '';
	str = '/products/default.aspx?pid=' + productid + '&';
	str += 'cid=' + maincatid + '&';
	str += 'scid=' + subcatid + '&';
	//str += 'sscid-' + subsubcatid + '/';
	str += 'psid=' + productsizeid + '&';
	str += 'pscid=' + productsizecolorid + '&';
	str += 'changepscid=1';
	document.location.href = str;
}

function checkRegisterForm(theform)
{
	var str='';
	var str2 ='';
	var str3 = '';
	
	/*if (theform.txtPostcodelookup.value == '' || theform.txtPostcodelookup2.value == '')
	{
	
		//check to see if all mandatory fields are filled in
		if (theform.txtemail.value=='' || theform.txtpasswordreminder.value=='' || theform.txtfname.value=='' || theform.txtlname.value=='' || theform.txtphoneday.value=='' || theform.txtaddress1.value=='' || theform.txttown.value=='' || theform.listcounty.value=='' || theform.txtpostcode.value=='')
			str3 = 'One or more fields marked *) are empty\n\n';
		
		str2 = 'DELIVERY ADDRESS ERROR(S):\n\n';
		if (theform.sameaddress.checked == false)
			{
			if (theform.txtdelfname.value == '')
				str += 'Please add your first name\n';
			if (theform.txtdellname.value == '')
				str += 'Please add your last name\n';
			if (theform.txtdeladdress1.value == '')
				str += 'Please add your delivery address\n';
			if (theform.txtdeltown.value == '')
				str += 'Please add your delivery town\n';
			if (theform.listdelcounty.value == '')
				str += 'Please add your delivery county\n';
			if (theform.txtdelpostcode.value == '')
				str += 'Please add your delivery postcode\n';
			}
			
		if (str != '')
			{
				if (str3 != '')
					alert(str3 + str2 + str);
				else
					alert(str2 + str);
				return false;
			}
		else if (str3 != '' && str == '')
			{
				alert(str3);
				return false;
			}
		else
			return true;
	}
	else*/
		return true;
}


