function DoPosition(){
    var f,g, H, W, LiveCat, h4, active, AjaxC4
    siteB = document.getElementById('mainContainer')
    if (self.innerWidth){
        f = self.innerWidth;
        g = self.innerHeight;
        f = Math.floor(f);
        g = Math.floor(g);
    }else if (document.documentElement && document.documentElement.clientWidth){
        a = document.documentElement.clientWidth;
        b = document.documentElement.clientHeight;
        f = Math.floor(a);
        g = Math.floor(b);
    }else if (document.body){
        f = document.body.clientWidth;
        g = document.body.clientHeight;
        f = Math.floor(f);
        g = Math.floor(g);
    }
    W=f/2
    H=g/2
    document.getElementById('HoverInside').style.left=(W-400)+"px"
    siteB.style.left=(W-400)+"px"
    document.getElementById('t4').style.display="block"
    document.getElementById('Cat4').style.display="block"
    //document.getElementById('alCat').style.display="block"
    $('#mainContainer').show('slow', function(){
        $('#menuLeft').animate({marginLeft:"0px"}, 1000)
        $('#menuCenter').animate({width:"350px"}, 1000,function(){
            document.getElementById('menuDotted').style.display="inline-block"
        })
    document.getElementById('menuPic').style.display="block"
    document.getElementById('menuText').style.display="block"
    })
    h=0
    pnum=1
    /*for(h=0; h<6; h++){
        mImg = new Array()
        mImg[0] = "/pic/info.png"
        mImg[1] = "/pic/referenciak.png"
        mImg[2] = "/pic/markalkulator.png"
        mImg[3] = "/pic/szolgaltatasok.png"
        mImg[4] = "/pic/kapcsolat.png"
        //alert(mImg[h])
        menuImg= new Image();
        menuImg.src=mImg[h];
    }*/
    prelodImageSiteP(h);
    function prelodImageSiteP(h){
            //alert(h)
            mImg = new Array()
            mImg[0] = "../pic/info_on.png"
            mImg[1] = "../pic/referenciak_on.png"
            mImg[2] = "../pic/markalkulator_on.png"
            mImg[3] = "../pic/szolgaltatasok.png"
            mImg[4] = "../pic/kapcsolat_on.png"
            mImg[5] = "../pic/siteImg/03.jpg"
            mImg[6] = "../pic/siteImg/01_anyagleadas.jpg"
            mImg[7] = "../pic/siteImg/01_cegT.jpg"
            mImg[8] = "../pic/siteImg/01_garancia.jpg"
            mImg[9] = "../pic/siteImg/01_megrendelesiszerz.jpg"
            mImg[10] = "../pic/siteImg/03_prosi.jpg"
            mImg[11] = "../pic/siteImg/05_csapat.jpg"
            mImg[12] = "../pic/siteImg/05_ftp.jpg"
            mImg[13] = "../pic/siteImg/07.jpg"
            mImg[14] = "../pic/siteImg/08.jpg"
            mImg[15] = "../pic/siteImg/04.jpg"
            menImg= new Image();
            menImg.src=mImg[h];
            h++
            menImg.onload = function(){
                prelodImageSiteP(h)
            }
        
        }
    Kimg = document.getElementById('kapcsImg')
    Ti = Kimg.getElementsByTagName('img')
    for(t=0; t<Ti.length; t++){
        $('#'+Ti[t].id).css({opacity:"0.5"})
    }
    Kimg = document.getElementById('gepekPic')
    Ti = Kimg.getElementsByTagName('img')
    for(t=0; t<Ti.length; t++){
        $('#'+Ti[t].id).css({opacity:"0.5"})
    }
    doEvents();
}
function doEvents(){
    var OLDCAT;
    OLDCAT='c4'
    AjaxC4="false"
    AjaxC2="false"
    h4="true"
    LiveCat="Cat4"
    active="false"
    menu = document.getElementById('menuPic')
    menuElements = menu.getElementsByTagName('div')
    textElements = document.getElementById('menuText')
    MenutextE = textElements.getElementsByTagName('h1')
    allText = document.getElementById('siteText')
    TextElement = allText.getElementsByTagName('div')
    allCategori=document.getElementById(LiveCat)
    Tcat = allCategori.getElementsByTagName('h3')
    Alc = document.getElementById('alCat')
    AlcD = Alc.getElementsByTagName('h3')
    DlcD = Alc.getElementsByTagName('div')
    AllMenuT = document.getElementById('menuText')
    TmenuT = AllMenuT.getElementsByTagName('h1')
    str = window.location.href;
    point = str.lastIndexOf("page=");
    //alert(point)
    part = str.substring(point+5,str.length);
    if(part=="info"){
        //alert('ok')
        ID="c1"
        doChangeSite(ID)
    }else if(part=="referenciak"){
        ID="c2"
        doChangeSite(ID)
    }else if(part=="arkalkulator"){
        ID="c3"
        doChangeSite(ID)
    }else if(part=="szolgaltatasok"){
        ID="c4"
        doChangeSite(ID)
    }else if(part=="kapcsolat"){
        //alert('ok')
        ID="c5"
        doChangeSite(ID)
    }
    for(i=0; i<TmenuT.length; i++){
        TmenuT[i].onmouseover = function(){
            thisid = this.id.replace('m', 'c')
            if(document.getElementById(thisid).className!="on"){
            this.style.color="#7b92aa"
            pic=""
            if(thisid=="c1"){
                pic="info"
            }else if(thisid=="c2"){
                pic="referenciak"
            }else if(thisid=="c3"){
                pic="markalkulator"
            }else if(thisid=="c4"){
                pic="szolgaltatasok"
            }else if(thisid=="c5"){
                pic="kapcsolat"
            }
            $("#"+thisid).css('backgroundImage', 'url("../pic/'+pic+'_on.png")' )
            }
        }
        TmenuT[i].onmouseout = function(){
            thisid2 = this.id.replace('m', 'c')
            if(document.getElementById(thisid2).className!="on"){
            this.style.color="#a1b1c2"
            if(thisid=="c1"){
                pic2="info"
            }else if(thisid=="c2"){
                pic2="referenciak"
            }else if(thisid=="c3"){
                pic2="markalkulator"
            }else if(thisid=="c4"){
                pic2="szolgaltatasok"
            }else if(thisid=="c5"){
                pic2="kapcsolat"
            }
            $("#"+thisid2).css('backgroundImage', 'url("../pic/'+pic2+'.png")' )
            }
        }
        TmenuT[i].onclick = function(){
            doChangeSite(this.id.replace('m','c'))
        }
        
    }
    
    for(i=0; menuElements.length>i; i++){
        menuElements[i].onmouseover=function(){
            Pnumb=1
            if(this.className!="on"){
            if(this.id=="c1"){
                pic="info"
            }else if(this.id=="c2"){
                pic="referenciak"
            }else if(this.id=="c3"){
                pic="markalkulator"
            }else if(this.id=="c4"){
                pic="szolgaltatasok"
            }else if(this.id=="c5"){
                pic="kapcsolat"
            }
            $("#"+this.id).css('backgroundImage', 'url("../pic/'+pic+'_on.png")' )
            document.getElementById(this.id.replace('c' , 'm')).style.color="#7b92aa"
            }
        }
        menuElements[i].onmouseout=function(){
            if(this.className!="on"){
            document.getElementById(this.id.replace('c' , 'm')).style.color="#a1b1c2"
            $("#"+this.id).css('backgroundImage', 'url("../pic/'+pic+'.png")' )
            }
        }
        menuElements[i].onclick = function(){
            doChangeSite(this.id)
        }
    }
    function doChangeSite(ID){
       // alert('ok')
        ID = document.getElementById(ID)
        active="false"
            if(ID.className!="on"){
                if(ID.id=="c1"){
                    pic="info"
                }else if(ID.id=="c2"){
                    pic="referenciak"
                }else if(ID.id=="c3"){
                    pic="arkalkulator"
                }else if(ID.id=="c4"){
                    pic="szolgaltatasok"
                }else if(ID.id=="c5"){
                    pic="kapcsolat"
                }
                window.location.hash="page="+pic
                hash = location.hash;
                t=setInterval(function(){
                    if (location.hash != hash){
                        part=window.location.hash
                        for(u=0; u<menuElements.length; u++){
                            menuElements[u].className="";
                        }
                    if(part=="#page=info"){
                        //alert('ok')
                        ID="c1"
                        doChangeSite(ID)
                    }else if(part=="#page=referenciak"){
                        ID="c2"
                        doChangeSite(ID)
                    }else if(part=="#page=arkalkulator"){
                        ID="c3"
                        doChangeSite(ID)
                    }else if(part=="#page=szolgaltatasok"){
                        ID="c4"
                        doChangeSite(ID)
                    }else if(part=="#page=kapcsolat"){
                        //alert('ok')
                        ID="c5"
                        doChangeSite(ID)
                    }
                   // alert(hash)
                    /*for(a=0; a<DlcD.length; a++){
                        DlcD[a].style.display="none"
                    }*/
                    hash = location.hash;
                    return false;
                }
                }, 100);
                $('#SiteImgCont').stop(true, true)
                $('#gepekPic').stop(true, true)
                $('#scroll').stop()
                $('#scroll').clearQueue()
                $('#gepekPic').animate({opacity:"0"}, 1000)
                document.getElementById('gepekPic').style.display="none"
                $('#siteText').animate({maxHeight:"280px"}, 1000)
                document.getElementById('siteText').style.overflowY="auto"
                $("#dot").animate({opacity:"0"}, 1000, function(){
                    $("#dot").css('backgroundImage', 'url("../pic/button.png")' )
                    $('#dot').animate({opacity:"1"}, 1000)
                })
                document.getElementById('SCText').style.display="none"
                $('#scroll').animate({scrollLeft :0+"px"}, 0)
                document.getElementById('SiteImgCont').style.display="block"
                document.getElementById('SiteImgCont').innerHTML = '<img src="pic/load.gif" id="SiteImg"/>';
                $('#map').hide('slow')
                $('#menuCenter').animate({width:"0px"}, 500,function(){
                        $('#menuCenter').animate({width:"350px"}, 1000)
                    })
                if(document.getElementById('c4').className=="on"){
                    document.getElementById('c4').className=""
                    $('#kapcsImg').animate({opacity:"0"}, 1000, function(){
                            document.getElementById('SiteImg').style.display="inline-block"
                            document.getElementById('kapcsImg').style.display="none"
                        })
                }
                //OLDCAT=0
                for(a=0; menuElements.length>a; a++){
                    if(menuElements[a].className!=""){
                        OLDCAT= menuElements[a].id
                    }
                    menuElements[a].className=""
                    if(menuElements[a].id=="c1"){
                        pic="info"
                    }else if(menuElements[a].id=="c2"){
                        pic="referenciak"
                    }else if(menuElements[a].id=="c3"){
                        pic="markalkulator"
                    }else if(menuElements[a].id=="c4"){
                        pic="szolgaltatasok"
                    }else if(menuElements[a].id=="c5"){
                        pic="kapcsolat"
                    }
                    if(menuElements[a].id!=ID.id){
                    $("#"+menuElements[a].id).css('backgroundImage', 'url("../pic/'+pic+'.png")' )
                    }
                }
                ID.className="on"
                $('#'+LiveCat).hide('fast')
                if(ID.id=="c1"){
                    t="CÉGÜNKRŐL"
                    LiveCat="Cat1"
                    pic="info"
                }else if(ID.id=="c2"){
                    t="REFERENCIA"
                    LiveCat="Cat2"
                    pic="referenciak"
                }else if(ID.id=="c3"){
                    t="ÁRKALKULÁTOR"
                    LiveCat="Cat3"
                    pic="markalkulator"
                }else if(ID.id=="c4"){
                    t="SZOLGÁLTATÁS"
                    LiveCat="Cat4"
                    pic="szolgaltatasok"
                }else if(ID.id=="c5"){
                    t="KAPCSOLAT"
                    LiveCat="Cat5"
                    pic="kapcsolat"
                }
                for(o=0; o<MenutextE.length; o++){
                            MenutextE[o].style.color="#a1b1c2"
                }
                tid=ID.id.replace('c',"m")
                document.getElementById(tid).style.color="#FF9900"
                for(a=0; a<TextElement.length; a++){
                    if(TextElement[a].className=="cati"){
                        $("#"+TextElement[a].id).hide('slow')
                    }
                }
                $('#leftText').show('slow')
                $('#siteText').animate({left:"0px"}, 0)
                $('#siteText').animate({width:"545px"}, 0)
                if(ID.id!="c4"){
                    if(ID.id=="c5"){
                        thisText = ID.id.replace('c',"")
                            $('#Sitecat').animate({opacity:"0"}, 1000)
                            $('#SiteImgCont').animate({opacity:"0"}, 1000,function(){
                                document.getElementById('SiteImg').style.display="none"
                                $('#map').show('slow')
                                $('#map').animate({opacity:"1"}, 1000)
                            })
                            document.getElementById('CatTit').innerHTML=t
                            document.getElementById(LiveCat).style.display="block"
                            $('#SiteImgCont').animate({opacity:"1"}, 1000)
                            $("#t"+thisText).show('slow')
                            $('#Sitecat').animate({opacity:"1"}, 1000)
                        }else{
                            if(ID.id=='c1'){
                                thisText = ID.id.replace('c',"")
                                $('#Sitecat').animate({opacity:"0"}, 1000)
                                document.getElementById('SiteImgCont').innerHTML = '<img src="pic/load.gif" id="SiteImg"/>';
                                //$('#scroll').scrollLeft(0)
                                    $('#SiteImgCont').animate({opacity:"0"}, 1000, function(){
                                        document.getElementById('SiteImgCont').style.display="none"
                                        $('#gepekpic').css({ opacity: 0 });
                                        //document.getElementById('gepekPic').style.opacity="0"
                                        document.getElementById('gepekPic').style.display="block"
                                        document.getElementById('CatTit').innerHTML=t
                                        document.getElementById(LiveCat).style.display="block"
                                        $('#Sitecat').animate({opacity:"1"}, 1000)
                                        $('#gepekPic').animate({opacity:"1"}, 1000)
                                    })
                                $('#ROLAND').animate({opacity:"1"}, 1000)
                                $("#t1gepek").show('slow')
                                $("#PROLAND").show('slow')
                            }else{
                            thisText = ID.id.replace('c',"")
                                $('#Sitecat').animate({opacity:"0"}, 1000)
                                $('#SiteImgCont').animate({opacity:"0"}, 1000,function(){
                                    document.getElementById('SiteImgCont').innerHTML = '<img src="pic/load.gif" id="SiteImg"/>';
                                    if(ID.id!='c2'){
                                        document.getElementById('SiteImg').src="pic/load.gif"
                                        preLoad = new Image();
                                        preLoad.src="pic/siteImg/0"+thisText+".jpg"
                                        preLoad.onload = function(){
                                            document.getElementById('SiteImg').src=preLoad.src
                                            document.getElementById('SiteImg').style.display="inline-block"
                                        }
                                    }else{
                                       document.getElementById('SiteImg').src="pic/load.gif" 
                                    }
                                    //$('#scroll').scrollLeft(0)
                                    document.getElementById('CatTit').innerHTML=t
                                    document.getElementById(LiveCat).style.display="block"
                                    $('#Sitecat').animate({opacity:"1"}, 1000)
                                    $('#SiteImgCont').animate({opacity:"1"}, 1000,function(){
                                    $("#t"+thisText).show('slow')
                                    if(ID.id=="c2"){
                                            document.getElementById('SCText3').innerHTML="one way vision tervezés, gyártás, kihelyezés"
                                            //document.getElementById('SiteImg').style.display='none'
                                            document.getElementById('SiteImgCont').innerHTML = '<img src="pic/load.gif" id="SiteImg"/>';
                                            //document.getElementById('SiteImgCont').removeChild(document.getElementById('SiteImg'))
                                            AjaxC2="true"
                                             link = "main.php?SiteGalery=true"
                                             httpObject = getHTTPObject();
                                             if (httpObject != null) {
                                                 httpObject.open("GET", link , true);
                                                 httpObject.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");
                                                 httpObject.setRequestHeader('User-Agent',"XHR User-Agent Override");
                                                 httpObject.onreadystatechange = GetGaleryImages;
                                                 httpObject.send(null);
                                            }
                                    }
                                if(ID.id=="c3"){
                                    $('#leftText').hide('slow')
                                    $('#siteText').animate({left:"0px"}, 1000)
                                    $('#siteText').animate({width:"760px"}, 1000, function(){
                                    document.getElementById("kalkulatorSite").style.display="block"
                                    //alert(document.getElementById('siteText').scrollHeight)
                                    $('#siteText').animate({maxHeight: (parseInt(document.getElementById('siteText').scrollHeight))+"px"}, 1000, function(){
                                    document.getElementById('siteText').style.overflowY="hidden"
                                    })
                                    //alert(document.getElementById('siteText').scrollHeight)
                                    })
                                    //$('#siteText').animate({maxHeight:"5000px"}, 1000)
                                    if(AjaxC4!="true"){
                                        AjaxC4="true"
                                         link = "main.php?kalkulator=true"
                                         httpObject = getHTTPObject();
                                         if (httpObject != null) {
                                             httpObject.open("GET", link , true);
                                             httpObject.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");
                                             httpObject.setRequestHeader('User-Agent',"XHR User-Agent Override");
                                             httpObject.onreadystatechange = GetKalkulatorText;
                                             httpObject.send(null);
                                        }
                                     }
                                }
                                })
                                })
                            }
                    }
                }else{
                    $('#gepekPic').animate({ opacity: 0 }, 1000);
                    document.getElementById('gepekPic').style.display="none"
                    $('#RuCenter').show('slow')
                    thisText = ID.id.replace('c',"")
                    document.getElementById('c4').className="on"
                    $('#Sitecat').animate({opacity:"0"}, 1000)
                    $('#SiteImg').animate({opacity:"0"}, 1000,function(){
                        document.getElementById('CatTit').innerHTML=t
                        document.getElementById(LiveCat).style.display="block"
                        document.getElementById('SiteImg').style.display="none"
                        document.getElementById('kapcsImg').style.display="block"
                        $('#Sitecat').animate({opacity:"1"}, 1000)
                        $('#kapcsImg').animate({opacity:"1"}, 1000)
                        $("#t"+thisText).show('slow')
                        })
                    allCategori=document.getElementById(LiveCat)
                    Tcat = allCategori.getElementsByTagName('h3')
                    doClickEvent(h4="true");
                }
                for(z=0; AlcD.length>z; z++){
                    if(AlcD[z].id!="" && AlcD[z].id!="SZFNY" && AlcD[z].id!="gepek"){
                        AlcD[z].className=""
                        AlcD[z].style.color="#7b92aa"
                        AlcD[z].style.fontWeight="normal"
                    }else{
                        AlcD[z].style.color="#FF9900"
                        AlcD[z].style.fontWeight="bold"
                    }
                }
                allCategori=document.getElementById(LiveCat)
                Tcat = allCategori.getElementsByTagName('h3')
                doClickEvent();
            }
    }
    Kalk = document.getElementById('KalpP')
    Kalk.onclick = function(){
        ID="c3"
        doChangeSite(ID)
    }
    KalkP = document.getElementById('almaPng')
    KalkP.onclick = function(){
        ID="c3"
        doChangeSite(ID)
    }
    siteLogo = document.getElementById('logo')
    siteLogo.onclick = function(){
        ID="c4"
        doChangeSite(ID)
    }
    function doClickEvent(){
        if(h4=="true"){
            allOpImg = document.getElementById('kapcsImg')
            thisOpImg = allOpImg.getElementsByTagName('Img')
            for(i=0; i<thisOpImg.length; i++){
                thisOpImg[i].onmouseover = function(){
                    if(document.getElementById(this.id.replace('d', "DCat")).className!="on"){
                        for(o=0; o<thisOpImg.length; o++){
                            $('#'+thisOpImg.id).stop(true, true)
                            }
                        $('#'+this.id).animate({opacity:"1"}, 1000)
                        ChildNumb = this.id.replace('d', '')
                        document.getElementById(this.id.replace('d', 'DCat')).style.color="#FF9900"
                        document.getElementById(this.id.replace('d', 'DCat')).style.fontWeight="bold"
                    }
                }
                thisOpImg[i].onmouseout = function(){
                    if(document.getElementById(this.id.replace('d', "DCat")).className!="on"){
                        for(o=0; o<thisOpImg.length; o++){
                            $('#'+thisOpImg.id).stop(true, true)
                            }
                        $('#'+this.id).animate({opacity:"0.5"}, 1000)
                        document.getElementById(this.id.replace('d', 'DCat')).style.color="#7b92aa"
                        document.getElementById(this.id.replace('d', 'DCat')).style.fontWeight="normal"
                    }
                }
                thisOpImg[i].onclick = function(){
                    ChildNumb = this.id.replace('d', 'DCat')
                    //alert(ChildNumb)
                    SetCat(ChildNumb)
                }
            }
        }
        for(f=0; Tcat.length>f; f++){
            Tcat[f].onmouseover = function(){
                if(this.className!="on"){
                    this.style.color="#FF9900"
                    this.style.fontWeight="bold"
                    if(this.parentNode.id=="Cat4"){
                        piId=this.id.replace('DCat', 'd')
                        $('#'+piId).animate({opacity:"1"}, 1000)
                    }
                }
            }
            Tcat[f].onmouseout = function(){
                if(this.className!="on"){
                    this.style.color="#7b92aa"
                    this.style.fontWeight="normal"
                    if(this.parentNode.id=="Cat4"){
                        piId=this.id.replace('DCat', 'd')
                        $('#'+piId).animate({opacity:"0.5"}, 1000)
                    }
                }

            }
            Tcat[f].onclick = function(){
                id=this.id
                SetCat(id)
            }
            
        }
        
    }
    AllGPic = document.getElementById('gepekPic')
    THISGPic = AllGPic.getElementsByTagName('img')
    ALLDiv = document.getElementById('t1gepek')
    TDiv = ALLDiv.getElementsByTagName('div')
    for(a=0; a<THISGPic.length; a++){
        THISGPic[a].onmouseover=function(){
            if(this.className!='on'){
                $('#'+this.id).animate({opacity:"1"}, 1000)
            }
        }
        THISGPic[a].onmouseout = function(){
            if(this.className!='on'){
                $('#'+this.id).animate({opacity:"0.5"}, 1000)
            }
        }
        THISGPic[a].onclick = function(){
            TID = this.id
            for(p=0; p<TDiv.length; p++){
                $('#'+TDiv[p].id).hide('slow')
            }
            for(v=0; v<THISGPic.length; v++){
                THISGPic[v].className=""
                if(THISGPic[v].id!=TID){
                    $('#'+THISGPic[v].id).animate({opacity:"0.5"}, 0)
                }
            }
           // alert('#P'+THISGPic[a].id)
           $('#'+this.id).animate({opacity:"1"}, 1000)
           this.className="on"
            $('#P'+this.id).show('slow')
        }
    }
    function SetCat(id){
                $("#dot").animate({opacity:"0"}, 1000, function(){
                    $("#dot").css('backgroundImage', 'url("../pic/button_back.png")' )
                    $('#dot').animate({opacity:"1"}, 1000)
                })
                id = document.getElementById(id)
                active="true"
                Tid = id.id
                //alert(Tid+" | "+id.className)
                if(id.parentNode.id!="Cat4"){
                if(id.className!="on"){
                    window.location.hash=location.hash+"/"
                    $('#gepekPic').animate({opacity:"0"}, 1000)
                    document.getElementById('gepekPic').style.display="none"
                    document.getElementById('SiteImgCont').style.display="block"
                    for(i=0; i<Tcat.length; i++){
                            Tcat[i].style.color="#7b92aa"
                            Tcat[i].style.fontWeight="normal"
                            Tcat[i].className=""
                            $('#'+id.parentNode.id.replace("Cat", "t")+Tcat[i].id).hide('slow')
                    }
                    id.style.color="#FF9900"
                    id.style.fontWeight="bold"
                    id.className="on"
                    if(id.id!="SZFNY"){
                        OldPId="_"+id.id
                    }else{
                        OldPId=""
                    }
                    OldId=id.id
                    newPic=id.parentNode.id.replace("Cat", "")+OldPId
                    NewText = id.parentNode.id.replace("Cat", "t")
                    //alert(newPic)
                    //alert(NewText+OldId)
                    $('#SiteImgCont').animate({opacity:"0"}, 1000,function(){
                        document.getElementById('SiteImgCont').innerHTML = '<img src="pic/load.gif" id="SiteImg"/>';
                        document.getElementById('SiteImg').src="pic/siteImg/0"+newPic+".jpg"
                        $('#SiteImgCont').animate({opacity:"1"}, 1000)
                        $('#'+NewText).hide('slow')
                        if(NewText+OldId!="t3SZFNY"){
                            $('#'+NewText+OldId).show('slow')
                        }else{
                            $('#'+NewText).show('slow')
                        }
                    })
                    if(Tid=="gepek"){
                        $('#SiteImgCont').animate({opacity:"0"}, 1000, function(){
                            document.getElementById('SiteImgCont').style.display="none"
                            $('#gepekPic').css({ opacity: 0 });
                            document.getElementById('gepekPic').style.opacity="0"
                            document.getElementById('gepekPic').style.display="block"
                            $('#gepekPic').animate({opacity:"1"}, 1000)
                        })
                    }else if(Tid=="prosi"){
                        //alert('ok')
                        DoDigiKalk();
                    }else if(Tid=="ftp" || Tid=="csapat"){
                        //alert('ok')
                        $('#map').animate({opacity:"0"}, 1000, function(){
                            document.getElementById('map').style.display="none"
                            document.getElementById('SiteImgCont').style.opacity="0"
                            document.getElementById('SiteImgCont').style.display="block"
                            $('#SiteImgCont').animate({opacity:"1"}, 1000)
                        })
                    }
                }else{
                    window.location.hash=location.hash.replace('/','')
                    if(id.parentNode.id=="Cat1"){
                        //alert('ok')
                        $("#dot").animate({opacity:"0"}, 1000, function(){
                            $("#dot").css('backgroundImage', 'url("../pic/button.png")' )
                            $('#dot').animate({opacity:"1"}, 1000)
                        })
                         $('#SiteImgCont').animate({opacity:"0"}, 1000, function(){
                            AC = document.getElementById('Cat1')
                            TC = AC.getElementsByTagName('h3')
                            for(u=0; u<TC.length; u++){
                            TC[u].style.color="#7b92aa"
                            TC[u].style.fontWeight="normal"
                            TC[u].className=""
                            $('#'+id.parentNode.id.replace("Cat", "t")+TC[u].id).hide('slow')
                            }
                            document.getElementById('gepek').calssName="on"
                            document.getElementById('gepek').style.color="#FF9900"
                            document.getElementById('gepek').style.fontWeight="bold"
                            $("#gepekPic").show('slow')
                            $('#gepekPic').animate({opacity:"1"}, 1000)
                            $('#ROLAND').animate({opacity:"1"}, 1000)
                            $("#t1gepek").show('slow')
                            $("#PROLAND").show('slow')
                         })
                    }else if(id.parentNode.id=="Cat5"){
                        //alert('ok')
                        $('#SiteImgCont').animate({opacity:"0"}, 1000, function(){
                            document.getElementById('SiteImgCont').style.display="none"
                            document.getElementById('map').style.opacity="0"
                            document.getElementById('map').style.display="inline-block"
                            AC = document.getElementById('Cat5')
                            TC = AC.getElementsByTagName('h3')
                            for(u=0; u<TC.length; u++){
                                TC[u].style.color="#7b92aa"
                                TC[u].style.fontWeight="normal"
                                TC[u].className=""
                                $('#'+id.parentNode.id.replace("Cat", "t")+TC[u].id).hide('slow')
                            }
                            $('#t5').show('slow')
                            $('#map').animate({opacity:"1"}, 1000)
                        })
                    }else{
                    $("#dot").animate({opacity:"0"}, 1000, function(){
                        $("#dot").css('backgroundImage', 'url("../pic/button.png")' )
                        $('#dot').animate({opacity:"1"}, 1000)
                    })
                    id.className=""
                    NewText = id.parentNode.id.replace("Cat", "t")
                    newSrc = NewText.replace('t','')
                    OlId = id.id
                    $('#gepekPic').animate({opacity:"0"}, 1000)
                    document.getElementById('gepekPic').style.display="none"
                    document.getElementById('SiteImgCont').style.display="block"
                    $('#SiteImgCont').animate({opacity:"0"}, 1000,function(){
                        document.getElementById('SiteImgCont').innerHTML = '<img src="pic/load.gif" id="SiteImg"/>';
                        document.getElementById('SiteImg').src="pic/siteImg/0"+newSrc+".jpg"
                        $('#SiteImgCont').animate({opacity:"1"}, 1000)
                        $('#'+NewText+OlId).hide('slow')
                        $('#'+NewText).show('slow')
                    })
                    }
                }
                //cat 4 /szolgaltatasok
                }else{
                    if(id.className!="on"){
                        window.location.hash=location.hash+"/"
                        $('#scroll').stop()
                        $('#scroll').clearQueue()
                        $('#scroll').animate({scrollLeft :0+"px"}, 0)
                        document.getElementById('SiteImgCont').innerHTML = '<img src="pic/load.gif" id="SiteImg"/>';
                        for(a=0; a<TextElement.length; a++){
                            if(TextElement[a].className=="cati"){
                                $("#"+TextElement[a].id).hide('slow')
                            }
                        }
                        //alert(id.className)
                        for(i=0; i<Tcat.length; i++){
                            Tcat[i].style.color="#7b92aa"
                            Tcat[i].style.fontWeight="normal"
                            Tcat[i].className=""
                            if(Tcat[i].id!=Tid){
                                $('#'+Tcat[i].id.replace("DCat", "d")).animate({opacity:"0.5"}, 1000)
                            }
                        }
                        id.style.color="#FF9900"
                        id.style.fontWeight="bold"
                        id.className="on"
                         NewText = id.parentNode.id.replace("Cat", "t")
                         $('#'+NewText).show('slow')
                        piId=id.id.replace('DCat', 'd')
                        $('#'+piId).animate({opacity:"1"}, 1000)
                        PicCount = id.id.replace('DCat', '')
                        $('#kapcsImg').animate({opacity:"0"}, 1000, function(){
                            document.getElementById('SiteImg').style.display="inline-block"
                            document.getElementById('kapcsImg').style.display="none"
                            $('#SiteImgCont').animate({opacity:"1"}, 1000, function(){
                            DIV=''
                            if(id.id=="DCat1"){
                                DIV="Dcat1Cont"
                                CatD = 0
                            }else if(id.id=="DCat2"){
                                DIV="Dcat2Cont"
                                CatD = 1
                            }else if(id.id=="DCat3"){
                                DIV="Dcat3Cont"
                                CatD = 2
                            }
                            DoGallery(CatD, 1, false, DIV)
                            })
                        })
                    }else{
                        window.location.hash=location.hash.replace('/','')
                        $('#scroll').animate({scrollLeft :0+"px"}, 0)
                        $('#scroll').stop()
                        $('#scroll').clearQueue()
                         $("#dot").animate({opacity:"0"}, 1000, function(){
                            $("#dot").css('backgroundImage', 'url("../pic/button.png")' )
                            $('#dot').animate({opacity:"1"}, 1000)
                        })
                        for(i=0; i<Tcat.length; i++){
                            Tcat[i].style.color="#7b92aa"
                            Tcat[i].style.fontWeight="normal"
                            Tcat[i].className=""
                        }
                        $('#SiteImgCont').animate({opacity:"0"}, 1000, function(){
                        document.getElementById('SiteImgCont').innerHTML = '<img src="pic/load.gif" id="SiteImg"/>';
                        document.getElementById('scrollControll').style.display="none"
                        document.getElementById('kapcsImg').style.display="inline-block"
                        $('#kapcsImg').animate({opacity:"1"}, 1000)
                        })
                        id.className=""
                        NewText = id.parentNode.id.replace("Cat", "t")
                        $('#'+NewText+id.id).hide('slow')
                        $('#'+NewText).show('slow')
                        piId=id.id.replace('DCat', 'd')
                        $('#'+piId).animate({opacity:"0.5"}, 1000)
                    }
                }
    }
    AllEv = document.getElementById('arTit')
    Tevent = AllEv.getElementsByTagName('li')
    for(j=0; j<Tevent.length; j++){
        Tevent[j].onmouseover = function(){
            if(this.className!="on"){
                this.style.color="#666666"
            }
        }
        Tevent[j].onmouseout = function(){
            if(this.className!="on"){
                this.style.color="#a1b1c2"
            }
        }
        Tevent[j].onclick = function(){
            if(this.className!="on"){
                for(d=0; Tevent.length>d; d++){
                    Tevent[d].className=""
                    Tevent[d].style.color="#a1b1c2"
                }
                this.style.color="#666666"
                this.className="on"
                if(this.id=="reg"){
                    $("#UserName").hide('slow')
                    $("#UserPass").hide('slow')
                    $('#regist').show('slow')
                }else{
                     $('#regist').hide('slow')
                    $("#UserName").show('slow')
                    $("#UserPass").show('slow') 
                }
            }
        }
        
    }
    logSend = document.getElementById('loginSend')
    logSend.onclick = function(){
        //alert('click')
        email = document.getElementById('loginN')
        pass = document.getElementById('loginP')
        if(email.value=="" || pass.value==""){
            document.getElementById('LoginError').innerHTML = "<p id='emptyInput'>Töltse ki mindkét mezőt!</p>"
            $('#LoginError').show('slow')
            $('#LoginError').show('slow').delay(5000).hide('slow')
            
        }else{
            httpObject = null;
            link = "main.php?user="+email.value+"&pass="+pass.value
            httpObject = getHTTPObject();
            if (httpObject != null) {
                httpObject.open("GET", link , true);
                httpObject.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");
                httpObject.setRequestHeader('User-Agent',"XHR User-Agent Override");
                httpObject.onreadystatechange = setOutputM;
                httpObject.send(null);
            }
        }
    }

/*    NRG = document.getElementById('NoRegPic')
    NRG.onclick = function(){
        ResDiv = document.getElementById('NoRegInp')
        ResDiv.innerHTML='<div class="inlineDiv" style="margin-bottom:10px"><p id="email" class="BoldText">Az Ön email címe:</p><input type="text" style="border:1px solid #FF9900;" value="" id="userLogin"/><input type="hidden" id="RegUser" value="no" /><input type="hidden" id="GratIsUser" value="100" /></div>'
        document.getElementById("kalkulatorSite").style.display="block"
        $('#NoReg').hide('slow')
        $('#RuCenter').hide('slow')
    }*/
    ReB = document.getElementById('regButton')
    ReB.onclick = function(){
        ReGN = document.getElementById('userName')
        ReGmaIl = document.getElementById('emailadress')
        if(ReGmaIl.value!="" && ReGN.value!="" && ReGmaIl.value.search('@')!=-1){
            $('#step1').hide('slow')
            $('#step2').show('slow')
        }else if(ReGmaIl.value=="" || ReGN.value=="" && ReGmaIl.value.search('@')!=-1){
            $('#LoginError').show('slow')
            document.getElementById('LoginError').innerHTML="<p>Töltse ki ménd két mezőt!</p>"
            $('#LoginError').show('slow').delay(1000).hide('slow')
        }else{
            $('#LoginError').show('slow')
            document.getElementById('LoginError').innerHTML="<p>Érvénytelen e-mail cím!</p>"
            $('#LoginError').show('slow').delay(1000).hide('slow') 
        }
    }
    reg2B = document.getElementById('regButton2')
    reg2B.onclick = function(){
        ReGmaIl = document.getElementById('emailadress')
        pass1 = document.getElementById('regPassword').value
        pass2 = document.getElementById('regPasswordEl').value
        if(pass1!='' & pass2!='' & pass1==pass2 & pass1.length>4){
            $('#LoginError').hide('slow')
            httpObject = null;
            link = "main.php?email="+ReGmaIl.value+"&password="+pass1+"&Name="+document.getElementById('userName').value
            httpObject = getHTTPObject();
            if (httpObject != null) {
                httpObject.open("GET", link , true);
                httpObject.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");
                httpObject.setRequestHeader('User-Agent',"XHR User-Agent Override");
                httpObject.onreadystatechange = setOutputM;
                httpObject.send(null);
            }
        }else if(pass1!='' & pass2!='' & pass1==pass2 & pass1.length<=4){
            //alert(pass1 +" | "+pass2)
            $('#LoginError').show('slow')
            document.getElementById('LoginError').innerHTML="<p>A beírt jelszó túl rövid!</p>"
            $('#LoginError').show('slow').delay(1000).hide('slow')
        }else if(pass1=='' || pass2==''){
            document.getElementById('LoginError').innerHTML="<p>Töltse ki ménd két mezőt!</p>"
            $('#LoginError').show('slow')
            $('#LoginError').show('slow').delay(1000).hide('slow')
        }else if(pass1!=pass2){
            document.getElementById('LoginError').innerHTML="<p>A beírt jelszavak nem egyeznek!</p>"
            $('#LoginError').show('slow')
            $('#LoginError').show('slow').delay(1000).hide('slow')
        }
    }
    dotClick=document.getElementById('CatTit')
    dotClick.onclick = function(){
        if(active=="true"){
        for(u=0; u<Tcat.length; u++){
            if(Tcat[u].className=="on"){
                id=Tcat[u].id
                Tcat[u].style.color="#0000000"
                Tcat[u].style.fontWeight="normal"
                
            }
        }
        SetCat(id)
        }
    }
    DCL=document.getElementById('dot')
    DCL.onclick = function(){
        if(active=="true"){
        for(u=0; u<Tcat.length; u++){
            if(Tcat[u].className=="on"){
                id=Tcat[u].id
                Tcat[u].style.color="#0000000"
                Tcat[u].style.fontWeight="normal"
                
            }
        }
        SetCat(id)
        }
    }
    SGP = document.getElementById('surgFelar')
    TMp = SGP.getElementsByTagName('input')
    for(o=0; o<TMp.length; o++){
        TMp[o].onclick = function(){
           // alert('ok')
            if(this.className!='on'){
                TMp[0].checked=false;
                TMp[1].checked=false;
                this.className="on"
                this.checked=true;
                SetPrice();
            }else{
                this.className=""
                this.checked=false;
                SetPrice();
            }
        }
    }
    Dot3Click = document.getElementById('dot3')
    Dot3Click.onclick = function(){
        //AllG = document.getElementById('t1gepek')
        DoLinkS(true, 'PROLAND', 'p')
        
    }
    Dot4Click = document.getElementById('dot4')
    Dot4Click.onclick = function(){
       SetCat('DCat1')
    }
    Dot5Click = document.getElementById('dot5')
    Dot5Click.onclick = function(){
        SetCat('DCat2')
    }
    Dot6Click = document.getElementById('dot6')
    Dot6Click.onclick = function(){
        SetCat('DCat3')
    }
    Dot7Click = document.getElementById('dot7')
    Dot7Click.onclick = function(){
        DoLinkS(false, 't5ftp', '_')
    }
    Dot8Click = document.getElementById('dot8')
    Dot8Click.onclick = function(){
        DoLinkS(false, 't5ftp', '_')
    }
    Dot9Click = document.getElementById('dot9')
    Dot9Click.onclick = function(){
        DoLinkS(false, 't5ftp', '_')
    }
    DesignInputs = document.getElementById('inputD')
    TDI = DesignInputs.getElementsByTagName('input')
    for(o=0; o<TDI.length; o++){
        TDI[o].onclick = function(){
            for(i=0; i<TDI.length; i++){
                TDI[i].checked = false; 
            }
            if(this.checked!=true){
                this.checked = true
                //alert(this.value)
            }
        }
    }
    Tdot = document.getElementById('dot1')
    Tdot.onclick = function(){
        $("#hoverDiv").show('slow')
        $("#HoverInside").show('slow')
        Alead = document.getElementById('t1anyagleadas')
        document.getElementById('HoverInside').innerHTML ="<p id='closePopup'>close</p>"+ Alead.innerHTML
        DoClose();
    }
    doClickEvent()
}
function DoLinkS(more, first, childs){
    //alert(more+" | "+ first +" | "+ childs)
    if (self.innerWidth){
        f = self.innerWidth;
        g = self.innerHeight;
        f = Math.floor(f);
        g = Math.floor(g);
    }else if (document.documentElement && document.documentElement.clientWidth){
        a = document.documentElement.clientWidth;
        b = document.documentElement.clientHeight;
        f = Math.floor(a);
        g = Math.floor(b);
    }else if (document.body){
        f = document.body.clientWidth;
        g = document.body.clientHeight;
        f = Math.floor(f);
        g = Math.floor(g);
    }
    if(f>=800){
    W=f/2
    H=g/2
    }else{
        W=400;
    }
    document.getElementById('HoverInside').style.height='260px'
    document.getElementById('HoverInside').style.width="800px"
    document.getElementById('HoverInside').style.left=W-400+"px"
    first = document.getElementById(first)
    if(more==true){
        childs = first.getElementsByTagName(childs)
        ReText = "<p id='closePopup'>close</p><div id='scD'>"
            for(i=0; i<childs.length; i++){
                ReText += '<p style="position:relative;top:0px;margin:0px 0px 0px 0px;">'+childs[i].innerHTML+'</p>'
            }
        ReText +="</div>"   
    }else{
       // alert(first)
        ReText = "<p id='closePopup'>close</p><div id='scD'>"
        ReText += first.innerHTML
        ReText +="</div>"  
    }
        document.getElementById('HoverInside').innerHTML = ReText
        $("#hoverDiv").show('slow')
        $("#HoverInside").show('slow')
        DoClose();
}
function DoClose(){
    CPop = document.getElementById('closePopup')
    CPop.onclick = function(){
        $("#hoverDiv").hide('slow')
        $("#HoverInside").hide('slow')
        document.getElementById('HoverInside').innerHTML = "";
        //alert(SCroll)
        //SCroll="To"
        SCrollOver=false
    }
}
function DoCl(){
    CPop = document.getElementById('closeP')
    CPop.onclick = function(){
        //alert('close')
        $("#hoverDiv").hide('slow')
        $("#HoverInside").hide('slow')
        SCrollOver=false
        document.getElementById('HoverInside').style.height='260px'
        document.getElementById('HoverInside').style.width="800px"
        if(document.getElementById('SCD').value=="To"){
            document.getElementById('HoverInside').innerHTML = "";
            //alert('t')
            DoScrollTo()
        }else{
            document.getElementById('HoverInside').innerHTML = "";
            //alert('b')
            DoScrollBack()
        }
    }
}
function DoCl1(){
    CPop = document.getElementById('closeP')
    CPop.onclick = function(){
        //alert('close')
        $("#hoverDiv").hide('slow')
        $("#HoverInside").hide('slow')
        SCrollOver=false
        document.getElementById('HoverInside').style.height='260px'
        document.getElementById('HoverInside').style.width="800px"
        if(document.getElementById('SCD').value=="To"){
            document.getElementById('HoverInside').innerHTML = "";
            //alert('t')
            DoScrollTo1()
        }else{
            document.getElementById('HoverInside').innerHTML = "";
            //alert('b')
            DoScrollBack1()
        }
    }
}
function DoKalkulator(){
    szeles = document.getElementById('JobWidth').value.replace(',','.').value
    magas = document.getElementById('JobHeight').value.replace(',','.').value
    db = document.getElementById('JobDb').value
    LogAble="true"
    Log = document.getElementById('sendJob')
    Log.onmouseover = function(){
        if(LogAble=="true"){
            $("#sendJob").css('backgroundImage', 'url("../pic/login_on_70x70.png")' )
        }
    }
    Log.onmouseout = function(){
        $("#sendJob").css('backgroundImage', 'url("../pic/login_70x70.png")' )
    }
    Log.onclick = function(){
       // alert('ok')
        allMin = document.getElementById('munka_minoseg')
        Tmin = allMin.getElementsByTagName('option')
        for(a=0; a<Tmin.length; a++){
            if(Tmin[a].selected==true){
                Tminval=Tmin[a].innerHTML;
            }
        }
        allanyag = document.getElementById('munka_anyag')
        Tanyag = allanyag.getElementsByTagName('option')
        for(a=0; a<Tanyag.length; a++){
            if(Tanyag[a].selected==true){
               // alert(Tanyag[a].value)
                Tanyagval=Tanyag[a].innerHTML;
            }
        }
        alltabla = document.getElementById('munka_tabla')
        Ttabla = alltabla.getElementsByTagName('option')
        for(a=0; a<Ttabla.length; a++){
            if(Ttabla[a].selected==true){
                Ttablaval=Ttabla[a].innerHTML;
            }
        }
        allkiegdijak = document.getElementById('munka_kiegdijak[]')
        Tkiegdijak = allkiegdijak.getElementsByTagName('option')
        
        for(a=0; a<Tkiegdijak.length; a++){       
            if(Tkiegdijak[a].selected==true){     
               Tkiegdijakval1=Tkiegdijak[a].innerHTML;
            }
        }
        AllInstall = document.getElementById('InstallElement')
        InstallCheck = AllInstall.getElementsByTagName('input')
        install=""
        for(i=0; i<InstallCheck.length; i++){
            if(InstallCheck[i].checked == true){
                install +=document.getElementById("id"+InstallCheck[i].value).innerHTML+" <br>";
            }
        }
        DesignInputs = document.getElementById('inputD')
        TDI = DesignInputs.getElementsByTagName('input')
        design=""
        for(o=0; o<TDI.length; o++){
            if(TDI[o].checked!=false){
                design = TDI[o].value
            }
        }
        hk = document.getElementById('hely')
        OUTDOOR="-"
        if(hk.checked!=false){
            OUTDOOR = document.getElementById('hsz').innerHTML;
        }
        ULS = document.getElementById('userLogin').value.search('@')
        if(LogAble=="true"){
            //alert('ok')
            httpObject = null;
            link = "main.php?rendel=true&width="+szeles+"&height="+magas+"&db="+db+"&minoseg="+Tminval+"&anyag="+Tanyagval+"&tabla="+Ttablaval+"&kiegdij="+Tkiegdijakval1+"&userEmail="+document.getElementById('userLogin').value+"&price="+document.getElementById('changeBill').innerHTML+"&installType="+install+"&designJob="+design+"&KIH="+OUTDOOR;
            //alert(link)
            httpObject = getHTTPObject();
            if (httpObject != null) {
                httpObject.open("GET", link , true);
                httpObject.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");
                httpObject.setRequestHeader('User-Agent',"XHR User-Agent Override");
                httpObject.onreadystatechange = SendKalkulatorData;
                httpObject.send(null);
            }
        }else{
            if(document.getElementById('LoginError').innerHTML.search('Bejelentkezve!')==-1){
            document.getElementById('LoginError').innerHTML="<p>Kérjük töltse ki az összes mezőt!</p>"
            $('#LoginError').show('slow')
            $('#LoginError').show('slow').delay(5000).hide('slow')
            }else{
                alert('Kérjük töltse ki az összes mezőt!')
            }
        }
    }
    allInp = document.getElementById('mainInput')
    tInp = allInp.getElementsByTagName('input')
    for(d=0; d<tInp.length; d++){
        tInp[d].value=""
    }
    for(i=0; i<tInp.length; i++){
        tInp[i].onkeypress = function(e){
            if(this.id=="JobWidth" || this.id=="JobHeight" || this.id=="JobDb"){
                if(window.event) // IE
                {
                keynum = e.keyCode
                }
                else if(e.which){
                keynum = e.which
                }
                keychar = String.fromCharCode(keynum)
                if(!isNaN(keychar)){
                    this.style.border="1px solid #666666"
                    inputCheker=0
                    tId = this.id
                    for(u=0; tInp.length>u; u++){
                        if(tInp[u].id=="JobWidth" || tInp[u].id=="JobHeight" || tInp[u].id=="JobDb"){
                            if(tInp[u].value==""){
                                if(tInp[u].id!=tId){
                                //alert("value"+tInp[u].value+" | "+tInp[u].id)
                                inputCheker++
                                }
                            }
                        }
                    }
                    if(inputCheker==0){
                        LogAble="true"
                    }
                }else{
                   // alert(keynum)
                    if(keynum=="8" || keynum=="46" || keynum=="44" ){
                        if(keynum=="8" && this.value.length==1){
                            this.style.border="1px solid #FF9900"
                        }
                        return true;
                    }else{
                        return false;
                    }
                }
            }
        }
        tInp[i].onkeyup = function(){
                if(document.getElementById('JobWidth').value!="" && document.getElementById('JobHeight').value!="" & document.getElementById('JobDb').value!=""){
                    SetPrice();
                }
        }
    }
}
function SetPrice(){
    szeles = document.getElementById('JobWidth').value.replace(',','.')
    magas = document.getElementById('JobHeight').value.replace(',','.')
    db = document.getElementById('JobDb').value
    //alert(szeles*magas)
    Tkiegdijakval=1
    CalculatedPrice = ((szeles*magas)/10000)*db
    allMin = document.getElementById('munka_minoseg')
    Tmin = allMin.getElementsByTagName('option')
    var Tallinstdijakval;
    for(a=0; a<Tmin.length; a++){
        if(Tmin[a].selected==true){
            Tminval=Tmin[a].value;
        }
    }
    allanyag = document.getElementById('munka_anyag')
    Tanyag = allanyag.getElementsByTagName('option')
    for(a=0; a<Tanyag.length; a++){
        if(Tanyag[a].selected==true){
           // alert(Tanyag[a].value)
            Tanyagval=parseInt(Tanyag[a].value);
        }
    }
    alltabla = document.getElementById('munka_tabla')
    Ttabla = alltabla.getElementsByTagName('option')
    for(a=0; a<Ttabla.length; a++){
        if(Ttabla[a].selected==true){
            if(Ttabla[a].value=='0'){
                tval = 0
            }else{
                tval = Ttabla[a].value;
            }
            Ttablaval=parseInt(tval);
        }
    }
    allkiegdijak = document.getElementById('munka_kiegdijak[]')
    Tkiegdijak = allkiegdijak.getElementsByTagName('option')
    Tkiegdijakval=0
    for(a=0; a<Tkiegdijak.length; a++){
       // alert(Tkiegdijak[a].checked)
        if(Tkiegdijak[a].selected==true){
            Tkiegdijakval= Tkiegdijakval+parseInt(Tkiegdijak[a].value);
        }
    }
    SG = document.getElementById('surgFelar')
        TMP = SG.getElementsByTagName('input')
        felar=1
        for(a=0; a<TMP.length; a++){
            if(TMP[a].checked==true){
                felar=TMP[a].value
            }
        }
    allinstdijak = document.getElementById('InstallElement')
    Tallinstdijak = allinstdijak.getElementsByTagName('input')
    Tallinstdijakval=0
    //alert(Tallinstdijak.length)
    for(a=0; a<Tallinstdijak.length; a++){
        if(Tallinstdijak[a].checked==true){
            Tallinstdijakval=Tallinstdijakval+parseInt(Tallinstdijak[a].value);
        }
    }
    //alert('ok')
   // alert(document.getElementById('RegUser'))
    //alert(CalculatedPrice+" | "+Tkiegdijakval+" | "+Ttablaval+" | "+Tanyagval+" | "+Tminval)
    if(document.getElementById('RegUser').value=="yes"){
        document.getElementById('changeBill').innerHTML=Math.round((((CalculatedPrice*Tanyagval*Tminval)+(Ttablaval*(((szeles*magas)/10000)*db))+(Tkiegdijakval*(((szeles*magas)/10000)*db))+(Tallinstdijakval*(((szeles*magas)/10000)*db)))*(document.getElementById('GratIsUser').value/100))*felar);
        document.getElementById('Gratis').innerHTML="(Az ár tartalmazza a <span style='color:#FF9900;'>"+(100-document.getElementById('GratIsUser').value)+"%</span> kedvezményt)"
    }else{
        //alert(felar)
        document.getElementById('changeBill').innerHTML=Math.round(((CalculatedPrice*Tanyagval*Tminval)+(Ttablaval*(((szeles*magas)/10000)*db))+(Tkiegdijakval*(((szeles*magas)/10000)*db))+(Tallinstdijakval*(((szeles*magas)/10000)*db)))*felar);
        document.getElementById('Gratis').innerHTML="Regisztráljon most és már ebből a megrendeléséből is biztosítunk <span style='color:#FF9900;'>10%</span> kedvezményt! <div id='dot10' onClick='window.scrollTo(0, 0)'></div>"
    }
    GetMouse();
}
function DoLog(){
    //alert('ok')
    LogOut = document.getElementById('QuIt')
    LogOut.onclick = function(){
        $('#RuCenter').show('slow')
        document.getElementById("LoginError").innerHTML=''
        $('#UserName').show('slow')
        $('#UserPass').show('slow')
        $('#arTit').show('slow')
        document.getElementById("FtpLogin").style.display="none"
        document.getElementById('NoRegInp').innerHTML='<div class="inlineDivD1" style="margin-bottom:10px"><p id="email" style="float:left" class="BoldText">Az Ön email címe:<span style="color:#FF9900; font-weight:bold;">*</span></p><input type="text" style="border:1px solid #FF9900; position:relative;top:25px; margin-left:0px;" value="" id="userLogin"/><input type="hidden" id="RegUser" value="no" /><input type="hidden" id="GratIsUser" value="100" /></div><div class="inlineDivD1" style="margin-bottom:10px"><p id="email" style="float:left" class="BoldText">Az Ön email címe:<span style="color:#FF9900; font-weight:bold;">*</span></p><input type="text" style="border:1px solid #FF9900; position:relative;top:25px; margin-left:0px;" value="" id="userLogin"/><input type="hidden" id="RegUser" value="no" /><input type="hidden" id="GratIsUser" value="100" /></div>'
        document.getElementById('NotRegg').innerHTML='<p class="DigiP">Az Ön email címe: </p><input type="text" id="FastCopyEmail">'
    }
    if(document.getElementById('RegUser').value=="yes"){
        SetPrice();
    }
}
function GetMouse(){
    allMinoseg = document.getElementById('munka_minoseg')
    allMinoseg.onchange = function(){
        SetPrice();
    }
    allMAt = document.getElementById('munka_anyag')
    allMAt.onchange = function(){
        SetPrice();
    }
    allTAB = document.getElementById('munka_tabla')
    allTAB.onchange = function(){
        SetPrice();
    }
    allkiegdijak = document.getElementById('munka_kiegdijak[]')
    allkiegdijak.onchange = function(){
        SetPrice();
    }
    
    allinstdijak = document.getElementById('InstallElement')
    Tallinstdijak = allinstdijak.getElementsByTagName('input')
    //alert(Tallinstdijak.length)
    for(a=0; a<Tallinstdijak.length; a++){
        Tallinstdijak[a].onclick = function(){
            SetPrice();
        }
    }
    
}
function DoGallery(CatD, counter, load, DIV){
    i=0;
    //alert(home)
    if(load==false){
        //alert('fasle')
        GimgPreload(CatD, counter, load, DIV)
        return false;
    }else if(load==true && document.getElementById('c4').className=="on" && document.getElementById(DIV.replace('Cont','').replace('c', 'C')).className=="on"){
    //alert('ok')
    document.getElementById('SiteImgCont').removeChild(document.getElementById('SiteImg'))
    //alert(counter+" | "+DIV+" | "+imageLoad+" | "+scrollIndex)
    allRef = document.getElementById('SiteImgCont')
    Tref = allRef.getElementsByTagName('img')
    $('#scroll').animate({opacity:"0"}, 1000 , function(){
        //alert(Tref.length)
        allRef.style.width="10000px;"
        allRef.style.display="block"
        for(i=0; i<Tref.length; i++){
            Tref[i].style.display="inline-block"
            Tref[i].style.marginRight = "10px"
        }
        $('#scroll').animate({opacity:"1"}, 1000, function(){
            DoScrollTo();
        })
    })
    SCroll=''
    SCrollOver=false
    for(i=0; Tref.length>i; i++){
        Tref[i].onmouseover=function(){
            $('#scroll').stop()
        }
        Tref[i].onmouseout=function(){
            if(SCroll=='To' && SCrollOver==false){
                DoScrollTo();
            }else if(SCroll=="Back" && SCrollOver==false){
                DoScrollBack();
            }else if(SCrollOver==true){
                
            }
            //$('#scroll').play(true, true)
        }
        Tref[i].onclick = function(){
           // alert(this.id)
            /*@cc_on
                /*@if (@_win32)
                     SC= parseInt(Tref[i].offsetWidth)
                @else @*/
                    SC = parseInt(window.getComputedStyle(document.getElementById(this.id),null).getPropertyValue("width")); 
                /*@end
            @*/
            if (self.innerWidth){
                f = self.innerWidth;
                g = self.innerHeight;
                f = Math.floor(f);
                g = Math.floor(g);
            }else if (document.documentElement && document.documentElement.clientWidth){
                a = document.documentElement.clientWidth;
                b = document.documentElement.clientHeight;
                f = Math.floor(a);
                g = Math.floor(b);
            }else if (document.body){
                f = document.body.clientWidth;
                g = document.body.clientHeight;
                f = Math.floor(f);
                g = Math.floor(g);
            }
            if(f>SC*(400/150)+80){
            W=f/2
            H=g/2
            }else{
                W=(SC*(400/150)+80)/2
            }
            document.getElementById('HoverInside').style.height='470px'
            document.getElementById('HoverInside').style.width=SC*(400/150)+80+"px"
            document.getElementById('HoverInside').style.left=W-((SC*(400/150)+80)/2)+"px"
            SCrollOver=true
            TID= parseInt(this.id.replace(this.className, ''))-1
            link = "main.php?GetPicText=1&scrollPosition="+TID+"&image="+this.src.replace("kicsik/", '')+"&AlCat="+CatD+"&ScrollDest="+SCroll
            //alert(link)
            httpObject = getHTTPObject();
            if (httpObject != null) {
                httpObject.open("GET", link , true);
                httpObject.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=ISO-5589-2");
                httpObject.setRequestHeader('User-Agent',"XHR User-Agent Override");
                httpObject.onreadystatechange = SetScrollText1;
                httpObject.send(null);
            }
        }
    }
    }
    
}
function DoScrollTo(){
    SCroll='To'
    SCW = document.getElementById('scroll').scrollWidth-570
    //alert((SCW-document.getElementById('scroll').scrollLeft)/50)
    $('#scroll').animate({scrollLeft : SCW+"px"}, 1000*((SCW-document.getElementById('scroll').scrollLeft)/60), function(){
        //alert('ok')
        DoScrollBack();
    })
}
function DoScrollBack(){
    SCroll='Back'
    SCW = document.getElementById('scroll').scrollWidth-570
    
    $('#scroll').animate({scrollLeft : 0+"px"}, 1000*((SCW-(SCW-document.getElementById('scroll').scrollLeft))/60), function(){
        DoScrollTo();
    })
}

