

if (!jse) {
	var jse = {};
}
if (!$) {
	var $ = function (_id) {
		return document.getElementById(_id);
	};
}
var w3c = (document.getElementById) ? true : false;
var agt = navigator.userAgent.toLowerCase();
var ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1) && (agt.indexOf("omniweb") == -1));
jse.popwin = {_win:null, _bodyWidth:0, _disabledZone:null, _top:0, _isShow:false, ieTrueBody:function () {
	return (document.compatMode && document.compatMode != "BackCompat") ? document.documentElement : document.body;
}, getScrollTop:function () {
	return ie ? jse.popwin.ieTrueBody().scrollTop : window.pageYOffset;
}, bodyHeight:function () {
	var cobj = document.body;
	while (cobj.scrollTop == 0 && cobj.parentNode) {
		if (cobj.tagName.toLowerCase() == "html") {
			break;
		}
		cobj = cobj.parentNode;
	}
	return cobj.clientHeight;
}, _checkDisabledZone:function () {
	jse.popwin._disabledZone = $("disabledZone");
	if (!jse.popwin._disabledZone) {
		jse.popwin._disabledZone = document.createElement("div");
		jse.popwin._disabledZone.id = "disabledZone";
		jse.popwin._disabledZone.style.cssText = "background-color:#eee;-moz-opacity:0.7;filter:alpha(opacity=70);position:absolute;z-Index:9998;left:0px;top:0px;display:none";
		document.body.appendChild(jse.popwin._disabledZone);
	}
}, _fixDisabledZoneHeight:function () {
	jse.popwin._checkDisabledZone();
	if (window.attachEvent) { //IE
		jse.popwin._disabledZone.style.width = document.body.clientWidth + "px";
		jse.popwin._disabledZone.style.height = Math.max(document.body.scrollHeight, document.body.clientHeight, jse.popwin.bodyHeight()) + "px";
	} else {  //firefox
		jse.popwin._disabledZone.style.width = "100%";
		jse.popwin._disabledZone.style.height = Math.max(document.body.offsetHeight + 16, document.body.clientHeight, jse.popwin.bodyHeight()) + "px";
	}
}, show:function (_winId, _top, _width, _height, _left) {
	 
	jse.popwin._fixDisabledZoneHeight();	
	jse.popwin._bodyWidth = document.body.clientWidth;
	jse.popwin._disabledZone.style.display = "block";
	jse.popwin._win = $(_winId);
	with (jse.popwin._win.style) {
		position = "absolute";
		zIndex = 9999;
		top = (jse.popwin.getScrollTop() + _top) + "px";
		width = _width + "px";
		height = _height + "px";
		left = (_left || (jse.popwin._bodyWidth - _width) / 2) + "px";
		display = "block";
	}
	//document.getElementById('pipiwebplayer_control').style.cssText='width:'+_width+'px;height:'+(_height-25)+'px';	
	jse.popwin.showWebPlay(_width,_height);
	jse.popwin._top = _top;
	jse.popwin._isShow = true;
}, hide:function () {
	jse.popwin._win.style.display = "none";
	jse.popwin._win.style.width ='0px';
	jse.popwin._win.style.height= '0px';
	//document.getElementById('pipiwebplayer_control').style.cssText='width:1px;height=1px';
	jse.popwin.hiddenWebPlay();
	jse.popwin._disabledZone.style.display = "none";
	jse.popwin._isShow = false;
}
,
updateWebPlayCssText:function (w_width,w_height)
{
	var _css = 'width:'+w_width+'px;height:'+(w_height)+'px';	
	//document.getElementById('pipiwebplayer_control').style.cssText=_css;
}
,
hiddenWebPlay:function ()
{
	jse.popwin.updateWebPlayCssText(1,1);	
},
showWebPlay:function (_width,_height)
{
		
	jse.popwin.updateWebPlayCssText(_width,_height-25)
}
};

/*window.onscroll = function () {
	if (jse.popwin._isShow) {
		jse.popwin._win.style.top = (jse.popwin.getScrollTop() + jse.popwin._top) + "px";
	}
};*/
