﻿function getDatetime(){
	var now= new Date();
	var year=now.getYear();
	var month=now.getMonth()+1;
	var day=now.getDate();
	var hour=now.getHours();
	var minute=now.getMinutes();
	var second=now.getSeconds();
	var weekday = new Array(7)  
 	weekday[0] = "星期日"
  	weekday[1] = "星期一"
  	weekday[2] = "星期二"
  	weekday[3] = "星期三"
  	weekday[4] = "星期四"
  	weekday[5] = "星期五"
  	weekday[6] = "星期六"
	document.getElementById("timers").innerHTML = year + "-" + month + "-" + day + " " + hour + ":" + minute  + ":" + second + " " + weekday[now.getDay()];
}

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 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>");
}

function checkKeywords()
{
	if(document.myform.keywords.value=="")
	{
		alert("请输入关键字！");
		document.myform.keywords.focus();
		return false;
	}
	return true;
}

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'));
        }
}
