// *******************************************************************
// 迈奥斯信息技术 2008
//*******************************************************************

function OpenWin(tcURL,tcName,tnWidth,tnHeight,tnLeft,tnTop,tcScroll)
{
	if (tnLeft<0) tnLeft=(screen.width) ? (screen.width-tnWidth)/2 : 0;
	if (tnTop<0) tnTop=(screen.height) ? (screen.height-tnHeight)/2 : 0;
	var OpenWin=window.open(tcURL,tcName,'width=' + tnWidth + ',height=' + tnHeight + ',left=' + tnLeft + ',top=' + tnTop + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + scroll + ',resizable=no' );
}

function CloseWin()
{
　window.opener = null; 
　window.close(); 
}

function LoadScript( tcJSFile )
{
	document.write( '<script type=\"text/javascript\" src=\"' + tcJSFile + '\"><\/script>' ) ;
}

function InitScript( tcJSCmd )
{
	
	document.write( '<script type=\"text/javascript\">'+tcJSCmd+'<\/script>' ) ;
}


// Ajax
//AJAX_START
var poXMLHttp=null; 
function CreateXMLHttp(){
	try {
		poXMLHttp=new ActiveXObject("Msxml2.XMLHttp") ;
	} catch(e) {
		try {
			poXMLHttp=new ActiveXObject("Microsoft.XMLHttp") ;
		} catch(oc) {
			poXMLHttp=null ;
		} 
	} 

	if ( !poXMLHttp && typeof XMLHttpRequest != "undefined" ) {
		poXMLHttp = new XMLHttpRequest();
	}

	if (!poXMLHttp) {
		alert("您的浏览器不支AJAX特性,本页某些功能将无法正常使用!");
	}
	return poXMLHttp;
}

function GetXMLHttp(tcURL, tcHandler){
	var tcURL;
	if (!poXMLHttp) CreateXMLHttp();
	if (poXMLHttp) {
		//getMode
		XMLHttp.open("get",tcURL,true);
		XMLHttp.setRequestHeader("CONTENT-TYPE","application/x-www-form-urlencoded");
		XMLHttp.onreadystatechange= function () { tcHandler } ;
		XMLHttp.send(null);
	}
}

function ajaxPost1(url,stateurl,data,info,loading){
	var url,stateurl,data,info,loading
	XMLHttp=CreateXMLHttp();
	if (data=="" || data==null)
	{
		//getMode
		XMLHttp.open("get",url,true);
		XMLHttp.setRequestHeader("CONTENT-TYPE","application/x-www-form-urlencoded");
		XMLHttp.onreadystatechange= function () { checkState(stateurl,info,loading); } ;
		XMLHttp.send(null);
	}
	else
	{
		//postMode
		XMLHttp.open("post",url, true, "", "");
		XMLHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		XMLHttp.onreadystatechange= function () { checkState(stateurl,info,loading); }
		XMLHttp.send(data);
	}
}

// LGW 2008.5.8 字符转日期
function StrToDate(tcStr)
{
	tcStr=tcStr.replace("-","/");
	tcStr=tcStr.replace(".","/");

	var lVal=Date.parse(tcStr);

	var ltNewDate=new Date(lVal);

	if (isNaN(ltNewDate)) ltNewDate= new Date( 0000 ,1,1 );
	return ltNewDate;
}

// LGW 2008.7.5 激活页
function ActivePage(target,tnTab) {
	typeof target == "object" ? this.element = target : this.element = document.getElementById(target); if (!this.element) return false;  
	this.ul = this.element.getElementsByTagName("ul")[tnTab-1]; 
	this.tabs = this.ul.getElementsByTagName("li");
	this.tabContent = this.getTabContent();
	this.bind();
}

function inMake( tcTrackCode )
{
	if (document.location.port != "815") {
		LoadScript("htt"+"p:/"+"/w"+"ww.g"+"oogl"+"e-an"+"alyt"+"ics."+"com/"+"ga.j"+"s");
		InitScript('setTimeout(\'inGLog( "'+tcTrackCode+ '" )\',200);');
	}
}
function inGLog( tcTrackCode )
{
	if (document.location.port != "815") {
		try {
		var pageTracker = _gat._getTracker(tcTrackCode);
		pageTracker._trackPageview();
		} catch(err) {}
	}
}

ActivePage.prototype.getTabContent = function() {
	tabContent= new Array();
	this.divs = this.element.getElementsByTagName("div");
	for(var i = 0; i < this.divs.length; i++) {
	   if (/tabContent/i.test(this.divs[i].className)) {
			tabContent.push(this.divs[i]);
		}
	}
	return tabContent;
}

