/******

******/
function setUpMenu(){
getStyleObject("menu1").position = "absolute";
getStyleObject("menu1").top = "300px";
getStyleObject("menu1").left = "20px";
}

//function sniffBrowsers() {
	var ns4 = document.layers;
	var op5 = (navigator.userAgent.indexOf("Opera 5")!=-1) ||(navigator.userAgent.indexOf("Opera/5")!=-1);
	var op6 = (navigator.userAgent.indexOf("Opera 6")!=-1) ||(navigator.userAgent.indexOf("Opera/6")!=-1);
	var agt=navigator.userAgent.toLowerCase();
	var mac = (agt.indexOf("mac")!=-1);
	var ie = (agt.indexOf("msie") != -1); 
	var mac_ie = mac && ie;
//}

function getStyleObject(objectId) {
    if(document.getElementById && document.getElementById(objectId)) {
	return document.getElementById(objectId).style;
    } else if (document.all && document.all(objectId)) {
	return document.all(objectId).style;
//    } else if (document.layers && document.layers[objectId]) {
//		return getObjNN4(document,objectId);
    } else {
	return false;
    } 
} 
function fadeBg(){
	
	document.getElementById('content').className = 'fd_on';
	/*
    if(agt.indexOf("msie") != -1)
    document.getElementById('content').filters.alpaha.opacity=40;
    else
    document.getElementById('content').style.opacity=.4;
    */
}
function notFadeBg(){
	
		document.getElementById('content').className = 'fd_off';
/*
      if(agt.indexOf("msie") != -1)
    document.getElementById('content').filters.alpaha.opacity=100;
    else
    document.getElementById('content').style.opacity=1;
    */
  
}
function moveMe(whoAmI,whereAmI){
	pos = findPos(whereAmI);
	layer2Left = eval(pos[0]) + 175;
	layer2Top = eval(pos[1]) + 0;
	getStyleObject(whoAmI).position = "absolute"
	getStyleObject(whoAmI).top = layer2Top + "px";
	getStyleObject(whoAmI).left = layer2Left + "px";
	showMe(whoAmI);
}
function moveMeTop(whoAmI,whereAmI){
	pos = findPos(whereAmI);
	layer2Left = eval(pos[0]) + 0;
	layer2Top = eval(pos[1]) + 18;
	getStyleObject(whoAmI).position = "absolute"
	getStyleObject(whoAmI).top = layer2Top + "px";
	getStyleObject(whoAmI).left = layer2Left + "px";
	showMe(whoAmI);
}
function moveMeTop2(whoAmI,whereAmI){
	pos = findPos(whereAmI);
	layer2Left = whereToGo(whereAmI,whoAmI);
	layer2Top = eval(pos[1]) + 0;
	getStyleObject(whoAmI).position = "absolute"
	getStyleObject(whoAmI).top = layer2Top + "px";
	getStyleObject(whoAmI).left = layer2Left + "px";
	showMe(whoAmI);
}
function showMe(whoAmI){
	getStyleObject(whoAmI).visibility="visible";
//	fadeBg();

	}
function hideMe(whoAmI){
	getStyleObject(whoAmI).visibility="hidden";
//	notFadeBg();
	}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	return [curleft,curtop];
	}
	else {
	    return [obj.x,obj.y];
	  }

}
function findPosY(obj) {
	var curtop = 0;
	if (obj.offsetParent) {
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curtop += obj.offsetTop
		}
	}
	return curtop;
}
function findPosX(obj) {
	var curleft  = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			}
	}
	return curleft;
}

function whereToGo(oneObj,two){
	winSize = getWinSize();
	posX = findPosX(oneObj);
	twoObj = document.getElementById(two);
	totalEnd = posX+oneObj.offsetWidth+twoObj.offsetWidth;
	leftPos = (winSize[0]>=totalEnd)?posX + oneObj.offsetWidth:posX - twoObj.offsetWidth;
	return leftPos;
}
function getWinSize() {
  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;
  }
 return  [myWidth,myHeight];
}

