﻿function divAbsCenter(obj){
var objs = document.getElementById(obj);
objs.style.left = (document.body.offsetWidth - objs.clientWidth)/2 ;
objs.style.top = (document.body.offsetHeight - objs.clientHeight)/2 ;
}

function InsertFlash(Flash,Width,Height,ID){
	document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" ");
	document.write("codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" ");
	document.write("width=\"" + Width + "\" height=\"" + Height + "\" id=\"" + ID + "\">");
	document.write("<param name=\"movie\" value=\"" + Flash + "\">");
	document.write("<param name=\"quality\" value=\"high\">");
	document.write("<param name=\"wmode\" value=\"transparent\">");
	document.write("<embed src=\"" + Flash + "\" wmode=\"transparent\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" ");
	document.write("type=\"application/x-shockwave-flash\" width=\"" + Width + "\" height=\"" + Height + "\"></embed>");
	document.write("</object>");
}

function focusFlash(JsPics,JsLinks,JsTexts,w,h,texth){
var pics=JsPics;
var links=JsLinks;
var texts=JsTexts;
var focus_width=w;
var focus_height=h;
var text_height=texth;
var swf_height = focus_height+text_height;

document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">');
document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="images/focus.swf"> <param name="quality" value="high"><param name="bgcolor" value="#CCCCCC">');
document.write('<param name="menu" value="false"><param name=wmode value="opaque">');
document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">');
document.write('<embed src="images/focus.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#ffffff" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>'); 
}

function FuFlash(w,h,xmlFile){
	if (AC_FL_RunContent == 0) {
		alert("此页需要 AC_RunActiveContent.js。在 Flash 中，运行“命令”菜单中的“应用活动内容更新”，以将 AC_RunActiveContent.js 复制到 HTML 输出文件夹。");
	} else {
		AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
			'width', ''+w+'',
			'height', ''+h+'',
			'src', 'viewer',
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'false',
			'scale', 'showall',
			'wmode', 'window',
			'devicefont', 'false',
			'id', 'viewer',
			'bgcolor', '#ffffff',
			'name', 'viewer',
			'menu', 'false',
			'allowScriptAccess','sameDomain',
			'movie', 'viewer',
			'salign', '',
			'FlashVars', 'xmlPath=xml/'+xmlFile+'.xml'
			);
	}
	
document.writeln("<noscript>");
document.writeln("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=7,0,19,0\" width=\""+w+"\" height=\""+h+"\">");
document.writeln("  <param name=\"movie\" value=\"viewer.swf\">");
document.writeln("  <param name=\"quality\" value=\"high\">");
document.writeln("  <embed src=\"viewer.swf\" quality=\"high\" pluginspage=\"http:\/\/www.macromedia.com\/go\/getflashplayer\" type=\"application\/x-shockwave-flash\" width=\""+w+"\" height=\""+h+"\"><\/embed>");
document.writeln("<\/object>");
document.writeln("<\/noscript>");
}

function showTab(elm,num,total) {
	for(i=0;i<=total;i++) {
		document.getElementById(elm+i).style.display = "none" ;
	}
	document.getElementById(elm+num).style.display = "" ;
}

function checkkey(obj) {

	if(document.getElementById(obj).value == ""){
		window.alert("关键字不得为空！");
		document.getElementById(obj).focus();
		return false;
	}
}
function checkLogin(){
	if(document.myform.Admin.value=="") 
	{ 
	alert("帐号不能为空"); 
	document.myform.Admin.focus(); 
	return false; 
	}
	if(document.myform.Psw.value=="") 
	{ 
	alert("密码不能为空"); 
	document.myform.Psw.focus(); 
	return false; 
	}
	if(document.myform.code.value=="") 
	{ 
	alert("验证码不能为空"); 
	document.myform.code.focus(); 
	return false; 
	} 
}

function highlight(key) {
        var key = key.split(' ');
        for (var i=0; i<key.length; i++) {
                var rng = document.body.createTextRange();
                while (rng.findText(key[i]))
                rng.pasteHTML(rng.text.fontcolor('red'));
        }
}

function openNewWin(winUrl,winName,winWidth,winHeight){
window.open(winUrl,winName,"width="+winWidth+",height="+winHeight+",scrollbars=yes,toolbar=no, status=no, menubar=no, resizable=yes")	
	}

function bcastr(xmlFile,width,height){
document.writeln("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" id=scriptmain name=scriptmain codebase=\"http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/");
document.writeln("flash\/swflash.cab#version=6,0,29,0\" width=\""+width+"\" height=\""+height+"\">");
document.writeln("    <param name=\"movie\" value=\"bcastr.swf?bcastr_xml_url=xml\/bcastr.xml\">");
document.writeln("    <param name=\"quality\" value=\"high\">");
document.writeln("    <param name=scale value=noscale>");
document.writeln("    <param name=\"LOOP\" value=\"false\">");
document.writeln("    <param name=\"menu\" value=\"false\">");
document.writeln("    <param name=\"wmode\" value=\"transparent\">");
document.writeln("    <embed src=\"bcastr.swf?bcastr_xml_url=xml\/"+xmlFile+".xml\" width=\""+width+"\" height=\""+height+"\" loop=\"false\" quality=\"high\" pluginspage=\"http:\/\/www.macromedia.com\/go\/getflashplayer\" type=\"application\/x-shockwave-flash\" salign=\"T\" name=\"scriptmain\" menu=\"false\" wmode=\"transparent\"><\/embed>");
document.writeln("  <\/object>");
}