﻿// JavaScript Document
function divAbs(obj){
var objs = document.getElementById(obj);
objs.style.left = event.clientX ;
objs.style.top = event.clientY;
}

function datetime(){
var week; 
if(new Date().getDay()==0)          week="星期日"
if(new Date().getDay()==1)          week="星期一"
if(new Date().getDay()==2)          week="星期二" 
if(new Date().getDay()==3)          week="星期三"
if(new Date().getDay()==4)          week="星期四"
if(new Date().getDay()==5)          week="星期五"
if(new Date().getDay()==6)          week="星期六"
document.write(new Date().getYear()+"年 "+(new Date().getMonth()+1)+"月 "+new Date().getDate()+"日 "+week);
}

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 + "\" 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 openNewWin(winUrl,winName,winWidth,winHeight){
window.open(winUrl,winName,"width="+winWidth+",height="+winHeight+",scrollbars=no,toolbar=no, status=no, menubar=no, resizable=no")	
	}
	
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 showTab(elm,num,total) {
	for(i=0;i<=total;i++) {
		document.getElementById(elm+i).style.display = "none" ;
		document.getElementById('t'+elm+i).className = elm+"_out" ;
	}
	document.getElementById(elm+num).style.display = "" ;
	document.getElementById('t'+elm+num).className = elm+"_over" ;
}
function checkLogin(){
	if(document.form1.Admin.value=="") 
	{ 
	alert("帐号不能为空"); 
	document.form1.Admin.focus(); 
	return false; 
	}
	if(document.form1.Psw.value=="") 
	{ 
	alert("密码不能为空"); 
	document.form1.Psw.focus(); 
	return false; 
	}
	if(document.form1.code.value=="") 
	{ 
	alert("验证码不能为空"); 
	document.form1.code.focus(); 
	return false; 
	} 
}

function initMarquee() {
 var str=marqueeContent[0];
 document.write('<div id=marqueeBox style="overflow:hidden;height:'+marqueeHeight+'px" onmouseover="clearInterval(marqueeInterval[0])" onmouseout="marqueeInterval[0]=setInterval(\'startMarquee()\',marqueeDelay)"><div>'+str+'</div></div>');
 marqueeId++;
 marqueeInterval[0]=setInterval("startMarquee()",marqueeDelay);
 }
function startMarquee() {
 var str=marqueeContent[marqueeId];
  marqueeId++;
 if(marqueeId>=marqueeContent.length) marqueeId=0;
 if(document.getElementById("marqueeBox").childNodes.length==1) {
  var nextLine=document.createElement('DIV');
  nextLine.innerHTML=str;
  document.getElementById("marqueeBox").appendChild(nextLine);
  }
 else {
  document.getElementById("marqueeBox").childNodes[0].innerHTML=str;
  document.getElementById("marqueeBox").appendChild(document.getElementById("marqueeBox").childNodes[0]);
  document.getElementById("marqueeBox").scrollTop=0;
  }
 clearInterval(marqueeInterval[1]);
 marqueeInterval[1]=setInterval("scrollMarquee()",10);
 }
function scrollMarquee() {
 document.getElementById("marqueeBox").scrollTop++;
 if(document.getElementById("marqueeBox").scrollTop%marqueeHeight==(marqueeHeight-1)){
  clearInterval(marqueeInterval[1]);
  }
 }
 
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 showSubmenu(n){
var mtop;
var mleft;
var menuObj;
mtop = document.getElementById('c'+n).offsetTop;
mleft = document.getElementById('c'+n).offsetLeft;
menuObj = document.getElementById('m'+n);
for(i=1;i<=5;i++ ){
	document.getElementById('m'+i).style.display='none';
}
menuObj.style.display = '';
menuObj.className ='sshow';
menuObj.style.top = mtop+110+"px";
menuObj.style.left = mleft+150+"px";
}
function bcastr(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\/bcastr.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>");
}

