﻿//window.onerror=Function("return true");
if(!document.all)document.addEventListener("DOMContentLoaded", function(){document.readyState='complete';}, false);
String.prototype.trim=function(){var tmp=this.replace(/(^\s+)|(\s+$)/g,"");return tmp.replace(/\s+/g, " ");};
//根据id获取对象组
function $() {
  var elements = new Array();

  for (var i = 0; i < arguments.length; i++) {
    var element = arguments[i];
    if (typeof element == 'string')
      element = document.getElementById(element);

    if (arguments.length == 1)
      return element;

    elements.push(element);
  }

  return elements;
}
//获取对象的绝对位置
function getAbsolutePosition(element) 
{ 
	if ( arguments.length != 1 || element == null ) 
	{ 
		return null; 
	} 

	var top = element.offsetTop; 
	var left = element.offsetLeft; 
	var width = element.offsetWidth; 
	var height = (element.offsetHeight > element.scrollHeight) ? element.offsetHeight : element.scrollHeight; 
	while( element = element.offsetParent ) 
	{ 
		if ( element.style.position == 'absolute' || element.style.position == 'relative'  
			|| ( element.style.overflow != 'visible' && element.style.overflow != '' ) ) 
		{ 
			break; 
		}  
		top += element.offsetTop; 
		left += element.offsetLeft; 
	} 
	return { top: top, left: left, width: width, height: height }; 
}
//过滤全角数字
function inputChk(obj)
{
	var c1 = new Array("０", "１", "２", "３", "４", "５", "６", "７", "８", "９", "—", "，", "·", "。");
	var c2 = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "-", ",", "@", ".");
	if(obj.value)
	{
		var str = obj.value;
		for(var i=0;i<c1.length;i++)
		{
			var re = new RegExp(c1[i], "g");
			str=str.replace(re, c2[i]);
		}
		obj.value=str;
	}
}
//确认信息
function chkMsg(s)
{
    return confirm(typeof(s)=="undefined"?"确认删除?":s);
}
//Author:UFO
//QQ:47210879
//Web:http://www.800abc.cn
//JS取得URL参数
function QueryString(para)
{
    var retval="",s=location.search.replace("?","");
    if(s=="")return "";s = s.split("&");
    for(var i=0;i<s.length;i++)
      if(s[i].toUpperCase().indexOf(para.toUpperCase() + "=")==0)
       retval+=((retval==""?"":", ")+s[i].substr(s[i].indexOf("=")+1,s[i].length));
    return retval;
}
//**********************************************************
function HigheLine()
{
	if(arguments.length==0 || arguments[0]=="")return;
	var obj	=	document.getElementsByTagName("a");
	for(i=0;i<obj.length;i++)
	{
		if(obj[i].getAttribute("s")==null)continue;
		for(var j=0;j<arguments.length;j++)
		{
			var str=arguments[j].replace(/([\\\^\$\*\+\?\{\}\.\(\)\[\]\|\+])/g,"\\$1");
			var re=new RegExp("(" + str + ")","ig");
			var tmp=obj[i].innerHTML;
			obj[i].innerHTML=tmp.replace(re,"<span class='searchkey'>$1</span>");
		}
	}
}
//**********************************************************
// Author:	陈世华
// QQ:		47210879
//**********************************************************
function ShowPage(PageCount, ShowNumber, ShowCNNext, ShowGO, RecNum)
{
	var PageSize	=	10;
	var queryStr	=	location.search;
	var CurrentPage	=	1;
	if(queryStr != "")
		queryStr	=	queryStr.replace("?","");
	if(queryStr.toLowerCase().indexOf("page=") == -1)
	{
		if(queryStr == "")
			queryStr	=	"Page=1";
		else
			queryStr	+=	"&Page=1";
	}
	else
	{
		CurrentPage	=	queryStr.toLowerCase().replace(/^[^\ ]*page=(\d+)[^\ ]*$/gi,"$1");
	}

	PageCount	=	parseInt(PageCount);
	if(isNaN(PageCount) || PageCount < 0)
		PageCount	=	0;
	CurrentPage	=	parseInt(CurrentPage);
	if(isNaN(CurrentPage) || CurrentPage < 0)
		CurrentPage	=	1;
	CurrentPage	=	CurrentPage>PageCount?PageCount:CurrentPage;

	//首页,上一页
	this.ShowFirstPrevious	=	function(PageCount, CurrentPage, FirstText, PreviousText, PageSize)
	{
		if(isNaN(parseInt(PageSize)))
			PageSize	=	0;
		if(PageSize > 0)
		{
			if(CurrentPage > 1)
			{
				document.write("<a href='?" + queryStr.replace(/page=(\d+)/gi,"Page=1") + "'>" + FirstText + "</a> ");
			}
			if(parseInt(CurrentPage / PageSize) + (CurrentPage % PageSize==0?0:1) > 1)
			{
				document.write("<a href='?" + queryStr.replace(/page=(\d+)/gi,"Page=" + ((parseInt(CurrentPage / PageSize) - (CurrentPage % PageSize==0?1:0)) * PageSize).toString()) + "'>" + PreviousText + "</a> ");
			}
		}
		else
		{
			if(CurrentPage > 1)
			{
				document.write("<a href='?" + queryStr.replace(/page=(\d+)/gi,"Page=1") + "'>" + FirstText + "</a> ");
			}
			if(CurrentPage > 1)
			{
				document.write("<a href='?" + queryStr.replace(/page=(\d+)/gi,"Page=" + (CurrentPage - 1).toString()) + "'>" + PreviousText + "</a> ");
			}
		}
	}
	//下一页,尾页
	this.ShowLastNext	=	function(PageCount, CurrentPage, NextText, LastText, PageSize)
	{
		if(isNaN(parseInt(PageSize)))
			PageSize	=	0;
		if(PageSize > 0)
		{
			if((parseInt(CurrentPage / PageSize) + (CurrentPage % PageSize==0?0:1)) * PageSize < PageCount)
			{
				document.write("<a href='?" + queryStr.replace(/page=(\d+)/gi,"Page=" + ((parseInt(CurrentPage / PageSize) + (CurrentPage % PageSize==0?0:1)) * PageSize + 1).toString()) + "'>" + NextText + "</a> ");
			}
			if(CurrentPage < PageCount)
			{
				document.write("<a href='?" + queryStr.replace(/page=(\d+)/gi,"Page=" + PageCount.toString()) + "'>" + LastText + "</a> ");
			}
		}
		else
		{
			if(CurrentPage < PageCount)
			{
				document.write("<a href='?" + queryStr.replace(/page=(\d+)/gi,"Page=" + (CurrentPage + 1).toString()) + "'>" + NextText + "</a> ");
			}
			if(CurrentPage < PageCount)
			{
				document.write("<a href='?" + queryStr.replace(/page=(\d+)/gi,"Page=" + PageCount.toString()) + "'>" + LastText + "</a> ");
			}
		}
	}
	if(typeof(RecNum)!='undefined')
	{
		document.write("共有<font color='red'><b>" + RecNum + "</b></font>个记录,");
	}
	//显示1..10
	if(ShowNumber)
	{
		var tmp	=	parseInt(CurrentPage / PageSize);
		if(CurrentPage % PageSize == 0)
			tmp--;
		tmp	=	tmp<0?0:tmp;
		this.ShowFirstPrevious(PageCount, CurrentPage, "<font face=webdings>9</font>", "<font face=webdings>7</font>", PageSize);
		for(var i = tmp * PageSize + 1; i <= PageSize * (tmp + 1); i++)
		{
			if(i > PageCount)break;
			if(CurrentPage != i)
				document.write("<a href='?" + queryStr.replace(/page=(\d+)/gi,"Page=" + i.toString()) + "'>" +  i.toString() + "</a> ");
			else
				document.write("<font color=red><b>" +  i.toString() + "</b></font> ");
		}
		this.ShowLastNext(PageCount, CurrentPage, "<font face=webdings>8</font>", "<font face=webdings>:</font>", PageSize);
	}
	//显示上一页,下一页
	if(ShowCNNext)
	{
		this.ShowFirstPrevious(PageCount, CurrentPage, "首页", "上一页");
		this.ShowLastNext(PageCount, CurrentPage, "下一页", "尾页");
	}
	//显示转到第几页
	if(ShowGO)
	{
		document.write('转到 <INPUT NAME="PageNumber" id="PageNumber" value="' + CurrentPage.toString() + '" TYPE="text" onchange="javascript:javascript:this.value=this.value.replace(/[^0-9]/gi,\'\');" onKeyUp="javascript:this.value=this.value.replace(/[^0-9]/gi,\'\');" SIZE="3" MAXLENGTH="5"> 页 ');
		document.write("<input type=button name=Submit value=GO onclick='var obj = document.getElementById(\"PageNumber\").value;if(!isNaN(parseInt(obj))){location.href=\"?" + queryStr.replace("\\","\\\\").replace(/\"/gi,"\\\"").replace(/\'/gi,"&#39;") + "\".replace(/page=(\\\d+)/gi,\"Page=\" + obj);}else{alert(\"请输入正确的页码!\");}'>");
	}
	//window.status	=	queryStr;
}
//个人内部搜索
function PersonInSearch()
{
    var retval = "";
    var tmp = new Array("ST", "HY", "GZ", "DQ", "KW");
    for(var i=0;i<tmp.length;i++)
    {
        var v = $(tmp[i]).value;
        if(v!="")retval += (retval==""?"":"&") + tmp[i] + "=" + escape(v);
    }
    return retval;
}
//企业内部搜索
function CompanyInSearch()
{
    var retval = "";
    var tmp = new Array("KW", "XL", "ZY", "JY","XB");
    for(var i=0;i<tmp.length;i++)
    {
        var v = $(tmp[i]).value;
        if(v!="")retval += (retval==""?"":"&") + tmp[i] + "=" + escape(v);
    }
    return retval;
}
//公共搜索
function CommonSearch()
{
    var retval = "";
    var tmp = new Array("ST", "DQ", "KW");
    for(var i=0;i<tmp.length;i++)
    {
        var v = $(tmp[i]).value;
        if(v.indexOf("关键字")!=-1)v="";
        if(v!="")retval += (retval==""?"":"&") + tmp[i] + "=" + escape(v);
    }
    return retval;
}
//显示职位
function showJob(cid, jid)
{
    if(window.ajax){window.ajax.transport.abort()};
    var obj = $("_" + cid);
    var newObj = $("_" + jid + "_" + cid);
    if(newObj){obj.style.display = "";initJobData(cid, jid, newObj);return;}
    var templ = '<table width="100%" id="_{JobID}_{cid}" border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC" style="margin-top:10px;background-Color:#CCCCCC;">';
    templ += '<tr><td width="8%" class="bg5">职位名称</td><td  class="bgwhite"><span class="ccc0">{JobName}</span></td><td width="8%" class="bg5">所需人数</td>';
    templ += '<td width="10%" class="bgwhite">{Persons}</td><td width="8%" class="bg5">每月薪水</td><td width="10%" class="bgwhite">{Salary}</td><td width="8%" class="bg5">所属部门</td>';
    templ += '<td width="10%" class="bgwhite">{Dept}</td><td width="8%" class="bg5">所需文化</td><td width="10%" class="bgwhite">{Diploma} 以上</td></tr>';
    templ += '<tr><td class="bg5">工作地点</td><td class="bgwhite">{WorkArea}</td><td class="bg5">年龄要求</td><td class="bgwhite">{Age1}</td><td class="bg5">性别要求</td>';
    templ += '<td class="bgwhite">{Gender}</td><td class="bg5">岗位浏览</td><td class="bgwhite">{LookedTimes} 次</td><td class="bg5">工作经验</td><td class="bgwhite">{WorkExp}</td></tr>';
    templ += '<tr><td class="bg5">工作种类</td><td class="bgwhite">{JobType}</td><td class="bg5">工作性质</td><td class="bgwhite">{JobKind}</td><td class="bg5">职位有效期</td>';
    templ += '<td class="bgwhite">{JobValidDay}</td><td class="bg5">更新日期</td><td class="bgwhite" colspan="3">{RefererTime}</td></tr>';
    templ += '<tr><td class="bg5">职位描述<br />岗位要求</td><td colspan="9" class="bgwhite">{Require}</td></tr>';
    templ += '<tr><td colspan="10" class="bg5"><div style="float:right;"><a href="javascript:hiddenJobs({cid})" class="l3F419E">收起列表</a> | <a href="/CompanyDetail.aspx?id={cid}" target=_balnk class="l3F419E">查看公司简介</a></div>';
    templ += '<a href="/myjob/applyJobs.aspx?id={JobID}" target="_blank"><img src="images/c12.gif" border="0" align="absmiddle" /></a><a href="/myjob/function.aspx?method=FavJobs&jid={JobID}" target="_blank"><img src="images/c13.gif" align="absmiddle" border="0" /></a>';
    templ += '<a href="javascript:;" onclick="wopen(\'/ToFriends.aspx?JID={JobID}&CID={cid}\',550,300,400,300); "><img src="images/email.gif" width="80" height="25" align="absmiddle" border="0"/></a></td></tr></table>'
    
    var url		= '/ajax.ashx';
	var param	= 'method=GetJobDetail&jid=' + jid + '&cid=' + cid;
	var option	=
	{
		method:"get",
		parameters: param,
		onFailure:function(){
			alert("读取数据失败，请重试！");
		},	
		onSuccess:function(transport)
		{
			var msg = transport.responseText;
			if(msg=="")return;
			var objXml = transport.responseXML.documentElement.childNodes;
			for(var j=0;j<objXml.length;j++)
			{
			    var obj = objXml[j].childNodes;
			    var tmp_templ = templ;
			    for(var i=0;i<obj.length;i++)
			    {
			        var k = "{" + obj[i].tagName + "}";
			        var v = obj[i].text ? obj[i].text : obj[i].textContent;
			        var re = new RegExp(k, "gi");
		            tmp_templ = tmp_templ.replace(re, (typeof v)=='undefined'?"":v);
			    }
			    //tmp_templ = tmp_templ.replace(/\{JobID\}/g, jid);
			    tmp_templ = tmp_templ.replace(/\{cid\}/g, cid);
			    initJobData(cid, jid, tmp_templ);
			}
			initJobData(cid, jid, $("_" + jid + "_" + cid));
		}
	}
	window.ajax = new Ajax.Request(url, option);
}
//显示提示职位
function showTipJobs(e, cid)
{
    if(document.readyState!="complete")return;
    if(window.ajax){window.ajax.transport.abort()};
    if(cid<=0)return;
    
    var url		= '/ajax.ashx';
	var param	= 'method=ShowJobs&id=' + cid;
	var x = 0, y = 0;
	if(document.all){x = e.x; y = e.y;}else{x = e.clientX; y = e.clientY;}
	if(window.Cache)
	{
	    if(window.Cache[cid])
	    {
	        showTip({x: x, y: y}, window.Cache[cid]);
	        return;
	    }
	}
	var option	=
	{
		method:"get",
		parameters: param,
		onFailure:function(){
			showTip({x: x, y: y}, "读取数据失败，请重试！");
		},	
		onSuccess:function(transport)
		{
		    if(!window.Cache){window.Cache = new Object();}
		    var msg = transport.responseText;
		    window.Cache[cid] = msg;
			showTip({x: x, y: y}, msg);
		}
	}
	window.ajax = new Ajax.Request(url, option);
}
//显示内容
function initJobData(cid, jid, content)
{
    var obj = $("_" + cid);
    obj.style.display = "";
    var isObject = typeof(content)=='object';
    if(isObject)
    {
        obj.removeChild(content);
        obj.insertBefore(content, obj.firstChild==null?null:obj.firstChild);
    }
    else
    {
        var supportsDOMRanges = document.implementation.hasFeature("Range", "2.0"); 
        if(supportsDOMRanges)
        {
            var range=document.createRange();
            range.setStartBefore(obj);
            var Frag=range.createContextualFragment(content);
            obj.insertBefore(Frag, null);
        }
        else
        {
            obj.insertAdjacentHTML("beforeEnd", content);
        }
    }
    if(window.lastObject)window.lastObject.style.backgroundColor = "";
    window.lastObject = $("_" + jid + "_" + cid);
    if(isObject)content.style.backgroundColor="#ff6600";
}
//隐藏职位
function hiddenJobs(cid)
{
    $("_" + cid).style.display = "none";
}
//弹出窗口
function wopen(url,width,height,left,top)
{
    open(url,"NewWindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width="+width+",height="+height+",left="+left+",top="+top+"");
}
function initTips()
{
    var o = document.getElementsByTagName("INPUT");
    for(var i=0;i<o.length;i++)
    {
        var obj = o[i];
        if(obj.type && (obj.type == "text" || obj.type == "password") && obj.id.substring(0, 3)=="txt")
        {
            if(obj.onfocus == null)
            {
                obj.onfocus = Function("Tips.change(this);");
            }
            else
            {
                var fun = obj.onfocus.toString();
                fun = fun.replace("function anonymous()\n{", "");
                fun = fun.replace(/\}$/, "");
                obj.onfocus = Function("Tips.change(this);" + fun);
            }
            if(obj.onblur == null)
            {
                obj.onblur = Function("Tips.reset(this);");
            }
            else
            {
                var fun = obj.onblur.toString();
                fun = fun.replace("function anonymous()\n{", "");
                fun = fun.replace(/\}$/, "");
                obj.onblur = Function("Tips.reset(this);" + fun);
            }            
        }
    }
}
//**************弹出职位**************************
function showTip(e, inp)
{
    if(document.readyState!="complete")return;
	if(!e)e=window.event;
	var oDiv = createDiv();
	oDiv.innerHTML = inp;
	oDiv.style.display = "";
	var docWidth = document.documentElement.scrollWidth;
	var docHeight = document.documentElement.scrollTop;
	var x = e.x,y = e.y;
	if(!e.x)
	{
	    x = e.clientX;y = e.clientY;
	}
	if(oDiv.offsetWidth + x + 30 >= docWidth)
	{
		oDiv.style.left = (docWidth - oDiv.offsetWidth - 30) + "px";
		oDiv.style.top = (y + docHeight + 25) + "px";
	}
	else
	{
		oDiv.style.left = (x + 10) + "px";
		oDiv.style.top = (y + docHeight) + "px";
	}
}
function createDiv()
{
	var oDiv = document.getElementById("tips");
	if(oDiv==null)
	{
		oDiv = document.createElement("DIV");
		oDiv.id="tips";
		oDiv.style.border="#858585 1px solid";
		oDiv.style.position="absolute";
		oDiv.style.backgroundColor = "#FFFFF1";
		oDiv.style.padding = "5px";
		oDiv.style.color="#333333";
		oDiv.style.lineHeight = "150%";
		document.body.appendChild(oDiv);
		oDiv.style.width = "230px";
		oDiv.style.display = "none";
	}
	oDiv.innerHTML = "正在读取数据,请稍等...";
	return oDiv;
}
function hideTip()
{
	var oDiv = document.getElementById("tips");
	if(oDiv)
	{
		oDiv.style.display = "none";
		oDiv.style.left = "0px";
		oDiv.style.top = "0px";
	}
}
//*********************首页切换****************************
function adSwitch(index)
{
    return;
    setTimeout("adSwitch1(" + index + ")", 200);
}
function adSwitch1(index)
{
    for(var i=1;i<=5;i++)
    {
        $("sw" + i).style.display="none";
        $("s" + i).className=(i!=5?"left good":"left good1");
    }
    $("sw" + index).style.display="";
    $("s" + index).className=index!=5?"left good_1":"left good1_1";
}
//*************************导航切换**************************
function navSwitch()
{
    var url = document.location.href.toLowerCase();
    if(url.indexOf("search.aspx?st=1")!=-1)navSwitch1(2);
    if(url.indexOf("search.aspx?st=2")!=-1)navSwitch1(3);
}
function navSwitch1(index)
{
    $("n" + index).className="hi";
    $("n1").className = "navy";
}
//**********************************************************
function Preview()
{
    var domain = $("PersonHead1_d").value;
    var host = location.host.split(".");
    
    while(host.length>=3)
    {
        host.shift();
    }
    host = new Array("rc" + domain).concat(host);
    window.open("http://" + host.join("."));
}

