/******** Editorial dept. begin ********/

/* sinaFlash begin */
/* http://i3.sinaimg.cn/home/sinaflash.js */
if(typeof(sina)!="object"){var sina={}}sina.$=function(i){if(!i){return null}return document.getElementById(i)};var sinaFlash=function(V,x,X,Z,v,z,i,c,I,l,o){var w=this;if(!document.createElement||!document.getElementById){return}w.id=x?x:'';var O=function(I,i){for(var l=0;l<I.length;l++){if(I[l]==i){return l}}return-1},C='8.0.42.0';if(O(['eladies.sina.com.cn','ent.sina.com.cn'],document.domain)>-1){w.ver=C}else{w.ver=v?v:C}w.ver=w.ver.replace(/\./g,',');w.__classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";w.__codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version="+w.ver;w.width=X;w.height=Z;w.movie=V;w.src=w.movie;w.bgcolor=z?z:'';w.quality=c?c:"high";w.__pluginspage="http://www.macromedia.com/go/getflashplayer";w.__type="application/x-shockwave-flash";w.useExpressInstall=(typeof(i)=="boolean")?i:false;w.xir=I?I:window.location;w.redirectUrl=l?l:window.location;w.detectKey=(typeof(o)=="boolean")?o:true;w.escapeIs=false;w.__objAttrs={};w.__params={};w.__embedAttrs={};w.__flashVars=[];w.__flashVarsStr="";w.__forSetAttribute("id",w.id);w.__objAttrs["classid"]=w.__classid;w.__forSetAttribute("codebase",w.__codebase);w.__forSetAttribute("width",w.width);w.__forSetAttribute("height",w.height);w.__forSetAttribute("movie",w.movie);w.__forSetAttribute("quality",w.quality);w.__forSetAttribute("pluginspage",w.__pluginspage);w.__forSetAttribute("type",w.__type);w.__forSetAttribute("bgcolor",w.bgcolor)};sinaFlash.prototype={getFlashHtml:function(){var I=this,i='<object ';for(var l in I.__objAttrs){i+=l+'="'+I.__objAttrs[l]+'"'+' '};i+='>\n';for(var l in I.__params){i+='	<param name="'+l+'" value="'+I.__params[l]+'" \/>\n'};if(I.__flashVarsStr!=""){i+='	<param name="flashvars" value="'+I.__flashVarsStr+'" \/>\n'};i+='	<embed ';for(var l in I.__embedAttrs){i+=l+'="'+I.__embedAttrs[l]+'"'+' '};i+='><\/embed>\n<\/object>';return i},__forSetAttribute:function(I,i){var l=this;if(typeof(I)=="undefined"||I==''||typeof(i)=="undefined"||i==''){return};I=I.toLowerCase();switch(I){case "classid":break;case "pluginspage":l.__embedAttrs[I]=i;break;case "onafterupdate":case "onbeforeupdate":case "onblur":case "oncellchange":case "onclick":case "ondblClick":case "ondrag":case "ondragend":case "ondragenter":case "ondragleave":case "ondragover":case "ondrop":case "onfinish":case "onfocus":case "onhelp":case "onmousedown":case "onmouseup":case "onmouseover":case "onmousemove":case "onmouseout":case "onkeypress":case "onkeydown":case "onkeyup":case "onload":case "onlosecapture":case "onpropertychange":case "onreadystatechange":case "onrowsdelete":case "onrowenter":case "onrowexit":case "onrowsinserted":case "onstart":case "onscroll":case "onbeforeeditfocus":case "onactivate":case "onbeforedeactivate":case "ondeactivate":case "codebase":l.__objAttrs[I]=i;break;case "src":case "movie":l.__embedAttrs["src"]=i;l.__params["movie"]=i;break;case "width":case "height":case "align":case "vspace":case "hspace":case "title":case "class":case "name":case "id":case "accesskey":case "tabindex":case "type":l.__objAttrs[I]=l.__embedAttrs[I]=i;break;default:l.__params[I]=l.__embedAttrs[I]=i}},__forGetAttribute:function(i){var I=this;i=i.toLowerCase();if(typeof I.__objAttrs[i]!="undefined"){return I.__objAttrs[i]}else if(typeof I.__params[i]!="undefined"){return I.__params[i]}else if(typeof I.__embedAttrs[i]!="undefined"){return I.__embedAttrs[i]}else{return null}},setAttribute:function(I,i){this.__forSetAttribute(I,i)},getAttribute:function(i){return this.__forGetAttribute(i)},addVariable:function(I,i){var l=this;if(l.escapeIs){I=escape(I);i=escape(i)};if(l.__flashVarsStr==""){l.__flashVarsStr=I+"="+i}else{l.__flashVarsStr+="&"+I+"="+i};l.__embedAttrs["FlashVars"]=l.__flashVarsStr},getVariable:function(I){var o=this,i=o.__flashVarsStr;if(o.escapeIs){I=escape(I)};var l=new RegExp(I+"=([^\\&]*)(\\&?)","i").exec(i);if(o.escapeIs){return unescape(RegExp.$1)};return RegExp.$1},addParam:function(I,i){this.__forSetAttribute(I,i)},getParam:function(i){return this.__forGetAttribute(i)},write:function(i){var I=this;if(typeof i=="string"){document.getElementById(i).innerHTML=I.getFlashHtml()}else if(typeof i=="object"){i.innerHTML=I.getFlashHtml()}}};
/* sinaFlash end */

