function OpenLink(controlID)
{
			ddl = document.getElementById(controlID);
			url = ddl.options[ddl.selectedIndex].value;
			if (url != '')
			{
				w=window.open(url,'','');
				w.focus();
			}
}
function OpenCalandar(formName, txtField)
{
	w=window.open("../Common/CalendarPopUp.aspx?formname="+ formName +"." + txtField,"calendar_window","width=220,height=220");
	w.focus();
}
function ClickButton(e, LinkToClick)
{	var i = 0; 
	while (i < document.forms(0).elements.length)
	{ if(document.forms(0).elements(i).name.indexOf(LinkToClick) > -1)
		{	
			document.forms(0).elements(i).click();
			return (true);
		}
		i++; 
	} 
	i=0;
	while (i < document.links.length) 
	{ 
		if (document.links.item(i).id.toString().indexOf(LinkToClick) > -1)
		{ 
			document.links.item(i).click(); 
			return (true); 
		} 
		i++; 
	} 
	return (false); 
} 

/*
	var nav = window.Event ? true :false; 
	if (nav) 
	{ 
		window.captureEvents(Event.KEYDOWN); 
		window.onkeydown = NetscapeEventHandler_KeyDown;
	} 
	else 
	{ 
		document.onkeydown = MicrosoftEventHandler_KeyDown;
	}
*/	

function NetscapeEventHandler_KeyDown(e) 
{ 
	if (e.which == 13 && e.target.type != 'textarea' && e.target.type != 'submit') 
		{ return false; }
	return true;
} 

function MicrosoftEventHandler_KeyDown() 
{ 
	if (event.keyCode == 13 && event.srcElement.type != 'textarea' && event.srcElement.type != 'submit')
		return false; 
	return true;
}
function SetElementVisiability(checkboxID, elementID)
{
	var visiable = !document.getElementById(checkboxID).checked;
	if (visiable)
	{
		if ( document.getElementById(elementID) != null)
		{
			document.getElementById(elementID).style.display = '';
		}
	}
	else
	{
		if ( document.getElementById(elementID) != null)
		{
			document.getElementById(elementID).style.display = 'none';
		}
	}
}
function ActivateFlash(src)
{
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"height="277px" width="628px" VIEWASTEXT>');
document.write('<param name="movie" value="' + src + '">');
document.write('<param name="quality" value="high">');
document.write('<param name="menu" value="false">');
document.write('<embed src="' + src + '" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" /></object>'); 
}

function GoToFeedbackForm(aspControlID) 
{

        re = new RegExp(':' + aspControlID + '$')  //generated control name starts with a colon

        for(i = 0; i < document.forms[0].elements.length; i++) 
        {

            elm = document.forms[0].elements[i]

            if (elm.type == 'radio'&& re.test(elm.name) && elm.checked == true) 
            {
                url = elm.value;
				if (url != '')
				{
					w=window.open(url,'','');
					w.focus();
					return false;
				}
				else
				{
					return true;
				}
				
		     }
        }
}

function OpenDialog(url)
{
	w = window.open(url, '', 'width=760,height=400'); 
	if (w.opener == null) w.opener = self
	w.focus();
}


