		var color = ""
		var pageName=null;
		var isVar = null;
		
		
		function preload_image(file) {         
        	var img = file.replace(/amp;/g,"");        	
        	(new Image()).src = img; 
		}
		
		function changeView(imgURL,imgID)
		{		
		document.getElementById(imgID).src = imgURL;
		
		}
				
		function setUrl(link1,linkStyle,link2,imgId) {		
			
			var query = document.getElementById(imgId).src;			
			var colorLink = query.substring(query.lastIndexOf("_") + 1, query.length - 4);	
			
			if (color == "") 
				{ 
					document.location.href=link1+link2;
				} 
					else 
				{
					document.location.href=link1+linkStyle+'_'+colorLink+link2;
				} 
		}		
		
	    
	    function toggleVis(id) {
	       var e = document.getElementById(id);	       
	       if(e.style.display == 'block')
	          e.style.display = 'none';
	       else
	          e.style.display = 'block';
	    }

	    function toggleVisOn(id) {
	       var e = document.getElementById(id);
	       if(e != null){	      
	          e.style.display = 'block';
	          }
	    }
	    
	    function toggleVisOff(id) {
	       var e = document.getElementById(id);
	          if(e != null){
	          e.style.display = 'none';
	          }
	    }
	    
	    function toggleAddress() {
	       if(document.getElementById('UseShippingAsBillingFlag').value == 'true')
	       {
	       		document.getElementById('divCass').style.display = 'none';
	       		document.getElementById('divDass').style.display = 'block';	
	       		//document.getElementById('buttons').style.marginTop = '-30px';       		
	       		document.getElementById('UseShippingAsBillingFlag').value = 'false'
	       }
	       else 
	       {
	       		document.getElementById('divCass').style.display = 'block';
	       		document.getElementById('divDass').style.display = 'none';	       		
	       		document.getElementById('UseShippingAsBillingFlag').value = 'true'
	       }
	    }
	    
	    function setElementValue(id, value) {
	       var e = document.getElementById(id);
	          e.value = value;
	    }


		function getNextElement(iElement) { 
		var parentForm = iElement.form; 
	
		for (i=0; i<parentForm.length; i++) { 
		if (parentForm.elements[i]==iElement) 
		if (parentForm.elements[i+1]) 
			return parentForm.elements[i+1]; 
		} 
		return null; 
		} 
		
		function autotab(iCtl, iMax) { 
		var nextElement, textValue = iCtl.value; 
			if (textValue.length==iMax) { 
				nextElement = getNextElement(iCtl); 	
				if (nextElement) { 
					nextElement.select(); 
					nextElement.focus(); 
				} 
			} 
		} 
		

function empty(object)
{
	if (object == null)
	{
		return true;
	}
	if (object.toString().length == 0)
	{
		return true;
	}
	
	return false;
}		
		
		
// class hashtable
function Hashtable(){
	this.hash = new Array();
	this.keys = new Array();

	this.location = 0;
}


Hashtable.prototype.get = function (key)
{
	return this.hash[key];
}

Hashtable.prototype.contains = function (key)
{
	if (this.hash[key] != null)
	{
		return true;
	}
	else
	{
		return false;
	}
}

Hashtable.prototype.put = function (key, value)
{
	if (value == null)
		return null;

	if (this.hash[key] == null)
		this.keys[this.keys.length] = key;

	this.hash[key] = value;
}


function addToCartFromQuickView(FormID, continueImage)
{		
	MiniCart.cartAdd( FormID, continueImage);
	return false;
}



function preLoadImagesMain()
{				
	preload_image(svrPath+'images/backgrounds/bg_quickview.gif');	
	preload_image(svrPath+'images/backgrounds/bg_quickview.png');	
	preload_image(svrPath+'images/header/nav_main.gif');		
	preload_image(svrPath+'images/backgrounds/bg_drop_sm.png');		
	preload_image(svrPath+'images/backgrounds/bg_drop_lg.png');		
	preload_image(svrPath+'images/backgrounds/bg_minicart.jpg');		
	preload_image(svrPath+'images/backgrounds/bg_gettheBuzz_rpt.png');
	preload_image(svrPath+'images/backgrounds/bg_gettheBuzz_top.png');
	preload_image(svrPath+'images/backgrounds/bg_gettheBuzz_bot.png');
	preload_image(svrPath+'images/backgrounds/bg_gettheBuzz.jpg');		
	preload_image(svrPath+'images/backgrounds/bg_searchWidget.png');			
	preload_image(svrPath+'images/backgrounds/bg_searchform.png');			
	preload_image(svrPath+'images/header/nav_men-over.png');			
	preload_image(svrPath+'images/header/nav_women-over.png');			
	preload_image(svrPath+'images/header/nav_kids-over.png');			
	preload_image(svrPath+'images/header/nav_jeans-over.png');			
	preload_image(svrPath+'images/header/nav_outfits-over.png');			
	preload_image(svrPath+'images/header/nav_new-over.png');			
	preload_image(svrPath+'images/header/nav_asseenin-over.png');		
	preload_image(svrPath+'images/header/nav_luckylife-over.png');		
	preload_image(svrPath+'images/header/nav_luckyfew-over.png');	
	
}

function preLoadImagesPD()
{
	//preload_image(svrPath+'images/backgrounds/loading_qv.gif');
	preload_image(svrPath+'images/backgrounds/bg_quickview.gif');	
	preload_image(svrPath+'images/backgrounds/bg_quickview.png');
	preload_image(svrPath+'images/backgrounds/bg_flyout_shad.png');
	preload_image(svrPath+'images/backgrounds/bg_prodImageTh.gif');	
	
}

function widgetShow(id)
{
	new Effect.SlideDown(id);
}

function mcDivShow(id)
{

	//alert(svrPath);
	var d1 = 'mcImg'+id;
	var d2 = 'mcDesc'+id;	
	var d3 = 'arrDiv'+id;	
	
	//alert(document.getElementById(d1).style.display);
	if (document.getElementById(d1).style.display == 'none')
	{
		document.getElementById(d1).style.display = 'block';
		document.getElementById(d2).style.display = 'block';
		document.getElementById(d3).src = svrPath+'images/buttons/arrw_mc_dwn.gif';		
	}
	else
	{
		document.getElementById(d1).style.display = 'none';
		document.getElementById(d2).style.display = 'none';
		document.getElementById(d3).src = svrPath+'images/buttons/arrw_mc.gif';
		//alert(document.getElementById(d3).src);
	}
}

document.onclick = function (e) {
	e = e || event
	var target = e.target || e.srcElement
	var box = document.getElementById("divSearchWidget")
	var sbox = document.getElementById("srchBoxMain")
	do {
		if (box == target || sbox ==target ) {
			// Click occured inside the box, do nothing.
			return true
		}
		target = target.parentNode
	} while (target)
	// Click was outside the box, hide it.
	
	if (box != null && box.style.display != 'none')
	{
	Effect.SlideUp('divSearchWidget');
	//box.style.display = "none"
	}
}

function queryString( key )
{
    var re = new RegExp( "[?&]" + key + "=([^&$]*)", "i" );
    var offset = location.search.search( re );
    if ( offset == -1 ) return null;
    return RegExp.$1;
}

function searchWidg() {
	if(document.getElementById("divSearchWidget").style.display == 'none')
	 {	 
	 	Effect.SlideDown('divSearchWidget');
	 }
	 else
	 {
	 return false
	 }
}

function ismaxlength(obj){
	var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
	if (obj.getAttribute && obj.value.length>mlength)
	obj.value=obj.value.substring(0,mlength)
}