//<input type="submit" value="Submit" onclick="this.disabled=true" >
var _maxad_id=0;
var _minad_id=0;

function menu_onmousedown(what)
	{
	return	;
	what.style.background='#8693AA';
	what.style.borderTop ='1px solid #495468';
	what.style.borderLeft ='1px solid #495468';
	what.style.borderBottom ='1px solid #ffffff';
	what.style.borderRight ='1px solid #ffffff';
	}
function TopbarMouseOver(what,b_name)
	{
	what.style.background='#316AC5';
	what.style.borderRight ='1px solid #316AC5';
	what.style.color='#FFFFFF';
	what.style.fontWeight=100;
	var objtop=what.offsetTop;
	var objleft=what.offsetLeft;
	while(what=what.offsetParent)
		{
		objtop+=what.offsetTop;
		objleft+=what.offsetLeft;
		}
	var divobj=document.getElementById(b_name);
	divobj.style.left=objleft+ "px";
	divobj.style.top=objtop+24+"px";
	divobj.style.display="";
	divobj.style.visibility="visible";

	if(b_name=='SiteSearchDIV')
		{
		document.searchform.elements['searchkeywords'].focus();
		document.searchform.elements['searchkeywords'].select();
		}
	
	}
function TopbarMouseOut(what,b_name)
	{
	what.style.background='';
	what.style.borderRight ='0px solid #EFEFEF';
	what.style.color='';
	what.style.fontWeight='normal';
	var divobj=document.getElementById(b_name);
	divobj.style.visibility="";
	divobj.style.display="none";
	}

function TextAdsMouseOver(what)
	{
	var objtop=what.offsetTop;
	var objleft=what.offsetLeft;
	var objwidth=what.offsetWidth;
	var objheight=what.offsetHeight;
	what.style.border='1px solid #79858C';
	what.style.background='#ffffff';

	while(what=what.offsetParent)
		{
		objtop+=what.offsetTop;
		objleft+=what.offsetLeft;
		}
	if(document.getElementById("TextAdsList").innerHTML=='')
		{
		var TextMenus = $('roll_TextMenus').getElementsByTagName('div');
		var roll_Text_num=TextMenus.length;
		var td_style=' style="border-bottom :1px dotted #666666;padding-top :10px;padding-bottom :10px"';
		var TextAdsHTML='<TABLE width="475" border="0" cellspacing="0">';
		for(var i=1; i<roll_Text_num; i++)
			{
			TextAdsHTML=TextAdsHTML+'<tr onMouseOver="javascript:this.style.background=\'#EFEFEF\' " onMouseOut="javascript:this.style.background=\'\'" ondblclick="javascript:roll_Text_i='+(i-1)+';roll_Text(1);"><td width="35"  align="center"'+td_style+'><i>&nbsp;'+i+'&nbsp;</i></td><td align="left" '+td_style+'>';
			TextAdsHTML=TextAdsHTML+''+document.getElementById("roll_TextMenu"+i).innerHTML;
			TextAdsHTML=TextAdsHTML+'</td><td width="100" align="center" '+td_style+'>'+document.getElementById("roll_TextImgMin"+i).innerHTML;
			}
		TextAdsHTML=TextAdsHTML+'</td></tr></table>';
		document.getElementById("TextAdsList").innerHTML=TextAdsHTML;
		}

	var divobj=document.getElementById('LINE_DIV');
	if(window.XMLHttpRequest)
		{
		divobj.style.left=objleft+ "px";
		divobj.style.width=objwidth-1+"px";
		}
	else
		{
		divobj.style.left=objleft+1+ "px";
		divobj.style.width=objwidth+"px";
		}
	divobj.style.top=objtop+23+"px";
	divobj.style.display="";
	divobj.style.visibility="visible";

	var divobj=document.getElementById('TextAdsDIV');
	if(window.XMLHttpRequest)
		divobj.style.left=objleft-1+ "px";
	else
		divobj.style.left=objleft+ "px";
	divobj.style.top=objtop+24+"px";
	divobj.style.display="";
	divobj.style.visibility="visible";
	document.getElementById("TextAdsIMG").src="./images/laba.gif";
	}
function TextAdsMouseOut(what)
	{
	var divobj=document.getElementById('LINE_DIV');
	divobj.style.visibility="";
	divobj.style.display="none";

	what.style.border='';
	what.style.background='';
	var divobj=document.getElementById('TextAdsDIV');
	divobj.style.visibility="";
	divobj.style.display="none";
	document.getElementById("TextAdsIMG").src="./images/alt.gif";
	}

