/*
// *********************************************************************************************** //
// T7 Micro   
// © Copyright David Tracz, Bitefish
// All Rights Reserved, www.bitefish.com
// *********************************************************************************************** //
*/



function ConfirmLink(pmessage,purl)
{
	if (window.confirm(pmessage) == true)
	{
		window.location.href = purl;
	}
}


function OpenDialog(purl,pname,pwidth,pheight)
{
	psize = "";
	if (pwidth > 0 && pheight > 0)
		psize = "height="+ pheight +",width="+ pwidth +",";
		
	pDialog = window.open(purl,pname,psize + "resizable=yes,scrollbars=yes,status=no,location=no,toolbar=no,menubar=no",true);
	
	wScreenX = ((screen.width-(pwidth*1))/2);
	wScreenY = ((screen.height-(pheight*1))/2);
		
	//pDialog.moveTo(wScreenX,wScreenY);
	//pDialog.focus();
}


function FormSubmitByIndex(pIndex)
{
	document.forms[pIndex].submit();
}



function SetField(pid,pvalue)
{
	document.getElementById(pid).value = pvalue;
}


function GetField(pid)
{
	return document.getElementById(pid).value;
}




function ToggleVisibility(pDiv)
{
	if (document.getElementById(pDiv).style.display == "block")
		document.getElementById(pDiv).style.display = "none";
	else
		document.getElementById(pDiv).style.display = "block";
}


function GotoSearch(pForm)
{	
	window.location.href = pForm + "?st=" + document.getElementById("searchterm").value;
}
