﻿function OpenWindow(targetUrl,width,height)
{	        
		var path= system_var1 + "Window.aspx?targetUrl=" + encodeURIComponent(system_var2+targetUrl);
		var oTarget = document.getElementById("WindowFrame");
		if(oTarget != null)
		{
			document.body.removeChild(oTarget);		
		}		
		var bodyWidth = document.body.clientWidth;
		var bodyHeight = document.body.clientHeight;		
		var scrLeft = document.body.scrollLeft;
		var scrTop = document.body.scrollTop;
		//alert(scrTop);		
		var posLeft = (bodyWidth -width)/2 + scrLeft;
		var posTop = (bodyHeight - height)/2 + scrTop;
		
		var html = "<IFRAME ID='WindowFrame' src='" + path + "' SCROLLING='no' frameborder='0' ";
		html += "progid:DXImageTransform.Microsoft.[glass](duration=1) ";
		html +="width='" + width + "' height='" + height +  "'";
		html +=" style='position:absolute;left:" + posLeft + "px;top:" + posTop + "px;'></IFRAME>";
		var oFrame = document.createElement(html);
		document.body.appendChild(oFrame);
}

function openSendMsg(id)
{	
    var L = (screen.width - 380) / 2;
    var s = "top=40,left="+L+",height=" + 280 + ",width=" + 380 + ",status=no,toolbar=no,menubar=no,scrollbars=yes";
	var url = system_var1 + "public/share/SendMessage.aspx?owner=" + id;
	newWindow = window.open(url,"data",s);		
    newWindow.focus();					
}

function openInterView(id)
{	
    var L = (screen.width - 380) / 2;
    var s = "top=40,left="+L+",height=" + 280 + ",width=" + 380 + ",status=no,toolbar=no,menubar=no,scrollbars=yes";
	var url = system_var1 + "public/share/InterViewDisp.aspx?uivid=" + id;
	newWindow = window.open(url,"data",s);		
    newWindow.focus();					
}

function openAddPrSpare(id,type)
{	
    var L = (screen.width - 280) / 2;
    var s = "top=40,left="+L+",height=" + 220 + ",width=" + 280 + ",status=no,toolbar=no,menubar=no,scrollbars=no";
	var url = system_var1 + "public/share/AddPrSpare.aspx?id=" + id + "&type=" + type;
	newWindow = window.open(url,"data",s);		
    newWindow.focus();					
}

function openAddPrStore(id,type,unitId)
{	
    var L = (screen.width - 280) / 2;
    var s = "top=40,left="+L+",height=" + 220 + ",width=" + 280 + ",status=no,toolbar=no,menubar=no,scrollbars=no";
	var url = system_var1 + "public/share/AddPrStore.aspx?id=" + id + "&type=" + type + "&unit_id=" + unitId;
	newWindow = window.open(url,"data",s);		
    newWindow.focus();					
}

function openLotApplication(sj2,id)
{	
    var L = (screen.width - 280) / 2;
    var s = "top=40,left="+L+",height=" + 160 + ",width=" + 280 + ",status=no,toolbar=no,menubar=no,scrollbars=no";
	var url = system_var1 + "public/share/LotApplication.aspx?sj2=" + sj2 + "&id=" +id;
	newWindow = window.open(url,"data",s);		
    newWindow.focus();					
}

function openAskQuestion()
{	
    var L = (screen.width - 320) / 2;
    var s = "top=40,left="+L+",height=" + 280 + ",width=" + 320 + ",status=no,toolbar=no,menubar=no,scrollbars=no";
	var url = system_var1 + "public/rcfw/rcfw001a.aspx";
	newWindow = window.open(url,"data",s);		
    newWindow.focus();					
}

function openAddUnStore(id)
{	
    var L = (screen.width - 280) / 2;
    var s = "top=40,left="+L+",height=" + 220 + ",width=" + 280 + ",status=no,toolbar=no,menubar=no,scrollbars=no";
	var url = system_var1 + "public/share/AddUnStore.aspx?id=" + id;
	newWindow = window.open(url,"data",s);		
    newWindow.focus();					
}

function openAddInterView(id)
{	
    var L = (screen.width - 360) / 2;
    var s = "top=40,left="+L+",height=" + 280 + ",width=" + 360 + ",status=no,toolbar=no,menubar=no,scrollbars=no";
	var url = system_var1 + "public/share/AddUnInterView.aspx?id=" + id;
	newWindow = window.open(url,"data",s);		
    newWindow.focus();					
}

function openQuickViewPerson(id)
{	
    var L = (screen.width - 400) / 2;
    var s = "top=40,left="+L+",height=" + 280 + ",width=" + 400 + ",status=no,toolbar=no,menubar=no,scrollbars=no";
	var url = system_var1 + "public/share/QuickViewPerson.aspx?person_id=" + id;
	newWindow = window.open(url,"data",s);		
    newWindow.focus();					
}
function openShowPrEdu(id)
{	
    var L = (screen.width - 400) / 2;
    var s = "top=40,left="+L+",height=" + 280 + ",width=" + 400 + ",status=no,toolbar=no,menubar=no,scrollbars=no";
	var url = system_var1 + "public/share/ShowPrEdu.aspx?id=" + id;
	newWindow = window.open(url,"data",s);		
    newWindow.focus();					
}
function openShowPrExp(id)
{	
    var L = (screen.width - 400) / 2;
    var s = "top=40,left="+L+",height=" + 280 + ",width=" + 400 + ",status=no,toolbar=no,menubar=no,scrollbars=no";
	var url = system_var1 + "public/share/ShowPrExp.aspx?id=" + id;
	newWindow = window.open(url,"data",s);		
    newWindow.focus();					
}
function openTrainBm(id)
{	
    var L = (screen.width - 300) / 2;
    var s = "top=40,left="+L+",height=" + 280 + ",width=" + 300 + ",status=no,toolbar=no,menubar=no,scrollbars=no";
	var url = system_var1 + "public/share/AddTrainBm.aspx?id=" + id;
	newWindow = window.open(url,"data",s);		
    newWindow.focus();					
}

function showUnTrainBm(id)
{	
    var L = (screen.width - 800) / 2;   
    var s = "top=40,left="+L+",height=" + 300 + ",width=" + 800 + ",status=no,toolbar=no,menubar=no,scrollbars=auto";
	var url = system_var1 + "public/share/ShowUnTrainBm.aspx?id=" + id;
	newWindow = window.open(url,"data",s);		
    newWindow.focus();					
}


