// ----------------------------- Fly Open Window ------------------------------------------
winName = "";


// openMe creates a window with a set name, locaton, width, height, top & left postions
function openMe(winName,urlPath,width,height,top,left) {
	winName = winName;
	BrowserName = navigator.appName;
	BrowserVersion = parseFloat(navigator.appVersion);
	
	// the adjusts the window for Netscape's lack of a phantom scroll bar
	
	if (BrowserName == "Netscape"){
		width -= 15;
	}
	
	eval(winName + '= eval(\'window.open(urlPath,"\' + winName + \'","resizable=no,scrollbars=no,titlebar=no,width=\' + width + \',height=\' + height + \',top=' + top + ',left=' + left + '")\')')
	//flyout = window.open(urlPath,"flyout","resizable=yes,scrollbars=yes,width=645,height=410,top=5,left=225");
	eval('window.' + winName + '.focus()');
	// eval('window.' + winName + '.onblur = window.'  + winName +  '.close');
	
}

function checkFieldsSearch(frmName) {
 
	var frmName = frmName; 
	
	if (frmName == "searchForm") {
		var textcheck = document.searchForm.search.value;  
	}
	if (textcheck == "") { 
		alert("\nPlease enter a value to search for!");
		return false;
	} else if (textcheck.length <= 2) {  
		alert("\nPlease enter an value longer than two characters.")
		return false;
	} else {
		var validChar = 0;
		for(var i=0; i<textcheck.length; i++){
			if(textcheck.charAt(i) != " "){
				validChar = 1;
			}
		}
		if(validChar == 0){
			alert("\nPlease enter a valid value to search!")
			return false;
		} else {
			return true;
		}
    }
}

// Check to see if browser supports rollovers.
var blnImageSupport = (document.images)? true:null;

//Image Replacer, much faster than the Macromedia version
function CV_ChangeImage(strImageName,sNewImagePath) { 
   // Change the original scource with the new one..
   if (blnImageSupport) { 
      document.images[strImageName].src = sNewImagePath;
   }
}


/*

This code is used to handle the exit survey for dockers.com. It is designed to only pop up an optional survey 
when a site visitor abandons their shopping cart. The purpose is to collect information on how we can improve 
our site. Once the survey has been presented, a cookie is placed that will prevent its display on future visits, 
regardless of whether the user decides to answer the questions or not

- DockersFootwear.com 

*/
var strLeaveSiteURL = "/exit_survey.aspx"; //Default survey
var blnEnablePopup = false; //Master switch.
var blnShowPopup = true; //Show popup when leaving this page? Default is yes.

function GetCookie (name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) {
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
		return getCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break; 
	}
	return null;
}
function getCookieVal (offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1) endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}
var exit_cookie = GetCookie("exit");
//if (exit_cookie != 3) { document.write('<body onUnload="check()">'); }

if ((exit_cookie != 3) && blnEnablePopup) {
	ExitWin=window.open("/exit_watcher.aspx","Exit","directories=0,top=2000,left=2000,screenX=2000,screenY=2000,height=10,width=10,alwaysLowered=yes,dependent=yes");
} 
function fcnLeaveSite(showit) {
	if ((exit_cookie != 3) && blnEnablePopup && blnShowPopup) {
		//var loc=self.location;
		ExitWin.startCheck(strLeaveSiteURL,showit);
	}
}

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_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_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_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];}
}