function spliter2 (id,blurb,offline){
	var i;
	var j;
	var k;
	var found;
	found=false;
	iloop:
	for (i=0;i<document.forms.length;i++)
	{
		jloop:
		for (j=0;j<document.forms[i].length;j++)
		{
			if (document.forms[i].elements[j].name.length>=id.length)
			{
				var tempstr= document.forms[i].elements[j].name.substring(0,id.length)
				if (id==tempstr)
				{
					if(document.forms[i].elements[j].checked)
					{
						if (offline)
							{
								location.href="/sections/account/cart.asp?offerproductid=" + id + "&offline=1&split_payment=1&catblurb=" + blurb
								found=true;
								break jloop;
								
							}
						else
							{
								location.href="/sections/account/cart.asp?offerproductid=" + id + "&offline=0&split_payment=1&catblurb=" + blurb
								found=true;
								break jloop;
							}
					}
					else
					{
						if (offline)
							{
								location.href="/sections/account/cart.asp?offline=1&offerproductid=" + id 
								found=true;
								break jloop;
							}
						else
							{
								location.href="/sections/account/cart.asp?offline=0&offerproductid=" + id 
								found=true;
								break jloop;
							}
					}
				}

			}
			
		}
		if (found)
		{
			break iloop;
		}
	}
}
//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();
    }
}
//help for checkout pages
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;
   }
 }
}
//functio fro back bnuttons
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
}

