window.onload=function() {
	changePos();
}
function changeItem(item){
menuItem = item;
}
function loadContent2(){
if(menuLastItem != menuItem){
	for(i=0; (a = document.getElementsByTagName("script")[i]); i++) {
		if(a.getAttribute("id") == "loadScript") {
			var index = i;
			alert(a);
			}
			/*alert(a.style.height);*/
		}
a.src = 'functions.php?';
menuLastItem = menuItem;
}
setTimeout('loadContent2()',10);
}
function removeScript(){
  var scriptTag = document.getElementById('loadScript');
  alert(scriptTag);
  if(scriptTag != null){
  			alert(scriptTag);
   		document.body.removeChild(scriptTag);
  }
}


function loadTest(){
if(menuLastItem != menuItem){
	for(i=0; (a = document.getElementsByTagName("div")[i]); i++) {
		if(a.getAttribute("id") == "home") {
			var index = i;
			}
			/*alert(a.style.heightvar oj = document.createTextNode(menuItem) ;);*/
		}
    
    var oj = document.createTextNode(menuItem) ;
    document.getElementsByTagName('div').item(index).appendChild(oj) ;   
    menuLastItem = menuItem;
}
	 setTimeout('loadTest()',10);
}




function changeSrc(srcName) {
	for(i=0; (a = document.getElementsByTagName("script")[i]); i++) {
		if(a.getAttribute("id") == "maindiv") {
		   a.setAttribute("src", srcName);
		   
		}
	}
}

function scrollZ() {
window.scrollTo(0,0);
}
function changeVis(id) {
var leftLeft = 0;
var leftWidth = 0;
var leftHeight = 0;
var pageTop = 0;
var Left;

window.scrollTo(0,0);

for(i=0; (a = document.getElementsByTagName("div")[i]); i++) {
		if(a.getAttribute("class") == "left") {
			leftLeft += a.offsetLeft;
			leftWidth += a.offsetWidth;
			a.style.top = 0 + "px";
			leftHeight += a.offsetHeight;
			/*a.style.position = "relative";
			a.style.top = 0 + "px";
			Left = a;*/
		}
		if(a.getAttribute("id") == "page") {
			pageTop += a.offsetTop;
		}
}
	for(i=0; (a = document.getElementsByTagName("div")[i]); i++) {
		if(a.getAttribute("class") == "main2") {
			/*a.style.visibility="hidden";*/
			a.style.height="auto";
			gh = a.offsetHeight;
			a.style.left = leftLeft + leftWidth + "px";
			a.style.top = pageTop + "px";

		}
		if(a.getAttribute("id") == "page") {
			/*a.style.height = 50000+"px";*/
			/*document.getElementById(id).height = "auto";*/
			/*alert(a.style.height);*/
			if(document.getElementById(id).offsetHeight > leftHeight) {
				a.style.height = document.getElementById(id).offsetHeight + 40 + "px";
			}else{
				a.style.height = leftHeight + 40 + "px";
			}
			/*alert(a.style.height);*/
		}
	}
document.getElementById(id).style.visibility="visible";
/*Left.style.position = "fixed";*/
}
function changePos(){
	
if (window.innerHeight)
{
  pos = window.pageYOffset
}
else if (document.documentElement && document.documentElement.scrollTop)
{
pos = document.documentElement.scrollTop
}
else if (document.body)
{
  pos = document.body.scrollTop
}
for(i=0; (a = document.getElementsByTagName("div")[i]); i++) {
		if(a.getAttribute("class") == "left") {
			a.style.top = pos + "px";			
		}
}
	temp = setTimeout('changePos()',10);
}

function setActiveStyleSheet(title) {
   var i, a, main;
   for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
     if(a.getAttribute("rel").indexOf("style") != -1
        && a.getAttribute("title")) {
       /*a.disabled = true;*/
       if(a.getAttribute("title") == title) a.disabled = false;
     }
   }
}
function setInActiveStyleSheet(title) {
   var i, a, main;
   for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
     if(a.getAttribute("rel").indexOf("style") != -1
        && a.getAttribute("title")) {
       /*a.disabled = true;*/
       if(a.getAttribute("title") == title) a.disabled = true;
     }
   }
}
function setInActiveAllStyleSheet() {
   var i, a, main;
   for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
     if(a.getAttribute("rel").indexOf("style") != -1) {
       a.disabled = true;
     }
   }
}

function replace(string,text,by) {
// Replaces text with by in string
    var strLength = string.length, txtLength = text.length;
    if ((strLength == 0) || (txtLength == 0)) return string;

    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return string;
    if (i == -1) return string;

    var newstr = string.substring(0,i) + by;

    if (i+txtLength < strLength)
        newstr += replace(string.substring(i+txtLength,strLength),text,by);

    return newstr;
}


function getElement(e)
{
  if(document.all) return document.all[e];
  else return document.getElementById(e);
}

function pmnu(mnu_id)
{
      getElement("sub").innerHTML = mnu[mnu_id];
}


var intg;
var PocetMenu = 0;

function hidemenus(exc)
{
 clearInterval(intg);
 intg = null;
 for (id=1; id<=PocetMenu; id++){
  document.all("mnui"+id).style.visibility = "hidden";
  document.all("i"+id).style.color = "#FFFFFF";
  document.all("i"+id).style.backgroundColor = "#444444";

 }
}

function outobject()
{
 intg = setInterval("hidemenus(20)",400);
}

function onheader(hID)
{
 hidemenus(hID);
 document.all("mnui"+hID).style.visibility = "visible";
 document.all("i"+hID).style.color = "#000";

}
 var mnu = new Array();
mnu[1] = '';
mnu[2] = '';
mnu[3] = '';
mnu[4] = '';
mnu[5] = '';
mnu[6] = '';
mnu[7] = '';
mnu[8] = '';
mnu[9] = '';
mnu[10] = '';
mnu[11] = '';
mnu[12] = '';

