

// --- MACROMEDIA FUNCTIONS ----------------------------


// --- GET URL FUNCTION ----------------------------

function goToURL() 
{
	var args = goToURL.arguments; 
	document.returnValue = false;
	eval(args[0]+".location='"+args[1]+"'");
}


// --- ALERT FUNCTIONS ----------------------------

function confirmAction(action, msg1, msg2) 
{
	if(confirm (msg1))
	{
		if(msg2)
		{
			if(confirm (msg2))
			{
				goToURL('parent','index.php?action='+action);
			}
			else
			{
				return false;
			}
		}
		else
		{
			goToURL('parent','index.php?action='+action);
		}
	}
	else
	{
		return false;
	}
}

function confirmDelete(url,msg1,msg2) 
{
	if(confirm (msg1))
	{
		if(msg2)
		{
			if(confirm (msg2))
			{
				goToURL('parent',url);
			}
			else
			{
				return false;
			}
		}
		else
		{
			goToURL('parent',url);
		}
	}
	else
	{
		return false;
	}
}


// --- NEW WINDOW FUNCTIONS ----------------------------

function openBrWindow(theURL,winName,features)
{
	window.open(theURL,winName,features);
}

function PopupPic(sPicURL) 
{ 
	window.open( "popup.htm?"+sPicURL, "theimage", "resizable=1,HEIGHT=200,WIDTH=200"); 
} 

function openWin(url)
{
	window.open(url);
}


// --- FORM FUNCTIONS ----------------------------



function fieldFocus()
{
	if(document.forms)
	{
		for(i=0; i<document.forms.length;i++)
		{
			if(document.forms[i][0] && (document.forms[i][0].type == 'text' || document.forms[i][0].type == 'password'))
			{
				document.forms[i][0].focus();
				
				return true;
			}
			else
			{
				return false;
			}
		}
	}
	else
	{
		return false;
	}
}

function submitForm(form_name)
{
	if(document.forms[form_name].submit())
	{
		return true;
	}
	else
	{
		return false;
	}
}

