



function varosok_ablak(lnk)
{
  szelesseg = 500;
  magassag = 400;
  xpos = (window.screen.width-szelesseg)/2;
  ypos = ((window.screen.height-magassag)/2)-40;
  nagykep=window.open(lnk,'_blank','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,width='+szelesseg+',height='+magassag+',left='+xpos+',top='+ypos+',screenx='+xpos+',screeny='+ypos+',resizable=0');
}



function termekhasonlitas_ablak(id)
{
  szelesseg = 700;
  magassag = 550;
  xpos = (window.screen.width-szelesseg)/2;
  ypos = ((window.screen.height-magassag)/2)-40;
  nagykep=window.open('termekosszehasonlit.aspx','_blank','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,width='+szelesseg+',height='+magassag+',left='+xpos+',top='+ypos+',screenx='+xpos+',screeny='+ypos+',resizable=0');
}




function termek_osszehasonlitas(term_id,checked) {
	
	parent.ifrosszehasonlit.location.href='ifrtermekosszehasonlit.aspx?term_id=' + term_id + '&checked='+ checked ;
         return (true);
   } 



// Email Validation. 

function check_email(e) {
   ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";

   for(i=0; i < e.length ;i++){
      if(ok.indexOf(e.charAt(i))<0){ 
         return (false);
      }	
   } 

   if (document.images) {
      re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
      re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
      if (!e.match(re) && e.match(re_two)) {
         return (-1);		
      } 

   }

}


function numbersonly(myfield, e, dec)
{
var key;
var keychar;

if (window.event)
   key = window.event.keyCode;
else if (e)
   key = e.which;
else
   return true;
keychar = String.fromCharCode(key);

// control keys
if ((key==null) || (key==0) || (key==8) ||
    (key==9) || (key==13) || (key==27) )
   return true;

// numbers
else if ((("0123456789").indexOf(keychar) > -1))
   return true;

// decimal point jump
else if (dec && (keychar == "."))
   {
   myfield.form.elements[dec].focus();
   return false;
   }
else
   return false;
}