/* login Suggest begin */
/* http://news.sina.com.cn/iframe/213/20080331/8.js */
(function () {
	/**
	 * 判断浏览器类型
	 * add by xs @ 2008-3-4
	 */
	var _ua = navigator.userAgent.toLowerCase();
	var $IE = /msie/.test(_ua);
	var $moz = /gecko/.test(_ua);
	var $Safari = /safari/.test(_ua);
	/**
	 * 根据元素的id获取对应节点的引用
	 * @author stan | chaoliang@staff.sina.com.cn
	 * @param {String} id 节点的id或者节点本身
	 */
	function $E(id) {
		return typeof(id) == 'string' ? _viewWindow.document.getElementById(id) : id;
	}
/**
 * 取得页面的scrollPos
 * @return {Array} 滚动条居顶 居左值
 * @author chaoliang@staff.sina.com.cn
 *         fangchao@staff.sina.com.cn
 * @update 08.02.13
 */
var getScrollPos = function(oDocument) {
	oDocument = oDocument || document;
	return [
			Math.max(oDocument.documentElement.scrollTop, oDocument.body.scrollTop), 
			Math.max(oDocument.documentElement.scrollLeft, oDocument.body.scrollLeft),
			Math.max(oDocument.documentElement.scrollWidth, oDocument.body.scrollWidth), 
			Math.max(oDocument.documentElement.scrollHeight, oDocument.body.scrollHeight)
			];
};

/**
* 获取指定节点的样式
* @method getStyle
* @param {HTMLElement | Document} el 节点对象
* @param {String} property 样式名
* @return {String} 指定样式的值
* @author FlashSoft | fangchao@staff.sina.com.cn
* @update 08.02.23
* @global $getStyle
* @exception
* 			getStyle(document.body, "left");
* 			$getStyle(document.body, "left");
*/ 
var getStyle = function (el, property) {
	switch (property) {
		// 透明度
		case "opacity":
				var val = 100;
				try {
						val = el.filters['DXImageTransform.Microsoft.Alpha'].opacity;
				}
				catch(e) {
						try {
							val = el.filters('alpha').opacity;
						}catch(e){}
				}
				return val;
		 // 浮动
		 case "float":
				 property = "styleFloat";
		 default:
				 var value = el.currentStyle? el.currentStyle[property]: null;
				 return ( el.style[property] || value );
	}
};
if($moz) {
	getStyle = function (el, property) {
		// 浮动
		if(property == "float") {
			property = "cssFloat";
		}
		// 获取集合
		try{
			var computed = document.defaultView.getComputedStyle(el, "");
		}
		catch(e) {
			traceError(e);
		}
		return el.style[property] || computed? computed[property]: null;
	};
}

/**
* 获取节点对象的距文档的XY值
* @method getXY
* @param {HTMLElement } el 节点对象
* @return {Array} x,y的数组对象
* @author FlashSoft | fangchao@staff.sina.com.cn
* @update 08.02.23
* @global $getXY
* @exception
* 			getXY($E("input"));
* 			$getXY($E("input"));
*/
var getXY = function (el) {
	if ((el.parentNode == null || el.offsetParent == null || getStyle(el, "display") == "none") && el != document.body) {
		return false;
	}
	var parentNode = null;
	var pos = [];
	var box;
	var doc = el.ownerDocument;
	// IE
	box = el.getBoundingClientRect();
	var scrollPos = getScrollPos(el.ownerDocument);
	return [box.left + scrollPos[1], box.top + scrollPos[0]];
	// IE end
	parentNode = el.parentNode;
	while (parentNode.tagName && !/^body|html$/i.test(parentNode.tagName)) {
		if (getStyle(parentNode, "display").search(/^inline|table-row.*$/i)) { 
			pos[0] -= parentNode.scrollLeft;
			pos[1] -= parentNode.scrollTop;
		}
		parentNode = parentNode.parentNode; 
	}
	return pos;
};
	if($moz) {
		getXY = function (el) {
			if ((el.parentNode == null || el.offsetParent == null || getStyle(el, "display") == "none") && el != document.body) {
				return false;
			}
			var parentNode = null;
			var pos = [];
			var box;
			var doc = el.ownerDocument;

			// FF
			pos = [el.offsetLeft, el.offsetTop];
			parentNode = el.offsetParent;
			var hasAbs = getStyle(el, "position") == "absolute";

			if (parentNode != el) {
				while (parentNode) {
						pos[0] += parentNode.offsetLeft;
						pos[1] += parentNode.offsetTop;
						if ($Safari && !hasAbs && getStyle(parentNode,"position") == "absolute" ) {
								hasAbs = true;
						}
						parentNode = parentNode.offsetParent;
				}
			}

			if ($Safari && hasAbs) {
				pos[0] -= el.ownerDocument.body.offsetLeft;
				pos[1] -= el.ownerDocument.body.offsetTop;
			}
			parentNode = el.parentNode;
			// FF End
			while (parentNode.tagName && !/^body|html$/i.test(parentNode.tagName)) {
				if (getStyle(parentNode, "display").search(/^inline|table-row.*$/i)) { 
					pos[0] -= parentNode.scrollLeft;
					pos[1] -= parentNode.scrollTop;
				}
				parentNode = parentNode.parentNode; 
			}
			return pos;
		};
	}

	/**
	 * 获取Event对象
	 * @method getEvent
	 * @return {Event} event对象
	 * @author FlashSoft | fangchao@staff.sina.com.cn
	 * @update 08.02.23
	 * @exception
	 * 			getEvent();
	 */
	var getEvent = function () {
		return window.event;
	};
	if($moz) {
		getEvent = function () {
			var o = arguments.callee.caller;
			var e;
			var n = 0;
			while(o != null && n < 40){
				e = o.arguments[0];
				if (e && (e.constructor == Event || e.constructor == MouseEvent)) {
					return e;

				}
				n ++;
				o = o.caller;
			}
			return e;
		};
	}

	/**
	 * 禁止Event事件冒泡
	 * @method stopEvent
	 * @author FlashSoft | fangchao@staff.sina.com.cn
	 * @update 08.02.23
	 * @exception
	 * 			stopEvent();
	 */
	var stopEvent = function() {
		var ev = getEvent();
		ev.cancelBubble = true;
		ev.returnValue = false;
	};
	if($moz) {
		stopEvent = function() {
			var ev = getEvent();
			ev.preventDefault();
			ev.stopPropagation();
		};
	}
	Function.prototype.bind3 = function(object, args) { 
		args = args == null? []: args;
		var __method = this; 
		return function() { 
			__method.apply(object, args); 
		} 
	};
	/**
	* 在指定节点上绑定相应的事件
	* @method addEvent2
	* @param {String} elm 需要绑定的节点id
	* @param {Function} func 事件发生时相应的函数
	* @param {String} evType 事件的类型如:click, mouseover
	* @update 08.02.23
	* @author Stan | chaoliang@staff.sina.com.cn
	*         FlashSoft | fangchao@staff.sina.com.cn
	* @example
	* 		//鼠标点击testEle则alert "clicked"
	* 		$addEvent2("testEle",function () {
	* 			alert("clicked")
	* 		},'click');
	*/
	function addEvent2 (elm, func, evType, useCapture) {
		var elm = $E(elm);
		if(typeof useCapture == 'undefined') useCapture = false;
		if(typeof evType == 'undefined')  evType = 'click';
		if (elm.addEventListener) {
			elm.addEventListener(evType, func, useCapture);
			return true;
		}
		else if (elm.attachEvent) {
			var r = elm.attachEvent('on' + evType, func);
			return true;
		}
		else {
			elm['on' + evType] = func;
		}
	};

	/**
		初始化的一些变量

		@author FlashSoft | fangchao@staff.sina.com.cn
	*/
	var _inputNode;
	var _rndID = parseInt(Math.random() * 100);
	/** 当前显示的菜单集合 */
	var _showMenuItems = [];
	/** 当前显示的菜单索引 */
	var _selectMenuIndex = -1;
	/** 被选中行的文字 */
	var _selectMenuText = "";

	var _viewWindow = window;
	var passcardOBJ = {
		// 鼠标经过背景颜色
		overfcolor: "#999",
		// 鼠标经过背景颜色
		overbgcolor: "#e8f4fc",
		// 鼠标离开字体颜色
		outfcolor: "#000000",
		// 鼠标离开背景颜色
		outbgcolor: "",
		menuStatus: {
			// 是否显示Sina邮箱
			"sina.com": true,
			// 是否显示VIP邮箱 
			"vip.sina.com": true,
			// 是否显示2008
			"2008.sina.com": true,
			// 是否显示263
			"263.sina.com": true,
			// 是否显示CN邮箱
			"sina.cn": true,
			// 是否显示外域邮箱
			"非新浪邮箱": true
		}
	}

	/**
	 * 动态生成提示框
	 * add by xs @ 2008-3-4
	 */
	passcardOBJ.createNode = function(){
			var d = _viewWindow.document;
			var div = d.createElement('div');
			div.innerHTML = '<ul class="passCard" id="sinaNote" style="display:none;"></ul>'
			d.body.appendChild(div);
	}
	/**
		快捷键选择菜单
		@author FlashSoft | fangchao@staff.sina.com.cn
	*/
	passcardOBJ.arrowKey = function (keyCodeNum) {
			if(keyCodeNum == 38) {// --
					if(_selectMenuIndex <= 0)_selectMenuIndex = _showMenuItems.length;
					_selectMenuIndex --;
					passcardOBJ.selectLi(_selectMenuIndex);
			}
			if(keyCodeNum == 40) {// ++
					if(_selectMenuIndex >= _showMenuItems.length - 1)_selectMenuIndex = -1;
					_selectMenuIndex ++;

					passcardOBJ.selectLi(_selectMenuIndex);
			}
	};
	passcardOBJ.showList = function(e)//显示列表
	{
			_selectMenuText = "";
			var keyCodeNum = getEvent().keyCode;
			if(keyCodeNum == 38 || keyCodeNum == 40)  {
				passcardOBJ.arrowKey(keyCodeNum);
				return false;
			}
			if (!$E('sinaNote')) 
					passcardOBJ.createNode();
			var username = $E(e).value;
			var menuList = {
			};
			var atIndex = username.indexOf("@");
			var InputCase = "";
			var InputStr = "";
			if(atIndex > -1) {
				InputCase = username.substr(atIndex + 1);
				InputStr = username.substr(0, atIndex);
			}

			_showMenuItems = [];
			_selectMenuIndex = 0;
			_showMenuItems[_showMenuItems.length] = "sinaNote_MenuItem_Title_" + _rndID;
			for(var key in this.menuStatus) {
				this.menuStatus[key] = true;
				if(InputCase != "" && InputCase != key.substr(0, InputCase.length)) {
						this.menuStatus[key] = false;
				}
				else {
						_showMenuItems[_showMenuItems.length] = "sinaNote_MenuItem_" + key + "_" + _rndID;
				}
			}
			var listcontent = '<li class="note">请选择登录类型</li>';

			listcontent += '<li id="sinaNote_MenuItem_Title_'+_rndID+'">' + username + '</li>';

			var itemLabel;
			for(var key in this.menuStatus) {
				if(this.menuStatus[key] == true) {
					if(InputStr == "") {
						itemLabel = username + "@" + key;
					}
					else {
						itemLabel = InputStr + "@" + key;
					}
					listcontent += '<li id="sinaNote_MenuItem_' + key + '_' + _rndID + '" title="'+itemLabel+'">' + itemLabel + '</li>';
				}
			}
			$E("sinaNote").innerHTML = listcontent;
			for (var i = 0; i < username.length; i++) {
					if (username.charCodeAt(i) < 0xA0) {
							$E("sinaNote").style.display = "";
							this.selectList(e);
					}
					else {
							this.hideList();
					}
			}

			/**
			 * 自动适应文本框的位置，及宽度
			 * add by xs @ 2008-3-3
			 */
			var el = $E(e);
			var note = $E("sinaNote");

			/**
				Iframe在父窗体的位置
				@author FlashSoft | fangchao@staff.sina.com.cn
			*/
			var frameLeft = 0;
			var frameTop = 0;
			var framePos;
			if(_viewWindow != window) {
				framePos = getXY(window.frameElement)
				frameLeft = framePos[0];
				frameTop = framePos[1];
			}

			var inputWidth = el.offsetWidth;
			if(inputWidth < 200) {
				inputWidth = 200;
			}
			note.style.width = inputWidth - 2 + 'px';
			var inputXY = getXY(el);
			note.style.left = (inputXY[0] - ($IE ? 2 : -1) + frameLeft) + 'px';
			note.style.top = (inputXY[1] + el.offsetHeight - ($IE ? 2 : -1) + frameTop) + 'px';
	}
	passcardOBJ.selectList = function(e)//选择列表
	{
			var unames = $E("sinaNote").getElementsByTagName("li");
			for (var i = 1; i < unames.length; i++) {
					unames[1].style.backgroundColor = passcardOBJ.overbgcolor;
					unames[1].style.color = passcardOBJ.outfcolor;//鼠标经过字体颜色
					unames[i].onmousedown = function(){
						var temp=this.innerHTML;
							if(temp.indexOf("非新浪邮箱")>-1){
								var pos=temp.split("@");
								$E(e).value=pos[0];
							}else{
								$E(e).value = this.innerHTML;
							}
							stopEvent();
					}
					unames[i].onmouseover = function(){
							if (i != 1) {
									unames[1].style.backgroundColor = passcardOBJ.outbgcolor;
									unames[1].style.color = passcardOBJ.overfcolor;//鼠标经过字体颜色
							}
							this.style.backgroundColor = passcardOBJ.overbgcolor;//鼠标经过背景颜色
							this.style.color = passcardOBJ.outfcolor;//鼠标经过字体颜色
					}
					unames[i].onmouseout = function(){
							this.style.backgroundColor = passcardOBJ.outbgcolor;//鼠标离开背景颜色
							this.style.color = passcardOBJ.overfcolor;//鼠标离开字体颜色
							unames[1].style.backgroundColor = passcardOBJ.overbgcolor;//鼠标经过背景颜色
							unames[1].style.color = passcardOBJ.outfcolor;//鼠标经过字体颜色
					}
			}
	}
	/**
		选中指定ID的li
		@author | fangchao@staff.sina.com.cn
	*/
	passcardOBJ.selectLi = function (nIndex) {
			var menuNode;
			$E("sinaNote_MenuItem_Title_"+_rndID).style.backgroundColor = passcardOBJ.outbgcolor;//鼠标离开背景颜色
			$E("sinaNote_MenuItem_Title_"+_rndID).style.color = passcardOBJ.overfcolor;//鼠标离开字体颜色
			for(var i = 0; i < _showMenuItems.length; i ++ ) {
				menuNode = $E(_showMenuItems[i]);
				menuNode.style.backgroundColor = passcardOBJ.outbgcolor;//鼠标离开背景颜色
				menuNode.style.color = passcardOBJ.overfcolor;//鼠标离开字体颜色
			}
			$E(_showMenuItems[nIndex]).style.backgroundColor = passcardOBJ.overbgcolor;//鼠标经过背景颜色
			$E(_showMenuItems[nIndex]).style.color = passcardOBJ.outfcolor;//鼠标经过字体颜色
			_selectMenuText = $E(_showMenuItems[nIndex]).innerHTML;

	}
	passcardOBJ.hideList = function()//隐藏列表
	{
			/**
			 * 如果没有找到页面中相应的对象，则自动创建
			 * add by xs @ 2008-3-3
			 */
			if (!$E('sinaNote')) 
					passcardOBJ.createNode();
			$E("sinaNote").style.display = "none";
	}
	passcardOBJ.init = function (oNode, oColors, oFocusNode, oWindowTarget) {
		for(var key in oColors) {
			this[key] = oColors[key];
		}
		addEvent2(document, passcardOBJ.hideList, "click");
		addEvent2(oNode, passcardOBJ.hideList, "blur");
		addEvent2(oNode, passcardOBJ.showList.bind3(this, [oNode]), "keyup");
		addEvent2(oNode, function (e) {
			var keyCodeNum = getEvent().keyCode;
			if(keyCodeNum == 13 || keyCodeNum == 9) {
				if(_selectMenuText != "") {
					var temp=_selectMenuText;
					if(temp.indexOf("非新浪邮箱")>-1){
						var pos=temp.split("@");
						oNode.value=pos[0];
					}else{
						oNode.value = _selectMenuText;
					}
				}
				if(oFocusNode != null) oFocusNode.focus();
				stopEvent();
			}
		}, "keydown");
		if(oWindowTarget) _viewWindow = oWindowTarget;
	}
	window.passcardOBJ = passcardOBJ;
})();
/* login Suggest end */

