// navigation config
// -----------------
var howmanymenus = 5; // 0=1 1=2 2=3 etc
var menunames = new Array(howmanymenus);
menunames[0] = "navMenu1";
menunames[1] = "navMenu2";
menunames[2] = "navMenu3";
menunames[3] = "navMenu4";
menunames[4] = "navMenu5";
menunames[5] = "navMenu6";

//widths of navbar menu headers
var navwidth = new Array(howmanymenus);
navwidth[0] = 60;
navwidth[1] = 125;
navwidth[2] = 125;
navwidth[3] = 125;
navwidth[4] = 125;
navwidth[5] = 125;

var cellpad=0;
var effectopen = 0; //set to -1 for no effects
var effectclose = 0; //set to -1 for no effects
var buttonwidth = 0; //how wide is each menu Item
var buttonheight = 0; //how high is each menu Item
var menudir ="hor"; //horizontal or vert   use "hor" or "ver"



function resizeWindow()
{
	var bottomBorder = 25;

	// get size of the page and of some elements
	var  y_used = document.body.scrollHeight;    // used height
	
	if(window.innerHeight)
	{	// Mozilla, Opera
		y_possible = window.innerHeight;
		y_used += 1;
	}
	else if(document.body.parentNode.offsetHeight)
	{	// Internet Explorer
		// y_possible = document.body.offsetHeight;  //  possible height
		y_possible = document.body.parentNode.offsetHeight;  //  possible height
		y_used += 2;
		y_possible -= 3;
	}
	
	if(y_used < (y_possible))
		y = y_possible;	//  with scrollbars
	else
		y = y_used;	//  content fits in screen
	
	// here we change the sizes of the elements
	// this works only with classes in safari!!!!!


	var height_navigation=document.getElementById('navigation').offsetHeight	// hoehe navigation
	var height_frontLogo=document.getElementById('frontLogo').offsetHeight	// hoehe frontBlog
	var height_frontBlog=document.getElementById('frontBlog').offsetHeight	// hoehe frontBlog
	var height_contentFront=document.getElementById('contentFront').offsetHeight	// hoehe contentFront
	var height_frontBoxTable=document.getElementById('frontBoxTable').offsetHeight	// hoehe frontBoxTable

	var height_frontBlog = height_contentFront - height_frontLogo - height_frontBoxTable - bottomBorder;	// hoehe von frontBlog

	changeCssAttrib('#frontBlog', 'height', height_frontBlog + "px", 0 );
}



function changeCssAttrib(cssElement, attribute, value,valueTop)
{
// thx to www.shanolson.net for assisting with this function. :)
	usedStyles = document.styleSheets;
	var cssList    = 0;
	var safariName = cssElement;
	
	if(cssElement.substring(0,1) == "#")
	{  //  this is needed for safari
		safariName = "*[ID\"" + cssElement.substring(1) + "\"]";
	}
	
	if(usedStyles)
	{  //  ie, mozilla
		if(usedStyles[0]['rules'])
		{  //  different way for different browsers  (IE)
			cssList = 'rules';
		}
		else if(usedStyles[0]['cssRules'])
		{  //  (Mozilla)
			cssList = 'cssRules';
		}
		
		for( i=0; i<usedStyles.length; i++)
		{  //  walk through all loaded files
			theCSS = usedStyles[i][cssList];
			for(j=0;j<theCSS.length;j++){  //  content of all styles
				if(theCSS[j].selectorText == cssElement || theCSS[j].selectorText == safariName)
				{  //  get the desired element
					theCSS[j].style[attribute] = value;
				}
			}
		}
		//document.getElementById('footer').style['top'] = valueTop-10 + "px";
	}
	else
	{  //  opera
		name = cssElement.substring(1);
		if(cssElement.substring(0,1) == "#")
		{
			elem = document.getElementById(name);
			elem.style[attribute] = value;
		}
		else
		{
			elems = document.getElementsByTagName("div");
			for(i=0;i<elems.length;i++)
			{
				if(elems[i].getAttribute("class") == name)
				{
					elems[i].style[attribute] = value;
				}
			}
		}
	}
}
