// keep the next line as it is. need it to benefit from InterDev colors, but must comment it out.
// <SCRIPT LANGUAGE="JScript">
<!-- Hide from old browsers
var stay_here	= false;
var s_ask_url	= '';



//'==================================
function ask_open( url )
{	
try {
	var askUrl = window.location.href
	var newwindow = null
	//'``````````````````````````````````
	if (stay_here==true) { return }	//set by onClick
    //if (navigator.appName=='Netscape') { return }
	// if (document.cookie.indexOf('pC_ask=1')>=0) { return }  

	newwindow = window.open( url, "pC_ask", 'scrollbars=no,menu=no,resizeable=no,status=no,width=460,height=300');
	
	if (newwindow) {
		if (window.focus) {newwindow.focus()}
	
		document.cookie='pC_ask=1; path=/; '
		return false;
		
	} else {	//no open
	
		var c = confirm(' Would you like to stay ? ' + ' ' );
		if (c) {				
				stay_here		= true;
				location.href = askUrl;
				return false;
			}
	}	//ifopen
} catch(e) {}
}
//'==================================
function ask_open__( url )
{	
try {
	//IsClick()
	if (stay_here==true) { return }
   	if (navigator.appName=='Netscape') { return }
	if (document.cookie.indexOf('pC_ask=1')>=0) { return }  

	newwindow = window.open( url, "pC_ask", 'scrollbars=no,menu=no,resizeable=no,status=no,width=460,height=300');
	
	if (window.focus) {newwindow.focus()}
	
	document.cookie='pC_ask=1; path=/; '
	
	return false;
	
} catch(e) {}
}
//===========================
function ask_return( url )
{
//alert( window.opener.closed );

	var isok = false
//try {
	//--------------------------------------------------
	var ret=window.opener;
	try {
		if (window.opener.closed == false )  { isok = true } 
	} 
	catch(e2) {
		isok = false
	}
	
	if (isok == false)  { ret=window.open(url) } 
	else { ret.location.href=url; }
	//'``````````````````````````````````
	ret.focus(); 
	self.close();
	
	return false;
	
//} catch(e) {}

} //function
//'==================================
function ask_before(  )
{	
try {
	if (stay_here==true) { return }
	
	//'``````````````````````````````````
	//var newwindow 
	//var newwindow = window.open( s_ask_url, "pC_ask", 'scrollbars=no,menu=no,resizeable=yes,status=no,width=460,height=500');
	var newwindow = null
	
	
	if (newwindow) {
		if (window.focus) {newwindow.focus()}
		document.cookie='pC_ask=1; path=/; '
	} else {	//no open
		
		var msg = '\n********************************************\nDon\'t leave yet!\nWhat if we give you $5 OFF?\n';
		msg = msg + 'Simply use coupon code "return" during checkout!\n'
		msg = msg + '********************************************\n\nClick CANCEL to stay here and SAVE!\n';
		msg = msg + '- - - - - - - - - - - - - - - - - - - - - -'
		
		//event.returnValue = msg
		return msg;
	}	//ifopen
	
} catch(e) {}
}
//'==================================
function IsClick()
{	
try {
	var par = window.event.srcElement.parentElement.tagName;
	var tag = window.event.srcElement.tagName;
	if (tag=="A" || tag=="AREA" || tag=="INPUT" || tag=="SELECT" || tag=="U" || par=="A")
	   { 
	    stay_here=true; 
	}//if
} catch(e) {}
}
//===========================
function onClick_ALL()
{	
 stay_here=true; 
}
//===========================
function OnClick_IE()
{	
try {
	var par = window.event.srcElement.parentElement.tagName;
	var tag = window.event.srcElement.tagName;
	if (tag=="A" || tag=="AREA" || tag=="INPUT" || tag=="SELECT" || tag=="U" || par=="A")
	   { 
	    stay_here=true; 
	}//if
} catch(e) {}
}
//===========================
function OnClick_MOZ( e )
{	
	var targ;
	if (!e) var e = window.event;
	if (e.target) targ = e.target;
	else if (e.srcElement) targ = e.srcElement;
	if (targ.nodeType == 3) // defeat Safari bug
		targ = targ.parentNode;
}
//========================


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));
}


function setCookie(c_name,value,expiredays)
{
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+
	((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}

function ask_before_new() {
	var myURL = '';
	var newURL = '';
	var showExitCookie;
	
	myURL = window.location.href;

    showExitCookie= GetCookie("showExit");
 
 if (showExitCookie!= null)  {
    if (parseFloat(showExitCookie)>1) { 
	  showExitCookie= showExitCookie- 1;
     setCookie('showExit',showExitCookie,90);
	  return true; 
	}
	else
	{
  	  setCookie('showExit','5',90); 
  	}


  }
  else
  	{
  	  setCookie('showExit','5',90);  
  	}

 
 
 
	var e = window.event;
	//alert(e.type);


    





try{
 		 if (stay_here==true) {return}

		var msg = '\n********************************************\nDon\'t leave yet!\nWhat if we give you $5 OFF?\n';
		msg = msg + 'Simply use coupon code "return5" during checkout!\n'
		msg = msg + '********************************************\n\nClick OK to stay here and SAVE!\n';
		
		msg = msg + '- - - - - - - - - - - - - - - - - - - - - -'
		
	newURL = window.location.href;

	var c = confirm(msg);
	if (c) {
		

		  var sTarget =myURL;
		  
		  if (sTarget.indexOf('pr=return')==-1)
		  {
				 if (sTarget.indexOf('?')==-1) 
				 {
					sTarget = sTarget + '?';
		  			} else {
           					 sTarget = sTarget + '&';
		 					}
		 
		 		sTarget = sTarget + 'pr=return';
		 }
	
			
		
		location.href = sTarget;
		
	 
	}
  //}

  return; 
  }catch(e) {}

}


//-->