function CompanyDomain()
{
    var domain = $("CompanyHead1_d").value;
    var host = location.host.split(".");
    
    while(host.length>=3)
    {
        host.shift();
    }
    host = new Array(domain).concat(host);
    window.open("http://" + host.join("."));
}
//判断是否是数字
function Myorder(text)
{
    inputChk(text);
    if(isNaN(text.value)||text.value=="")
    {
         text.value="0";
    }
}

function companyTemplte(v)
{
	if(v=="")return;
	var con = new Array(
		"感谢您的应聘！\r\n您的简历我们已收到，会尽快阅评，如有需要将约您面谈！",
		"面试时间:XXXX年XX月XX日\r\n面试地址:XXXXXXXXXXXXXXXXXXX\r\n联系人:" + LinkMan + " 联系电话:" + Tel + "\r\n谢谢!",
		"感谢您的应聘！\r\n但该职位已招满,如有需要我们将联系你!",
		"您已被录用,请前来报道\r\n报道时间:XXXX年XX月XX日\r\n报道地址:XXXXXXXXXXXXXXXXXXX\r\n联系人:" + LinkMan + " 联系电话:" + Tel + "\r\n谢谢!");
	
	this.$("M_txt3").value = con[parseInt(v)];
}

function defaultSwitch(o)
{
    switch(o)
    {
        case 1:
            $("re1").style.display="none";
            $("ire1").style.display="none";
            $("re2").style.display="";
            $("ire2").style.display="";
            break;
        case 2:
            $("re1").style.display="";
            $("ire1").style.display="";
            $("re2").style.display="none";
            $("ire2").style.display="none";
            break;
    }
}
/******************************************************************************************************************************/
/*                                              新加功能                                                                      */
/******************************************************************************************************************************/

