// === функция отображения popup-окна === //
function pop_window(file, name_wnd, params)
{
	first_param = true;
	wnd_params = "";
    for (var key in params) 
    {
        if (first_param)
        	wnd_params = '?'+key+'='+params[key];
        else
        	wnd_params += '&'+key+'='+params[key];
        first_param = false;
    }
	msgWindow=window.open(file+wnd_params, name_wnd, 'toolbar=0,resizable=1,scrollbar=1,scrollbars=yes,location=0,height=850,width=1024');
	msgWindow.focus;	

}

// === функция пересылки данных в popup-окно === //
function Form2Popup(params, actionUrl, name, popupConfig, get) 
{ 
	var method = (get == undefined || !get) ? 'POST' : 'GET'; 
        
    if (name == undefined || name == '') 
    	name = 'tmpPopup'; 

    var form = document.createElement("FORM");
	form.setAttribute('action', actionUrl);
	form.setAttribute('method', method);
	form.setAttribute('target', name);
	form.setAttribute('style', 'display:none');						        
    var element = null; 
    for (var propName in params) 
    { 
		var element = document.createElement("INPUT");
		element.setAttribute('type', "text");
		element.setAttribute('name', propName);
		element.setAttribute('value', params[propName]);
        form.appendChild(element); 
    } 
    document.body.appendChild(form);

    var win = window.open('about:blank', name, popupConfig); 

    win.focus(); 
    form.submit();
    var ver = navigator.appVersion;
    if (ver.indexOf("MSIE") != -1)
    	form.removeNode(true);           	

    return win; 
}

function tabshow()
{
	sTabsScl.style.display='block';
	sTabs.style.backgroundImage='url(./i/common-decTab2.gif)';
}

function tabhide()
{
	sTabsScl.style.display='none';
	sTabs.style.backgroundImage='url(./i/common-decTab.gif)';
}


function FlLoad(fid)
{
	flWindow=window.open('/pop_filelink.php?fid='+fid,'flWin', 'toolbar=0,resizable=1,scrollbar=1,scrollbars=yes,location=0,height=450,width=400');
	flWindow.focus;
}

function pop_fundanketa(fid,tid,oid,ssid)
{
	msgWindow=window.open('/popup_fundanketa.php?d=payank&id='+fid+'&fid='+tid+'&oid='+oid+'&ssid='+ssid,'fotoWin', 'toolbar=0,resizable=1,scrollbar=1,scrollbars=yes,location=0,height=850,width=800');
	msgWindow.focus;
}

function pop_fundsogl(fid,tid,oid,ssid)
{
	msgWindow=window.open('/popup_fundsogl.php?d=payank&id='+fid+'&fid='+tid+'&oid='+oid+'&ssid='+ssid,'fotoWin', 'toolbar=0,resizable=1,scrollbar=1,scrollbars=yes,location=0,height=850,width=800');
	msgWindow.focus;
}

function pop_funddov(fid,tid,oid,ssid)
{
	msgWindow=window.open('/popup_funddov.php?id='+fid+'&fid='+tid+'&oid='+oid+'&ssid='+ssid,'dovWin', 'toolbar=0,resizable=1,scrollbar=1,scrollbars=yes,location=0,height=850,width=800');
	msgWindow.focus;
}


function pop_fundsert(fid,ssid)
{
	msgWindow=window.open('/popup_fundsert.php?sert_id='+fid+'&ssid='+ssid,'fotoWin', 'toolbar=0,resizable=1,scrollbar=1,scrollbars=yes,location=0,height=850,width=800');
	msgWindow.focus;
}
//Модификация Пташник 08.01.29
function pop_fundrisks(fid,ssid)
{
	msgWindow=window.open('/popup_fundrisks.php?id='+fid+'&ssid='+ssid,'sertEdWin', 'toolbar=0,resizable=1,scrollbar=1,scrollbars=yes,location=0,height=850,width=800');
	msgWindow.focus;
}
//
function pop_dureport(year,cid,fid,ssid,sign)
{
	if(sign=='yes'){
		msgWindow=window.open('/popup_dureport.php?year='+year+'&client_id='+cid+'&fund_id='+fid+'&ssid='+ssid+'&sign','fotoWin', 'toolbar=0,resizable=1,scrollbar=1,scrollbars=yes,location=0,height=850,width=800');
	}
	else{
		msgWindow=window.open('/popup_dureport.php?year='+year+'&client_id='+cid+'&fund_id='+fid+'&ssid='+ssid,'fotoWin', 'toolbar=0,resizable=1,scrollbar=1,scrollbars=yes,location=0,height=850,width=800');
	}	
	msgWindow.focus;
}

