﻿// JScript File

    function updatecartdetails(strsum){
      var myvar = "shopcartstatus"; 
      document.getElementById(myvar).innerHTML = strsum;
    }

    function addtocart(id) {
        var shopwin = window.open("popup.aspx?prd=" + id, "Cart_Add", "status=yes,height=200,width=450,resizable,scrollbars=yes");
        shopwin.focus();
    }

    function addtocart2(id) {
        var shopwin = window.open("popUpItemOptions.aspx?prodID=" + id, "Cart_Add", "status=yes,height=300,width=300,resizable,scrollbars=yes");
        shopwin.focus();
    }
    
    function winBRopen(theURL) {
      var shopwin = window.open(theURL,"winBRopen","status=no,height=400,width=800,resizable,scrollbars=yes");
    }

    function search(strSearch) {
        setTmpVar(document.forms["aspnetForm"].textfield.value);
        setLinkName("search");    
        document.forms["aspnetForm"].submit();
    }

    function searchKeyPressed(e){
        e = e || window.event;
        var unicode=e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0;
        if (unicode == 13){
            search();
            return false;
        }
        return true;
    }
    
	function callproductpage(ID){
	//window.open("product_detail.aspx?prodID="+ID,"Search_Results","");
	window.location = "product_detail.aspx?prodID="+ID;
	//window.open("product_detail.aspx?prodID="+ID,"Search_Results","");
	}
	
	function changeQuantity(e, k){
		setQChange(e);
		setQValue(k);
		determineLink("changeQuantity");
	}
	
	function deleteRow(prodID, strGuid){
	  // var obj = window.event.srcElement;
  	if(confirm("Are you sure you want to delete this row from your cart?")){
	    	  setTmpVar(prodID);
			  determineLink("deleteRow");	
	  }
	}

	function determineLink(e){
		setLinkName(e);
		document.forms["aspnetForm"].submit();
	}

