// JavaScript Document



var agt=navigator.userAgent.toLowerCase();
var ie = false
var ffShadowOffset = 0;
var lastLinkId="about";

if (agt.indexOf("msie")>-1)  ie = true;


if (!ie){
		
		ffShadowOffset = 0;
	
	}




function init(){

	//return;

	//var canvas  = alertSize()[1]-140-5;
	
	//document.getElementById("mainCanvas").style.height = canvas + "px";
	
	//shadowAttach();
	
	//placeLogo();
	
	//placeLinks();
	
	//overAction(document.getElementById(currentId + "-lnk"));
	
	//attachElement()
	
	setMrque();
	
}


function setMrque(){

		if (page=="index.asp"){
			
			document.getElementById("indexNews1").innerHTML = document.getElementById("INDEX_NEWS").innerHTML;
		}

}



function attachElement(){

		var ip = document.getElementById("bottomElement");
		var obj = new Obj_rectangle(document.getElementById("bottomTD"))
		ip.style.top = obj.ObjTop - 120 + "px";
		ip.style.left = obj.ObjLeft  + "px";
		ip.style.visibility = "visible";
}

function hideElement(){

		var ip = document.getElementById("bottomElement");
		ip.style.visibility = "visible";
	
}

function fadeElement(){

		var ip = document.getElementById("bottomElement");
		ip.filters.alpha.opacity = 30;
		ip.style.opacity = .3;
	
}



function resizeEvent(){

	ffShadowOffset = 0;

	//shadowAttach();
	
	//placeLogo();
	
	//placeLinks();
	
	//iTravelerPhoto();
}


function placeLinks(){

var obj = new Obj_rectangle(document.getElementById("topRightImage"))
var floatLayer = document.getElementById("floatLayer").style;
floatLayer.top=obj.ObjBottom  + 45 + "px";
floatLayer.left=obj.ObjLeft  + "px";
floatLayer.visibility="visible";

}



//left and right shadow attach
function shadowAttach(){

	var obj = new Obj_rectangle(document.getElementById("topImage"))
	var leftShadow = document.getElementById("leftShadow").style;
	leftShadow.top=obj.ObjTop + "px";
	leftShadow.left=obj.ObjLeft -8 + ffShadowOffset  + "px";

	var obj = new Obj_rectangle(document.getElementById("mainTable"))
	var leftShadow = document.getElementById("leftShadowTable").style;
	leftShadow.height=obj.ObjHeight + "px";
	
	//--------------------------------------
	
	var obj = new Obj_rectangle(document.getElementById("topRightImage"))
	var rightShadow = document.getElementById("rightShadow").style;
	rightShadow.top=obj.ObjTop + "px";
	rightShadow.left=obj.ObjRight + ffShadowOffset + "px";

	var obj = new Obj_rectangle(document.getElementById("mainTable"))
	var rightShadow = document.getElementById("rightShadowTable").style;
	rightShadow.height=obj.ObjHeight + "px";
	
}




function placeLogo(){
	
	var obj = new Obj_rectangle(document.getElementById("topRightImage"))
	document.getElementById("logoSpan").style.left = obj.ObjRight - 50 + "px";
	document.getElementById("logoSpan").style.top = "5px";
		
	document.getElementById("logoSpan").style.display = "block";
}


function lnkOver(obj){

	var id = obj.id.split("-")[0];

	if (id!=currentId) {

		overAction(obj)
		
	}
	else{
		
	}
}

function overAction(obj){
	
	var id = obj.id.split("-")[0];
	document.getElementById(id+"-tdLnk").style.backgroundColor="#00A6A8";
	
	//obj.style.textDecoration = 'underline';

}

function lnkOut(obj){

	var id = obj.id.split("-")[0];

	if (id!=currentId) {
		
		mouseOutAction(obj);
	}
	
}


function mouseOutAction(obj){
	
	var id = obj.id.split("-")[0];
	document.getElementById(id+"-tdLnk").style.backgroundColor="";
	
	//obj.style.textDecoration = 'none';
}


function Obj_rectangle(Obj)
{
	if (! Obj){return;};

	this.ObjLeft = findOffset(Obj, "offsetLeft");
	this.ObjWidth = Obj.offsetWidth;
	this.ObjRight = this.ObjLeft + this.ObjWidth;
	this.ObjTop = findOffset(Obj, "offsetTop");
	this.ObjHeight = Obj.offsetHeight;
	this.ObjBottom = this.ObjTop + this.ObjHeight;

	function findOffset(Obj, offset)
	{
		var NumValue = 0;
		
		var startOffsetDom = Obj;

		while (startOffsetDom.offsetParent)
		{
			NumValue = NumValue + startOffsetDom[offset];
			startOffsetDom = startOffsetDom.offsetParent;
		}
		return NumValue;
	}
}



    function alertSize() {
      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] 
    } 