// JavaScript Document


//funciton for homepage
function doResize(){
	var winInHt=window.innerHeight? window.innerHeight : Math.max(document.body.clientHeight, document.documentElement.clientHeight)
	//alert(winInHt);
	var maxHeight=680;

	if(winInHt>maxHeight){ 
		table_height=maxHeight; 
	}else{ 
		table_height=winInHt; 
	}
	
	table_height-=90;
	document.getElementById('m_container').style.height=table_height; 
	document.getElementById('l_container').style.height=table_height; 
	document.getElementById('r_container').style.height=table_height; 
	document.getElementById('home_global_intro_id').style.top=table_height - 87 - 120; 
}

//for all additional further pages
function doResizeAll(){
	var winInHt=window.innerHeight? window.innerHeight : Math.max(document.body.clientHeight, document.documentElement.clientHeight)
	//alert(winInHt);
	var maxHeight=700;
	var minHeight=585;
	
	if(winInHt>maxHeight){ 
		table_height=maxHeight; 
	}else if(winInHt<minHeight){
		table_height=minHeight; 
	}else{ 
		table_height=winInHt; 
	}
	
	table_height-=90;
	document.getElementById('m_container').style.height=table_height; 
	document.getElementById('l_container_about').style.height="100%"; 
	document.getElementById('r_container_about').style.height="100%"; 
	document.getElementById('scroll_contain_id').style.height=table_height - 110; 
}


var hide_id;//variable for showing and hiding the sub menus

function callHideAll()
{
	hide_id=setInterval("hideAll()", 800);
}
function hideAll()
{
	MM_showHideLayers('mnu_1','','hide','mnu_2','','hide','mnu_3','','hide','mnu_4','','hide');
}

function timeOut() 
{
	clearTimeout(hide_id);
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

$(function(){
  $('#navbar>li').hover(
    function(){
      if ($('body.home').length) {
        $('#navbar').removeClass('nobg');
      }
    },
    function(){
      if ($('body.home').length) {
        $('#navbar').addClass('nobg');
      }
    }
  );
});

 function unhide(divID) {
 var item = document.getElementById(divID);
 if (item) {
 item.className=(item.className=='hidden')?'unhidden':'hidden';
 }
 }

