﻿			function ShowArea(sender)
			{
				document.getElementById("allchannel").style.display = "block";
				var leftpos = 0,toppos = 0;
				var pObject = sender.offsetParent;
				if (pObject)
				{
					leftpos += pObject.offsetLeft;
					toppos += pObject.offsetTop;
				}
				while(pObject=pObject.offsetParent )
				{
					leftpos += pObject.offsetLeft;
					toppos += pObject.offsetTop;
				};

				document.getElementById("allchannel").style.left = (sender.offsetLeft + leftpos - 310) + "px";
				document.getElementById("allchannel").style.top = (sender.offsetTop + toppos + sender.offsetHeight - 2) + "px";
			}
			
			function HideArea(sender)
			{
				document.getElementById("allchannel").style.display = "none";
			}
			
			function SetLang(curLangType)
            {
				window.location.href = "MainLoginEN.aspx";
				return false;
				if (curLangType == 'en-us')
				{
					SetCookie("LangType",'Lang=');
				}
				else
				{
					SetCookie("LangType",'Lang=en-us');
				}
            }
            
            function SetCookie(name, value)
            {
                document.cookie = name +"=" + value;
            }
            
			function js_callpage(htmlurl)
			{
				var newwin=window.open(htmlurl,"newwin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=700px,height=550px");
			}

			function js_callpagebig(htmlurl)
			{
				var newwin=window.open(htmlurl,"newwin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=700px,height=550px");
			}

			function MM_jumpMenu(targ,selObj,restore)
			{
				eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
				if (restore)
					selObj.selectedIndex=0;
			}

			function showObj(name, show)
			{
				obj = getObj(name);
				obj.visibility = (show)?visible:hidden;
			}

			function redirect(obj)
			{
				area = obj.value;
				
				if(area == "")
				{
					window.location = "http://www.51job.com/default-hr.php";
				}
				if(area == "0000")
				{
					window.location = "http://www.51job.com/default-qz.php";
				}
				else
				{
					window.location = "http://www.51job.com/default-area.php?area="+area;
				}
			}

			function setCookie(name,value,expiry,path,domain,secure)
			{
				var nameString = name + "=" + value;
				var expiryString = (expiry == null) ? "" : " ;expires = "+ expiry.toGMTString();
				var pathString = (path == null) ? "" : " ;path = "+ path;
				var domainString = (domain == null) ? "" : " ;domain = "+ domain;
				var secureString = (secure) ?";secure" :"";
				
				document.cookie = nameString + expiryString + pathString + domainString + secureString;
			}

			function getCookie(name)
			{
				var CookieFound = false;
				var start = 0;
				var end = 0;
				var CookieString = document.cookie;
				var i = 0;
				
				while (i <= CookieString.length)
				{
					start = i ;
					end = start + name.length;
					if (CookieString.substring(start, end) == name){
						CookieFound = true;
						break; 
					}
					i++;
				}
				
				if (CookieFound)
				{
					start = end + 1;
					end = CookieString.indexOf(";",start);
					if (end < start)
						end = CookieString.length;
					return unescape(CookieString.substring(start, end));
				}
				return "";
			}

			function deleteCookie(name,value,path,domain,secure)
			{
				var expires = new Date();
				expires.setTime(expires.getTime() - 1);

				setCookie(name,value,expires,path,domain,secure);
			}

			function setDefault(obj)
			{
				if(obj.checked)
				{
					var expires = new Date();
					expires.setTime(expires.getTime()+3*30*24*60*60*1000);//保持3个月
					setCookie("SetHeadPage","1",expires,"/","51job.com",false);
				}
				else
				{
					deleteCookie("SetHeadPage","1","/","51job.com",false);
				}
			}
			
//			function InitAD()
//			{
//				var LeftOffSet = parseInt(Math.random()*screen.availWidth - 130,10);
//				var TopOffSet = parseInt(Math.random()*screen.availHeight - 130,10);
//				document.getElementById("MoveAD").style.left = (LeftOffSet > 0 ? LeftOffSet : -LeftOffSet) + "px";
//				document.getElementById("MoveAD").style.top = (TopOffSet > 0 ? TopOffSet : -TopOffSet) + "px";
//				document.getElementById("MoveAD").style.display="block";
//				MoveOn();
//			}
			
//			function StopMoving()
//			{
//			  if (timeid != null)
//					window.clearTimeout(timeid);
//			}
//			function StopMovadd()
//			{
//			  if (time2 != null)
//					window.clearTimeout(time2);
//			}
//			function MoveOn()
//			{
//				timeid = window.setTimeout("MoveObj();",100);
//				
//			}
//			function moveADDon()
//			{
//			  window.setTimeout("MoveADDf();",120);
//			}
			//window.setTimeout("MoveADDf();",100);
