var newAblak=null;
function winOpen(url,n,width,height){
    var sw=screen.width;
    var sh=screen.height;
    var left=sw?(sw-width)/2:0;
    var top=sh?(sh-height)/2:0;
    newAblak=window.open(url,n,"width="+width+",height="+height+",top="+top+",left="+left+",resizable=0,location=0,statusbar=0,toolbar=0,scrollbars=1");
}
function createRequestObject(){
    var req;
    try{
        req=new ActiveXObject("Microsoft.XMLHTTP");
    }catch(e){
        req=new XMLHttpRequest();
    }
    return req;
}
function showContent(divid){
    var div=document.getElementById("bovebben"+divid).style;
    if(div.display=="none"){
        div.display="block";
    }else{
        div.display="none";
    }
}
function winOpen(url,n,width,height){
    var newablak
    var sw=screen.width;
    var sh=screen.height;
    var left=sw?(sw-width)/2:0;
    var top=sh?(sh-height)/2:0;
    newablak=window.open(url,n,"width="+width+",height="+height+",top="+top+",left="+left+",resizable=1,location=0,statusbar=1,toolbar=0,scrollbars=1");
}
function basket(termekid,action,a){
    var retval;
    var http=createRequestObject();

    http.open("get","basket.php?termekid="+termekid+"&action="+action+"&a="+a,true);
    http.onreadystatechange=function(){
        if(http.readyState==4){
            retval=http.responseText;
            document.getElementById("basket").innerHTML=retval;
        }
    }
    http.send(null);
}
function folyamatban(){
    var f=document.getElementById("folyamatban");
    f.innerHTML="<b>Folyamatban...</b>";
}
function masol(f){
    f.szlairsz.value=f.szallirsz.value;
    f.szlatelepules.value=f.szalltelepules.value;
    f.szlautca.value=f.szallutca.value;
}
function checkSzallCity(item,f){
    if(item.value.charAt(0)=="1"){
        f.szalltelepules.value="Budapest";
    }else{
        f.szalltelepules.value="";
    }
}
function checkSzlaCity(item,f){
    if(item.value.charAt(0)=="1"){
        f.szlatelepules.value="Budapest";
    }else{
        f.szlatelepules.value="";
    }
}
function hirlevelChecker(f){
    if(f.email.value==""){
        alert("Kérem adja meg az e-mail címet a feliratkozáshoz!");
        f.email.focus();
        return false;
    }else{
        return true;
    }
}

