﻿function wheretogetitOnLoad()
 {
	 try{
	 CWC2OnLoadFunction();
	 }catch (err) {
									 // handle error
	 }
 }
 //find a store form
 function postalcode_onfocus() {
	var zip=document.locate.zp.value;
	if (zip=="Enter a Zip Code"){
		document.form1.zp.value="";
	}
}

function findastore()
{
var zip=document.locate.zp.value;
//var i=document.locate.rd.selectedIndex;
//var radi=document.locate.rd.value;
if (zip=="Enter your zip..." || zip==""){
	 alert("Enter a Zip Code");
	 return false 
	}else{
	document.location.href = "/web/findstore/default.aspx?addressline=" + zip;// + "&searchradius=" + radi  ;
	//document.frmfindastore.submit();
	return false 
}
return true
}

function findastoreb()
{
var zip=document.request.zpb.value;
var radi=10;
if (zip=="Enter your zip..." || zip==""){
	 alert("Enter a Zip Code");
	 return false 
	}else{
	document.location.href = "/web/findstore/default.aspx?addressline=" + zip + "&searchradius=" + radi  ;
	//document.frmfindastore.submit();
	return false 
}
return true
}



function submitsearchform()
{
  document.searchform.submit();
}



function checkEnter(e,n){ //e is event object passed from function invocation
var characterCode;// literal character code will be stored in this variable

if(e && e.which){ //if which property of event object is supported (NN4)
e = e
characterCode = e.which //character code is contained in NN4's which property
}
else{
e = event
characterCode = e.keyCode //character code is contained in IE's keyCode property
}

if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
if (n==1){

findastore(); //submit the form
return false 
}else{

submitsearchform();
return false
}
}
else{
return true 
}

}

function checkEnterb(e,n){ //e is event object passed from function invocation
var characterCode;// literal character code will be stored in this variable

if(e && e.which){ //if which property of event object is supported (NN4)
e = e
characterCode = e.which //character code is contained in NN4's which property
}
else{
e = event
characterCode = e.keyCode //character code is contained in IE's keyCode property
}

if(characterCode == 13){ //if generated character code is equal to ascii 13 (if enter key)
if (n==1){

findastoreb(); //submit the form
return false 
}else{

submitsearchform();
return false
}
}
else{
return true 
}

}
function noEnter(e){
var characterCode
	 if(e && e.which){
	 e = e
	 characterCode = e.which
	 }
	 else{
	 e = event
	 characterCode = e.keyCode
	 }	 
	 if(characterCode == 13){
 	 return false
	 }
	 else{
	 return true
	 }
}
