//
//-------------------------------------------------------------------
// Licensed Materials - Property of IBM
//
// WebSphere Commerce
//
// (c) Copyright IBM Corp. 2006
//
// US Government Users Restricted Rights - Use, duplication or
// disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
//-------------------------------------------------------------------
//

var busy = false;

function Add2ShopCart(form)
{
       var donotsubmit = false;
       if (!busy) {
              busy = true;
              form.action="OrderItemAdd";
              form.URL.value='OrderCalculate?URL=OrderItemDisplay?partNumber*=&quantity*=';
				
			  var control=form.elements;
				for (var i=0;i<control.length;i++) 
				{
					if (control[i].type.match(/select/i)) 
					{
						if (control[i].selectedIndex==0 && donotsubmit == false)
						{
							donotsubmit = true;
							alert("Please choose a value for all components.");
						}
					}
				}
			  
				
	            if( !donotsubmit)
	            {
	            	form.submit();
	       	    }
	       	    else
			    {
					busy = false;
       	    	}
      }

}

function Add2WishList(form)
{
       if (!busy) {
              busy = true;
              form.action="InterestItemAdd";
              form.URL.value='InterestItemDisplay';
              var control=form.elements;
				for (var i=0;i<control.length;i++) 
				{
					if (control[i].type.match(/select/i)) 
					{
						if (control[i].selectedIndex==0 && donotsubmit == false)
						{
							donotsubmit = true;
							alert("Please choose a value for all components.");
						}
					}
				}
			  
				
	            if( !donotsubmit)
	            {
	            	form.submit();
	       	    }
	       	    else
			    {
					busy = false;
       	    	}
       }
}

