// JavaScript Document
function $(id){return document.getElementById(id);}
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;

function BodyOnLoad()
{
	var elements = document.getElementsByTagName("H1");
	for ( var i = 0; i < elements.length; i++ )
	{
		if ( elements[i].parentNode.className == "b_t" )
		{
			if (window.navigator.userAgent.indexOf("MSIE")>=1) 
			{ 
				elements[i].style.cursor = "hand";
					elements[i].onclick= function(){
						 HiddenIEUL();
						var ul = this.nextSibling;
						ul.className = ( ul.className=="d_n") ? "" : "d_n";
						var img = this.firstChild;
						var indexSrc = img.src.substring(0, img.src.indexOf(".gif") -1);
						img.src = indexSrc + (( ul.className=="d_n") ? "1.gif" : "2.gif");
						}
			}
			else if(window.navigator.userAgent.indexOf("Firefox")>=1) 
			{ 
				elements[i].style.cursor = "pointer";
					elements[i].onclick= function(){
						HiddenFFUL();
						var ul = this.nextSibling.nextSibling;
						var className = ( ul.getAttribute("class")=="d_n") ? "" : "d_n";
						ul.setAttribute("class", className);
						var img = this.firstChild;
						var indexSrc = img.src.substring(0, img.src.indexOf(".gif") -1);
						img.src = indexSrc + (( ul.className=="d_n") ? "1.gif" : "2.gif");
				}
			}
		}
	}
}

function HiddenIEUL()
{
	var elements = document.getElementsByTagName("H1");
	for ( var i = 0; i < elements.length; i++ )
	{
		var ul = elements[i].nextSibling;
		ul.className = "d_n";
		var img = elements[i].firstChild;
		var indexSrc = img.src.substring(0, img.src.indexOf(".gif") -1);
		img.src = indexSrc + "1.gif";
	}
}

function HiddenFFUL()
{
	var elements = document.getElementsByTagName("H1");
	for ( var i = 0; i < elements.length; i++ )
	{
		var ul = elements[i].nextSibling.nextSibling;
		ul.setAttribute("class", "d_n");
		var img = elements[i].firstChild;
		var indexSrc = img.src.substring(0, img.src.indexOf(".gif") -1);
		img.src = indexSrc + "1.gif";
	}
}
function A_OnClientClick(ele)
{
	document.getElementById("r_t").innerText =  ele.innerText;
}

function popwindows(obj,c,vs){
	$("popwindows").style.display = '';
	$("popwindows").style.left = $("wrap").offsetLeft+175+'px';
	var top=document.documentElement.scrollTop+'px'||document.body.scrollTop+'px';
	$("popwindows").style.top = $("wrap").offsetTop+47 + 'px';//top;

	$("popwindows").style.width = "215px";
	$("popwindows").style.height = "583px";
	try{
	$("popwindowsc").style.height=isIE()?'97%':'565px';
	}catch(ex){
	$("popwindowsc").style.height=isIE?'97%':'565px';
	}

	switch(obj){
		case "fax":
			window.open("/Common/Users/Login/?Action=Transfer&Target=fax&Path=http://fax.ufo007.com/transfer.asp%3ffaxTarget=l%26lang=cn%26faxto=%26faxrec=%26usernamev="+c,"popwindowsc");
			break;
		case "tofax":
			window.open("/Common/Users/Login/?Action=Transfer&Target=fax&Path=http://fax.ufo007.com/transfer.asp%3ffaxTarget=l%26lang=cn%26faxto="+c+"%26faxrec="+vs+"%26usernamev=","popwindowsc");
			break;
		case "myufo007":
			Login?window.open("/Common/Users/Login/?Action=Transfer&Target=m&Path=http://www.ufo007.com/zh-CN/Users","popwindowsc"):window.open("http://www.ufo007.com/zh-CN/Users/menu.asp","popwindowsc");
			break;
		case "gts":
			window.open("/Common/Users/Login/?Action=Transfer&Target=m&Path=http://cn.ufo007.com/index/gts.asp%3ftab="+c+"","popwindowsc");
			break;
		case "sms":
			$("popwindows").style.width = "666px";
			$("popwindows").style.height = "385px";
			try{
			$("popwindowsc").style.height=isIE()?'97%':'370px';
			}catch(ex){
			$("popwindowsc").style.height=isIE?'97%':'370px';
			}
			window.open("/Common/Users/Login/?Action=Transfer&Path=http://www.ufo007.com/sms_chat/chat/%3ftelv="+c,"popwindowsc");
			break;
		case "client-side":
			$("popwindows").style.width = "260px";
			$("popwindows").style.height = "683px";
			try{
			$("popwindowsc").style.height=isIE()?'97%':'663px';
			}catch(ex){
			$("popwindowsc").style.height=isIE?'97%':'663px';
			}
			window.open("/Common/Users/Login/?Action=Transfer&Target=m&Path=http://cn.ufo007.com/index/__img/swf/ufo007.swf","popwindowsc");
			break;
		default:
			window.open(obj, "popwindowsc");
			break;
		}
	if(!obj){
		$("popwindowsc").src="";
		$("popwindows").style.display = 'none';
	}
}