/*
var IE = document.all?true:false;
var tempX =0;
var tempY =0;
function getMouseXY(e) {
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft
    tempY = event.clientY + document.body.scrollTop
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY  
  return true
}*/
var gbTo;
function Goback()
{
var minx = getOffset(document.getElementById("dolphincontainer")).left;
var miny = getOffset(document.getElementById("dolphincontainer")).top;
if (screen.width > 1024)
	minx = minx - (screen.width-1024);
var maxx = minx + 1024;
var maxy = miny + 65;
if(curGX < minx || curGX > maxx || curGY < miny || curGY > maxy){
	dolphintabs.init("dolphinnav",curSelect);
	clearTimeout(gbTo);
	//alert("minx:" + minx + "miny:" + miny + "maxx:" + maxx + "maxy:" + maxy + "CurX:" + curGX + "CurY:" + curY);
}
else{
	clearTimeout(gbTo);
	gbTo=setTimeout("Goback()",3000);	
}
}
function getOffset( el ) {
    var _x = 0;
    var _y = 0;
    while( el && !isNaN( el.offsetLeft ) && !isNaN( el.offsetTop ) ) {
        _x += el.offsetLeft - el.scrollLeft;
        _y += el.offsetTop - el.scrollTop;
        el = el.parentNode;
    }
    return { top: _y, left: _x };
}

//===================================================
var dolphintabs={
	subcontainers:[], last_accessed_tab:null,

	revealsubmenu:function(curtabref){
	this.hideallsubs()
	if (this.last_accessed_tab!=null)
		this.last_accessed_tab.className=""
	if (curtabref.getAttribute("rel")) //If there's a sub menu defined for this tab item, show it
	document.getElementById(curtabref.getAttribute("rel")).style.display="block"
	curtabref.className="current"
	this.last_accessed_tab=curtabref
	},

	hideallsubs:function(){
	for (var i=0; i<this.subcontainers.length; i++)
		document.getElementById(this.subcontainers[i]).style.display="none"
	},
	
	init:function(menuId, selectedIndex){
	var tabItems=document.getElementById(menuId).getElementsByTagName("a")
		for (var i=0; i<tabItems.length; i++){
			if (tabItems[i].getAttribute("rel"))
				this.subcontainers[this.subcontainers.length]=tabItems[i].getAttribute("rel") //store id of submenu div of tab menu item
			if (i==selectedIndex){ //if this tab item should be selected by default
				tabItems[i].className="current"
				this.revealsubmenu(tabItems[i])
			}
			else
				if(i==1)
					tabItems[i].className="divHotItem";
		tabItems[i].onmouseover=function(){
		dolphintabs.revealsubmenu(this)
		}
		} //END FOR LOOP
	}
}
function setIframeHeight() {
	  //var iframeWin = window.frames[iframeName];
	  var iframeName = "FrameVideo3D";
	  var iframeEl = document.getElementById? document.getElementById(iframeName): document.all? document.all[iframeName]: null;
	  if (iframeEl) {
	      iframeEl.style.height = "auto"; // helps resize (for some) if new doc shorter than previous
	      //var docHt = getDocHeight(iframeWin.document);
	      // need to add to height to be sure it will all show
	      var h = alertSize();
	      var new_h = (h-1);
	      iframeEl.style.height = new_h + "px";
	      //alertSize();
	  }
}

function alertSize() {
  var myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
  }
  //window.alert( 'Height = ' + myHeight );
  return myHeight;
}
function LoadLTD()
{
	document.getElementById("divLTD").style.display="block";
	document.getElementById("divKQ").style.display="none";
}
function LoadKQ()
{
	document.getElementById("divKQ").style.display="block";
	document.getElementById("divLTD").style.display="none";
}




