var ShopPath='./';

function stripParams(url)
{
   url=url+''
   p=url.indexOf('?')
   return (p<0)? url : url.substr(0,p)
}

function RadioValue(r)
{
 for(var i=0;i< r.length; i++)
  {
    if(r[i].checked=="1")
  return r[i].value;
  }
 return 0;
}

function EAlert(msg)
{/*Shows photocagan popup window with msg message*/
  openFrameless(ShopPath+'popups/EAlert.php?msg='+escape(msg),'Alert',350,200);
}


function EConfirm(msg,onconfirm)
{
  openFrameless(ShopPath+'popups/EConfirm.php?msg='+escape(msg)+
    '&onconfirm='+escape(onconfirm),'Alert',350,200)
}

function AddToCart(id,qty,color)
{
 qty=parseInt(qty)
//Already validated. it's not necessory.
 if(!qty || qty<1) 
  { EAlert('Quantity is not a number');return }
  openFrameless('./popups/ProductAddToCart.php?id='+id+'&qty='+qty+
  '&clr='+color,'photocagan',350,200)
}

function ZoomProduct(id)
{
  openFrameless('ProductImage.php?type=big&id='+id,'photocagan',320,320);
}


