// JavaScript Document
function imageSelector(imgObj,tagID)
{
	var returnImg=new String();
	if (Math.random)
		returnImg = imgObj[eval(Math.round(Math.random() * (imgObj.length-1)))];
	else 
	{
		var now = new Date();
		returnImg = imgObj[eval((now.getTime() / 1000) % range)];
	}
	document.getElementById(tagID).src=returnImg;
}

function chButtonImages(Obj,cond)
{
	if(cond=='over')
	{
		Obj.src='http://www.drivethrunames.com/images/'+Obj.id+'_over'+'.gif';
	}
	else
	{
		Obj.src='http://www.drivethrunames.com/images/'+Obj.id+'.gif';
	}
}

var globalMenuState=0;
function MenuChange(menuName,condition)
{
	if(condition=="In")
	{
		MenuCloseAll();
		globalMenuState=1;
		document.getElementById(menuName).className='PrimaryNavMenu_Display';
	}
	else
	{	
		globalMenuState=0;
		eval("setTimeout(\""+"if(globalMenuState==0){document.getElementById('"+menuName+"').className='PrimaryNavMenu_Hide';}"+"\",500)");
	}
}

function MenuCloseAll()
{
	document.getElementById('NamingServicesMenu').className='PrimaryNavMenu_Hide';
	document.getElementById('AboutUsMenu').className='PrimaryNavMenu_Hide';
}

function CMcheckBox(Obj)
{
	if(Obj.checked)
	{
		document.getElementById('f'+Obj.id).value=1;
	}
	else
	{
		document.getElementById('f'+Obj.id).value=0;
	}
	
}
function CMhref(Obj)
{
	document.getElementById('f'+Obj.id).value=1;
	document.NamingServicesMenufm.submit();
}

function selectCountry(Obj,FormObj)
{
	if(Obj.value !=0)
	{
		FormObj.State.selectedIndex="FN";
		FormObj.State.value="FN";
	}
	else
	{
		FormObj.State.selectedIndex="AL";
		FormObj.State.value="AL";
	}
}

function selectState(Obj,FormObj)
{
	if(Obj.value=="FN")
	{
		FormObj.Country.selectedIndex="2";
		FormObj.Country.value="2";
	}
	else
	{
		FormObj.Country.selectedIndex="0";
		FormObj.Country.value="0";
	}
}