//------------------------------------------------------------------------------
function popup(url,name,prop)
{
	Hwnd = window.open(url,name,prop);
	Hwnd.focus();
}
//------------------------------------------------------------------------------
function uc()
{
	alert("Under Construction");
}
//------------------------------------------------------------------------------
function addproducttocart(id,quantity,productcolorid,catid,sitepath)
{   

    if(isNaN(parseInt(quantity)))
    {
        quantity = 1;
    }
    else
    {
        quantity = parseInt(quantity);
        if (quantity < 1)
        {
            quantity = 1;
        }
    }

	popup(sitepath+"/products/additem.php?productcode="+id+"&productcolorid="+productcolorid+"&quantity="+quantity+"&catid="+catid,'AddItem','width=200,height=200,left=50,top=50,noresize')
}
//------------------------------------------------------------------------------
function showAccessory(id,type,sitepath)
{
     popup(sitepath + "/products/accessory.php?"+type+"="+id,"accessory","height=417,width=450,left=50,top=50,scrollbars=yes");
}
//------------------------------------------------------------------------------
function changeImageColor(obj,frm,sitepath)
{
    if(obj.selectedIndex > 0)
    {
        productcolordetail =  obj.options[obj.selectedIndex].value;
        arrproductcolordetail = productcolordetail.split("_");
        frm.productcolorid.value = arrproductcolordetail[0];
        productcolordetail = productcolordetail.replace(".","_300_300.");
        frm.prodimglarge.src= sitepath + "/products/images/"+productcolordetail;
    }
}
//------------------------------------------------------------------------------
function searchproduct(frm)
{
    if(isNull(frm.searchtext.value))
    {
        alert("Please enter the Search Text");
        frm.searchtext.focus();
    }
    else
    {
        if(frm.searchtext.value.length < 3)
        {
            alert("Search text should have atleast 3 characters");
            frm.searchtext.focus();
        }
        else
        {
            frm.submit();
        }
   }
}
//------------------------------------------------------------------------------

function validatelogin(frm)
{
    if(isNull(frm.userid.value))
    {
        alert("Please enter Email");
        frm.userid.focus();
        return;
    }
    if(isNull(frm.password.value))
    {
        alert("Please enter Password");
        frm.password.focus();
        return;
    }
    frm.mode.value='checklogin';
    frm.submit();
}
//------------------------------------------------------------------------------