function GimgPreload(CatD, counter, load, DIV){
        //alert(counter+" | "+DIV+" | "+imageLoad+" | "+scrollIndex)
        arr = Array();
        arr[0]='Dcat1Cont'
        arr[1]='Dcat2Cont'
        arr[2]='Dcat3Cont'
        arr[3]=''
        if(counter<10){
            GsImg="pic/"+arr[CatD]+"/kicsik/0"+counter+".jpg"
        }
        if(counter>=10){
            GsImg="pic/"+arr[CatD]+"/kicsik/"+counter+".jpg"
        }
        //alert(GsImg)
        GaleryPic= new Image();
        GaleryPic.src=GsImg;
        GaleryPic.onerror = function(){
            // alert(counter)
            DoGallery(CatD, counter, true, DIV)
        
        }
        GaleryPic.onload = function(){
            //alert(counter)
            GImg = document.createElement('img')
            GImg.setAttribute('class',arr[CatD])
            GImg.setAttribute('id', arr[CatD]+counter)
            GImg.setAttribute('style', 'display:none; height:150px; margin-right:10px; margin-top:70px; cursor: pointer;')
            document.getElementById('SiteImgCont').appendChild(GImg)
            GImg.setAttribute('src', GsImg)
            counter++;
            GimgPreload(CatD, counter, load, DIV)
            
        }
}
function DoC2Galery(){
    document.getElementById('SiteImgCont').innerHTML = '<img src="pic/load.gif" id="SiteImg"/>';
    document.getElementById('SiteImg').style.display="inline-block"
    GC = document.getElementById('GaleryContainer')
    GI = GC.getElementsByTagName('img')
    for(i=0; i<GI.length; i++){
        GI[i].onmouseover = function(){
            if(this.className!="on"){
                $('#'+this.id).animate({opacity:"1"}, 1000)
            }
        }
        GI[i].onmouseout = function(){
            if(this.className!="on"){
                $('#'+this.id).animate({opacity:"0.5"}, 1000)
            }
        }
    }
    
    DoGaleryPreload(0, 1)
}
function DoGaleryPreload(img, imgCounter){
    //alert(img+" | "+imgCounter)
    i = parseInt(img)
    var NewC, GC, GI;
    NewC = Array();
    GC = document.getElementById('GaleryContainer')
    GI = GC.getElementsByTagName('img')
    for(o=0; o<GI.length; o++){
        NewC[o]=GI[o].id.replace('01_', '')
    }
    //alert(GI.length)
    NewCi=NewC[i]
    //alert(NewC)
    if(imgCounter<10){
        GSRC = 'pic/galery/01_'+NewCi+'/kicsik/0'+imgCounter+"_"+NewCi+".jpg"
    }else{
        GSRC = 'pic/galery/01_'+NewCi+'/kicsik/'+imgCounter+"_"+NewCi+".jpg"
    }
    GPic= new Image();
    GPic.src=GSRC;

    //alert(GSRC)
    GPic.onerror = function(){
        if(imgCounter!=1){
            //img++
            //imgCounter=1
            DoGaleryScroll();
            //DoGaleryPreload(img, imgCounter)
        }else{
            DoGaleryScroll();
            //alert('end')
        }
    }
    GPic.onload = function(){
        //alert('ok')
        GImg = document.createElement('img')
        GImg.setAttribute('class',NewCi)
        GImg.setAttribute('id', NewCi+imgCounter)
        GImg.setAttribute('style', 'display:none; height:150px; margin-right:10px; margin-top:70px; cursor: pointer;')
        document.getElementById('SiteImgCont').appendChild(GImg)
        GImg.setAttribute('src', GSRC)
        imgCounter++
        DoGaleryPreload(img, imgCounter)
       // document.getElementById('SiteImg').src=GSRC
    }
}
function DoGaleryScroll(){
    if(document.getElementById('c2').className=="on"){
    //alert('ok')
    scrollIndex=0
    over=""
    GC = document.getElementById('SiteImgCont')
    GI = GC.getElementsByTagName('img')
    GaC = document.getElementById('GaleryContainer')
    GaI = GaC.getElementsByTagName('img')
    document.getElementById('GaleryContainer').getElementsByTagName('img')[0].className="on"
    $('#'+document.getElementById('GaleryContainer').getElementsByTagName('img')[0].id).css({ opacity: 1 });
    document.getElementById('SiteImgCont').removeChild(document.getElementById('SiteImg'))
    $('#scroll').animate({opacity:"0"}, 1000, function(){
    for(k=0; k<GI.length; k++){
        GI[k].style.display="inline-block"
    }
    $('#scroll').animate({opacity:"1"}, 1000, function(){
        DoScrollTo1();
    })
    })
    for(d=0; d<GaI.length; d++){
        GaI[d].onclick = function(){
            TD =this.id
            for(c=0; c<GaI.length; c++){
                GaI[c].className=""
                if(GaI[c].id!=TD){
                    $('#'+GaI[c].id).animate({opacity:"0.5"}, 1000)
                }
            }
            this.className="on"
            $('#scroll').stop()
            $('#scroll').clearQueue()
            $('#scroll').animate({scrollLeft :0+"px"}, 0)
            $('#'+this.id).animate({opacity:"1"}, 1000)
            document.getElementById('SiteImgCont').innerHTML='<img src="pic/load.gif" id="SiteImg"/>'
            tI = this.id
            for(i=0; i<GaI.length; i++){
                if(GaI[i].id==tI){
                    img=i
                }
            }
            //alert(d)
            DoGaleryPreload(img, 1)
        }
    }
    SCroll=''
    SCrollOver=false
    for(i=0; GI.length>i; i++){
        GI[i].onmouseover=function(){
            $('#scroll').stop()
        }
        GI[i].onmouseout=function(){
            if(SCroll=='To' && SCrollOver==false){
                DoScrollTo1();
            }else if(SCroll=="Back" && SCrollOver==false){
                DoScrollBack1();
            }else if(SCrollOver==true){
                
            }
            //$('#scroll').play(true, true)
        }
        GI[i].onclick = function(){
            SCrollOver=true
        /*@cc_on
                /*@if (@_win32)
                     SC= parseInt(Tref[i].offsetWidth)
                @else @*/
                    SC = parseInt(window.getComputedStyle(document.getElementById(this.id),null).getPropertyValue("width")); 
                /*@end
            @*/
            if (self.innerWidth){
                f = self.innerWidth;
                g = self.innerHeight;
                f = Math.floor(f);
                g = Math.floor(g);
            }else if (document.documentElement && document.documentElement.clientWidth){
                a = document.documentElement.clientWidth;
                b = document.documentElement.clientHeight;
                f = Math.floor(a);
                g = Math.floor(b);
            }else if (document.body){
                f = document.body.clientWidth;
                g = document.body.clientHeight;
                f = Math.floor(f);
                g = Math.floor(g);
            }
            if(f>SC*(400/150)+80){
            W=f/2
            H=g/2
            }else{
                W=(SC*(400/150)+80)/2
            }
            document.getElementById('HoverInside').style.height='470px'
            document.getElementById('HoverInside').style.width=SC*(400/150)+80+"px"
            document.getElementById('HoverInside').style.left=W-((SC*(400/150)+80)/2)+"px"
            SCrollOver=true
            TID= parseInt(this.id.replace(this.className, ''))-1
            link = "main.php?GetPicText=2&scrollPosition="+TID+"&image="+this.src.replace("kicsik/",'')+"&AlCat="+this.className+"&ScrollDest="+SCroll
            httpObject = getHTTPObject();
            if (httpObject != null) {
                httpObject.open("GET", link , true);
                httpObject.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=ISO-5589-2");
                httpObject.setRequestHeader('User-Agent',"XHR User-Agent Override");
                httpObject.onreadystatechange = SetScrollText;
                httpObject.send(null);
            }
        }
        }
    }
}
function DoScrollTo1(){
    SCroll='To'
    SCW = document.getElementById('scroll').scrollWidth-570
    if(SCW>0){
    //alert((SCW-document.getElementById('scroll').scrollLeft)/50)
    $('#scroll').animate({scrollLeft : SCW+"px"}, 1000*((SCW-document.getElementById('scroll').scrollLeft)/30), function(){
        //alert('ok')
        DoScrollBack1();
    })
    }
}
function DoScrollBack1(){
    SCroll='Back'
    SCW = document.getElementById('scroll').scrollWidth-570
    if(SCW>0){
    $('#scroll').animate({scrollLeft : 0+"px"}, 1000*((SCW-(SCW-document.getElementById('scroll').scrollLeft))/30), function(){
        DoScrollTo1();
    })
    }
}

