﻿function switchImg(obj,par){
	if(document.getElementById(obj))
		obj=document.getElementById(obj);
	imgName=obj.src;
	imgName=imgName.split("/");
	imgName=imgName[(imgName.length)-1];
	imgPath=obj.src.split(imgName);
	imgPath=imgPath[0];
	imgName=imgName.split(".");
	imgSuffix=imgName[1];
	imgName=imgName[0];
	if(par==1)
		imgName=imgName+"_over."+imgSuffix;
	else{
		imgName=imgName.split("_");
		imgName=imgName[0]+"."+imgSuffix;
	}
	obj.src=imgPath+imgName;
}

function findPosition(obj){
	x=0; y=0; w=0; h=0; var el,temp;
	el=getE(obj);
	if(el.offsetParent){
		temp=el;
		while(temp.offsetParent){
			temp=temp.offsetParent; 
			x+=temp.offsetLeft;
			y+=temp.offsetTop;
		}
	}
	x+=el.offsetLeft;
	y+=el.offsetTop;
	w=el.offsetWidth;
	h=el.offsetHeight;
	return [x,y,w,h];
}

function extLinks(){ 
	if(!document.getElementsByTagName)
		return; 
	var anchors=document.getElementsByTagName("a"); 
	for(var i=0;i<anchors.length;i++)				
		if(anchors[i].getAttribute("href")&&anchors[i].getAttribute("rel")) 
			anchors[i].target=anchors[i].getAttribute("rel");
}

function bookmark(title,url){
	if(document.all)
		window.external.AddFavorite(url,title);
	else if(window.sidebar)
		window.sidebar.addPanel(title,url,"")
}

function getE(obj){
	return document.getElementById(obj);	
}

function getEe(e){
	return e?e.target:window.event.srcElement;
}

function showE(obj,par){
	if(typeof(obj)=="string")
		obj=getE(obj);
	if(par==1)
		obj.style.display=obj.style.display=="block"?"none":"block";
	else
		obj.style.display="block";	
}

function hideE(obj){
	if(typeof(obj)=="string")
		obj=getE(obj);
	obj.style.display="none";	
}

var wm=null;



onload=function(){
	menu_onload();
	extLinks();
	if(wm)webmin_init();
};

/*  */
function showMenu(obj){
	el=obj.nextSibling;
	el.className=el.className=="off"?"on":"off";
}