// JavaScript Document
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=325,height=300');");
}
function popUp2(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=425,height=775');");
}
// Accordian Function for Customer Service page
var accordion=function(){
	var tm=sp=10;
	function slider(n){this.nm=n; this.arr=[]}
	slider.prototype.init=function(t,c,k){
		var a,h,s,l,i; a=document.getElementById(t); this.sl=k?k:'';
		h=a.getElementsByTagName('dt'); s=a.getElementsByTagName('dd'); this.l=h.length;
		for(i=0;i<this.l;i++){var d=h[i]; this.arr[i]=d; d.onclick=new Function(this.nm+'.pro(this)'); if(c==i){d.className=this.sl}}
		l=s.length;
		for(i=0;i<l;i++){var d=s[i]; d.mh=d.offsetHeight; if(c!=i){d.style.height=0; d.style.display='none'}}
	}
	slider.prototype.pro=function(d){
		for(var i=0;i<this.l;i++){
			var h=this.arr[i], s=h.nextSibling; s=s.nodeType!=1?s.nextSibling:s; clearInterval(s.tm);
			if(h==d&&s.style.display=='none'){s.style.display=''; su(s,1); h.className=this.sl}
			else if(s.style.display==''){su(s,-1); h.className=''}
		}
	}
	function su(c,f){c.tm=setInterval(function(){sl(c,f)},tm)}
	function sl(c,f){
		var h=c.offsetHeight, m=c.mh, d=f==1?m-h:h; c.style.height=h+(Math.ceil(d/sp)*f)+'px';
		c.style.opacity=h/m; c.style.filter='alpha(opacity='+h*100/m+')';
		if(f==1&&h>=m){clearInterval(c.tm)}else if(f!=1&&h==1){c.style.display='none'; clearInterval(c.tm)}
	}
	return{slider:slider}
}();
// END Accordian Function for Customer Service page
// Accordian Function for Catalog pages
var Cat_accordion = function() {
	var tm = sp = 10;
	function Cat_slider(n) { this.nm = n; this.arr = [] }
	Cat_slider.prototype.init = function(t, c, k) {
		var a, h, s, l, i; a = document.getElementById(t); this.sl = k ? k : '';
		h = a.getElementsByTagName('dt'); s = a.getElementsByTagName('dd'); this.l = h.length;
		for (i = 0; i < this.l; i++) { var d = h[i]; this.arr[i] = d; d.onclick = new Function(this.nm + '.pro(this)'); if (c == i) { d.className = this.sl } }
		l = s.length;
		for (i = 0; i < l; i++) { var d = s[i]; d.mh = d.offsetHeight; if (c != i) { d.style.height = 0; d.style.display = 'none' } }
	}
	Cat_slider.prototype.pro = function(d) {
		for (var i = 0; i < this.l; i++) {
			var h = this.arr[i], s = h.nextSibling; s = s.nodeType != 1 ? s.nextSibling : s; clearInterval(s.tm);
			if (h == d && s.style.display == 'none') { s.style.display = ''; Cat_su(s, 1); h.className = this.sl }
			else if (s.style.display == '') { s.style.display = 'none';Cat_su(s, -1); h.className = 'subcat' }
		}
	}
	function Cat_su(c, f) { c.tm = setInterval(function() { Cat_sl(c, f) }, tm) }
	function Cat_sl(c, f) {
		var h = c.offsetHeight, m = c.mh, d = f == 1 ? m - h : h; c.style.height = h + (Math.ceil(d / sp) * f) + 'px';
		c.style.opacity = h / m; c.style.filter = 'alpha(opacity=' + h * 100 / m + ')';
		if (f == 1 && h >= m) { clearInterval(c.tm) } else if (f != 1 && h == 1) { c.style.display = 'none'; clearInterval(c.tm) }
	}
	return { Cat_slider: Cat_slider }
} ();
// END Accordian Function for Catalog pages



function popUpRules(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=250,height=400,left = 515,top = 312');");
}



function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=yes,menubar=no,toolbar=no,resizable=yes';
win=window.open(mypage,myname,settings);}

function popUpgordon(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=810,height=560');");
}

function technoPop()
{
	window.open("technoPop.html","tecnoPop","toolbar=no, location=0, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=810, height=460, top=300, left=50")
}