function setOutputM(){
             if(httpObject.readyState == 4){
                //alert(httpObject.responseText)
                var objDiv = document.getElementById("LoginError");
                var response = httpObject.responseText;
                objDiv.innerHTML = response;
                objDiv.style.display="block"
                // alert(response)
                searchText = response.search('Bejelentkezve')
                if(searchText!=-1){
                    $('#UserName').hide('slow')
                    $('#UserPass').hide('slow')
                    $('#arTit').hide('slow')
                    document.getElementById("kalkulatorSite").style.display="block"
                    document.getElementById("FtpLogin").style.display="block"
                    document.getElementById('NoRegInp').innerHTML=""
                    $('#RuCenter').hide('slow')
                    document.getElementById('NotRegg').innerHTML = '<p class="DigiP">Az Ön email címe: </p><input type="text" value="'+document.getElementById('userLogin').value+'" id="FastCopyEmail">'
                    $('#LoginError').show('slow')
                    DoLog();
                }else{
                    $('#LoginError').show('slow').delay(1000).hide('slow')
                }
             }
             }
function GetKalkulatorText(){
             if(httpObject.readyState == 4){
                var objDiv = document.getElementById("ajaxDiv");
                var response = httpObject.responseText;
                objDiv.innerHTML = response;
                //alert(response)
                SetCalkulatorText();
             }
             }
