//<!-- Copyright (c) 1999-2006 UniteU Technologies Inc.  All rights reserved.   //-->
// ************************************************************************************
// ****    DO NOT MODIFY THIS FILE!!!  **************************************************
// **************************************************************************************
//This file will be re-generated any time the site is upgrade, any changes will be lost.
//	Also, This folder is NOT included in Transfers.  Please make your own js file.
//<% version = " 4.94ac 12/12/2006 " %>
//<!--
function IntURL(BaseURL,Linktext,args){
	if (user_guid !=' '){
		mlink=Linktext.link(BaseURL + '?s_id='+i_jscript_uu_sid+'&mscssid='+ user_guid+ '&'+args);
	}else{
		mlink=Linktext.link(BaseURL + '?s_id='+i_jscript_uu_sid+'&'+ args);
	}
	document.write(mlink); 
}

function visitargs(PageURL,args,SURL)
{
	// watch out for anchors
	var delimAnchor="#";
	var strAnchor = "";
    var PageURLold = PageURL
	if(-1 < args.indexOf(delimAnchor))
	{
		var arrParts = args.split(delimAnchor);
		args = arrParts[0];
		strAnchor += delimAnchor+arrParts[1];
	}

	var storeIdClause='?';
	var argsLowerCase=args.toLowerCase();
	var i=0;
	var trailingAmpersandCount=0;

	//if s_id isn't in the args, prepare it for addition
	//gets us "?s_id=nnn" for use as the first URL arg
	if(argsLowerCase.indexOf('s_id')<0 && argsLowerCase.indexOf('s%5fid')<0)
		storeIdClause += 's_id='+i_jscript_uu_sid;

	//gets use "example.asp?" or "example.asp?sid=nnn"
    PageURL += storeIdClause;
        
	if (args.length>0)
	{
		//at this point, PageURL will end a "?" or a "s_id=nnn" so...
		//if PageURL doesn't end in a "?" and args doesn't start with one
		//we need an initial amp
		var initialamp = (('?' == PageURL[PageURL.length-1]) && ('&' == args[0]))? '' : '&';
        if(i_jscript_uu_URL_RW == 'True' && ('dept.asp'==PageURLold || 'product.asp'==PageURLold)){
		   PageURL = getRewriteURL(PageURLold,args);
        }else{
            PageURL += initialamp + args;
        }
	}
	//watch out for alots of amps at the end of PageURL
	for(i=PageURL.length-1;i>=0;i--)
	{
		if (PageURL.charAt(i)=='&')
		{
			trailingAmpersandCount++;
		}
		else
		{
			break;
		}
	}
	//wipe out any trailing amps in PageURL
	PageURL=PageURL.substring(0,PageURL.length-trailingAmpersandCount)
    
	if (user_guid !=' '){
        if (PageURL.charAt(PageURL.length-1)!='?'){
            PageURL =PageURL + '&'
        }
        PageURL =PageURL + 'mscssid='+ user_guid;
    }

	// add any anchor (could be "" or "#<anchor>"
	PageURL += strAnchor;

	if (SURL=='SURL')
		location = i_jscript_uu_rootSURL+PageURL;
	else
		location = i_jscript_uu_rootURL+PageURL;

	return(false);	
}
function drawinput(type,name,value,size,target,iclass,selected){document.write('<input type='+type+' name="'+name+'" id="'+name+'" value="'+value+'" size='+ size +' class='+iclass+' '+selected+' target='+target+'>');} 
function drawinput_limited(type,name,value,size,target,iclass,selected,maxlength){document.write('<input type='+type+' name="'+name+'" id="'+name+'" value="'+value+'" size='+ size +' class='+iclass+' '+selected+' target='+target+' maxlength=' + maxlength + '>');} 

