// JavaScript Document


function tabC(numId, totIdx) {
	var lilength = document.getElementById("litabs");
	var tabsE = lilength.getElementsByTagName("li");
	for (i=0;i<totIdx;i++) {
		//document.getElementsByTagName("li")[i].id = "";
		tabsE[i].id = "";
		document.getElementById("li" + i).style.display = "none";
	}
	//document.getElementsByTagName("li")[numId].id = "current";
	tabsE[numId].id = "current";
	document.getElementById("li" + numId).style.display = "";
}

function cont(idDiv, dispDiv, totDiv) {
	/*for (i=0;i<totDiv;i++) {
		document.getElementById(idDiv + i).style.display = "none";
	}*/
	if (document.getElementById(idDiv + dispDiv).style.display == "") {
		document.getElementById(idDiv + dispDiv).style.display = "none";
		document.getElementById(idDiv + "img" + dispDiv).src = "/images/fold-plus.jpg";
	} else {
		document.getElementById(idDiv + dispDiv).style.display = "";
		document.getElementById(idDiv + "img" + dispDiv).src = "/images/fold-minus.jpg";
	}
}

function goSearch() {
	var docs = document.search;
	alert (docs.txtSearch.value);
}

function showHides(boxC1, boxC2, boxO, imgId) {
	var boxContBox = document.getElementById(boxC1);
	var boxCont = document.getElementById(boxC2);
	var imgArrw = document.getElementById(imgId);
	var bWidth = document.body.clientWidth;
	var bHeight = document.body.clientHeight;
	var bLeft = document.body.clientLeft;
	
	var leftTop = findPos(imgArrw);
		
	boxContBox.style.height = boxCont.offsetHeight + "px";
	boxContBox.style.top = leftTop[1] + 35 + "px"; //(bHeight / 3) + (boxO * banner) + "px";
	boxContBox.style.left = leftTop[0] + 40 + "px"; //(bWidth / 2) + 120 + "px";
	boxContBox.style.visibility = 'visible';
}

function hideShows(boxC1) {
	var boxContBox = document.getElementById(boxC1);
	boxContBox.style.height = "0px";
	boxContBox.style.visibility = 'hidden';
}

function ketShow(boxC1, boxC2, boxO, imgId) {
	var boxContBox = document.getElementById(boxC1);
	var boxCont = document.getElementById(boxC2);
	var imgArrw = document.getElementById(imgId);
	var leftTop = findPos(imgArrw);
	
	boxContBox.style.height = boxCont.offsetHeight + "px";
	boxContBox.style.top = leftTop[1] + 30 + "px";
	boxContBox.style.left = leftTop[0] + 40 + "px";
	boxContBox.style.visibility = 'visible';
}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
	}
	var posObj = new Array();
	posObj[0] = curleft;
	posObj[1] = curtop;
	//return [curleft,curtop];
	return posObj;
}

function pageWidth() {return window.innerWidth != null? window.innerWidth : document.documentElement && document.documentElement.clientWidth ?       document.documentElement.clientWidth : document.body != null ? document.body.clientWidth : null;} 

function pageHeight() {return  window.innerHeight != null? window.innerHeight : document.documentElement && document.documentElement.clientHeight ?  document.documentElement.clientHeight : document.body != null? document.body.clientHeight : null;} 

function posLeft() {return typeof window.pageXOffset != 'undefined' ? window.pageXOffset :document.documentElement && document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ? document.body.scrollLeft : 0;} 

function posTop() {return typeof window.pageYOffset != 'undefined' ?  window.pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ? document.body.scrollTop : 0;} 
		 
function posRight() {return posLeft()+pageWidth();} function posBottom() {return posTop()+pageHeight();}