function GetGaleryImages(){
             if(httpObject.readyState == 4){
                var objDiv = document.getElementById("GaleryContainer");
                var response = httpObject.responseText;
                objDiv.innerHTML = response;
                //alert(response)
                //document.getElementById('SiteImgCont').removeChild(document.getElementById('SiteImg')
                DoC2Galery();
             }
             }
function SetScrollText(){
             if(httpObject.readyState == 4){
                var objDiv = document.getElementById("HoverInside");
                var response = httpObject.responseText;
                objDiv.innerHTML = response;
                ReText = "<p id='closeP'>close</p>"+  response;
                document.getElementById('HoverInside').innerHTML = ReText
                $("#hoverDiv").show('slow')
                $("#HoverInside").show('slow')
                $('#scroll').stop()
                DoCl1()
                //alert(response)
                //document.getElementById('SiteImgCont').removeChild(document.getElementById('SiteImg')
                //DoC2Galery();
             }
             }
function SetScrollText1(){
             if(httpObject.readyState == 4){
                var objDiv = document.getElementById("HoverInside");
                var response = httpObject.responseText;
                objDiv.innerHTML = response;
                ReText = "<p id='closeP'>close</p>"+  response;
                document.getElementById('HoverInside').innerHTML = ReText
                $("#hoverDiv").show('slow')
                $("#HoverInside").show('slow')
                $('#scroll').stop()
                DoCl()
                //alert(response)
                //document.getElementById('SiteImgCont').removeChild(document.getElementById('SiteImg')
                //DoC2Galery();
             }
             }