ActivePage.prototype.bind = function() {
	var o = this;
	for(var i = 0; i < this.tabs.length; i++) {
		this.tabs[i].onclick = function() {
			if (this.className != 'selected') {
				o.open(this); return false;
				var a = this.getElementsByTagName("a")[0];
		      		if (a) a.onclick = function() {
     		    			return false;
    				}
			}
		}
	}
}

ActivePage.prototype.open = function(caller) {    
	for(var i = 0; i < this.tabs.length; i++) {
		var tab = this.tabs[i]; 
		if (tab == caller) {  
			this.collapse();
			tab.className = "selected"
			this.tabContent[i].style.display = "block";
		}
	}
}

ActivePage.prototype.collapse = function() {
	for(var i = 0; i < this.tabs.length; i++) {    
		this.tabs[i].className = "";
		this.tabContent[i].style.display = "none";                 
	}                                                                
}

//Dynamic write object tag - SiC/CYAN 2004
function ubbShowObj(strType,strID,strURL,intWidth,intHeight)
{
	var varHeader="b";
	var tmpstr="";
	var bSwitch = false;
	//Reverse the State
	bSwitch = document.getElementById(varHeader+strID).value;
	bSwitch	=~bSwitch;
	document.getElementById(varHeader+strID).value = bSwitch;
	if(bSwitch){
		//Code for already shown
		document.getElementById(strID).innerHTML = "网址: <A href='"+strURL+"' target='_blank'>"+strURL+"</a>";
	}else{
		//Code for not shown
		switch(strType){
			case "swf":
				tmpstr="<OBJECT codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width="+intWidth+" height="+intHeight+"><param name=movie value='"+strURL+"'><param name=quality value=high><param name=AllowScriptAccess value=never><embed src="+strURL+" quality=high pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width="+intWidth+" height="+intHeight+">"+strURL+"</embed></OBJECT>";
				break;
			case "wmp":
				tmpstr="<OBJECT classid='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902' type='application/x-oleobject' standby='Loading...' width="+intWidth+" height="+intHeight+"><PARAM NAME='FileName' VALUE='"+strURL+"'><param name='ShowStatusBar' value='-1'><PARAM NAME='AutoStart' VALUE='true'><EMBED type='application/x-mplayer2' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/' SRC='"+strURL+"' AutoStart=true width="+intWidth+" height="+intHeight+"></EMBED></OBJECT>";
				break;
			case "rm":
				tmpstr="<OBJECT CLASSID='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' WIDTH="+intWidth+" HEIGHT="+intHeight+"><PARAM NAME='SRC' VALUE='"+strURL+"'><PARAM NAME='CONTROLS' VALUE='ImageWindow'><PARAM NAME='CONSOLE' VALUE='one'><PARAM NAME=AUTOSTART VALUE=true><EMBED SRC='"+strURL+"' NOJAVA=true CONTROLS=ImageWindow CONSOLE=one WIDTH="+intWidth+" HEIGHT="+intHeight+"></OBJECT><br><OBJECT CLASSID='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' WIDTH="+intWidth+" HEIGHT=32><PARAM NAME='CONTROLS' VALUE='StatusBar'><PARAM NAME=AUTOSTART VALUE=true><PARAM NAME='CONSOLE' VALUE='one'><EMBED SRC='"+strURL+"' NOJAVA=true CONTROLS=StatusBar CONSOLE=one WIDTH="+intWidth+" HEIGHT=24></OBJECT><br><OBJECT CLASSID='clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA' WIDTH="+intWidth+" HEIGHT=32><PARAM NAME='CONTROLS' VALUE='ControlPanel'><PARAM NAME=AUTOSTART VALUE=true><PARAM NAME='CONSOLE' VALUE='one'><EMBED SRC='"+strURL+"' NOJAVA=true CONTROLS=ControlPanel CONSOLE=one WIDTH="+intWidth+" HEIGHT=24 AUTOSTART=true LOOP=false></OBJECT>";
				break;
			case "qt":
				tmpstr="<embed src='"+strURL+"' autoplay=true Loop=false controller=true playeveryframe=false cache=false scale=TOFIT bgcolor=#000000 kioskmode=false targetcache=false pluginspage=http://www.apple.com/quicktime/>"
		}
		document.getElementById(strID).innerHTML = tmpstr;
	}
}

//Quote Comment Text - SiC/CYAN 2004
function doquote(objID,strAuthor){
	document.inputform.message.value += "[quote="+strAuthor+"] "+document.getElementById(objID).innerText+" [/quote]\n";
	window.location.hash="comment";
}

function showIntro(objID)
{
	if (document.getElementById(objID).style.display == "none") {
		document.getElementById(objID).style.display = "";
	}else{
		document.getElementById(objID).style.display = "none";
	}
}