function popitup(url) {
  var width  = 500;
  var height = 300;
  var left   = (screen.width  - width)/2;
  var top    = (screen.height - height)/2;
  var params = 'width='+width+', height='+height;
  params += ', top='+top+', left='+left;
  params += ', directories=no';
  params += ', location=no';
  params += ', menubar=no';
  params += ', resizable=no';
  params += ', scrollbars=no';
  params += ', status=no';
  params += ', toolbar=no';
  params += ', titlebar=no';
  newwin=window.open(url,'Info', params);
  if (window.focus) {newwin.focus()}
  return false;
}

function checkSelect() 
{
  var checkBoxList = document.getElementsByName("products[]");
  var count = 0;
  var selEle;
  for(i=0;i<checkBoxList.length;i++) {
      if (checkBoxList[i].checked == true) {
        if((checkBoxList[i].value != 'CaliPlus') && (checkBoxList[i].value != 'VigaPlus')) {
	  selEle = document.getElementById(checkBoxList[i].value);
	  count = parseInt(selEle.options[selEle.selectedIndex].value)+parseInt(count);;
	} else {
	   count++;
	}
      }
    
  }

   if(count >4) {
    alert('You can select only 4 products!');
    return false
   } else {
    return true;
   }
}


function dropSelect(ele) 
{
  var checkBoxList = document.getElementsByName("products[]");
  var count = 0;
  var selEle;
  for(i=0;i<checkBoxList.length;i++) {
      if (checkBoxList[i].checked == true) {
        if((checkBoxList[i].value != 'CaliPlus') && (checkBoxList[i].value != 'VigaPlus')) {
	  selEle = document.getElementById(checkBoxList[i].value);
	  count = parseInt(selEle.options[selEle.selectedIndex].value)+parseInt(count);;
	} else {
	   count++;
	}
      }
    
  }

   if(count >4) {
    alert('You can select only 4 products!');
    for(i=0;i<checkBoxList.length;i++) {
        if((checkBoxList[i].value == ele.name)) {
	  checkBoxList[i].checked=false;
	}
      }
    return false
   } else {
    return true;
   }
}
