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_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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

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_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];}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
/*
var    currentpos,timer;    

function    initialize()    
{    
timer=setInterval("scrollwindow()",100);    
}    
function    sc(){    
clearInterval(timer);    
}    
function    scrollwindow()    
{    
currentpos=document.body.scrollTop;    
window.scroll(0,++currentpos);    
if    (currentpos    !=    document.body.scrollTop)    
sc();    
}    
document.onmousedown=sc    
document.ondblclick=initialize  
*/

function changeHtml(text) 
{ 
main.innerHTML=text; 
return;
}
function changeText(text) 
{ 
main.innerText=text; 
return;
}

function preloadImgs() {//v1.0
 var d=document,a=arguments; if(!d.imgs) d.imgs=new Array();
 for(var i=0; i<a.length; i++) { d.imgs[i]=new Image; d.imgs[i].src=a[i]; }
}

function swapImg() {//v1.0
 var doc=document,args=arguments,elm,n; doc.$imgSwaps=new Array(); for(n=2; n<args.length;
 n+=2) { elm=getObjectByID(args[n]); if(elm) { doc.$imgSwaps[doc.$imgSwaps.length]=elm;
 elm.$src=elm.src; elm.src=args[n+1]; } }
}

function getObjectByID(id,o) {//v1.0
 var c,el,els,f,m,n; if(!o)o=document; if(o.getElementById) el=o.getElementById(id);
 else if(o.layers) c=o.layers; else if(o.all) el=o.all[id]; if(el) return el;
 if(o.id==id || o.name==id) return o; if(o.childNodes) c=o.childNodes; if(c)
 for(n=0; n<c.length; n++) { el=getObjectByID(id,c[n]); if(el) return el; }
 f=o.forms; if(f) for(n=0; n<f.length; n++) { els=f[n].elements;
 for(m=0; m<els.length; m++){ el=getObjectByID(id,els[n]); if(el) return el; } }
 return null;
}

function changePage()
{
   var f = document.forms.navigation;

   var uri = f.pages.options[f.pages.selectedIndex].value;
   newPage =window.open(uri,"_top",",,,,,,,");

  
   }


function menumouseclick(item1){
	if (item1.style.display=='none'){
	item1.style.display='block';
	
	}else{
	item1.style.display='none';
	

	}
}

function mouseoverit(item){
	if(item.style.color!='blue'&&item.style.color!='purple') {
		item.style.color='blue';
		}
	item.style.cursor='hand';	
}

function mouseoutit(item){
	if(item.style.color=='blue') {item.style.color='gray';}
	item.style.cursor='auto';
}
function mouseclickdisplay(item1,item2){
	if (item2.style.display=='none'){
	item1.style.color='red';
	item2.style.display='';
	}else{
	item1.style.color='blue';
	item2.style.display='none';
	}
}
function mouseclick(item1,item2){
	if (item2.style.display=='none'){
	item1.style.color='purple';
	item2.style.display='block';
	}else{
	item1.style.color='blue';
	item2.style.display='none';
	}
	alert(item2.style.display);
}

function mouseclick4(item1,item2,item3,item4){
	if (item1.style.display=='none'){
	item1.style.display='block';
	item2.style.display='none';
	item3.style.display='none';
	item4.style.display='none';
	//item5.style.display='none';
	//item6.style.display='none';
	}
else{
	item1.style.display='none';
	item2.style.display='none';
	item3.style.display='none';
	item4.style.display='none';

	}
}



function showinfo()
{
window.open("<%=PopWin%>","hgmbapop","width=250,height=200,menubars=no,scrollbars=no,resizable=no")

}
function getViewportInfo() {
     var w = (window.innerWidth) ? window.innerWidth : (document.documentElement && document.documentElement.clientWidth) ? document.documentElement.clientWidth : document.body.offsetWidth;
     //var h = (window.innerHeight) ? window.innerHeight : (document.documentElement && document.documentElement.clientHeight) ? document.documentElement.clientHeight : document.body.offsetHeight;
     return w; 
     }
     
function LayerPosition(item){

	var x;
//	alert(getViewportInfo());
	if (getViewportInfo()<1024) 
	{ 
		x = 197; 
	}
	else
	{
	    if(!document.all)
	    {
		    x=197+getViewportInfo()/2-508;
		}
		else
		{
		    x=197+getViewportInfo()/2-500;
		}
	}
    item.style.left=x+"px";
//    alert(item.style.left);
}


  function   show(o)   
      {ShowStaPhotoZone.innerHTML=o.innerHTML;   
      }   
  function   hid()   
      {ShowStaPhotoZone.innerHTML="";   
      }   
function  ShowMBAProgramName(NameStr,positionx,displaystyle)   
      {
		  ProgramNameDiv.style.left=positionx;
		  ProgramNameDiv.style.display="block";
		  ProgramNameDiv.innerText=NameStr;   
      } 

//登录区处理函数

var newWindow = null
function open_window(loadpos)
{	
	if (! newWindow || newWindow.closed)
	{
  	newWindow = window.open(loadpos,"surveywin","toolbar,location,resizable,scrollbars,dependent,width=400,height=280");
	}else
	{
		newWindow.focus();
		newWindow.location.href=loadpos;
		newWindow.refresh();
	}
}
function log_submit()
{	
	var ProNo	= document.msg.selectName.selectedIndex+1;
	var ProURL	= document.msg.selectName.value;
	var User	= document.msg.u.value;
	var Passwd	= document.msg.psw.value;
	document.msg.u.value = ""
	document.msg.psw.value = ""
			

	if(ProNo == 1){	
		if(Passwd!=""){
			document.msg.username.value	= User;
			document.msg.password.value	= Passwd;
			document.msg.action=ProURL;
			document.msg.submit();
			return true;
		}
		else {
			window.location=ProURL;
			return false;
		}
	} 
	else if(ProNo == 2){	
		if(Passwd!=""){
			document.msg.username.value	= User;
			document.msg.password.value	= Passwd;
			document.msg.action=ProURL;
			document.msg.submit();
			return true;
		}
		else {
			window.location=ProURL;
			return false;
		}
	} 
	else if(ProNo == 3){	
		if(Passwd!=""){
			document.msg.username.value	= User;
			document.msg.password.value	= Passwd;
			document.msg.action=ProURL;
			document.msg.submit();
			return true;
		}
		else {
			window.location=ProURL;
			return false;
		}
	} 
	else if(ProNo == 4){	
		if(Passwd!=""){
			document.msg.user.value	= User;
			document.msg.password.value	= Passwd;
			document.msg.action=ProURL;
			document.msg.submit();
			return true;
		}
		else {
			window.location=ProURL;
			return false;
		}
	} 
	else if(ProNo == 5){	
		if(Passwd!=""){
			document.msg.uid.value	= User;
			document.msg.pwd.value	= Passwd;
			document.msg.action=ProURL;
			document.msg.submit();
			return true;
		}
		else {
			window.location=ProURL;
			return false;
		}
	}
	return false;
}
//登录区处理函数结束

function NewWindow(mypage, myname, w, h, scroll) {
	self.name = "main"; 
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
