function winPU4P(picfile, title, w, h, scroll) {
  var winl = (screen.width - w) / 2;
  var wint = (screen.height - h) / 2;
  winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll
  win = window.open(picfile, title, winprops)
  win.document.open('text/html');
  win.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
  win.document.write('<html><head><title>' + title + '</title></head><body bgcolor="#FFFFFF" style="margin: 0; padding: 0">');
  win.document.write('<img src="' + picfile + '" alt="picture" border="0" />');
  win.document.write('</body></html>');
  win.document.close();
}

function winPU4F(file, title, w, h, scroll) {
  var winl = (screen.width - w) / 2;
  var wint = (screen.height - h) / 2;
  winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll
  window.open(file, title, winprops)
}

function closeWin() {
  window.close()
}

function delSearchStr() {
/*  var string = document.getElementsByName("k")[0].value*/
  //onlineboltok.hu
  var onlineboltokSearcher_1 = document.getElementsByClassName('input_search')[0].value
  var onlineboltokSearcher_2 = document.getElementsByClassName('input_search')[2].value

  //onlineboltok.hu
  document.getElementsByClassName('input_search')[0].value = onlineboltokSearcher_1.replace(onlineboltokSearcher_1,"")
  document.getElementsByClassName('input_search')[2].value = onlineboltokSearcher_2.replace(onlineboltokSearcher_2,"")
}

function delGoogleSearchStr() {
  //google.hu
  var onlineboltokGoogleSearcher_1 = document.getElementsByClassName('input_search')[1].value
  var onlineboltokGoogleSearcher_2 = document.getElementsByClassName('input_search')[3].value

  //google.hu
  document.getElementsByClassName('input_search')[1].value = onlineboltokGoogleSearcher_1.replace(onlineboltokGoogleSearcher_1,"")
  document.getElementsByClassName('input_search')[3].value = onlineboltokGoogleSearcher_2.replace(onlineboltokGoogleSearcher_2,"")
}

function goBack() {
  window.history.back()
}

function changeVisibilityOnError() {
  var valid = true;
  var elements_id = ["la_href", "la_cat", "la_mail", "la_name", "la_code"];
  for (var i in elements_id) {
     if (document.getElementById(elements_id[i] + "_id").value == '') {
        document.getElementById(elements_id[i]+ "_span").style.visibility = "visible";
        document.getElementById("la_mainError").style.visibility = "visible";
        valid = false;
     } else {
        document.getElementById(elements_id[i] + "_span").style.visibility = "hidden";
        document.getElementById("la_mainError").style.visibility = "hidden";
     }
  }
  if (valid)
     return true;
  else
     return false;
}

function getFocus(id) {
    document.getElementById(id).focus()
}

function checkOption(value) {
  if (value == 1) {
    document.getElementById('optionOne').style.visibility = "visible";
    document.getElementById('optionOneSubmit').style.visibility = "visible";
    document.getElementById('optionTwoSubmit').style.visibility = "hidden";
  } else {
    document.getElementById('optionOne').style.visibility = "hidden";
    document.getElementById('optionTwoSubmit').style.visibility = "visible";
    document.getElementById('optionOneSubmit').style.visibility = "hidden";
  }
}

function inputBoxOnError() {
    if (document.getElementById('optionOne').style.visibility == "visible") {
        var valid = true;
        var errormsg = "";
        var elements_id = ["regPartnerName", "regCity", "regAddress", "regZipCode"];
        if (document.getElementById(elements_id[0]).value == '') {
           errormsg += "- Nem töltötte ki a név mezőt.\n";
           valid = false;
        }
        if (document.getElementById(elements_id[1]).value == '') {
           errormsg += "- A város mező üresen maradt.\n";
           valid = false;
        }
        if (document.getElementById(elements_id[2]).value == '') {
           errormsg += "- Nem adott meg utcát/házszámot.\n";
           valid = false;
        }
        if (document.getElementById(elements_id[3]).value == '') {
           errormsg += "- Kérem adja meg az irányítószámát.";
           valid = false;
        }
        if (errormsg != "") {
            alert(errormsg)
        }
        if (valid)
           return true;
        else
           return false;
    }
}

