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_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_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_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_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; }
}


// Set Booleans for Browser Type

var isLayers; // Netscape 4.x on Mac and PC
var isDivs; // IE 4.x on Mac and PC
var isDOM; // Netscape 6 on Mac and PC
var isOther; // None of the above

if ((parseInt(navigator.appVersion) >= 5) || (navigator.userAgent.indexOf('5.0') != -1)) {

	isDOM = (navigator.appName == 'Netscape'); // Netscape 6: Not yet functional
	isDivs = (navigator.appName.indexOf('Microsoft') != -1);

} else if (parseInt(navigator.appVersion) >= 4) {

	isLayers = (navigator.appName == 'Netscape');
	isDivs = (navigator.appName.indexOf('Microsoft') != -1);

}
	
isOther = ((!isLayers) && (!isDivs)); // Any non-common browser, including Netscape 6

// -->


// BEGIN whereami function to track mousemoving
function whereami(e) {

	if (!m_flag) { return; }
	if (m_current=0) { return; }
	
	if (isLayers) { 
		x = e.pageX; 
		y = e.pageY; 
	} else { 
		x = event.clientX + document.body.scrollLeft; 
		y = event.clientY + document.body.scrollTop; 
	}

	if ((x < bound_x1) || (y < bound_y1) || (x > bound_x2) || (y > bound_y2) || ((x < bound_x3) && (y > bound_y3))) { 
		m_current = 0;
		m_hide(0); // hide everything at state 1 or above
	}
	
} // END whereami function





//BEGIN m_show function to turn menus On
function m_show(new_menu) {
	
	if (!m_flag) { return; }
	if (new_menu == m_current) { return; }

	var new_obj = theobjs['m' + new_menu];
	if (!new_obj) { return; }

	var m_state = Math.floor(new_menu/20)*20;

	m_hide(m_state);

	new_obj.objShow();

	bound_x2 = new_obj.x2;
	bound_y2 = new_obj.y2;
	bound_x3 = new_obj.x3;
	bound_y3 = new_obj.y3;

	m_current = new_menu;

} // END m_show function



// BEGIN m_hide function to hide all menus at current menu's state and higher
function m_hide(new_state) {

	for (i = 0; i < m_total; i++) {
	var m_num = m_list[i];
	if (m_num >= new_state) {
		var old_obj = theobjs['m' + m_num];
		old_obj.objHide();
		}
	}

} // END m_hide function



////////////////////////////////////////////////////////////////////////////////////////
// document object creation functions -- generic

// BEGIN Create objects from Divs
function create_objects() {
	if (isLayers) { create_nn_objects(); 
	} else if (isDivs) { create_ie_objects(); 
	} else if (isDOM) { create_dom_objects(); }
} // END create_objects() function


// BEGIN For IE, pull DIV blocks into object array
function create_ie_objects() {
	thedivs = document.all.tags("div");
	theobjs = new Array();
	for (i = 0; i < thedivs.length; i++) {
		if (thedivs[i].id != "") {
			theobjs[thedivs[i].id] = new dom_object(thedivs[i]);
		}
	}
} // END create_ie_objects()


// BEGIN For Navigator 4.x, pull layer blocks into object array
function create_nn_objects() {
	theobjs = new Array();
	for (i = 0; i < document.layers.length; i++) {
		if (document.layers[i].name != "") {
			theobjs[document.layers[i].name] = new nn_object(document.layers[i]);
		}
	}
} // END create_nn_ojbects()


// BEGIN For W3C DOM (Navigator 6.x, Mozilla), pull DIV blocks into object array
function create_dom_objects() {
	thedivs = document.getElementsByTagName("div");
	theobjs = new Array();
	for (i = 0; i < thedivs.length; i++) {
		var obj = thedivs[i];
		if (obj.id != "") { 
			theobjs[obj.id] = new dom_object(obj); 
		}
	}
} // END create_dom_objects()


// BEGIN Establish properities of the DOM; also works for IE 4.x and 5.x Object
function dom_object(obj) {
	this.css2 = obj;
	this.name = obj.id;
	this.objHide = domHide;
	this.objShow = domShow;
	this.objSetTop = domSetTop;
	this.objSetLeft = domSetLeft;
	this.objMoveAbsolute = domMoveAbsolute;
	this.objSetZIndex = domSetZIndex;
} // END ie_object(obj)