//			function MoveObj()
//			{
//				var obj = document.getElementById("MoveAD");
//				var LeftOffSet = 3;
//				var TopOffSet = 2;
//				var objLeft = parseInt(obj.style.left,10);
//				var objTop = parseInt(obj.style.top,10);
//				
//				if ((LeftOffSet + objLeft + obj.clientWidth) > (screen.availWidth - 30) || LeftOffSet + objLeft < 10)
//				{
//					xInc = -xInc;
//				}
//				
//				obj.style.left = objLeft + LeftOffSet*xInc + "px";
//				
//				var pageY = 0;
//				
//				if(window.pageYOffset)
//				{
//					pageY=window.pageYOffset + window.innerHeight;
//				} 
//				else
//				{
//					pageY=window.document.body.parentNode.scrollTop;
//				}
//				
//				if ((TopOffSet + objTop + obj.clientHeight > screen.availHeight + pageY - 80))
//				{
//					yInc = -1;
//				}
//				
//				if (TopOffSet + objTop < 10 + pageY)
//				{
//					yInc = 1;
//				}
//				
//			    obj.style.top = (objTop + TopOffSet*yInc) + "px";
//				
//				timeid = window.setTimeout("MoveObj();",100);
//			}
//			function MoveADDf()
//			{
//				var obj = document.getElementById("MoveADD");
//				var LeftOffSet = 4;
//				var TopOffSet =3;
//				var objLeft = parseInt(obj.style.left,10);
//				var objTop = parseInt(obj.style.top,10);
//				
//				if ((LeftOffSet + objLeft + obj.clientWidth) > (screen.availWidth - 30) || LeftOffSet + objLeft < 10)
//				{
//					xInc = -xInc;
//				}
//				
//				obj.style.left = objLeft + LeftOffSet*xInc + "px";
//				
//				var pageY = 0;
//				
//				if(window.pageYOffset)
//				{
//					pageY=window.pageYOffset + window.innerHeight;
//				} 
//				else
//				{
//					pageY=window.document.body.parentNode.scrollTop;
//				}
//				
//				if ((TopOffSet + objTop + obj.clientHeight > screen.availHeight + pageY - 80))
//				{
//					yInc = -1;
//				}
//				
//				if (TopOffSet + objTop < 10 + pageY)
//				{
//					yInc = 1;
//				}
//		     obj.style.top =(objTop + TopOffSet*yInc) + "px";//60 + document.body.scrollTop//;
//				
//				time2 = window.setTimeout("MoveADDf();",120);
//			}
			
                //		首页漂浮广告js
//                var x = 50,y = 60
//                var xin = true, yin = true
//                var step = 1 
//                var delay = 20
//                var obj = document.getElementById("Movegif");
//                function floatAD() 
//                {
//                var L=T=0
//                var R= document.body.clientWidth-obj.offsetWidth
//                var B = document.body.clientHeight-obj.offsetHeight
//                document.getElementById("Movegif").style.left = x + document.body.scrollLeft
//                document.getElementById("Movegif").style.top = y + document.body.scrollTop
//                x = x + step*(xin?1:-1) 
//                if (x < L) { xin = true; x = L} 
//                if (x > R){ xin = false; x = R} 
//                y = y + step*(yin?1:-1) 
//                if (y < T) { yin = true; y = T } 
//                if (y > B) { yin = false; y = B } 
//                }
//                var itl= setInterval("floatAD()", delay) 
//                document.getElementById("Movegif").onmouseover=function(){clearInterval(itl)} 
//                document.getElementById("Movegif").onmouseout=function(){itl=setInterval("floatAD()", delay)}
   
			function ShowNotice()
			{
				/*var today = new Date();
				if (parseInt(today.getFullYear(),10) <= 2007 && parseInt(today.getMonth(),10) <= 9 && parseInt(today.getDate(),10) <= 23)
				{
					if (parseInt(today.getDate(),10) == 23 && parseInt(today.getHours(),10) > 8)
					{
						return;
					}
					
					window.open("Notice.aspx","","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=270px,height=210px;");
				}
				else
				{
					return;
				}*/
				//window.open("Notice.aspx","","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=315px,height=260px;");
				//window.open("Notice.html","","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=250px,height=220px;");
			}
			
			function FindPwd(sender)
			{
				window.open('Member/FindPassword.aspx','_blank','Scrollbars=no,Width=400px,Height=258px,Top=240px,Left=300px');
				return false;
			}
			
            function showPop(){ 
                    var width = 318; //弹出框的宽度 
                    var height = 282; //弹出框的高度 
                    var obj = document.getElementById("pop"); 
                    obj.style.display = "block"; 
                    obj.style.position = "absolute"; 
                    obj.style.zindex = "-1"; 
                    obj.style.width = width + "px"; 
                    obj.style.height = height + "px"; 
                    obj.style.background="#3366FF";
                    obj.style.left =0+ "px"; 
                    obj.style.top =0+ "px";
             } 
                    
             function hidePop()
             { 
                   document.getElementById("pop").style.display = "none"; 
             }
             
             function SendLogin(sender)
             {
				var MemberName = document.getElementById("user").value;
				var UserName = document.getElementById("login").value;
				var Password = document.getElementById("password").value;
				
				//检查验证码是否为正整数
				var numreg = new RegExp("^\\d+$");

				if (MemberName.length > 0)
				{
					if (UserName.length > 0)
					{
						if (Password.length > 5)
						{
							//WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions('Login_ibtnLogin', '', false, '', 'Index.aspx<%= (string.IsNullOrEmpty(Request.QueryString["returl"]) ? string.Empty : "?returl=" + Server.UrlEncode(Request.QueryString["returl"])) %>', false, false));
							return true;
						}
						else
						{
							alert("密码必须在6到12位！");
						}
					}
					else
					{
						alert("用户名不能为空！");
					}
				}
				else
				{
					alert("会员名不能为空！");
				}
				return false;
            }

            function iGetAbsPos( a ) {
                var wi = hi = 0;
                while ( a ) 
                {
                    wi += a['offsetLeft'];
                    hi += a['offsetTop'];
                    a = a.offsetParent;
                }
                return [wi,hi];
            }           
