
function kisszerkablak(URL)
	{ 
	  window.open(URL,'','width=550,height=400,menubar=no,scrollbars=yes,status=no,toolbar=no,top=100,left=150,resizable=yes');
	  
	}


function szerkablak(URL)
	{ 
	  window.open(URL,'','width=1000,height=600,menubar=no,scrollbars=yes,status=no,toolbar=no,top=100,left=150,resizable=yes');
	} 

	
function nagykepablak(URL)
	{ 
	  window.open(URL,'','width=600,height=650,menubar=no,scrollbars=yes,status=no,toolbar=no,top=50,left=200,resizable=yes');
	}


function bezarfrissit()
	{ 
		OnClick=window.close(); 
		opener.location.reload(true);	
	}



function emailCheck(mezo){
  szoveg = mezo.value;
  if ((szoveg != "") && !((szoveg.indexOf('@')>0 && szoveg.indexOf('@')<szoveg.length-1) && (szoveg.indexOf('.')>0 && szoveg.indexOf('.')<szoveg.length-1)))
  {
    alert("Helytelen e-mail cím!");
return false;
  }
 
}


function uresCheck(mezo){
  if ( mezo.value != "" && mezo.value != " " && mezo.value != "  " && mezo.value != "   " ) return true;
  else{
    alert("A mező kitöltése kötelező!");
    return false;
  }
}

/*
function uresCheck(mezo){
  writeln("hossz" + mezo.length);

for (i=0;i<=mezo.length;i++)
{
	  if (mezo.lenght > 0  &&  ( (mezo.charCodeAt(i)>=48 && mezo.charCodeAt(i)<=57) || (mezo.charCodeAt(i)>=64 && mezo.charCodeAt(i)<=90) || (mezo.charCodeAt(i)>=97 && mezo.charCodeAt(i)<=122) ) 
	{ 
	return true;
	}
  else{
    alert("A mezo kitöltése kötelező!");
    return false;
  }
}

}
*/



function valt(f)
{
	if (f.checkbox.checked)
		{
		f.uszallitnev.value=f.uszamlanev.value=(f.uvnev.value+' '+f.uknev.value);
		f.uszallitirsz.value=f.uszamlairsz.value=f.uirsz.value;
		f.uszallitvaros.value=f.uszamlavaros.value=f.uvaros.value;
		f.uszallitutca.value=f.uszamlautca.value=f.uutca.value;	
		f.uszallittel1.value=f.utel1.value;	
		f.uszallittel2.value=f.utel2.value;	
		}
	  else
		{
		f.uszallitnev.value=f.uszamlanev.value='';	
		f.uszallitirsz.value=f.uszamlairsz.value='';	
		f.uszallitvaros.value=f.uszamlavaros.value='';	
		f.uszallitutca.value=f.uszamlautca.value='';	
		f.uszallittel1.value='';	
		f.uszallittel2.value='';
		
		}
}


function szamell(mit) {
	adat = mit.value
	vissza=""
	szamok = "1234567890"
	for (i=0; i<mit.value.length; i++)
	if (szamok.indexOf(adat.substring(i,i+1) )>-1)
	vissza+=adat.substring(i,i+1)
	mit.value=vissza
}


function datumell(mit) {
	adat = mit.value
	vissza=""
	szamok = "1234567890-"
	for (i=0; i<mit.value.length; i++)
	if (szamok.indexOf(adat.substring(i,i+1) )>-1)
	vissza+=adat.substring(i,i+1)
	mit.value=vissza
}



function gettrailobj()
{
	if (document.getElementById) return document.getElementById("trailimageid").style
	else if (document.all) return document.all.trailimagid.style
}

function truebody()
{
	return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function hidetrail()
{
	document.onmousemove=""
	document.getElementById('ttimg').src='http://www.alexandra.hu/css/images/s.gif'
	gettrailobj().visibility="hidden"
	gettrailobj().left=-1000
	gettrailobj().top=0
}

function showtrail(width,height,file)
{
	if(navigator.userAgent.toLowerCase().indexOf('opera') == -1 && navigator.userAgent.toLowerCase().indexOf('safari') == -1)
	{
		w=width
		h=height

// followmouse()

		gettrailobj().visibility="visible"
		gettrailobj().width=w+"px"
		gettrailobj().height=h+"px"
		document.getElementById('ttimg').src=file
		document.onmousemove=followmouse
	}
}

function followmouse(e)
{
	if(navigator.userAgent.toLowerCase().indexOf('opera') == -1 && navigator.userAgent.toLowerCase().indexOf('safari') == -1)
	{
		var xcoord=20
		var ycoord=20
		if (typeof e != "undefined")
		{
			xcoord+=e.pageX
			ycoord+=e.pageY
		}
		else if (typeof window.event !="undefined")
		{
			xcoord+=truebody().scrollLeft+event.clientX
			ycoord+=truebody().scrollTop+event.clientY
		}
		var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
		var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)
		if (xcoord+w+3>docwidth)
		xcoord=xcoord-w-(20*2)
		if (ycoord-truebody().scrollTop+h>truebody().clientHeight)
		ycoord=ycoord-h-20;
		gettrailobj().left=xcoord+"px"
		gettrailobj().top=ycoord+"px"
	}
}

function wopen(url, name)
{
  // Fudge factors for window decoration space.
  // In my tests these work well on all platforms & browsers.
  w += 32;
  h += 96;
  wleft = (screen.width - w) / 2;
  wtop = (screen.height - h) / 2;
  var win = window.open(url,
    name,
    'width=' + w + ', height=' + h + ', ' +
    'left=' + wleft + ', top=' + wtop + ', ' +
    'location=no, menubar=no, ' +
    'status=no, toolbar=no, scrollbars=no, resizable=no');
  // Just in case width and height are ignored
  win.resizeTo(w, h);
  // Just in case left and top are ignored
  win.moveTo(wleft, wtop);
  win.focus();
}



function testAndAlert(sDate) {
if (isDate(sDate)) {
window.status = 'Date Valid';
} else {
alert("Érvénytelen dátum, vagy" + '\n' +  "érvénytelen dátumformátum (éééé-hh-nn)!");
}
}