function MenuMouseOver(what,b_name)
	{
	var item_obj=document.getElementById(b_name);
	if(item_obj.style.width=='10px')
		{
		document.getElementById('swap_tab').style.display='';
		document.getElementById('swap_tab').style.visibility="visible";
		document.getElementById('swap_tab_TD').innerHTML=item_obj.innerHTML;
		var wd=document.getElementById('swap_tab_TD').offsetWidth;
		document.getElementById('swap_tab_TD').innerHTML='';
		document.getElementById('swap_tab').style.display='none';
		if(wd<120)
			{
			wd=120;
			}
		document.getElementById(b_name+'_item').style.width=wd+'px';
		item_obj.style.width=null;
		}
	what.style.background='#316AC5';
	what.style.borderRight ='1px solid #0F5381';
	what.style.fontWeight='100';
	what.style.color='#FFFFFF';
	var objtop=what.offsetTop;
	var objleft=what.offsetLeft;
	while(what=what.offsetParent)
		{
		objtop+=what.offsetTop;
		objleft+=what.offsetLeft;
		}
	var divobj=document.getElementById(b_name);
	divobj.style.left=objleft+ "px";
	divobj.style.top=objtop+28+"px";
	divobj.style.display="";
	divobj.style.visibility="visible";
	}
function MenuMouseOut(what,b_name)
	{
	what.style.background='';
	what.style.borderRight ='0px solid #EFEFEF';
	what.style.fontWeight='normal';
	what.style.color='';
	var divobj=document.getElementById(b_name);
	divobj.style.visibility="";
	divobj.style.display="none";
	}

function MenuItemMouseOver(what)
	{
	if(_use_Browser=='Fire')
		{
		what.style.width='auto';
		}
	what.style.background='#316AC5';
	what.style.fontWeight=100;
	what.style.color='#FFFFFF';
	}
function MenuItemMouseOut(what)
	{
	what.style.background='';
	what.style.color='#575757';
	what.style.fontWeight='normal';
	}

String.prototype.Tlength = function()
	{
	var arr=this.match(/[^\x00-\xff]/ig);
	return this.length+(arr==null?0:arr.length);
	}

function OpenLink(urls)
	{
	window.open(url,'my_win');
	}

var http_request=false;
var http_ajax_obj='';
function Ajax(http_url,obj,send_string)
	{
	//初始化，指定處理函數，發送請求的函數
	if(obj==undefined)
		{
		obj='';
		}
	if(obj!='')
		{
		document.getElementById(obj).innerHTML="請稍候，數據正在讀取中...";
		}
	http_ajax_obj=obj;
	http_request=false;
	//開始初始化XMLHttpRequest對象
	if(window.XMLHttpRequest)
		{//Mozilla瀏覽器
		http_request=new XMLHttpRequest();
		if(http_request.overrideMimeType)
			{//設置MIME類別
			http_request.overrideMimeType("text/xml");
			}
		}
	else if(window.ActiveXObject)
		{//IE瀏覽器
		try
			{
			http_request=new ActiveXObject("Msxml2.XMLHttp");
			}
		catch(e)
			{
			try
				{
				http_request=new ActiveXobject("Microsoft.XMLHttp");
				}
			catch(e)
				{
				http_request=false;
				}
			}
		}
	if(!http_request)
		{
		//異常，創建對象實例失敗
		window.alert("創建XMLHttp對象失敗！");
		return false;
		}
	http_request.onreadystatechange=processrequest
	//確定發送請求方式，URL，及是否同步執行下段代碼
	if(send_string==undefined)
		{
		http_request.open("GET",http_url,true);
		http_request.send(null);
		}
	else
		{
		http_request.open("POST",http_url,true);
		http_request.setrequestheader("cache-control","no-cache");
		http_request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		//傳遞參數
		http_request.send(send_string);
		}
	}
//處理返回信息的函數
document.write("<DIV id=\"main_ajax\" style=\"display:none;\"></DIV>");
function processrequest()
	{
	if(http_request.readyState==4)
		{//判斷對象狀態
		if(http_request.status==200)
			{//信息已成功返回，開始處理信息
			if(http_ajax_obj=='')
				{
				http_ajax_obj='main_ajax';
				//alert(http_ajax_obj);
				}
			document.getElementById(http_ajax_obj).innerHTML=http_request.responseText;
			}
		else
			{//頁面不正常
			//alert("您所請求的頁面不正常！");
			}
		}
	}
/* $id('id') document.getElementById('id')*/
//Ajax("at.php");
function $id()
	{
	var elements = new Array();
	for (var i = 0; i < arguments.length; i++)
		{
		var element = arguments[i];
		if (typeof element == 'string')
			element = document.getElementById(element);
		if (arguments.length == 1)
			return element;
		elements.push(element);
		}
	return elements;
	}


function addCookie()
	{
	if (document.all)
		{
		window.external.addFavorite(website_http,website_name);
		}
	else if (window.sidebar)
		{
		window.sidebar.addPanel(website_name, website_http,"");
		}
	}
function setHomepage()
	{
	if (document.all)
		{
		document.body.style.behavior='url(#default#homepage)';
		document.body.setHomePage(website_http);
		}
	else if (window.sidebar)
		{
		if(window.netscape)
			{
			 try
				{
				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
				}
			 catch (e)
				{
				alert( "該操作被瀏覽器拒絕，如果想啟用該功能，請在地址欄內輸入 about:config，然後將項 signed.applets.codebase_principal_support 值改為true！" );
				}
			}
		var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
		prefs.setCharPref('browser.startup.homepage',website_http);
		}
	}