function checkOptionAtShopReg(value) {
  if (value == 1) {
    document.getElementById('ifChecked').style.visibility = "hidden";
  } else {
    document.getElementById('ifChecked').style.visibility = "visible";
  }
}

function checkOptionDomainShopReg(value) {
  if (value == 0) {
    document.getElementById('fileUploadTR').style.visibility = "hidden";
  } else {
    document.getElementById('fileUploadTR').style.visibility = "visible";
  }
}

function checkOptionUrlReg(value) {
  if (value >= 1) {
    document.getElementById('ifUrlChecked').style.visibility = "hidden";
  } else {
    document.getElementById('ifUrlChecked').style.visibility = "visible";
  }
}

function inputBoxOnErrorAtShopReg() {
    if (document.getElementById('optionOne').style.visibility == "visible") {
        var valid = true;
        var errormsg = "";
        var elements_id = ["sr_city2", "sr_address2", "sr_zipCode2"];
        if (document.getElementById(elements_id[0]).value == '') {
           errormsg += "- A város mező üresen maradt.\n";
           valid = false;
        }
        if (document.getElementById(elements_id[1]).value == '') {
           errormsg += "- Nem adott meg utcát/házszámot.\n";
           valid = false;
        }
        if (document.getElementById(elements_id[2]).value == '') {
           errormsg += "- Kérem adja meg az irányítószámát.";
           valid = false;
        }
        if (errormsg != "") {
            alert(errormsg)
        }
        if (valid)
           return true;
        else
           return false;
    }
}

function CreateBookmarkLink(url, title) {
	if (window.sidebar) {
		window.sidebar.addPanel(title, url, "");
	} else if (window.external) {
		window.external.AddFavorite(url, title);
    } else if (window.opera && window.print) {
		return true;
	}
}

function imgChange(source) {
    var firstPic = source.firstChild;
    var secondPic = source.firstChild.nextSibling;

    firstPic.style.visibility = "hidden";
    secondPic.style.visibility = "visible";
}

function imgChangeBack(source) {
    var firstPic = source.firstChild;
    var secondPic = source.firstChild.nextSibling;

    firstPic.style.visibility = "visible";
    secondPic.style.visibility = "hidden";
}

function activeLink(source) {
    if (document.getElementById('menu') != null) {
        var menuAnchors = document.getElementById('menu').getElementsByTagName('a');

        for (var i = 0; i < menuAnchors.length; i++) {
            if (source == menuAnchors[i].href) {
                menuAnchors[i].className='menuActive';
                menuAnchors[i].firstChild.style.visibility = "hidden";
                menuAnchors[i].firstChild.nextSibling.style.visibility = "visible";
            }
        }
    }
}

/***********************************************
* Disable Text Selection script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

function disableSelection(target) {
    if (typeof target.onselectstart!="undefined") //IE route
    	target.onselectstart=function(){return false}
    else if (typeof target.style.MozUserSelect!="undefined") //Firefox route
    	target.style.MozUserSelect="none"
    else //All other route (ie: Opera)
    	target.onmousedown=function(){return false}
    target.style.cursor = "default"
}

/*
//Disable right click script III- By Renigade (renigade@mediaone.net)
//For full source code, visit http://www.dynamicdrive.com

var message="";
///////////////////////////////////
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")*/

function newsletterInputBoxOnError() {
    var valid = true;
    var errormsg = "";
    var elements_id = ["newsletterTop", "newsletterMail"];
    if (document.getElementById(elements_id[0]).value == '') {
        errormsg += "- Nem töltötte ki a keresztnév mezőt.\n";
        valid = false;
    }
    if (document.getElementById(elements_id[1]).value == '') {
        errormsg += "- Hiányzó e-mail cím.\n";
        valid = false;
    }
    if (errormsg != "") {
        alert(errormsg)
    }
    if (valid)
        return true;
    else
        return false;
}

