function CmsJavPopup(lnk, vars){
var cfg = new Array();
if(vars){
vars = vars.split(";");
for(i=0; i<vars.length; i++){
a = vars[i].split(":");
cfg[a[0]] = a[1];
}
}
if(!cfg['wid']){cfg['wid'] = 600;}
if(!cfg['hei']){cfg['hei'] = 450;}
var pageScroll = new Array();
pageScroll = getPageScroll();
var pageSize = new Array();
pageSize = getPageSize();
if(cfg['wid'] == '100%'){
var objWid = pageSize[2]-50;
}else if(cfg['wid'] == 'auto'){
var objWid = pageSize[2] - (pageSize[2] * 0.3);
}else{
var objWid = cfg['wid'];
}
if(cfg['hei'] == '100%'){
var objHei = pageSize[3]-50;
}else if(cfg['hei'] == 'auto'){
var objHei = pageSize[3] - (pageSize[3] * 0.3);
}else{
var objHei = cfg['hei'];
}
var centerW = 0;
var centerH = 0;
popup = new Object();
popup.Width = objWid + 'px';
popup.Height = objHei + 'px';
var maxSize2 = pageSize[3];
centerW = (pageSize[0] - objWid) / 2;
centerH = ((pageSize[3]) - objHei) / 2;
centerH += pageScroll[1];
try{
if(document.getElementById('objPopCms_')){
document.body.removeChild(document.getElementById('objPopCms_'));
}
}catch(e){}
popup.BG = document.createElement('div');
popup.BG.id = 'objPopCms_';
if(mozilla_ff){
}
popup.BG.style['position'] = 'absolute';
popup.BG.style['left'] = '0px';
popup.BG.style['top'] = '0px';
popup.BG.style['width'] = pageSize[2] - 20+'px';
popup.BG.style['height'] = pageSize[3]+'px';
popup.BG.style['zIndex'] = '99996';
document.body.insertBefore(popup.BG, document.body.nextSibling);
popup.Base = document.createElement('div');
popup.Base.style['position'] = 'absolute';
popup.Base.style['left'] = centerW + 'px';
popup.Base.style['top'] = centerH + 'px';
popup.BG.appendChild(popup.Base);
popup.Transp = document.createElement('div');
popup.Transp.style['zIndex'] = '999';
popup.Transp.style['position'] = 'absolute';
popup.Transp.style['left'] = (parseInt(centerW)) + 'px';
popup.Transp.style['top'] = (parseInt(centerH-20)) + 'px';
popup.Transp.style['width'] = (parseInt(objWid)) + 'px';
popup.Transp.style['background'] = '#ffffff url(engine/crm/images/cms-popup-header.jpg) repeat-x';
popup.Transp.style['height'] = (parseInt(objHei)) + 'px';
popup.Transp.innerHTML = '<div style="float: right; padding: 1px 1px 0px 0px;"><img src="engine/crm/images/cms_ico_close.png" onclick="CmsJavPopupClose()" border="0" style="cursor: pointer;" /></div>';
popup.BG.appendChild(popup.Transp);
iframe = document.createElement("iframe");
window.setTimeout('iframe.src = "'+lnk+'"', 100);
iframe.style['zIndex'] = '1000';
iframe.style['position'] = 'absolute';
iframe.style['margin'] = '5px';
iframe.style['border'] = 'solid #eeeeee 1px';
iframe.style['left'] = (parseInt(centerW)) + 'px';
iframe.style['top'] = (parseInt(centerH+3)) + 'px';
iframe.width = (parseInt(objWid-12)) + 'px';
iframe.height = (parseInt(objHei-35)) + 'px';
iframe.setAttribute("frameBorder", "0");
iframe.setAttribute("frameSpacing", "0");
iframe.setAttribute("marginHeight", "0");
iframe.setAttribute("marginWidth", "0");
if(mozilla_ff){
iframe.setAttribute("scrolling", "auto");
}else{
iframe.setAttribute("scrolling", "yes");
}
popup.BG.appendChild(iframe);
}
function CmsJavPopupClose(){
document.body.removeChild(document.getElementById('objPopCms_'));
}