/******** Editorial dept. end ********/

/******** Sales dept. begin ********/
function SinaDotAdJs(){
//-------------------------------

var pthis = this;
//浏览器判断
this.isIE=navigator.userAgent.indexOf("MSIE")==-1?false:true;
this.isOPER=navigator.userAgent.indexOf("Opera")==-1?false:true;
this.version=navigator.appVersion.split(";"); 
this.trim_Version=this.version[1].replace(/[ ]/g,""); 
this.isIE6=(navigator.appName=="Microsoft Internet Explorer" && this.trim_Version=="MSIE6.0")?true:false;
this.isXHTML = document.compatMode=="CSS1Compat"?true:false;

//获取body
this.bdy = (document.documentElement && document.documentElement.clientWidth)?document.documentElement:document.body;

//获取对象
this.$ = function(id){if(document.getElementById){return eval('document.getElementById("'+id+'")')}else{return eval('document.all.'+id)}};

//获取cookie
this.getAdCookie = function(N){
	var c=document.cookie.split("; ");
	for(var i=0;i<c.length;i++){var d=c[i].split("=");if(d[0]==N)return unescape(d[1]);}
	return "";
};

//设置cookie
this.setAdCookie = function(N,V,Q,D){
	var L=new Date();
	var z=new Date(L.getTime()+Q*60000);
    var tmpdomain = "";
	if(typeof(D)!="undefined"){if(D){tmpdomain="domain=sina.com.cn;";}}
	document.cookie=N+"="+escape(V)+";path=/;"+tmpdomain+"expires="+z.toGMTString()+";";
};

//日期判断函数
this.compareDate = function(type,d){
  try{
        var dateArr = d.split("-");
        var checkDate = new Date();
        checkDate.setFullYear(dateArr[0], dateArr[1]-1, dateArr[2]);
		var now = new Date();
        var nowTime = now.getTime();
		var checkTime = checkDate.getTime();
		if(type=="after"){          
		  if(nowTime >= checkTime){return true;}
		  else{return false;}
		}		
        else if(type=="before"){
          if(nowTime <= checkTime){return true;}
		  else{return false;}
		}
  }catch(e){return false;}
}

//获取时间对象
this.strToDateFormat = function(str,ext){
	var arys = new Array();
	arys = str.split('-');
	var newDate = new Date(arys[0],arys[1]-1,arys[2],arys[3],0,0);
	if(ext){newDate = new Date(newDate.getTime()+1000*60*60*24);}
	return newDate;
 }

//时间区间检查
this.checkTime = function(begin,end){
  var td = new Date();
  var flag = (td>=pthis.strToDateFormat(begin,false) && td<pthis.strToDateFormat(end,begin==end?true:false))?true:false;
  return flag;
}

//外部事件加载
this.addEvent = function(obj,event,func){
  var MSIE=navigator.userAgent.indexOf("MSIE");
  var OPER=navigator.userAgent.indexOf("Opera");
  if(document.all && MSIE!=-1 && OPER==-1){
    obj.attachEvent("on"+event,func);
  }else{
    obj.addEventListener(event,func,false);
  }
};

//PNG透明函数
this.correctPNG = function(){ 
    var arVersion = navigator.appVersion.split("MSIE");
    var vs = parseFloat(arVersion[1]);
    if ((vs >= 5.5) && (document.body.filters)){ 
       for(var j=0; j<document.images.length; j++){ 
          var img = document.images[j];
          var imgName = img.src.toUpperCase(); 
          if (imgName.substring(imgName.length-3, imgName.length) == "PNG"){ 
             var imgID = (img.id) ? "id='" + img.id + "' " : "";
             var imgClass = (img.className) ? "class='" + img.className + "' " : "";
             var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
             var imgStyle = "display:inline-block;" + img.style.cssText;
             if (img.align == "left"){imgStyle = "float:left;" + imgStyle}
             if (img.align == "right"){imgStyle = "float:right;" + imgStyle}
             if (img.parentElement.href){imgStyle = "cursor:hand;" + imgStyle}
             var strNewHTML = "<span " + imgID + imgClass + imgTitle + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>";
             img.outerHTML = strNewHTML;
             j = j-1;
          } 
       } 
    }     
};

//容器对象
this.initWrap = function(mod,id,v,w,h,po,l,r,t,b,z,m,p,bg,dsp){
  var lst='';
  if(mod == 0x01){lst += 'pthis.'+v+' = document.createElement("'+id+'");';}
  else if(mod == 0x02){lst += 'pthis.'+v+' = document.getElementById("'+id+'");';}
  else return;
  if(v!="" && mod == 0x01){lst+=v+'.id = "'+v+'";';}
  if(w!=""){lst+=v+'.style.width = '+w+' + "px";';}
  if(h!=""){lst+=v+'.style.height = '+h+' + "px";';}
  if(po!=""){
	  lst+=v+'.style.position = "'+po+'";';

      if(l!=""){lst+=v+'.style.left = '+l+' + "px";';}
      else if(l=="" && r!=""){lst+=v+'.style.right = '+r+' + "px";';}
	  if(t!=""){lst+=v+'.style.top = '+t+' + "px";';}
      else if(t=="" && b!=""){lst+=v+'.style.bottom = '+b+' + "px";';}
	  if(z!=""){lst+=v+'.style.zIndex = "'+z+'";';}
  }
  if(bg!=""){lst+=v+'.style.background = "'+bg+'";';}
  if(m!=""){lst+=v+'.style.margin = "'+m+'";';}
  if(p!=""){lst+=v+'.style.padding = "'+p+'";';}
  if(dsp!=""){lst+=v+'.style.display = "'+dsp+'";';}
  return lst;
};

//素材对象
this.initObj = function(id,s,u,w,h){
  var lst = s.substring(s.length-3).toLowerCase();
  switch(lst){
	 case "tml":
	 case "htm":
	 case "php":var to = document.createElement("iframe");
                     to.id=id;
	                 to.width=w;
	                 to.height=h;
                     to.src=s;
                     to.frameBorder = 0;
					 to.allowTransparency = "true";
                     to.scrolling = "no";
                     to.marginheight = 0;
                     to.marginwidth = 0;
					 break;
	 case "swf": var to = document.createElement("div");
					 var fo = new sinaFlash( s, id, w, h, "7", "", false, "High");
	                 fo.addParam("wmode", "transparent");
	                 fo.addParam("allowScriptAccess", "always");
	                 fo.addParam("menu", "false");
	                 fo.write(to);
				     break;
     case "jpg":
     case "gif":
	 case "png":if(u!=""){
		             var to = document.createElement("a");
					 to.href = u;
					 to.target = "_blank";
					 var io = new Image();
	                 io.id = id;
					 io.style.width = w+"px";
					 io.style.height = h+"px";
					 io.style.border = "none";
					 io.src = s;
					 to.appendChild(io);
				}else{
				     var to = new Image();
	                 to.id = id;
					 to.style.width = w+"px";
					 to.style.height = h+"px";
					 to.style.border = "none";
					 to.style.cursor = "pointer";
					 to.src = s;	 
				}
				     break;
	     default:var to = document.createElement("a");
		             to.id = id;
					 to.href = u;
					 to.target = "_blank";
                     to.innerText = s;
  }
  return to;
};

//-------------------------------
};



