var alertbox = false;
var isIE = (navigator.appName == "Microsoft Internet Explorer");

function bevitel_csakszam(e) {
var Key = e.keyCode;
if (Key == 0) {Key = e.which}
if ((Key >= 48 && Key <= 57) || Key == 8 || Key == 9 || Key == 37 || Key == 38 || Key == 39 || Key == 11 || Key == 12 || Key == 46) 
return true;
return false;
}


function db_modosit(db,id)
{
  
  if (!alertbox) {    document.location.href='index.php?m=shop&a=kosar&f=kosarba&db='+db+'&id='+id;}
}


var fotoablak;
var hatterkepablak;
function galeria(gal,kep)
   {
   fotoablak = window.open("galeria.php?galeriaid="+gal+"&kepid="+kep,"Fotoalbum","width=790,height=655,status=no");
   }



function ujsagcikktolt(cim,x,y)
   {
     x=x+20;
     ujsagcikkablak = window.open(cim,"Ujsagcikk","width="+x+",height="+y+",resizable=yes,scrollbars=yes");
   }


var hatterkepablak;
function hirleveltolt(cim,x,y)
   {
     kottakablak = window.open(cim,"Hirlevel","width="+800+",height="+580+",resizable=yes,scrollbars=yes");
   }


function hatterkeptolt(cim,x,y)
   {
     hatterkepablak = window.open(cim,"Hatterkepek","width="+700+",height="+580+",resizable=yes,scrollbars=yes");
   }



function set_innerhtml(divnev,html)
{
if (document.getElementById)
{
// this is the way the standards work
var style2 = document.getElementById(divnev).innerHTML = html;
}
else if (document.all)
{
// this is the way old msie versions work
 document.all[divnev].innerHTML = html;
}
else if (document.layers)
{
// this is the way nn4 works
var style2 = document.layers[divnev].innerHTML = html;
}
}



/**
 * DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}

function validate(form_id,email) {
   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   var address = document.forms[form_id].elements[email].value;
   if(reg.test(address) == false) {
      return false;
   }
   else return true;
}