function pop_fundorder(fid,ssid)
{
	msgWindow=window.open('/popup_fundorder.php?ord_id='+fid+'&ssid='+ssid,'fotoWin', 'toolbar=0,resizable=1,scrollbar=1,scrollbars=yes,location=0,height=850,width=800');
	msgWindow.focus;
}

function pop_buhorder(fid,ssid)
{
	msgWindow=window.open('/popup_buhorder.php?ord_id='+fid+'&ssid='+ssid,'fotoWin', 'toolbar=0,resizable=1,scrollbar=1,scrollbars=yes,location=0,height=850,width=800');
	msgWindow.focus;
}

function pop_ndfl(fid,ssid)
{
	msgWindow=window.open('/popup_ndflinfo.php?ord_id='+fid+'&ssid='+ssid,'ndflWin', 'toolbar=0,resizable=1,scrollbar=1,scrollbars=yes,location=0,height=850,width=800');
	msgWindow.focus;
}


function pop_ndfl_cft(fid,ssid)
{
	msgWindow=window.open('/popup_ndflinfo_cft.php?ord_id='+fid+'&ssid='+ssid,'ndflWin', 'toolbar=0,resizable=1,scrollbar=1,scrollbars=yes,location=0,height=850,width=800');
	msgWindow.focus;
}


function pop_fundorderedit(fid,ssid)
{
	msgWindow=window.open('/popup_fundorderedit.php?ord_id='+fid+'&ssid='+ssid,'fotoWin', 'toolbar=0,resizable=1,scrollbar=1,scrollbars=yes,location=0,height=850,width=800');
	msgWindow.focus;
}

function pop_fundanyorderedit(fid,ssid)
{
	msgWindow=window.open('/popup_fundanyorderedit.php?ord_id='+fid+'&ssid='+ssid,'fotoWin', 'toolbar=0,resizable=1,scrollbar=1,scrollbars=yes,location=0,height=850,width=800');
	msgWindow.focus;
}

function pop_fundsertedit(fid,ssid)
{
	msgWindow=window.open('/popup_fundsertedit.php?sert_id='+fid+'&ssid='+ssid,'sertEdWin', 'toolbar=0,resizable=1,scrollbar=1,scrollbars=yes,location=0,height=850,width=800');
	msgWindow.focus;
}


function pop_movein(fid,ssid)
{
	msgWindow=window.open('/popup_movein.php?basket_id='+fid+'&ssid='+ssid,'moveinWin', 'toolbar=0,resizable=1,scrollbar=1,scrollbars=yes,location=0,height=850,width=800');
	msgWindow.focus;
}



function pop_ugame( )
{
	msgWindow=window.open('/ugame/popup_ugame.php','ugame', 'toolbar=0,resizable=0,scrollbar=0,location=0,height=600,width=800');
	msgWindow.focus;
}

function pop_tt( )
{
	msgWindow=window.open('/popup_tt_new.php','javaTT', 'toolbar=0,resizable=0,scrollbar=0,location=0,height=300,width=550');
	msgWindow.focus;
}

function pop_ufx_demo( )
{
	msgWindow=window.open('/popup_ufx_demo.php','java_ufx_demo', 'toolbar=0,resizable=1,scrollbar=0,location=0,height=700,width=1000');
	msgWindow.focus;
}

function pop_ufx_sys( )
{
	msgWindow=window.open('/popup_ufx_sys.php','java_ufx_sys', 'toolbar=0,resizable=1,scrollbar=0,location=0,height=700,width=1000');
	msgWindow.focus;
}

function pop_pageedit(fid,ssid)
{
	msgWindow=window.open('/popup_pageedit.php?id='+fid+'&ssid='+ssid,'fotoWin', 'toolbar=0,resizable=1,scrollbar=1,scrollbars=yes,location=0,height=850,width=800');
	msgWindow.focus;
}