/*********************************/

/*

轮播背投类 RotatorPB v3.1
Update by Dakular <shuhu@staff.sina.com.cn> 2008-8-25
格式：new RotatorPB(广告数组)
说明：第一次访问随机出现，以后访问顺序轮播；自动过滤过期广告；cookie时间24小时；商业广告数量不足时不显示
*/
if(typeof(RotatorPB)!='function'){
	var RotatorPB=function (rad){
		this.ary = new Array();
		this.date = new Date();
		this.w = rad.width;
		this.h = rad.height;
		this.num = rad.num;
		this.o = rad.length;
		this.id = RotatorPB.id++;
		this.m = 'rpb_'+this.id;
		this.n = new Array();
		this.L = new Date();
		this.e = 0;
		var f;
		var D = false;
		var nn = 0;
		//过滤无效广告
		for(var i=0; i<rad.length; i++){
			var start = RotatorPB.strToDate(rad[i][2].replace('<startdate>','').replace('</startdate>',''));
			var end = RotatorPB.strToDate(rad[i][3].replace('<enddate>','').replace('</enddate>',''),true);
			if(this.date>start && this.date<end && (this.num==null || this.ary.length<this.num) ){
				this.ary.push([rad[i][0], rad[i][1], rad[i][4]]);
			}
		}
		this.o = this.ary.length;
		//取id
		for(var i=0;i<this.o;i++){
			f=this.m+'_'+(i+1);
			g=RotatorPB.G(f);
			if(g!=''){
				this.n[i]=g;
				D=true;
			}else {
				this.n[i]=0;
			}
		}
		if(!D){
			var r=Math.ceil(Math.random()*this.o);
			var t=this.m+'_'+r;
			RotatorPB.S(t,this.L.getTime(),1440);
			this.e=r;
			if(this.o==1){RotatorPB.S('s_dl',r,1440);}
			//return r;
		}else {
			var R=this.n.join(',').split(',');
			var k=R.sort();
			var max=Number(k[k.length-1]);
			var min=Number(k[0]);
			var F;
			for(var i=0;i<this.n.length;i++){
				if(max==this.n[i]){
					F=i+1;
					break;
				}
			}
			if(typeof(F)!='undefined'){
				G=this.m+'_'+F;
				H=Number(RotatorPB.G(G));
				I=F%this.o+1;
				J=this.m+'_'+I;
				RotatorPB.S(J,this.L.getTime(),1440);
				if(this.o==1){
					I=-RotatorPB.G('s_dl');
					if(I==0){I=1;RotatorPB.S('s_dl',1,1440);}
					RotatorPB.S('s_dl',I,1440);
				}
				this.e=I;
				//return I;
			}
		}
		//Show AD
		if(this.e==0 || this.ary.length==0) return; //如果没有广告则不显示
		if(this.e==-1) return; //当只有一个广告时：始终显示第一个/奇数次刷新显示
		var n = this.e-1;
		var btsrc = this.ary[n][0];
		var bturl = this.ary[n][1];
		var bttype = btsrc.substring(btsrc.length-3).toLowerCase();
		if(bttype=='.js'){ //js
			document.write('<script language="javascript" type="text/javascript" src="'+btsrc+'"></scr'+'ipt>'); return;
		}else if(bttype!='htm' && bttype!='tml'){
			sinabturl = "http://d1.sina.com.cn/d1images/pb/pbv4.html?"+bturl+"${}"+bttype+"${}"+btsrc;
		}else{
			sinabturl = btsrc;
		}
		try{
			aryADSeq.push("openWindowBack()");
		}catch(e){
			openWindowBack();
		}
		if(this.ary[n][2]!=""){ //监测计数
			var oImg = new Image();
			oImg.src = this.ary[n][2];
		}
	};
	RotatorPB.id=1;
	RotatorPB.G=function (N){
		var c=document.cookie.split("; ");
		for(var i=0;i<c.length;i++){
			var d=c[i].split("=");
			if(d[0]==N)return unescape(d[1]);
		}return '';
	};
	RotatorPB.S=function (N,V,Q){
		var L=new Date();
		var z=new Date(L.getTime()+Q*60000);
		document.cookie=N+"="+escape(V)+"; path=/; expires="+z.toGMTString()+";";
	};
	RotatorPB.strToDate = function(str,ext){
		var arys = new Array();
		arys = str.split('-');
		var newDate = new Date(arys[0],arys[1]-1,arys[2],9,0,0);
		if(ext){
			newDate = new Date(newDate.getTime()+1000*60*60*24);
		}
		return newDate;
	}
	var openWindowBack = function(){
		var popUpWin2 = open(sinabturl, (window.name!="popUpWin2")?"popUpWin2":"", "width=1,height=1,top=4000,left=3000");
	}
};

/*********************************/



