	function mainLoader(linkName){
    setInterval(function() { updateClock(); }, 500);
	headerTextBgset(updateClock(),linkName);
	}
	window.onresize= resizeWindow; 
	
	function updateClock()
	{
  	var currentTime = new Date ( );

  	var currentHours = currentTime.getHours ( );
  	var currentMinutes = currentTime.getMinutes ( );
  	var currentSeconds = currentTime.getSeconds ( );

  	// Pad the minutes and seconds with leading zeros, if required
  	currentHours = ( currentHours < 10 ? "0" : "" ) + currentHours;
  	currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;
  	currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;

  	// Choose either "AM" or "PM" as appropriate
  	//var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM";

  	// Convert the hours component to 12-hour format if needed
  	//currentHours = ( currentHours > 12 ) ? currentHours - 12 : currentHours;

  	// Convert an hours component of "0" to "12"
  	currentHours = ( currentHours == 0 ) ? 12 : currentHours;

  	// Compose the string for display
  	var currentTimeString = currentHours + ":" + currentMinutes + ":" + currentSeconds ;

  	// Update the time display
  	document.getElementById("clock").innerHTML= currentTimeString;
	return currentHours;
	}
	
	function GetHour()
	{
  	var currentTime = new Date ( );

  	var currentHours = currentTime.getHours ( );
  	var currentMinutes = currentTime.getMinutes ( );
  	var currentSeconds = currentTime.getSeconds ( );

  	// Pad the minutes and seconds with leading zeros, if required
  	currentHours = ( currentHours < 10 ? "0" : "" ) + currentHours;
  	currentMinutes = ( currentMinutes < 10 ? "0" : "" ) + currentMinutes;
  	currentSeconds = ( currentSeconds < 10 ? "0" : "" ) + currentSeconds;

  	// Choose either "AM" or "PM" as appropriate
  	//var timeOfDay = ( currentHours < 12 ) ? "AM" : "PM";

  	// Convert the hours component to 12-hour format if needed
  	//currentHours = ( currentHours > 12 ) ? currentHours - 12 : currentHours;

  	// Convert an hours component of "0" to "12"
  	currentHours = ( currentHours == 0 ) ? 12 : currentHours;

  	// Compose the string for display
  	var currentTimeString = currentHours + ":" + currentMinutes + ":" + currentSeconds ;

  	// Update the time display
  	//document.getElementById("clock").innerHTML= currentTimeString;
	return currentHours;
	}
	
	function headerTextBgset(hour,linkName){
		if(hour >= 8 && hour < 16){
		document.getElementById("body").style.backgroundImage = "url('/Front-end/public/img/layout_img/bg_sets/"+linkName+"/"+linkName+"_am.jpg')";
		document.getElementById("header").style.backgroundImage = "url('/Front-end/public/img/layout_img/bg_header.png')";
		document.getElementById("header_text").innerHTML= "We are busy working at the moment...";
		document.getElementById("clock").style.color ="black";
		document.getElementById("clock").style.left =124 +"px";
        document.getElementById("language").style.color ="black";
		document.getElementById("hu").style.color ="black";
        document.getElementById("de").style.color ="black";
        document.getElementById("en").style.color ="black";
		document.getElementById("header_text").style.color ="black";
		document.getElementById("header_text").style.left = 15	+"px";
		document.getElementById("header_text").style.width = 181+"px";
		}else{
		document.getElementById("body").style.backgroundImage = "url('/Front-end/public/img/layout_img/bg_sets/"+linkName+"/"+linkName+"_pm.jpg')";
		document.getElementById("header").style.backgroundImage = "url('/Front-end/public/img/layout_img/bg_header_pm.png')";
		document.getElementById("clock").style.color ="white";
		document.getElementById("clock").style.left =124 +"px";
		document.getElementById("header_text").style.color ="white";
        document.getElementById("language").style.color ="white";
		document.getElementById("hu").style.color ="white";
        document.getElementById("de").style.color ="white";
        document.getElementById("en").style.color ="white";
		document.getElementById("header_text").style.left = 35	+"px";
		document.getElementById("header_text").style.width = 160+"px";
		document.getElementById("header_text").innerHTML= "We are sleeping at the moment...";
		}
	}
	
	
	function resizeWindow() { 
  	var logo = document.getElementById('logo');
  	var header = document.getElementById('header');
  	var w = 0;
	var h = 0;

	//IE
	if(!window.innerWidth)
	{
		//strict mode
		if(!(document.documentElement.clientWidth == 0))
		{
			w = document.documentElement.clientWidth;
			h = document.documentElement.clientHeight;
		}
		//quirks mode
		else
		{
			w = document.body.clientWidth;
			h = document.body.clientHeight;
		}
	}
	//w3c
	else
	{
		w = window.innerWidth;
		h = window.innerHeight;
	}
  
	logo.style.position="relative";
	logo.style.left=w-123+"px";
	logo.style.top=h-133+"px";
	
	header.style.position="relative";
	header.style.left=w-197+"px";
	} 