//URL,提交方法,参数,回调函数,聚焦控件ID
document.write("<div id='systemWorking' style='display:none;position:absolute;left:0px;top:0px;background-Color:#ffffaa;border:1px solid red;'><img src='/images/waiting.gif'>Loading...</div>");
function AjaxMethod(url, method, parame, callBack, objID)
{
    if(parame==""){alert("参数为空");return;}

    var myGlobalHandlers = {
        onCreate: function(){
            $("systemWorking").style.top = document.documentElement.scrollTop + "px";
            $("systemWorking").style.left = document.documentElement.scrollLeft + "px";
            Element.show('systemWorking');
        },
        onComplete: function() {
            if(Ajax.activeRequestCount == 0){
                Element.hide('systemWorking');
            }
        }
    };
    if(callBack!=null)Ajax.Responders.register(myGlobalHandlers);
	var option	=
    {
	    method:method||"get",
	    parameters: parame + "&" + Math.random(),
	    onFailure:function(){
		    alert("提交服务器失败!");
	    },	
	    onSuccess:function(transport)
	    {
	        if(callBack!=null)callBack(transport, objID);
	    }
    }
    new Ajax.Request(url, option);
}

//隐藏控件
function hideObject(controlID)
{
    $(controlID).style.display = "none";
    if($("hidden_layer"))$("hidden_layer").style.display = "none";
}

