
function popUp(URL, width, height) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width="+width+",height="+height+"');");
}

function popUpBux(URL, width, height) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width="+width+",height="+height+"');");
}

function tansformPopUp(URL, width, height) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width="+width+",height="+height+"');");
}

function my_alert(alerttext){
$("uzenet").innerHTML = alerttext;
Effect.Appear("uzenet");
setTimeout("Effect.Fade('uzenet')", 3000);
}

function checkEmail(emailfield) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test($F(emailfield))){
	 $("uzenet").innerHTML = "";
	 $(emailfield).style.background = "#FFFFFF";
	return true;
}
else {
	 my_alert("Az email cím formailag nem jó");
     $(emailfield).focus();
	 $(emailfield).style.background = "#FFECEC";
     return false;
}
}

function checkujhird(){
	if(!$("kategoria").selectedIndex){
		alert("1ok")
		my_alert("Válasszon ki egy kategóriát!");
		$("kategoria").focus();
		$("kategoria").style.background = "#FFECEC";
		return false;
	}
	else if(!$("tipus").selectedIndex){
		alert("2ok")
		my_alert("Válasszon ki egy tipust!");
		$("tipus").focus();
		$("tipus").style.background = "#FFECEC";
		$("kategoria").style.background = "#FFFFFF";
		return false;
	}
	else if(!$F("tovabbi")){
		alert("3ok")
		my_alert("Nem adta meg a hirdetés szövegét!");
		$("tovabbi").focus();
		$("tovabbi").style.background = "#FFECEC";
		return false;
	}
	else if(!$F("elfogadtam")){
		alert("4ok")
		my_alert("A hirdetés feladásához el kell fogadja a feltételeit!");
		$("elfogadtam").focus();
		$("tovabbi").style.background = "#FFFFFF";
		return false;
	}
	else {
	return true;
	}
}

// position of the tooltip relative to the mouse in pixel //
var offsetx = -130;
var offsety =  -30;

function newelement(newid)
{ 
    if(document.createElement)
    { 
        var el = document.createElement('div'); 
        el.id = newid;     
        with(el.style)
        { 
            display = 'none';
            position = 'absolute';
        } 
        el.innerHTML = '&nbsp;'; 
        document.body.appendChild(el); 
    } 
} 
var ie5 = (document.getElementById && document.all); 
var ns6 = (document.getElementById && !document.all); 
var ua = navigator.userAgent.toLowerCase();
var isapple = (ua.indexOf('applewebkit') != -1 ? 1 : 0);
function getmouseposition(e)
{
    if(document.getElementById)
    {
        var iebody=(document.compatMode && 
        	document.compatMode != 'BackCompat') ? 
        		document.documentElement : document.body;
        pagex = (isapple == 1 ? 0:(ie5)?iebody.scrollLeft:window.pageXOffset);
        pagey = (isapple == 1 ? 0:(ie5)?iebody.scrollTop:window.pageYOffset);
        mousex = (ie5)?event.x:(ns6)?clientX = e.clientX:false;
        mousey = (ie5)?event.y:(ns6)?clientY = e.clientY:false;

        var lixlpixel_tooltip = document.getElementById('tooltip');
        lixlpixel_tooltip.style.left = (mousex+pagex+offsetx) + 'px';
        lixlpixel_tooltip.style.top = (mousey+pagey+offsety) + 'px';
    }
}
function tooltip(tip)
{
    if(!document.getElementById('tooltip')) newelement('tooltip');
    var lixlpixel_tooltip = document.getElementById('tooltip');
    lixlpixel_tooltip.innerHTML = tip;
    lixlpixel_tooltip.style.display = 'block';
    document.onmousemove = getmouseposition;
}
function exit()
{
    document.getElementById('tooltip').style.display = 'none';
}


