  jQuery.extend({
	  getUrlVars: function(){
	    var vars = [], hash;
	    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
	    for(var i = 0; i < hashes.length; i++)
	    {
	      hash = hashes[i].split('=');
	      vars.push(hash[0]);
	      vars[hash[0]] = hash[1];
	    }
	    return vars;
	  },
	  getUrlVar: function(name){
	    return $.getUrlVars()[name];
	  }
	});


	jQuery(document).ready( function() {
		jQuery("div.scrollable").scrollable({size:1,loop:true}).autoscroll({autoplay: true, interval: 3000 });
		jQuery("div.scrollable2").scrollable({size:1,loop:true});
		jQuery("a[rel='refs']").colorbox({ slideshow:false, height: "560px", });
		var active_url = jQuery.getUrlVar('page');
		jQuery(".menu ."+active_url+" a").addClass("aktiv");
		jQuery(".reklamdekoracio").click(
			function(){
					console.log("click 1");
					document.location = "?page=dekoracio";

			}
				);
		jQuery(".kiallitas").click(
				function(){

						document.location = "?page=megoldasok";

				}
					);

	});



    function showImage(oImg, bVisible)
    {
      if (bVisible) oImg.src="pics/" + oImg.id + ".jpg";
      else oImg.src="pics/null.gif";
    }
    function goPage(cPage)
    {
      if (cPage == "") location.href = "index.php";
      else location.href = "index.php?page=" + cPage;
    }

    function clearBox()
    {
      if (document.getElementById("codeCheck").value.length > 8)
      {
        document.getElementById("codeCheck").value = "";
        document.getElementById("codeCheck").maxLength = 8;
      }
    }

    function checkTextLength(oTextarea, nMax)
    {
      if (oTextarea.value.length > nMax)
      {
        alert('A szöveg mérete elérte a megengedett maximális karakterszámot!');
        oTextarea.value = oTextarea.value.slice(0, nMax);
        return false;
      }
    }

    function trim(str)
    {
       return str.replace(/^\s*|\s*$/g,"");
    }

    function ajanlo()
    {
     document.getElementById("frmAjanl").submit();
    }

    function getPopup(cUrl)
    {
      window.open(cUrl, "egyediPopUp", "menu=0,toolbar=0,left=100,top=100,width=660,height=500" );
    }