function InitObjectPos(obj)
{
	var scrollTop = document.documentElement.scrollTop;
	var scrollHeight = document.documentElement.scrollHeight;
	var clientHeight = document.documentElement.clientHeight;
	
	var scrollLeft = document.documentElement.scrollLeft;
	var scrollWidth = document.documentElement.scrollWidth;
	var clientWidth = document.documentElement.clientWidth;
	
	var offsetWidth = document.documentElement.offsetWidth;	
	var offsetHeight = document.documentElement.offsetHeight;
	
	var Obj_offsetWidth = document.all?obj.firstChild.offsetWidth:obj.firstChild.width;
	var Obj_offsetHeight = obj.firstChild.offsetHeight;
	
	var layer = $("hidden_layer");
	if(!layer)
	{
        layer = document.createElement("div");
        if(document.all)
            layer.style.filter = "Alpha(Opacity=40)";
        else
            layer.style.opacity = "0.4";
        layer.style.position="absolute";
        layer.id = "hidden_layer";
        layer.style.backgroundColor = "#ccc";
        document.body.appendChild(layer);
    }
    else
    {
        layer.style.display = "";
    }
	
	obj.style.position = "absolute";
	obj.style.border = "1px solid red";
	
	var myOffsetLeft = 0, myOffsetTop = 0;
	if(offsetHeight>Obj_offsetHeight)
	{
	    myOffsetTop = parseInt(clientHeight / 2 - Obj_offsetHeight / 2 + scrollTop);
	}
	else
	{
	    myOffsetTop = scrollTop;
	}
	
	if(offsetWidth>Obj_offsetWidth)
	{
	    myOffsetLeft = parseInt(clientWidth / 2 - Obj_offsetWidth / 2 + scrollLeft);
	}
	else
	{
	    myOffsetLeft = scrollLeft;
	}
	
	obj.style.left = myOffsetLeft + "px";
	obj.style.top = myOffsetTop + "px";
	obj.style.width = Obj_offsetWidth + "px";
	
	layer.style.zIndex='998';
    layer.style.left = "0px";
    layer.style.top = "0px";
    layer.style.width = scrollWidth + "px";
    layer.style.height = scrollHeight + "px";
    
    document.onkeydown = function(e){if(!e)e=event;if(e.keyCode==27)hideObject(obj.id);}
}function mi(i){document.write((i==""?"":"&#") + i.replace(/;/g,";&#"));}
