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 printMe(url)
{
	printWindow=window.open(url,'printWin', 'toolbar=0,resizable=1,scrollbars=yes,location=0,height=450,width=800');
	printWindow.focus;
}

function popup(url, x, y, name)
{
	if (!x) x = 600;
	if (!y) y = 600;
	
	if (!name) name='popWindow';
	// if (!name) name=Math.random();
	pop1 = window.open(url,name, 'toolbar=0,resizable=1,scrollbars=yes,location=0,height='+y+',width='+x+'');
	//window.open(url,name,'location=0,height='+y+',width='+x+'');
	pop1.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 unfocus()
{
	var i
	var L=document.links
	for (i=0; i < L.length; i++)
	{ L[i].onfocus=function() { this.blur() } }
}

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;}
	else {obj.style.top=posY-obj.clientHeight;};
	posX=null;
	posY=null;
    obj.style.visibility="visible";
  }
}

function helphide(obj2)
{
  obj=obj2.firstChild;
  if (obj)
  {
    obj.style.visibility="hidden";
  }
}


function show_oward(uniq)
{
	var url = '/oward/?print=2';
	var pars = 'unique='+uniq;
	var myAjax = new Ajax.Updater('overlaycontent', url, {method: 'get', evalScripts:true, parameters: pars, onComplete: show_oward_ok});

}

function show_oward_ok(originalRequest)
{
	document.getElementById('overlaycontent').style.display='';
}

function p_show_o(id)
	{
		cur = Number(document.getElementById('curo').value);
		 
		if (!id) {return false;}
		if (cur>0 && cur!=id)
		{
			document.getElementById('d'+cur).style.display='none';
			 
		}
		cur=id;
		document.getElementById('curo').value = cur;
		document.getElementById('d'+cur).style.display='';

	}