function SendKalkulatorData(){
             if(httpObject.readyState == 4){
                var objDiv = document.getElementById("LoginError");
                var response = httpObject.responseText;
                if(document.getElementById('LoginError').innerHTML.search('Bejelentkezve!')==-1){
                  alert(response)
                $('#LoginError').show('slow')
                $('#LoginError').show('slow').delay(5000).hide('slow')
                }else{
                    alert(response)
                }
                SetCalkulatorText();
             }
             }
function SetDigiPrice(){
             if(httpObject.readyState == 4){
                var objDiv = document.getElementById("bill2");
                var response = httpObject.responseText;
                if(response.search('Sike elküldtük az emailt!')!=-1){
                    if(document.getElementById('LoginError').innerHTML.search('Bejelentkezve!')==-1){
                        alert('Sikn elküldtük az e-mailt!')
                        $('#LoginError').show('slow')
                        $('#LoginError').show('slow').delay(5000).hide('slow')
                    }else{
                        alert('Sikn elküldtük az e-mailt!')
                    }
                }else if(response.search('Sikertelen')!=-1){
                    if(document.getElementById('LoginError').innerHTML.search('Bejelentkezve!')==-1){
                      alert('Az e-mail küldése sikertelen!')
                        $('#LoginError').show('slow')
                        $('#LoginError').show('slow').delay(5000).hide('slow')
                    }else{
                        alert('Az e-mail küldése sikertelen!')
                    }
                }else{
                        objDiv.innerHTML = response;
						alert(response)
                }
                //alert(response)
                DigiMail();
             }
             }
