function hideOElements()
{
        var country= document.getElementById('country_id');
        var oCountry=document.getElementById('ocountry_id');
        var currLocation=document.getElementById('currlocation_id');
        var oCurrLocation=document.getElementById('ocurrlocation_id');
	var ug_course = document.getElementById('ugcourse_id');
        var oug_course = document.getElementById('ougcourse_id');
        var pg_course = document.getElementById('pgcourse_id');
        var ppg_course = document.getElementById('ppgcourse_id');
        var opg_course = document.getElementById('opgcourse_id');
        var oppg_course = document.getElementById('oppgcourse_id');
        if(country.value!='Other')
        oCountry.style.display="none";
	if(country.value == 'INDIA')
	{
      		if(!currLocation.value.match('Other'))
	       	oCurrLocation.style.display="none";
	}
	
}
function getStyleObject(objectId) 
{
    // cross-browser function to get an object's style object given its id
	if(document.getElementById && document.getElementById(objectId)) 
	{
	// W3C DOM
		return document.getElementById(objectId).style;
	} 
	else if (document.all && document.all(objectId)) 
	{
	// MSIE 4 DOM
		return document.all(objectId).style;
	} 
	else if (document.layers && document.layers[objectId]) 
	{
	// NN 4 DOM.. note: this won't find nested layers
		return document.layers[objectId];
	} 
	else 
	{
		return false;
	}
} // getStyleObject
function changeObjectVisibility(objectId, newVisibility) 
{
    // get a reference to the cross-browser style object and make sure the object exists
	var styleObject = getStyleObject(objectId);
	if(styleObject) 
	{
		styleObject.display= newVisibility;
		return true;
	} 
	else 
	{
	// we couldn't find the object, so we can't change its visibility
		return false;
	}
} // changeObjectVisibility
function hideMBA()
{
        var ppgcourse=document.getElementById('pgcourse_id');
        var mbatype=document.getElementById('mbatype_id');
        var sp1 = ppgcourse.value.split("|X|");
        if(sp1[0]=='MBA/PGDM')
        {
                mbatype.style.display="";
        }
        else
        {
                mbatype.style.display="none";
        }
}
function showHideOtherOpenBox(callingDDId, openBoxId, otherString)
{
       otherString = (otherString == null) ? '|Other|' : otherString;
        var callingDD = document.getElementById(callingDDId);
        var selI = callingDD.selectedIndex;
	var valtoCheck = '|' + callingDD[selI].value + '|';
        if (otherString.indexOf(valtoCheck) != -1)
                changeObjectVisibility(openBoxId, '');
        else
                changeObjectVisibility(openBoxId, 'none');
}
function rm_setCountryAreaCode(cntryDDId, currLocnDDId, cntryCodeBoxId, areaCodeBoxId)
{

        countryCode = new Array();
        cityCode = new Array();

/*****************              STD CODES FOR CITIES OF INDIA           *****************/
        cityCode['Ahmedabad'] = "79";
        cityCode['Bangalore'] = "80";
        cityCode['Chennai'] = "44";
        cityCode['Delhi'] = "11";
        cityCode['Hyderabad'] = "40";
        cityCode['Kolkata'] = "33";
        cityCode['Mumbai'] = "22";
        cityCode['Pune'] = "20";
/* ****************             ISD CODES               **************** */
        countryCode["INDIA"] = "91";
/* ************************************************ */

        var cntryDD = document.getElementById(cntryDDId);
        var currLocnDD = document.getElementById(currLocnDDId);

        var cntryCodeBox = document.getElementById(cntryCodeBoxId);
        var areaCodeBox = document.getElementById(areaCodeBoxId);

        var selectedCountry =  cntryDD.options[cntryDD.options.selectedIndex].value;
        var selectedCity = currLocnDD.options[currLocnDD.options.selectedIndex].value;

//         if(countryCode[selectedCountry]==null)
//         {
//                 //if(rm_trim(cntryCodeBox.value)=="91")
//                         cntryCodeBox.value = "";
//         }
//         else
//                 cntryCodeBox.value = countryCode[selectedCountry];

//         if(cityCode[selectedCity]==null )//&& rm_trim(areaCodeBox.value)=="")
//         {
//                 areaCodeBox.value = "";
//         }
//         else
//                 areaCodeBox.value = cityCode[selectedCity];

        if(selectedCountry!="INDIA" && selectedCountry!="select")
        {
                currLocnDD.value = "select";
        }
        else
        if(selectedCountry=="select")
        {
                currLocnDD.value ="select";
        }

}

function showHideCityOpenBox(cityId, ocityId)
{
        cityDD = document.getElementById(cityId);

        var selI = cityDD.selectedIndex;
        if (cityDD[selI].value.match("Other") != null) // selected element contains "other", so show "ocity open box"
                changeObjectVisibility(ocityId, '');
        else
                changeObjectVisibility(ocityId, 'none');
}

// if cntry value is NOT india, then make selected value in city dd as "Other"
function rm_cntryChangedEvent(cntryVal, form_city_id, form_ocity_id)
{
        var cityEle = document.getElementById(form_city_id);

        if (cntryVal == "seedEvent(cntlect")
        {
                cityEle.selectedIndex = 0;
		cityEle.disabled = false;
                showHideCityOpenBox(form_city_id, form_ocity_id);
        }
        else if (cntryVal == 'INDIA' || cntryVal == 'select')
        {
                cityEle.selectedIndex = 0;
                cityEle.disabled = false;
                showHideCityOpenBox(form_city_id, form_ocity_id);
	}
        else	// if (cntryVal != 'INDIA')
        {
                cityEle.selectedIndex = cityEle.length - 1;
		cityEle.disabled = true;
		document.getElementById(form_ocity_id).style.display = "";
                //showHideCityOpenBox(form_city_id, form_ocity_id);
        }
}

// if city value is NOT "Other", then make selected value in cntry dd as india
function rm_cityChangedEvent(cityVal,form_country_id,form_ocountry_id)
{
        if (cityVal != 'Other')
        {
                var cntryEle = document.getElementById(form_country_id);

                for (i = 0; i < cntryEle.length; ++i)
                {
                        if (cntryEle[i].value == "INDIA")
                        {
                                cntryEle.selectedIndex = i;
                                showHideOtherOpenBox(form_country_id,form_ocountry_id);
                                break;
                        }
                }
        }
}