//index page tools
function init() {
	var d=document.location.search;
	if(d!='')top.frames["content_frame"].document.location.href=d.substring(d.lastIndexOf('?')+1,d.length);
	createMusic('wrapper_music', 'music', 'music', '/w2/player/playlist.xml', 'true');
	contentSize();
}

//content tools
	function contentSize() {
	  var myWidth = 0, myHeight = 0;
	  if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	  }
	  
	  myHeight -= 202;
	  document.getElementById('content').style.height = myHeight + 'px';
	  document.getElementById('ContentRight').style.height = myHeight + 'px';
	
	}


//menu tools
var time = 3000;
var numofitems = 6;

//menu constructor
function menu(allitems,thisitem,startstate){ 
  callname= "gl"+thisitem;
  divname="subglobal"+thisitem;  
	this.numberofmenuitems = allitems;
	this.caller = document.getElementById(callname);
	this.thediv = document.getElementById(divname);
	this.thediv.style.visibility = startstate;
	
	//opera Netscape 6 Netscape 4x Mozilla 
	if (window.innerWidth || window.innerHeight){ 
	docwidth = window.innerWidth; 
	} 
	//IE Mozilla 
	if (document.body.clientWidth || document.body.clientHeight){ 
	docwidth = document.body.clientWidth; 
	}	
	

}
				 
//menu methods
function ehandler(event,theobj){
  for (var i=1; i<= theobj.numberofmenuitems; i++){
	  var shutdiv =eval( "menuitem"+i+".thediv");
    shutdiv.style.visibility="hidden";
	}
	theobj.thediv.style.visibility="visible";
}
				
function closesubnav(event){
  if ((event.clientY <107)||(event.clientY > 180)){
    for (var i=1; i<= numofitems; i++){
      var shutdiv =eval('menuitem'+i+'.thediv');
			shutdiv.style.visibility='hidden';
		}  
	}
}

//iframe tools
// resizes Iframe according to content
function resizeConcerts(obj){ 
docHeight = concerts.document.body.scrollHeight;
obj.style.height = docHeight + 'px';
 } 
 
function resizeNews(obj){ 
docHeight = news.document.body.scrollHeight;
obj.style.height = docHeight + 'px';
 }
 
function resizeContent(obj){ 
obj.style.height = '1px';
docHeight = content_frame.document.body.scrollHeight;
if (docHeight < 500) docHeight = 500;
obj.style.height = docHeight + 'px';
 } 
 
//player tools
function deletePlayer(theWrapper, thePlaceholder, thePlayerId) { 
    swfobject.removeSWF(thePlayerId);
    var tmp=document.getElementById(theWrapper);
    if (tmp) { tmp.innerHTML = "<div id=" + thePlaceholder + "></div>"; }
}

function createVideo(theWrapper, thePlaceholder, thePlayerId, theFile, theStart) { 
	deletePlayer(theWrapper, thePlaceholder, thePlayerId);

	var flashvars = {
		file:theFile, 
		autostart:theStart,
		playlist:"right",
		playlistsize:"320",
		repeat:"true",
		skin:"player/schoon.swf",
		lightcolor:"0xFF9900",
		backcolor:"0xffffff",
		frontcolor:"#999999",
		screencolor:"#FFCC80"
	}

	var params = {
		allowfullscreen:"true", 
		allowscriptaccess:"always"
	}

	var attributes = {
		id:thePlayerId,  
		name:thePlayerId
	}

	swfobject.embedSWF("/w2/player/player.swf", thePlaceholder, "715", "350", "9.0.115", false, flashvars, params, attributes);
}

function createSlideShow(theWrapper, thePlaceholder, thePlayerId, theFile, theStart) { 
	deletePlayer(theWrapper, thePlaceholder, thePlayerId);

	var flashvars = {
		file:theFile, 
		autostart:theStart,
		width:"350",
		height:"263",
		usefullscreen:"false",
		backcolor:"0xFFCC80",
		screencolor:"0xffffff"
	}

	var params = {
		bgcolor:"#ffffff",
		allowfullscreen:"true", 
		allowscriptaccess:"always"
	}

	var attributes = {
		id:thePlayerId,  
		name:thePlayerId
	}

	swfobject.embedSWF("/w2/slideshow/imagerotator.swf", thePlaceholder, "350", "283", "9.0.115", false, flashvars, params, attributes);
}

function createMusic(theWrapper, thePlaceholder, thePlayerId, theFile, theStart) { 
	deletePlayer(theWrapper, thePlaceholder, thePlayerId);

	var flashvars = {
		file:theFile, 
		autostart:theStart,
		repeat:"always",
		skin:"/w2/player/schoon.swf",
		shuffle:"true"
	}

	var params = {
		allowfullscreen:"false", 
		allowscriptaccess:"always",
		wmode:"opaque"
	}

	var attributes = {
		id:thePlayerId,  
		name:thePlayerId
	}

	swfobject.embedSWF("/w2/player/player.swf", thePlaceholder, "258", "38", "9.0.115", false, flashvars, params, attributes);
}

WEBAUDIT=function() {
    
  this.WACID=null;
  this.WACIDName="WACID";
  
  
  this.getCookie=function(name)  {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++)
    {
            var c = ca[i];
            while (c.charAt(0)==' ') c = c.substring(1,c.length);
            if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
  }
  
  this.setCookie=function(name,value,topDomain) {
    var date = new Date(2020,12,31,23,59,59);
    var expires = "; expires="+date.toGMTString();
    document.cookie = name+"="+value+expires+"; path=/; domain=" + topDomain;  
  }
  
  this.generateID=function(splitter) {
    var sp=(splitter) ? splitter : 'A';
    var now=new Date();
    return Date.parse(now.toGMTString()) + sp + Math.floor(Math.random()*1000000000);
  }
  
  this.getTopDomain=function(fullDomain) {
    var darabok=fullDomain.split('.');
    return darabok[(darabok.length-2)] + '.' + darabok[(darabok.length-1)];
  }
  
  this.getDomain=function(url) {
    var urlDarabok=url.split('/');
    return urlDarabok[2];
  }
  
  this.WACID=this.getCookie(this.WACIDName);
}

var wa=new WEBAUDIT();
var felbontas = "";
var same =  Math.floor(Math.random()*1000000);

if(wa.WACID==null)
{
  wa.WACID=wa.generateID('A');
  wa.setCookie(wa.WACIDName,wa.WACID,wa.getTopDomain(wa.getDomain(document.URL)));
}

same = same + "@welid=" + wa.WACID;
if(screen) felbontas='@felbontas='+screen.width+'x'+screen.height;
same = same + felbontas;

