	 function AddToCart(obj)
    {
		var prdid,price,IsAttrExist,qty;
		var str1,str2,str3,str4,str5;
		str1=obj.id;
		str2=str1.replace('_imgBuy','_hdngrdPrdId');
		str3=str1.replace('_imgBuy','_hdngrdPrice');
		str4=str1.replace('_imgBuy','_hdngrdAttr');	
		prdid=document.getElementById(str2).value;		
		price=document.getElementById(str3).value;		
		IsAttrExist=document.getElementById(str4).value;		
		qty=1;
  	    
		if(isNaN(qty)==true)
		{
			alert('Invalid Quantity');
			return false;
		}
        if(IsAttrExist==0)
        {     
			if(isNaN(qty)==true)
			{
				alert('Invalid Quantity');
				return false;
			}     
			else
			{
            	location.href="int_ses.aspx?Mode=Add&price=" + price + "&qty=" + qty + "&id=" + prdid + "&aid=0";
				return false;
			}
        }   
        else 
        {
			alert('Product have attributes go to more info page.');
			return false;          
		}
		return false;
    }
	
	function ChooseAttributes(id)
    {
        if(id==1)
        {
            location.href="productdetails.aspx?id=" + document.getElementById('hdnprdid').value;        
         }
         else
         {
            location.href="int_ses.aspx?Mode=Add&price=" +  document.getElementById('hdnprdprice').value + "&id=" + document.getElementById('hdnprdid').value + "&aid=" + document.getElementById('hdnAttributeId').value + "&Qty=1";  
         }
    }    
	
