// JavaScript Document


/////////////////////// AJAX FUNCTION END ////////////////////////////////////////////////

function hideStates(country)
{
	if(country=='India')
	{	
		document.getElementById("cusa").style.display="none";
		document.getElementById("cother").style.display="none";
		document.getElementById("cind").style.display="inline";
	}
	else if(country=='United States')
	{	
		document.getElementById("cind").style.display="none";
		document.getElementById("cusa").style.display="inline";
		document.getElementById("cother").style.display="none";
	}
	else
	{	
		document.getElementById("cind").style.display="none";
		document.getElementById("cusa").style.display="none";
		document.getElementById("cother").style.display="inline";
	}
	
}




function showState(val)
{
	//alert(val);
	if(val=='India')
	{	
		document.getElementById("cusa").style.display="none";
		document.getElementById("cother").style.display="none";
		document.getElementById("cind").style.display="inline";
	}
	else if(val=='United States')
	{	
		document.getElementById("cind").style.display="none";
		document.getElementById("cusa").style.display="inline";
		document.getElementById("cother").style.display="none";
	}
	else
	{	
		document.getElementById("cind").style.display="none";
		document.getElementById("cusa").style.display="none";
		document.getElementById("cother").style.display="inline";
	}
}


///////////////////////////////   SELECT ALL  ///////////////////////////////////////////////

function SetAllCheckBoxes(FormName, FieldName, CheckValue)
{
	//alert('ok');
	if(!document.forms[FormName])
		return;
	var objCheckBoxes = document.forms[FormName].elements[FieldName];
	if(!objCheckBoxes)
		return;
	var countCheckBoxes = objCheckBoxes.length;
	if(!countCheckBoxes)
		objCheckBoxes.checked = CheckValue;
	else
		// set the check value for all check boxes
		for(var i = 0; i < countCheckBoxes; i++)
			objCheckBoxes[i].checked = CheckValue;
			
}


