
function launchWin(w,h,srcURL,sizable, obj, scrollbar)
{
	if (scrollbar=="") scrollbar=0;
	lPos = (screen.width) ? (screen.width-w)/2 : 0; tPos = (screen.height) ? (screen.height-h)/2 : 0;
	aWin = window.open(srcURL, "", "height="+h+", width="+w+", left="+lPos+", top="+tPos+", toolbar=0, location=0,directories=0,status=0,menuBar=0,scrollBars="+scrollbar+",resizable="+sizable);
	//aWin.opener=obj;				
	aWin.focus();
	aWin.owner=document.location.href;
	//processBarred(aPos);
}

function cacheEnter(buttonid)
{
	if(window.event.keyCode == 13)
	{
		document.getElementById(buttonid).focus();
		document.getElementById(buttonid).click();
		return false;
	}
	else
	{
		return false;
	}
	
}

var EditWin;
function EditItem(TheUrl,QValue,Holder,W,H,Q)
{
window.status = 'Done';
	var TheId = document.getElementById(Holder).value;
	
	if(TheId != null && TheId != "")
	{	
window.status = 'Done';
		if(Q == null || Q == 'undefined')
			Q = "&";
			EditWin = openWin(TheUrl+""+Q+""+QValue+"="+TheId,W,H);
			
	}
}

function EditItem2(TheUrl,QValue,Holder,W,H)
{ 
           var SubTopMenu = name;
window.status = 'Done';
		
	if(W == null || W == 'undefined')
		W = 350;
	if(H == null || H == 'undefined')
		H = 140;

	if(QValue == "NewA")
	{
		EditWin = openWin(TheUrl,W,H);
window.status = 'Done';		
	}
	else if(QValue == "NEW")
	{
		setTimeout("aFRAME.document.getElementById('UserProfile__ctl0_cl8').click()",1000); 
window.status = 'Done';

	}
	else{
		if(TheId != null && TheId != "")
		{
			EditWin = openWin(TheUrl+"&"+QValue+"="+TheId,W,H);
		}		
window.status = 'Done';
	}
} 
function EditItemWork(TheUrl,QValue,Holder,W,H)
{
window.status = 'Done';
	var TheId = document.getElementById(Holder).value;
	
	if(QValue == "New")
	{
window.status = 'Done';
		EditWin = openWin(TheUrl,W,H);		
	}
	else{
window.status = 'Done';
		if(TheId != null && TheId != "")
		{
			EditWin = openWin(TheUrl+"&"+QValue+"="+TheId,W,H);
		}		
	}
}