function pop_textimg(fid,x,y, ssid)
{
	msgWindow=window.open('/popup_textimg.php?id='+fid+'&ssid='+ssid,'fotoWin', 'toolbar=0,resizable=1,scrollbar=1,location=0,height='+(y+0)+',width='+(x+0));
	msgWindow.focus;
}

function pop_texted(act, fid, ssid)
{
	msgWindow=window.open('/popup_textedit.php?act='+act+'&id='+fid+'&ssid='+ssid,'fotoWin', 'toolbar=0,resizable=1,scrollbars=yes,location=0,height=850,width=800');
	msgWindow.focus;
}

function pop_allow(act, fid, ssid)
{
	msgWindow=window.open('/popup_allow.php?act='+act+'&id='+fid+'&ssid='+ssid,'fotoWin', 'toolbar=0,resizable=1,scrollbars=yes,location=0,height=850,width=800');
	msgWindow.focus;
}

function pop_allow_inst(act, fid, ssid)
{
	msgWindow=window.open('popup_allow_inst.php?act='+act+'&id='+fid+'&ssid='+ssid,'fotoWin', 'toolbar=0,resizable=1,scrollbars=yes,location=0,height=850,width=800');
	msgWindow.focus;
}

function pop_faq(act, fid, ssid)
{
	msgWindow=window.open('/popup_faq.php?act='+act+'&nid='+fid+'&ssid='+ssid,'fotoWin', 'toolbar=0,resizable=1,scrollbars=yes,location=0,height=450,width=800');
	msgWindow.focus;
}


function printMe(url)
{
	printWindow=window.open(url,'printWin', 'toolbar=0,resizable=1,scrollbars=yes,location=0,height=450,width=800');
	printWindow.focus;
}

function popup(url)
{
	popWindow=window.open(url,'popWin', 'toolbar=0,resizable=1,scrollbars=yes,location=0,height=450,width=800');
	popWindow.focus();
	return popWindow;
}


function pop_reviewcat(act, fid, ssid)
{
	msgWindow=window.open('/popup_reviewcat.php?act='+act+'&id='+fid+'&ssid='+ssid,'fotoWin', 'toolbar=0,resizable=1,scrollbars=yes,location=0,height=200,width=200');
	msgWindow.focus;
}


var msgWindow = new Array();
function pop_tech(user, id, ssid)
{
	user2=user;
	if (!user2)	user2=1;
/*
//	var msgWin;
// || (msgWindow[user] && msgWindow[user].closed)
	if(msgWindow[user2]){
//		if(msgWindow[user2].name)
//			alert(msgWindow[user2].name);
	}else{
	*/
		msgWin=window.open('/popup_tech.php?user='+user+'&id='+id+'&ssid='+ssid, 'wina'+user,'directories=no,toolbar=0,resizable=0,scrollbars=no,location=0,height=595,width=600');
		msgWin.focus;
		//msgWindow[user2] = msgWin;		
	//}

		
	//else
		//alert(msgWindow[user]);
}

function helpshow(obj2)
{
  obj=obj2.firstChild;
  if (obj)
  {
  	var tmpel=obj2;
	var posX = tmpel.offsetLeft;
	var posY = tmpel.offsetTop;
	while (tmpel.offsetParent != null)
	{
	  tmpel = tmpel.offsetParent;
	  posX += tmpel.offsetLeft;
	  posY += tmpel.offsetTop;
	}
	tmpel=null;
	if (posX+obj2.clientWidth+obj.clientWidth<document.body.clientWidth)
    {obj.style.left=posX+obj2.clientWidth;}
	else {obj.style.left=posX+obj2.clientWidth-obj.clientWidth;};
	if (posY+obj2.scrollHeight+obj.clientHeight<document.body.clientHeight)
    {obj.style.top=posY+obj2.scrollHeight-1;}
	else {obj.style.top=posY-obj.clientHeight+1;};
	posX=null;
	posY=null;
    obj.style.visibility="visible";
  }
}

function helphide(obj2)
{
  obj=obj2.firstChild;
  if (obj)
  {
    obj.style.visibility="hidden";
  }
}