function writeoption(option,display,select){
	if (select==option){selected=" SELECTED";}else{selected="";}
	option=String(option);	
	option=option.replace(/'/g,"&#39;");
	document.write("<OPTION Value='"+option+"'"+ selected +">"+ display);
}  

function deptdropdown(label) {
	document.write('<form METHOD="POST">');
	deptdropdownsel(label);
	document.write('</TD></form>');
}

function visit(newURL) {
	if (newURL != ""){winObj=window.open(newURL,'_top')}
}

function OKStrOfPenny(X) { 
	var T, S=new String(Math.round(X));
	while (S.length<3) S='0'+S;
	return S.substr(0, T=(S.length-2)) + '.' + S.substr(T, 2);
}

function  basket_items_qty()
{
	basket_items=0;
	if (shopping_basket.items!="")
	{
		for(i=0;i< shopping_basket.items.length;++i)
		{
			basket_items= basket_items + eval(shopping_basket.items[i].quantity);
		}
	}
	return basket_items;
}

function draw_related(type,display,message,rel_image_enable,rel_image_width,rel_list_pricelab,rel_sale_pricelab,rel_our_pricelab){
	var prodlink="";
	var typematch=0;
	var show_price=1;

	if(typeof type=="undefined"){
	type="0";
	}
	if (typeof display=="undefined"){
	display=1;
	}
	if (typeof message=="undefined"){
	message="";
	}
	if (typeof rel_image_enable=="undefined"){
	rel_image_enable="PRODUCT";
	}
	if (typeof rel_image_width=="undefined"){
	rel_image_width="";
	}
	if (typeof rel_list_pricelab=="undefined"){
	rel_list_pricelab="Price ";
	}
	if (typeof rel_sale_pricelab=="undefined"){
	rel_sale_pricelab="Sale Price";
	}
	if (typeof rel_our_pricelab=="undefined"){
	rel_our_pricelab="Our Price";
	}

	if (Related_prod.length >0){
		for (itematn=0;itematn< Related_prod.length ;itematn++){
			for (atn=0;atn< Related_prod[itematn].related.length ;atn++){
				if (Related_prod[itematn].related[atn].crosstype==type){
					typematch=1;
				}
			}
		}
	}
	if (typematch==1) {
		document.write("<table cellpadding=\"1\" cellspacing=\"0\" border=\"0\" width=\"100%\" class=\"SubHeadbgcolor\"><tr><td>");
		document.write("<table cellpadding=\"10\" cellspacing=\"0\" border=\"0\" width=\"100%\" class=\"tablebgcolor\"><tr><td class=CartLabels>");
		document.write(message);
		document.write("</td></tr><tr><td>");
	}

	if (Related_prod.length>0){
		document.write("<Table border=0 cellpadding=2 cellspacing=2>");
		document.write("<TR valign=\"bottom\">");
		for (itematn=0;itematn< Related_prod.length ;itematn++){
			for (atn=0;atn< Related_prod[itematn].related.length ;atn++){
				if (Related_prod[itematn].related[atn].crosstype==type){
					if (user_guid !=' '){
							prodlink="<A HREF=\"" + Related_prod[itematn].related[atn].link +"s_id=" + i_jscript_uu_sid +  "&mscssid="+ user_guid+ "&\">";
					}
					else{
							prodlink="<A HREF=\"" + Related_prod[itematn].related[atn].link +"s_id=" + i_jscript_uu_sid +  "&\">";
					}
				if (display==1){
					document.write("<TD class=relProduct WIDTH=\"100%\" VALIGN=TOP ALIGN=CENTER>");
				}else{
					document.write("<TD class=relProduct VALIGN=TOP ALIGN=CENTER>");
				}
				//product image & link
				if ((Related_prod[itematn].related[atn].image!="")&&(rel_image_enable!="NONE")){
					document.write(prodlink);
					if (rel_image_width !=""){
						document.write("<img ALIGN=CENTER WIDTH =\"" + rel_image_width + "\" BORDER=0  VSPACE=0  HSPACE=0  ALT=\"" + Related_prod[itematn].related[atn].name + "\" SRC=\"assets/product_images/" + Related_prod[itematn].related[atn].image + "\"></A>");
					}else{
						document.write("<img ALIGN=CENTER BORDER=0  VSPACE=0  HSPACE=0  ALT=\"" + Related_prod[itematn].related[atn].name + "\" SRC=\"assets/product_images/"+ Related_prod[itematn].related[atn].image +"\"></A>");
					}
					if (display==1){
						document.write("</TD></TR><TR class=relProduct><TD class=relProduct WIDTH=100% VALIGN=TOP ALIGN=CENTER>");
					}else{
						document.write("<BR>");
					}
				}
				//product name link
				document.write(prodlink + Related_prod[itematn].related[atn].name + "</A>");
				//product price (if enabled)
				if ((show_price==1)&&(Related_prod[itematn].related[atn].list_price!="")){
					if (Related_prod[itematn].related[atn].on_sale!="False" && Related_prod[itematn].related[atn].sale_price!="" && Related_prod[itematn].related[atn].sale_price!="$0.00" && Related_prod[itematn].related[atn].sale_price!=Related_prod[itematn].related[atn].list_price){
						document.write("<font class=ListPricewSaleR>" + rel_list_pricelab + Related_prod[itematn].related[atn].list_price + " </font>");
						document.write("<font class=SalePriceR>" + rel_sale_pricelab + Related_prod[itematn].related[atn].sale_price + " </B></font>");
					}else{
						document.write("<font class=ListPricewoSaleR>" + rel_our_pricelab + Related_prod[itematn].related[atn].list_price + " </font>");
					}
				}
				document.write("</TD>");
				if (display==1){document.write("</TR>");}
			}
		}
		if (display!=1){
			if((itematn+1)%3==0&&(itematn+1)!=packages_array[itematn].children.length)
			{
				document.write("</TR>");
			}
		}
		document.write("</Table>");
		}
	}
	if (typematch==1) {
		document.write("</TD></TR></TABLE></TD></TR></TABLE>");
	}
}//end function draw_related

function ship_sort(a,b)
{
	return integer_sort(a.sort_order,b.sort_order);
}

function basket_items_struct()
{
	this.sku
	this.dept_id
	this.pf_id
	this.px_id
	this.name
	this.image
	this.attr_value1
	this.attr_value2
	this.attr_value3
	this.attr_value4
	this.attr_value5
	this.info_attr1	
	this.info_attr2
	this.info_attr3	
	this.info_parent	
	this.quantity
	this.item_listprice
	this.item_price
	this.discount
	this.item_total
	this.avail	
	this.stock_msg
	this.award_qty_added
	this.ebay_id
	this.wish_id
	this.shipignore
	this.nonship
}

function basket_struct()
{
	this.no_items
	this.sub_total
	this.shipping_total
	this.shipping_method
	this.ship_award
	this.ship_to_street
	this.ship_to_city
	this.ship_to_state
	this.ship_to_zip
	this.tax_total
	this.total_total
	this.stage
	this.comment
	this.discount_code
	this.ebay_id
	this.shipping_methods	
	this.items
}

function related_struc()
{
	this.pf_id
	this.related
}

function RelSku()
{
	this.sku
	this.attr_value1
	this.attr_value2
	this.attr_value3
	this.attr_value4
	this.attr_value5
	this.price_list
	this.price_sale
	this.price_MSRP
	this.avail
	this.avail_msg
}

function Related()
{
	this.pf_id
	this.dept_id
	this.name
	this.image
	this.onsale
	this.MSRP_price
	this.list_price
	this.sale_price
	this.crosstype
	this.link
	this.skus	
}

function struct_ship_methods()
{
	this.method
	this.method_name
	this.cost
	this.sort_order
	this.ship_of_index
}

var basket_items= '0';
shopping_basket=new basket_struct();
shopping_basket.no_items = '0' ;
shopping_basket.sub_total = '0';
shopping_basket.shipping_total= '0';
shopping_basket.shipping_method ='';
shopping_basket.ship_award ='';
shopping_basket.tax_total='';
shopping_basket.total_total='';
shopping_basket.comment='';
shopping_basket.discount_code='';
shopping_basket.shipping_methods=new Array();
shopping_basket.items=new Array();

//-->
