$(document).ready(function(){
       $("#compare_selected").show();
});

windowHeightDetail = 475;
windowWidthDetail = 230;
windowHeightComparison = 450;
windowWidthComparison = 720;

function chgcolor(myid, direction, row)
{
}

function chgcolorback(myid, direction, row)
{
}

function getChecked() {
//    var windowHeightDetail = 500;
//    var windowWidthDetail = 620;
//    var windowHeightComparison = 600;
//    var windowWidthComparison = 720;
   urlget = ""; i = 0;
   for (x=0; x < document.getElementsByName("pid[]").length; x++) {
      if (document.getElementsByName("pid[]")[x].checked) { 
            i++; 
            urlget = urlget + "&pid[]=" + document.getElementsByName("pid[]")[x].value; 
      }
   }
   if (i < 2) { alert("Please select at least two Products to compare!"); }
   else {
      /*document.forms[0].submit();*/ 
      /*document.location.href=document.forms[0].action + "?plid=" + document.forms[0].plid.value + urlget;*/
       windowWidthComparison=120+50+70*i;
       
       var producttable = document.getElementById('producttable');
       var no_of_elements = producttable.getElementsByTagName('tr');

       windowHeightComparison=60+60+40*no_of_elements.length;
       
       openWin(document.forms[0].action + "?plid=" + document.forms[0].plid.value + urlget,windowWidthComparison,windowHeightComparison,'yes');
   }
}

function openWin(page, breit, hoch, scrleist) {
if (isNaN(breit) == true) {
    breit = windowWidthDetail;
    hoch = windowHeightDetail;
    scrleist = "yes";
}
  popup = window.open(page,'popupwin1','menubar=yes,toolbar=no,location=no,directories=no,status=no,scrollbars='+scrleist+',resizable=yes,copyhistory=no,width='+breit+',height='+hoch);
  if (popup.opener == null) popup.opener = window;
  if (((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) >= 3)) || ((navigator.appName == 'Microsoft Internet Explorer') && (parseInt(navigator.appVersion) >= 4))) {
  popup.focus();
  }
}