function getHTTPObject(){
         if (window.ActiveXObject) return new ActiveXObject("Microsoft.XMLHTTP");
         else if (window.XMLHttpRequest) return new XMLHttpRequest();
         else {
            alert("Your browser does not support AJAX.");
            return null;
         }
}
function SetCalkulatorText(){
    document.getElementById('munka_kiegdijak[]').innerHTML =""
    document.getElementById('munka_anyag').innerHTML =""
    document.getElementById('munka_tabla').innerHTML =""
    document.getElementById('munka_minoseg').innerHTML =""
    document.getElementById('InstallElement').innerHTML=""
    allCatset = document.getElementById('ajaxDiv')
    TcatText = allCatset.getElementsByTagName('select')
    Tcatdiv = allCatset.getElementsByTagName('div')
    document.getElementById('InstallElement').innerHTML+=document.getElementById('InstallElement_select').innerHTML
    for(i=0; i<TcatText.length; i++){
        //alert(TcatText[i].innerHTML)
            document.getElementById(TcatText[i].id.replace("_select","")).innerHTML += TcatText[i].innerHTML
    }

}
function DoDigiKalk(){
    //alert('kalk')
    PAM = document.getElementById('FastCopyPM')
    FDB = document.getElementById('FastCopyDb')
    FPV = document.getElementById('FastCopyPv')
    FPT = document.getElementById('FastCopyPt')
    PriceS = document.getElementById('rightFLOAT')
    FPSZ = document.getElementById('FastCopySz')
    FPOL = document.getElementById('FastCopyOl')
    PAMvalue='';
    FMvalue='';
    FDBvalue="";
    FPSZvalue = "";
	FPVvalue = "";
	for(i=0; i<FPV.length; i++){
        if(FPV[i].selected == true){
            FPVvalue =FPV[i].value
        }
    } 
    for(i=0; i<PAM.length; i++){
        if(PAM[i].selected == true){
            PAMvalue =PAM[i].value
        }
    } 
    for(i=0; i<FPSZ.length; i++){
        if(FPSZ[i].selected == true){
            FPSZvalue =FPSZ[i].value
        }
    }
    for(i=0; i<FPOL.length; i++){
        if(FPOL[i].selected == true){
            FPOLvalue =FPOL[i].value
        }
    }
    DBV = parseInt(FDB.value)
    if(DBV>0 && DBV<50){
        FMvalue=1
    }else if(DBV>=50 && DBV<100){
        FMvalue=2
    }else if(DBV>=100 && DBV<500){
        FMvalue=3
    }else if(DBV>=500){
        FMvalue=4
    }
    //alert(FMvalue)
    httpObject = null;
    link = "main.php?DigiPress=true&A="+PAMvalue+"&M="+FMvalue+"&Sz="+FPSZvalue+"&O="+FPOLvalue+"&DB="+DBV+"&PV="+FPVvalue;
    //alert(link)
    httpObject = getHTTPObject();
    if (httpObject != null) {
        httpObject.open("GET", link , true);
        httpObject.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");
        httpObject.setRequestHeader('User-Agent',"XHR User-Agent Override");
        httpObject.onreadystatechange = SetDigiPrice;
        httpObject.send(null);
    }
    DoDigiMous();
}
function DoDigiMous(){
    //alert('ok')
    PAM = document.getElementById('FastCopyPM')
    FDB = document.getElementById('FastCopyDb')
    FPV = document.getElementById('FastCopyPv')
    FPT = document.getElementById('FastCopyPt')
    FPSZ = document.getElementById('FastCopySz')
    FPOL = document.getElementById('FastCopyOl')
    PAM.onchange = function(){
        DoDigiKalk();
    }
    FPV.onchange = function(){
        DoDigiKalk();
    }
    FPT.onchange = function(){
       // DoDigiKalk();
    }
    FPSZ.onchange = function(){
        DoDigiKalk();
    }
    FPOL.onchange = function(){
        DoDigiKalk();
    }
    FDB.onkeyup = function(){
        DoDigiKalk();
    }
}
function DigiMail(){
    DIgiMailerBut = document.getElementById('DigiPost')
    DIgiMailerBut.onclick = function(){
        PAM = document.getElementById('FastCopyPM')
        FDB = document.getElementById('FastCopyDb')
        FPV = document.getElementById('FastCopyPv')
        FPT = document.getElementById('FastCopyPt')
        PriceS = document.getElementById('rightFLOAT')
        FPSZ = document.getElementById('FastCopySz')
        FPOL = document.getElementById('FastCopyOl')
        PAMvalue=''
        FMvalue=''
        FDBvalue=""
        FPSZvalue = ""
        FPVvalue=""
        FPTvalue=""
        for(i=0; i<PAM.length; i++){
            if(PAM[i].selected == true){
                PAMvalue =PAM[i].value
            }
        }
        for(i=0; i<FPSZ.length; i++){
            if(FPSZ[i].selected == true){
                FPSZvalue =FPSZ[i].value
            }
        }
        for(i=0; i<FPOL.length; i++){
            if(FPOL[i].selected == true){
                FPOLvalue =FPOL[i].value
            }
        }
        for(i=0; i<FPV.length; i++){
            if(FPV[i].selected == true){
                FPVvalue =FPV[i].value
            }
        }
        for(i=0; i<FPT.length; i++){
            if(FPT[i].selected == true){
                FPTvalue =FPT[i].value
            }
        }
        DBV = parseInt(FDB.value)
        if(DBV>0 && DBV<50){
            FMvalue=1
        }else if(DBV>=50 && DBV<100){
            FMvalue=2
        }else if(DBV>=100 && DBV<500){
            FMvalue=3
        }else if(DBV>=500){
            FMvalue=4
        }
        //alert(FMvalue)
        //alert(FPV)
        if(document.getElementById('FastCopyEmail').value!="" && FPV.value!="" && DBV!=0 && FMvalue!=""){
        httpObject = null;
        link = "main.php?DigiMail=true&A="+PAMvalue+"&PV="+FPVvalue+"&M="+FMvalue+"&Sz="+FPSZvalue+"&O="+FPOLvalue+"&DB="+DBV+"&AR="+document.getElementById('bill2').innerHTML+"&Email="+document.getElementById('FastCopyEmail').value+"&PV="+FPVvalue+"&PT="+FPTvalue;
        //alert(link)
        httpObject = getHTTPObject();
        if (httpObject != null) {
            httpObject.open("GET", link , true);
            httpObject.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");
            httpObject.setRequestHeader('User-Agent',"XHR User-Agent Override");
            httpObject.onreadystatechange = SetDigiPrice;
            httpObject.send(null);
        }
    }else{
        if(document.getElementById('LoginError').innerHTML.search('Bejelentkezve!')==-1){
        document.getElementById('LoginError').innerHTML="<p>Kérjük töltse ki az összes mezőt!</p>"
        $('#LoginError').show('slow')
        $('#LoginError').show('slow').delay(5000).hide('slow')
        }else{
            alert('Kérjük töltse ki az összes mezőt!')
        }
    }
    }
}

//"history.go(0);" onbeforeunload="history.go(0)"
window.onload = function(){
    DoPosition();
    DoKalkulator();
    if(location.hash==""){
        window.location.hash="page=szolgaltatasok"
    }
}


/*window.onunload = function(){
    history.go(0);
}
window.onbeforeunload=function(){history.go(0)}*/
