//alert('here');
var AddToCartFlag = 0;


function UpDateViewPrice(price,count){
		objBoxProductprice = document.getElementById("BoxProductprice"+count);
		objBoxProductprice.innerHTML ="£"+price; 
		//alert("Prce is "+price);
		}
				
	
function openhelp(code)
	{
	window.open("helpcat.php?cat="+code,"newwin1","width=500,height=500,scrollbars=yes,top=100,left=200")
	}
	
	
	
function openLensGuide(){
		window.open("lenseguide.php","newwin1","width=1000,height=600,scrollbars=yes,top=100,left=200");
	}
	
	
	
function val(abc){
	
 	if(document.getElementById('quantitiy'+abc).value != 0 ){
 	
	qtval=document.getElementById('quantitiy'+abc).value;
	// alert(qtval);
	document.frm.valu.value = abc;
	

    document.frm.action="addtocart.php?valu="+abc;
	
        $(document).ready(function() { 
            // bind 'myForm' and provide a simple callback function 

   			 // submit the form 
 			 $("#frm").ajaxSubmit(function(){
				
				$("#Promotional_Basket_Wrapper").load("mainimages.php");
				$("#FeedBackUserCart").load("BasketAlert.php?qtval="+qtval);
				//alert($('#frm').formSerialize());
				if(AddToCartFlag ==0){
					
					/*
					$("#FeedBackUserCart").fadeIn(50,function(){$("#FeedBackUserCart").fadeOut(20000);});
					//$("#FeedBackUserCart").fadeIn(5000,function(){$("#FeedBackUserCart").fadeOut(10000); });
					AddToCartFlag =0;
				   */
				
$("#FeedBackUserCart").fadeIn(2500);
//$("#FeedBackUserCart").delay(800);
timerID=setTimeout("abc()",8000);

				
				
				
				}
				
			 }); 
		
			 
// return false to prevent normal browser submit and page navigation 
 	return false; 

        });
		
		

		
//document.frm.submit();
		}

 else{
		alert("Quantity Can Not Be Zero Or Empty");
		document.getElementById('quantitiy'+abc).focus();
     }
	 
		
}



// By Nisar ===========
function abc()
     {
	   //alert('adfdaf');
	   $("#FeedBackUserCart").fadeOut(3000);
	  }
	   
		
function valcroc(){
clearTimeout(timerID);
$("#FeedBackUserCart").stop();
$("#FeedBackUserCart").fadeOut(1000);

}

//======= End By nisar============





function AddToCart(FormTracking){
	
	
	//alert('sddasd');
		
frmobj = document.getElementById('frm');
	//=========== By Nisar Ahmad==========================
if (document.getElementById('lense'+FormTracking)) { 
	othproidd=document.getElementById('lense'+FormTracking).value;
	frmobj.action="addtocartpackage.php?FormTrack="+FormTracking+"&othptoid="+othproidd;
 }else{
frmobj.action="addtocartpackage.php?FormTrack="+FormTracking;
}
	
		
            //frmobj.submit();
	 $(document).ready(function() { 
            // bind 'myForm' and provide a simple callback function 
   			 // submit the form 
 			$("#frm").ajaxSubmit(function(){
									   
			
				$("#Promotional_Basket_Wrapper").load("mainimages.php");
				$("#FeedBackUserCart").load("BasketAlert.php");
				//alert($('#frm').formSerialize());
				$("#FeedBackUserCart").fadeIn(5000,function(){$("#FeedBackUserCart").fadeOut(10000); });
				
				
			 }); 
  			  // return false to prevent normal browser submit and page navigation 
 			   return false; 

        }); 

}





function val1(abc){
 document.frm.valu.value = abc;
 document.frm.action="addtowishlist.php";
 document.frm.submit();
 }
 



function openwin()
	{
	window.open("http://www.ukcctv.co.uk/thanksaddtocart.php","newwin","width=700,height=300,scrollbars=no,top=200,left=200")
	}
	
	
	function openwinemail(code)
	{
	window.open("mailitem.php?productid="+code,"newwin1","width=840,height=575,scrollbars=yes,top=100,left=100")
	}

