//Print handler
function PrintPage(){
if (window.print) {	
agree = confirm('We recommend you print this receipt for your records.\nWould you like to print your receipt now?');
if (agree) window.print(); 
   }
else alert("Press ctrl/p for windows or command/p on a mac to print this page.")
}
/****************************
	Netscape Resize handler
*****************************/
if (document.layers){
window.onresize = resize;
window.saveInnerWidth = window.innerWidth;
window.saveInnerHeight = window.innerHeight;
}
function resize() {
    if (saveInnerWidth < window.innerWidth || 
        saveInnerWidth > window.innerWidth || 
        saveInnerHeight > window.innerHeight || 
        saveInnerHeight < window.innerHeight ) 
    {
        window.location.reload();
    }
}
//M$ IE7 Will still show page URL in window for anti phishing 
function OpenHelp(strURL){
	window.open(strURL,'HELP','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=690,height=555,top=50,left=50')
}
function OpenImage(strURL){
	window.open(strURL,'Product','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=480,height=500,top=40,left=20')
}
function OpenSizeHelp(strURL){
	window.open(strURL,'SizeCharts','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=800,height=600,top=50,left=50')
}
function OpenDisplay(strURL){
	window.open(strURL,'SizeCharts','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=700,height=600,top=50,left=50')
}
function OpenSizeCharts(URL){
	window.open(strURL,'SizeCharts','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=800,height=600,top=5,left=5')
}

//image swapper
function DJ_imageSwap(daImage, daSrc){
 var objStr,obj;
 if(document.images){
   if (typeof(daImage) == 'string') {
     objStr = 'document.' + daImage;
     obj = eval(objStr);
     obj.src = daSrc;
   } else if ((typeof(daImage) == 'object') && daImage && daImage.src) {	
     daImage.src = daSrc;
   }
 }
}
//function for back buttons
function GoBack(){
history.go(-1);
return;	
}
function GoBack2(){
history.go(-2);
return;	
}
function DJ_preloadImages() {
 if (document.images) {
   if (typeof(document.DJ) == 'undefined'){
     document.DJ = new Object();
   }
   document.DJ.loadedImages = new Array();
   var argLength = DJ_preloadImages.arguments.length;
   for(arg=0;arg<argLength;arg++) {
     document.DJ.loadedImages[arg] = new Image();
     document.DJ.loadedImages[arg].src = DJ_preloadImages.arguments[arg];
   }
 }
}
// trim the text
function strTrim(strText) {
for (i=0; i<strText.length; ++i) {
	if (strText.charAt(i) != ' ') break;
}
if (i >= strText.length) return ('');
if (i > 0) strText = strText.substring(i, strText.length);
for (j=strText.length-1; j > i; --j) {
	if (strText.charAt(j) != ' ') break;
}
if (j < strText.length -1)
	strText = strText.substring(0, j+1);
return strText;
}
function ISEmail(s){
    var i = 1;
    var sLength = s.length;
    while ((i < sLength) && (s.charAt(i) != "@"))
    { i++
    }
    if ((i >= sLength) || (s.charAt(i) != "@")) return false;
    else i += 2;
    while ((i < sLength) && (s.charAt(i) != "."))
    { i++
    }
    if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
    else return true;
} 
// Checks to ensure string is made up of numbers
function isDigit (c){   
var OKNumbers = "0123456789 ";
var i = 0;
		while (i < c.length) {
			if (OKNumbers.indexOf(c.charAt(i)) < 0)
				return false;
			i++;
		}
return true
}