function urlPop(url)
{
	window.open(url, "SpinToWin","toolbar=no, location=0, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=415, height=250, top=300, left=50")
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function contains_ns6(a, b) {
	while (b.parentNode)
		if ((b = b.parentNode) == a)
			return true;
		return false;
}

function validate(){
	if (document.LocateZIP.ZIP.value==""||document.LocateZIP.ZIP.value=="enter zip code"||document.LocateZIP.ZIP.value.length<5) {
		alert("Please enter a valid ZIP code");
		document.LocateZIP.ZIP.focus();
		return false;
	}
	if (document.LocateZIP.size.value=="") {
		alert("Please select a size");
		document.LocateZIP.size.focus();
		return false;
	}
	return true;
}

function postForm(postIt){
		document.catSearch.submit();
}

function go1(form){
form.submit();
		}
		
function swapMainIMG(NewIMG){
	document.CurrentIMG.src=NewIMG
}

function BrandsJumpTo(tmpCatID,tmpCatTitle,tmpBrand){
    document.BrandForm.brand.value=tmpBrand
    document.BrandForm.action=MainURL+"/catalog/"+tmpCatTitle+"/"+tmpCatID+".html"
    document.BrandForm.submit()
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function validateZIP2(){
	if (document.locate.postalcode.value.length<5) {
		alert("Please enter a valid ZIP code")
		document.store.postalcode.focus()
		return false
	}
	document.locate.submit();
}

function clearState(){
	document.locate.State.value=""
}

function validateZIP(){
	if (document.locate.postalcode.value.length<5) {
		alert("Please enter a valid ZIP code")
		document.store.postalcode.focus()
		return false
	}
	return true
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function findShoe(){
    var frm = document.showShoe;
    if ((frm.category_id.value == "0")&&(frm.category.value == "0")&&(frm.style.value == "0")) {
 	    alert("Please select a department, category, or style.");
	    document.catSearch.shoe_department.focus();
	    return false;
	}
	document.showShoe.submit();
}

function PageSizeJump(newPgSize){
    document.PageSizeForm.submit()
}

function PageSizeJumpX(){
    document.PageSizeForm.submit()
}

function PageSizeJump2(newPgSize){
    document.PageSizeForm2.submit()
}

function PageSizeJump2X(){
    document.PageSizeForm2.submit()
}

function LtFormSubmit(){
    document.LtForm.submit()
}

function RtFormSubmit(){
    document.RtForm.submit()
}

var xmlHttp=null; // Defines that xmlHttp is a new variable.
// Try to get the right object for different browser
try {
// Firefox, Opera 8.0+, Safari, IE7+
    xmlHttp = new XMLHttpRequest(); // xmlHttp is now a XMLHttpRequest.
} catch (e) {
// Internet Explorer
    try {
        xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
}

xmlHttp.onreadystatechange = function() {
    if (xmlHttp.readyState == 4)
        try { // In some instances, status cannot be retrieved and will produce an error (e.g. Port is not responsive)
            if (xmlHttp.status == 200) {
                //Set the main HTML of the body to the info provided by the AJAX Request
                document.getElementById("PollResultsDIV").innerHTML = xmlHttp.responseText;
            }
        } catch (e) {
        document.getElementById("PollResultsDIV").innerHTML = "Error on Ajax return call : " + e.description;
        }
}

function QuickPollValue(){
    for (i=0;i<document.QuickPoll.VoteChoice.length;i++) {
	    if (document.QuickPoll.VoteChoice[i].checked) {
		    return document.QuickPoll.VoteChoice[i].value;
	    }
    }
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function validateZIP(){
	if (document.locate.postalcode.value.length<5) {
		alert("Please enter a valid ZIP code")
		document.store.postalcode.focus()
		return false
	}
	return true
}

function validateZIP2(){
	if (document.locate.postalcode.value.length<5) {
		alert("Please enter a valid ZIP code")
		document.store.postalcode.focus()
		return false
	}
	document.locate.submit();
}

function clearState(){
	document.locate.State.value=""
}

function go1(form){
	form.submit();
}

function go2(aState){
	location="tab_locator.asp?state="+aState;
}
