var globalClickObj;
var globalObjStyle;
var globalClickObjStyle;

function mouseOver(obj, className) {
	if (obj == null) obj = event.srcElement;
	if (obj == globalClickObj) return;
	globalObjStyle = obj.className;
	if (className == null) className = "over";
	obj.className = className;
}

function mouseOut(obj, className) {
	if (obj == null) obj = event.srcElement;
	if (obj == globalClickObj) return;
	if (className == null) className = globalObjStyle;
	obj.className = className;
}

function mouseClick(obj, className) {
	if (isInput()) return;
	if (obj == null) obj = event.srcElement;
	if (className == null) className = "click";
	if (globalClickObj != null) globalClickObj.className = globalClickObjStyle;
	globalClickObjStyle = globalObjStyle;
	obj.className = className;
	globalClickObj = obj;
}

function mouseSelect(obj, className) {
	globalObjStyle = obj.className;
	mouseClick(obj, className);
}

function openWin(url, target, width, height,scrollbars) {
	var r = window.open(url, target == null ? "_blank" : target, "width=" + (width == null ? 564 : width) + ", height=" + (height == null ? 528 : height)+ ", scrollbars=" + (scrollbars == null ? "yes" : scrollbars) + ", toolbar=no, location=no, directories=no, status=no, menubar=no, resizable=no, top=30, left=30");
	r.focus();
}

function writeFlashIndex() {
	 var fo = new FlashObject("../flash/start.swf", "flashIndex", "540", "180", "7", "#013F3B");
   fo.addParam("quality", "high");
   //fo.addParam("wmode", "transparent");
   //fo.addParam("salign", "t");
   //fo.addParam("scale", "noscale");
		//fo.addParam("loop", "false");
   fo.write("divFlashIndex"); 
}


function enter() {
	if (event.keyCode == 13) {
		event.returnValue = false;
		return true;
	}
	return false;
}

function playMovie(fileName, fileUrl,playTime) {
	openWin("../multimedia/player.jsp?fileName="+encode(fileName)+"&fileUrl="+encode(fileUrl)+"&playTime="+encode(playTime), "player", 360, 440,"no");
}

function playFlv(fileName, fileUrl,playTime) {
	openWin("../multimedia/movies.jsp?fileName="+encode(fileName)+"&fileUrl="+encode(fileUrl)+"&playTime="+encode(playTime), "movies", 360, 387,"no");
}

/*function playFlv(fileName, fileUrl,playTime) {
	openWin("../multimedia/movies.jsp?fileName="+encode(fileName)+"&fileUrl="+encode(fileUrl)+"&playTime="+encode(playTime), "movies", 320, 325,"no");
}*/

function hideWaForm(){
	obj("waForm").style.display = "none";
}

function doRequestArea() {
	var provinceId = document.getElementById("provinceId").value;
	var branchTypeIds = document.getElementById("branchTypeIds").value;
	doIframeRequest(obj("areaFrame"), "choose_area.jsp", "provinceId=" + provinceId + "&branchTypeIds=" + branchTypeIds, "doResponseArea");
}

function doResponseArea(resp) {
	obj("span_area").innerHTML = (resp?resp:"<select name='areaId' id='areaId' class='full' style='width:60px; margin-top:6px' onChange='//doQueryBranch()'><option value=''>-地区-</option></select>");
}

function doIframeRequest(obj, url, pars, func) {
	obj.src = url + "?" + pars + "&func=" + func ;
}


function doResponseFrame(func) {
	try {
		if (func != "") {
			eval("parent.window." + func + "(obj('chooseDiv').innerHTML)");
		}
	}
	catch (e) { }
}