// BEGIN Establish properities of the Netscape object
function nn_object(obj) {
	this.css2 = obj;
	this.name = obj.name;
	this.objHide = nnobjHide;
	this.objShow = nnobjShow;
	this.objSetTop = nnobjSetTop;
	this.objSetLeft = nnobjSetLeft;
	this.objMoveAbsolute = domMoveAbsolute;
	this.objSetZIndex = nnobjSetZIndex;
} // END nn_object(obj)


// BEGIN DOM and IE set element's top position
function domSetTop(top) {
	this.css2.style.top = top + "px";
} // END domSetTop(top)


// BEGIN DOM and IE set element's left position
function domSetLeft(left) {
	this.css2.style.left = left + "px";
} // END domSetLeft(left)


// BEGIN DOM and IE hide element
function domHide() {
   this.css2.style.visibility = "hidden";
} // END domHide()


// BEGIN DOM and IE show element
function domShow() {
   this.css2.style.visibility = "visible";
} // END domShow()


// BEGIN DOM and IE set element's zindex order
function domSetZIndex(zindex) {
   this.css2.style.zIndex = zindex;
} // END domSetZIndex(zindex)


// BEGIN make absolute move
function domMoveAbsolute(newleft,newtop) {
   this.objSetLeft(newleft);
   this.objSetTop(newtop);
} // END domMoveAbsolute(newleft,newtop)


// BEGIN Netscape 4.x hide element
function nnobjHide() {
	this.css2.visibility = "hidden";
} // END nnobjHide()


// BEGIN Netscape 4.x show element
function nnobjShow() {
	this.css2.visibility = "inherit";
} // END nnobjShow()


// BEGIN Netscape 4.x set element's top position
function nnobjSetTop(top) {
	this.css2.top = top;
} // END nnobjSetTop(top)


// BEGIN Netscape 4.x set element's left position
function nnobjSetLeft(left) {
	this.css2.left = left;
} // END nnobjSetLeft(left)


// BEGIN Netscape 4.x set element's zindex order

function nnobjSetZIndex(zindex) {
	this.css2.zIndex = zindex;
} // END nnobjSetZindex(zindex)


function CheckCGIForm()
{
if (document.forms[0].name.value=="" )
{alert("Please input your name");document.forms[0].name.focus();return;}
else if (document.forms[0].email.value.length<=0)
{
alert("Please input your e-mail address");document.forms[0].email.focus();return false;
}
else if (document.forms[0].email.value.indexOf("@") == -1 &
document.forms[0].email.value.indexOf(".") == -1)
{ alert("Please check your e-mail address and input correct one");document.forms[0].email.focus();return false;
}
document.forms[0].submit();
}


function CheckForm(){
	if (document.LoginForm.username.value==""){
		alert("请填写您的用户名！");
		document.LoginForm.username.focus();
		return false;
	}

	if (document.LoginForm.password.value==""){
		alert("请填写您的密码！");
		document.LoginForm.password.focus();
		return false;
	}

	return true;
}


function check()
{
if (document.forms[0].full_name.value=="" )
{alert("请输入您的姓名");document.forms[0].full_name.focus();return;}
else if (document.forms[0].email.value.length<=0)
{
alert("请输入您的邮件地址");document.forms[0].email.focus();return false;
}
else if (document.forms[0].email.value.indexOf("@") == -1 &
document.forms[0].email.value.indexOf(".") == -1)
{ alert("请检查您的邮件地址，输入有误");document.forms[0].email.focus();return false;
}
else if (document.forms[0].title.value.length<=0)
{
alert("请输入您的职位");document.forms[0].title.focus();return false;
}
else if (document.forms[0].middle_name.value.length<=0)
{
alert("请输入您的联系电话");document.forms[0].middle_name.focus();return false;
}
else if (document.forms[0].last_name.value.length<=0)
{
alert("请输入您的公司名称");document.forms[0].last_name.focus();return false;
}
document.forms[0].submit();
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}



// Flash Image Extension for Dreamwever
nereidFadeObjects = new Object();
nereidFadeTimers = new Object();
function nereidFade(object, destOp, rate, delta){
if (!document.all)
return
    if (object != "[object]"){  //do this so I can take a string too
        setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
        return;
    }
    clearTimeout(nereidFadeTimers[object.sourceIndex]);
    diff = destOp-object.filters.alpha.opacity;
    direction = 1;
    if (object.filters.alpha.opacity > destOp){
        direction = -1;
    }
    delta=Math.min(direction*diff,delta);
    object.filters.alpha.opacity+=direction*delta;
    if (object.filters.alpha.opacity != destOp){
        nereidFadeObjects[object.sourceIndex]=object;
        nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
    }
}
