var topmenu = {
	
		move_step:"",
		overelement:"",

		over: function(obj)
		{
			imgChange("menuimg"+obj,documentRoot+"web/design/topmenurow.gif");
			if(document.getElementById(this.hideelement) && this.hideelement!=obj) { document.getElementById(this.hideelement).style.display = "none"; clearTimeout(this.move_step); }
			if(document.getElementById(obj)) { document.getElementById(obj).style.display = "block"; this.overelement = obj; }
		},
		out: function(obj)
		{
			imgChange("menuimg"+obj,documentRoot+"web/design/x.gif");
			this.hideelement = obj;
			this.move_step = setTimeout("topmenu.hide()",1000);
		},
		layerout:function(obj)
		{
			document.getElementById(obj).style.display = "none"; clearTimeout(this.move_step);
		},
		show: function(obj)
		{
			document.getElementById(obj).style.display = "block"; this.hideelement = "";
		},
		hide: function()
		{
			if(document.getElementById(this.hideelement)) { document.getElementById(this.hideelement).style.display = "none"; this.overelement = ""; this.hideelement = ""; clearTimeout(this.move_step); }
		}
}

var menu = {
	


		over: function(obj)
		{
			styleChange(obj+"td","selected menuitem");
		},
		out: function(obj)
		{
			styleChange(obj+"td","menuitem");
		}

}




var contentsupdate = {

	linkstart:'<p class="dot">',
	linkstartend:'<p class="nodot">',
	linkend:"&nbsp;&raquo;</p>",
	dotlinkstart:'<p class="dot"><b>&middot;&nbsp;</b>',
	dotlinkstartend:'<p class="nodot"><b>&middot;&nbsp;</b>',
	dotlinkend:"<b>&nbsp;&raquo;</b></p>",

	start:function()
	{
		this.linkbox(); 
		this.picttitle();
		this.pictlead();
    	this.regform();
		this.errortext();
    this.username();
	},

	linkbox:function() 
	{
		var content = document.getElementsByTagName("A");

		for (var i=0; i<content.length; i++) 
		{
			if(content[i].className == "linklist") { var cnt = content[i].innerHTML; content[i].innerHTML = this.dotlinkstart + cnt + this.dotlinkend; }
			if(content[i].className == "linklistend") { var cnt = content[i].innerHTML; content[i].innerHTML = this.dotlinkstartend + cnt + this.dotlinkend; }
			if(content[i].className == "framelinklist") { var cnt = content[i].innerHTML; content[i].innerHTML = this.linkstart + cnt + this.linkend; }
			if(content[i].className == "framelinklistend") { var cnt = content[i].innerHTML; content[i].innerHTML = this.linkstartend + cnt + this.linkend; }
		}
	},
	picttitle:function() 
	{
		var content = document.getElementsByTagName("IMG");

		for (var i=0; i<content.length; i++) 
		{
			if(content[i].className == "cikkkepfelugro")
			{
				var pictid = "pictid"+i;
				var picttitle = content[i].title;
				content[i].id=pictid;

				Imagesrc = $('img#'+pictid).attr("src");
				Imagestyle = $('img#'+pictid).attr("style");
 				Imagetitle = $('img#'+pictid).attr("title");
 				Imagewidth = $('img#'+pictid).attr("width");
 				$('img#'+pictid).removeAttr("style");
 				$('img#'+pictid).wrapAll('<a href="'+Imagesrc+'" class="cikkkepfelugro" style="'+Imagestyle+' width:'+Imagewidth+'px;" title="'+Imagetitle+'"></a>');
 				$('img#'+pictid).after('<div class="kepala">'+picttitle+'</div>');
			}
			if(content[i].className == "cikkkepkepala")
			{
				var pictid = "pictid"+i;
				var picttitle = content[i].title;
				content[i].id=pictid;

				Imagesrc = $('img#'+pictid).attr("src");
				Imagestyle = $('img#'+pictid).attr("style");
 				Imagetitle = $('img#'+pictid).attr("title");
 				Imagewidth = $('img#'+pictid).attr("width");
 				$('img#'+pictid).removeAttr("style");
 				$('img#'+pictid).after('<div class="kepala">'+picttitle+'</div>');
			}
		}
	},
	pictlead:function()
	{
 		var content = document.getElementsByTagName("IMG");	

		for (var i=0; i<content.length; i++) 
		{
			if(content[i].className == "leadkep") 
			{ 
				var pictid = "leadpictid"+i; 
				var picttitle = content[i].title; 
				content[i].id=pictid; 

				$('img#'+pictid).wrapAll('<div class="leadkep shadow"></div>');
			}
		}
	},
  regform:function()
  {
    if(hirlevelid != undefined && hirlevelnev != undefined)
    {
      if(document.getElementById('hirlevelek'))
      {
        for(i=0; i < hirlevelid.length; i++)
        {
          html = document.getElementById('hirlevelek').innerHTML;
            document.getElementById('hirlevelek').innerHTML = html + '<input type="checkbox" name="hirlevel[]" value="'+hirlevelid[i]+'"> ' + hirlevelnev[i] + "<br>";
        }
      }
    }
  },
	errortext:function()
	{
		if(errorid != 'none')
			document.getElementById('error'+errorid).innerHTML = errortext;
	},
	username:function()
	{
		  if(document.getElementById('username'))
		  	document.getElementById('username').innerHTML = "Üdvözöljük " + username + "!";
	}
}



$(document).ready(function(){
	
	$('ul.sf-menu').superfish({autoArrows: false, delay:600 });
  $('ul.sf-topmenu').superfish({autoArrows: false, delay:300 });
		
	/*$("#sliderFlash").easySlider({
		prevId: 'FlashprevBtn',
		nextId: 'FlashnextBtn',	
			prevText: 		'',
			nextText: 		'',
		controlsShow: true,
		controlsFade: true,
		speed: 800,
		auto: false,
		continuous: false
	});*/

			$("#sliderFlash").easySliderLoop({
						prevId: 'FlashprevBtn',
		nextId: 'FlashnextBtn',	
			prevText: 		'',
			nextText: 		'',
		controlsShow: true,
		controlsFade: true,
					loop: true,                           // Looping
	 				orientation: 'fade',                  // Fading
	 				autoplayDuration: 6000,               // Autoplay with 1 second intervals
					restartDuration: 2500,                // In case of user interaction, restart the autoplay after 2.5 seconds
					auto: true,
					continuous: true
			});
	
	if($('ul.sf-aloldalmenu')) { $('ul.sf-aloldalmenu').superfish(); }

 	contentsupdate.start();

	$().piroBox({
			my_speed: 400, //animation speed
			bg_alpha: 0.3, //background opacity
			slideShow : true, // true == slideshow on, false == slideshow off
			slideSpeed : 4, //slideshow duration in seconds(3 to 6 Recommended)
			close_all : '.piro_close,.piro_overlay'// add class .piro_overlay(with comma)if you want overlay click close piroBox

	});

});




function checkreg()
{
    var formit = document.registration;

    if(formit.username.value == "" || formit.email.value == "" || formit.name.value == "" || formit.business.value == "" || formit.phone.value == "" || formit.password.value == "")
    {
      alert("A *-gal jelzett mezők kitöltése kötelező!");
      return false;
    }
    else
    {
      return true;
    }
}



function sLoad()
{
  document.login.S.value = S;
  return true;
}


