function ElasticdMovie_DoFSCommand(command, args) {
    if ( command == 'cache_layer'){
    MM_showHideLayers('Layer1','','hide');
}
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//***********默认设置定义.*********************
tPopWait=50;//停留tWait豪秒后显示提示。
tPopShow=5000;//显示tShow豪秒后关闭提示
showPopStep=20;
popOpacity=99;

//***************内部变量定义*****************
sPop=null;
curShow=null;
tFadeOut=null;
tFadeIn=null;
tFadeWaiting=null;

document.write("<style type='text/css'id='defaultPopStyle'>");
document.write(".cPopText {  background-color: #F8F8F5;color:#000000; border: 1px #000000 solid;font-color: font-size: 12px; padding-right: 4px; padding-left: 4px; height: 20px; padding-top: 2px; padding-bottom: 2px; filter: Alpha(Opacity=0)}");
document.write("</style>");
document.write("<div id='dypopLayer' style='position:absolute;z-index:1000;' class='cPopText'></div>");


function showPopupText(){
var o=event.srcElement;
	MouseX=event.x;
	MouseY=event.y;
	if(o.alt!=null && o.alt!=""){o.dypop=o.alt;o.alt=""};
        if(o.title!=null && o.title!=""){o.dypop=o.title;o.title=""};
	if(o.dypop!=sPop) {
			sPop=o.dypop;
			clearTimeout(curShow);
			clearTimeout(tFadeOut);
			clearTimeout(tFadeIn);
			clearTimeout(tFadeWaiting);	
			if(sPop==null || sPop=="") {
				dypopLayer.innerHTML="";
				dypopLayer.style.filter="Alpha()";
				dypopLayer.filters.Alpha.opacity=0;	
				}
			else {
				if(o.dyclass!=null) popStyle=o.dyclass 
					else popStyle="cPopText";
				curShow=setTimeout("showIt()",tPopWait);
			}
			
	}
}

function showIt(){
		dypopLayer.className=popStyle;
		dypopLayer.innerHTML=sPop;
		popWidth=dypopLayer.clientWidth;
		popHeight=dypopLayer.clientHeight;
		if(MouseX+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24
			else popLeftAdjust=0;
		if(MouseY+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24
			else popTopAdjust=0;
		dypopLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust;
		dypopLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust;
		dypopLayer.style.filter="Alpha(Opacity=0)";
		fadeOut();
}

function fadeOut(){
	if(dypopLayer.filters.Alpha.opacity<popOpacity) {
		dypopLayer.filters.Alpha.opacity+=showPopStep;
		tFadeOut=setTimeout("fadeOut()",1);
		}
		else {
			dypopLayer.filters.Alpha.opacity=popOpacity;
			tFadeWaiting=setTimeout("fadeIn()",tPopShow);
			}
}

function fadeIn(){
	if(dypopLayer.filters.Alpha.opacity>0) {
		dypopLayer.filters.Alpha.opacity-=1;
		tFadeIn=setTimeout("fadeIn()",1);
		}
}
document.onmouseover=showPopupText;

//顶部菜单控制
var selectedMenu 	= 0;
var delayMenu		= 0;
var delayMenuFlag	= 0;
/*
menu0on = new Image();		menu0off = new Image();	
menu1on = new Image();		menu1off = new Image();
menu2on = new Image();		menu2off = new Image();
menu3on = new Image();		menu3off = new Image();
menu4on = new Image();		menu4off = new Image();
menu5on = new Image();		menu5off = new Image();
menu6on = new Image();		menu6off = new Image();
menu7on = new Image();		menu7off = new Image();
menu8on = new Image();		menu8off = new Image();
menu9on = new Image();		menu9off = new Image();
*/		
function OrgLayer(No){
	//document.all ['SubMenu' + No].style.display = "none";
	//document.all ['SubMenu0'].style.display = "block";
	document ['gnb_menu' + No].src = eval("menu" + No + "off.src");
}

function imgOver(imgNum){
	document ['gnb_menu' + imgNum].src = eval("menu" + imgNum+ "on.src");
}

function imgOut(imgNum){
	for ( var i = 0; i < 8; i++ ){
		if ( i != imgNum ){
			document ['gnb_menu' + i].src = eval("menu" + i + "off.src");
		}
		else{
			document ['gnb_menu' + selectedMenu ].src = eval("menu" + selectedMenu + "off.src");
		}	
	}
}

function ShowSubMenu(tmp){
	for ( var i = 0; i < 8; i++ ){
		document.all ['SubMenu' + i].style.display = "none";
		document ['gnb_menu' + i].src = eval("menu" + i + "off.src");
				
		if ( i == tmp){
			document.all ['SubMenu' + tmp].style.display = "";
			document ['gnb_menu' + i].src = eval("menu" + i + "on.src");
		}	
	}

	selectedMenu = tmp;
}
	
function GNB_BackInit(){
	ShowSubMenu(0);
	imgOut(0);
}

n = (document.layers) ? 1:0
ie = (document.all) ? 1:0

/*function GNB_Init(){
	document.onmousemove = mouseMove
	if (n) document.captureEvents(Event.MOUSEMOVE)
}*/
		
function mouseMove(e){
	if (n) { var CY = e.pageY; }
	if (ie) { var cY = event.y; }
		
	if ( cY > 117 ){
		delayMenu = 0;
		delayMenuFlag = 1;
	}
	else{
		delayMenu = 0;
		delayMenuFlag = 0;
	}
}
		
function delayDisplay(){
	if ( delayMenuFlag > 0 ){
		delayMenu = delayMenu + 1;
				
		if ( delayMenu > 100 ){
			delayMenu = 0
			delayMenuFlag = 0;
			GNB_BackInit();
		}
	}
	setTimeout("delayDisplay();", 100);
}

//GNB_Init();
delayDisplay();
function makeRectangularDropShadow(el, color, size)
{
	var i;
	for (i=size; i>0; i--)
	{
		var rect = document.createElement('div');
		var rs = rect.style
		rs.position = 'absolute';
		rs.left = (el.style.posLeft + i) + 'px';
		rs.top = (el.style.posTop + i) + 'px';
		rs.width = el.offsetWidth + 'px';
		rs.height = el.offsetHeight + 'px';
		rs.zIndex = el.style.zIndex - i;
		rs.backgroundColor = color;
		var opacity = 1 - i / (i + 1);
		rs.filter = 'alpha(opacity=' + (100 * opacity) + ')';
		el.insertAdjacentElement('afterEnd', rect);
		global.fo_shadows[global.fo_shadows.length] = rect;
	}
}
function CheckNumber(object_value,flag){
    if (object_value.length == 0)return true;
	var start_format;
	if (flag == 0)
		start_format = " .+-0123456789";
	else
		start_format = ".0123456789";
	var number_format = " .0123456789";
	var check_char;
	var decimal = false;
	var trailing_blank = false;
	var digits = false;
    //The first character can be + - .  blank or a digit.
	check_char = start_format.indexOf(object_value.charAt(0))
    //Was it a decimal?
	if (check_char == 0)
	    return false;//decimal = true; Can not be decimal;
	else if (check_char < 1)
		return false;
	//Remaining characters can be only . or a digit, but only one decimal.
	for (var i = 1; i < object_value.length; i++){
		check_char = number_format.indexOf(object_value.charAt(i))
		if (check_char < 0)
			return false;
		else if (check_char == 1){
			if (decimal)		// Second decimal.
				return false;
			else
				decimal = true;
		}else if (check_char == 0){
			if (decimal || digits)	
				trailing_blank = true;// ignore leading blanks
		}else if (trailing_blank)
			return false;
		else
			digits = true;
	}//All tests passed, so...
    return true;
}
function hasBlank(value){
	var i = 0;
	for(var j=0; j<value.length; j++){
		if(value.charAt(j)==' ')i++;
	}
	if(i==0){
		return false;//no blank
	}
	return true;//blank
}
function Blank(value){
	var x = value.length;
	var y = 0;
	if(x==0)return true;
	for(var i = 0; i < x; i++){
		if(value.charAt(i) == ' ')y++;
	}
	if(x==y){
		return true;
	}else{
		return false;
	}
}
//检查输入的Email地址格式是否正确
function isMailAddress(address)
{
	var emailPat=/^(.+)@(.+)$/;
	var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]";
	var validChars="\[^\\s" + specialChars + "\]";
	var quotedUser="(\"[^\"]*\")";
	var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
	var atom=validChars + '+';
	var word="(" + atom + "|" + quotedUser + ")";
	var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
	var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
	var matchArray=address.match(emailPat);

	if (matchArray==null)
	{
		return false;
	}

	var user=matchArray[1];
	var domain=matchArray[2];

	if (user.match(userPat)==null)
	{
		return false;
	}

	var IPArray=domain.match(ipDomainPat);

	if (IPArray!=null)
	{
		for (var i=1;i<=4;i++)
		{
			if (IPArray[i]>255)
			{
				return false;
			}
		}

		return true;
	}

	var domainArray=domain.match(domainPat);

	if (domainArray==null)
	{
		return false;
	}

	var atomPat=new RegExp(atom,"g");
	var domArr=domain.match(atomPat);
	var len=domArr.length;

	if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>3)
	{
		return false;
	}

	if (len<2)
	{
		return false;
	}

	return true;
}
///////////////////////////////////////
//身份证检查
function checkIdcard(idcard)
{
	BirthYear  =  document.FORM.year.value ;
 BirthMonth =  document.FORM.month.value ;
 BirthDay   =  document.FORM.day.value ;
	IDCardLenth = idcard.length;
//先判断身份证号的位数是否则正确。
 if  (!((IDCardLenth==15) ||  (IDCardLenth==18)))
   {
     window.alert("您所输入的身份证号码位数不对，应该为15位或18位！");
	 document.FORM.idcard.focus();
	 return false;
   }
 //如果身份证号是15位，则判断是否全是数字，且与出生日期相符
 if (IDCardLenth==15)
  {
    if (isNaN(idcard))
	  {
	  window.alert("身份证号为15位，应该全部为数字")
	  document.FORM.idcard.focus();
	  return false;	  
	  }
	else  //把出生年月日与身份证号比较！
	  {  
	  IDBirth=BirthYear.substr(2,2) + BirthMonth + BirthDay;
	  if (IDBirth!=idcard.substr(6,6))
         {
		   window.alert("身份证号为15位，与出生日期不符")
		   document.FORM.idcard.focus();
	       return false;	  
		 }  
      }
  }
 if  (IDCardLenth==18)
  {
   if (isNaN(idcard.substr(0,17)))
      {
	   window.alert("身份证号为18位，前17应该全部为数字")
	   document.FORM.idcard.focus();
	   return false;	  
	  }
    else
	  {
	  	IDBirth=BirthYear + BirthMonth + BirthDay;  
		if (IDBirth!=idcard.substr(6,8))
         {
		   window.alert("身份证号为18位，与出生日期不符")
		   document.FORM.idcard.focus();
	       return false;	  
		 }  
 
      }  
  }
  return true;
}