function newNewsletterInputBoxOnError() {
    var valid = true;
    var errormsg = "";
    var elements_id = ["newsletterTopTwo", "newsletterMailTwo"];
    if (document.getElementById(elements_id[0]).value == '') {
        errormsg += "- Nem töltötte ki a keresztnév mezőt.\n";
        valid = false;
    }
    if (document.getElementById(elements_id[1]).value == '') {
        errormsg += "- Hiányzó e-mail cím.\n";
        valid = false;
    }
    if (errormsg != "") {
        alert(errormsg)
    }
    if (valid)
        return true;
    else
        return false;
}

function toGoogleSearchbar() {
    if (document.getElementById('catName') != null) {
        var catName = document.getElementById('catName').innerHTML
        var onlineboltokGoogleSearcher_1 = document.getElementsByClassName('input_search')[1].value
        var onlineboltokGoogleSearcher_2 = document.getElementsByClassName('input_search')[3].value

        document.getElementsByClassName('input_search')[1].value = onlineboltokGoogleSearcher_1.replace(onlineboltokGoogleSearcher_1, catName)
        document.getElementsByClassName('input_search')[3].value = onlineboltokGoogleSearcher_2.replace(onlineboltokGoogleSearcher_2, catName)
    }

    if (document.getElementById('noHit') != null) {
        var noHit = document.getElementById('noHit').innerHTML
        var onlineboltokGoogleSearcher_1 = document.getElementsByClassName('input_search')[1].value
        var onlineboltokGoogleSearcher_2 = document.getElementsByClassName('input_search')[3].value

        document.getElementsByClassName('input_search')[1].value = onlineboltokGoogleSearcher_1.replace(onlineboltokGoogleSearcher_1, noHit)
        document.getElementsByClassName('input_search')[3].value = onlineboltokGoogleSearcher_2.replace(onlineboltokGoogleSearcher_2, noHit)
        document.getElementsByClassName('googleForm')[0].submit()
    }
}

function noHitPForGoogleDisplay() {
    document.getElementById('noHitPForGoogle').style.display = "block"
}

function scrollit_r21(seed){
          var msg="ONLINEBOLTOK.HU TÖBB MINT 2000 WEBÁRUHÁZ 1 HELYEN! SPÓROLJON IDŐT ÉS PÉNZT! A JÖVŐ MÁR JELEN VAN! "
          var out = " ";
          var c    = 1;
          if (seed > 100)  {
                    seed--;
                    var cmd="scrollit_r21(" + seed + ") ";
                    timerTwo=window.setTimeout(cmd, 200) ;
          }
          else if (seed <= 100 && seed > 0)  {
                    for (c=0 ; c < seed ; c++) {
                              out+=" ";
                    }
                    out+=msg;
                    seed--;
                    var cmd="scrollit_r21(" + seed + ") ";
                              window.status=out;
                    timerTwo=window.setTimeout(cmd, 200);
          }
          else if (seed <= 0) {
                    if (-seed < msg.length) {
                              out+=msg.substring(-seed,msg.length);
                              seed--;
                              var cmd="scrollit_r21(" + seed + ")";
                              window.status=out;
                              timerTwo=window.setTimeout(cmd, 200) ;
                    }
                    else  {
                              window.status=" ";
                              timerTwo=window.setTimeout("scrollit_r21(100)",75);
                    }
          }
}

function morePartnerDetails(value) {
  if (value == 1) {
    document.getElementById('option_1').style.display = "block";
    document.getElementById('option_2').style.display = "none";
    document.getElementById('partnerKompi').style.display = "none";
    document.getElementById('footer_first_page').style.display = "none";
  } else {
    document.getElementById('option_1').style.display = "none";
    document.getElementById('option_2').style.display = "block";
    document.getElementById('partnerKompi').style.display = "none";
    document.getElementById('footer_first_page').style.display = "none";
  }
}
