function PopupPic(sPicURL) {
	sPicURL = escape(sPicURL);
     window.open( "/site/latch_popup.htm?http://shopping.netsuite.com"+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=200");
}

function hideButtons() 
{
	// this function will hide the features list elements that are blank on item detail pages
				for (i=1; i<6; i++) {
					if (document.getElementById("bul"+i).innerHTML =="") {
					document.getElementById("bul"+i).style.visibility = "hidden";
					}
				}
}

function stripCharacter(words,character) 
{ // strip a character from a string
	//documentation for this script at http://www.shawnolson.net/a/499/
		var spaces = words.length;
		for(var x = 1; x<spaces; ++x){
		 words = words.replace(character, "");   
	 }
	 return words;
}

/* OMTR add to cart */

/****************
* Sample Code - Adds another onSubmit to the form
* 	Parameters
*		form - a form object that you want to add the handle to
*		onSubmit - the function that will replace the form handler
****************/
function addOmnitureOnSubmit(elem, onClick)
{
	if(elem.onclick && !elem.omn_onclickBk) // check for an onClick and make sure it hasn't already been backed up
	{
		elem.omn_onclickBk = elem.onsubmit; // Back up the existing onClick
		elem.onclick = onClick // Add the new onClick
	}
	else if (!elem.onclick) // if no onClick
	{
		elem.onclick = onclick; // Add the new onClick
		elem.omn_onclickBk = true; // Add a flag to Omniture onClick has already been added so it can't be added again and cause an infinitie loop		
	}

}

function OmnitureOnClick(event)
{
	var b  = true // Set the boolean variable to return
	var elem = this;
	if(typeof(elem.omn_onclickBk) == 'function') // if an onClick was backed up run that function 1st
	{
		b = elem.omn_onclickBk(event); //Call the backed up onClick
	}
	/********************Begin Analytics Logic *************************/
		//put you logic here to run after the form validation has passed successfully
		s.pageName='Add to Cart';
		s.events='scAdd';
		s.t();
	/********************End Analytics Logic **************************/	
	return b; //return a boolean
}

//This call adds the on submit function
//if(document.getElementById('cartButton') !=null)
//	addOmnitureOnSubmit(document.getElementById('cartButton'),OmnitureOnClick);
