var httpObj = false;
		try {
			  httpObj = new XMLHttpRequest();
		} catch (trymicrosoft) {
		  try {
				httpObj = new ActiveXObject("Msxml2.XMLHTTP");
		  } catch (othermicrosoft) {
			try {
			  httpObj = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (failed) {
			  httpObj = false;
			}
	  }
	}

var SingleSignOnCityName = new Array('Ahmedabad','Bangalore','Bhopal','Bhubaneswar','Calicut','Chandigarh','Chennai','Cochin','Coimbatore','Delhi','Ernakulam','Faridabad','Ghaziabad','Guntur','Gurgaon','Guwahati','Hyderabad','Indore','Jaipur','Kannur','Kanpur','Kolkata','Kottayam','Lucknow','Ludhiana','Madurai','Malapuram','Mangalore','Mumbai','Mysore','Nagpur','Nashik','Navi Mumbai','Noida','Palghat','Patna','Pune','Rajkot','Salem','Secunderabad','Surat','Thane','Thrissur','Tiruchy','Trivandrum','Vadodara','Vijayawada','Vishakhapatnam','Warangal');

function SingleSignOnDisplayError(Message){
	document.getElementById("singlesignon_newerror").style.display = "block";
	document.getElementById("singlesignon_newerror").innerHTML = '<p style="margin:0 auto; color:#000000;">' + Message + '</p>';
}

function SingleSignOnHideError(){
	document.getElementById("singlesignon_newerror").innerHTML = '';
	document.getElementById("singlesignon_newerror").style.display = "none";
}

function SingleSignOnShowCross(name){
	if(name=='singlesignon_city1'){
		document['singlesignon_city1'].src = urlpath + "images/delete.png";
		document.getElementById('singlesignon_othercity').style.border = "1px solid #d12f19";
		document.getElementById('singlesignon_othercity').style.background = "#f7cbc2";
	}else{
		document[name].src = urlpath + "images/delete.png";
		document.getElementById(name).style.border = "1px solid #d12f19";
		document.getElementById(name).style.background = "#f7cbc2";
	}
}

function SingleSignOnRemoveCross(name){
	if(name=='singlesignon_city1'){
		document['singlesignon_city1'].src = urlpath + "images/accept.png";
		document.getElementById('singlesignon_othercity').style.border = "1px solid #a1a1a1";
		document.getElementById('singlesignon_othercity').style.background = "#fff";
	}else{
		document[name].src = urlpath + "images/accept.png";
		document.getElementById(name).style.border = "1px solid #a1a1a1";
		document.getElementById(name).style.background = "#fff";
	}
}

function SingleSignOnSetValue(value){
	document.getElementById("seterror").value = value;
}

function SingleSignOnGetInputName(name){
	if(name=="singlesignon_f_name"){
		document['singlesignon_l_name'].src= urlpath + "images/blank.gif";
		document.getElementById(name).style.border = "1px solid #a1a1a1";
		document.getElementById(name).style.background = "#fff";
	}else if(name=="singlesignon_day" || name=="singlesignon_month" || name=="singlesignon_year"){
		document['singlesignon_year'].src= urlpath + "images/blank.gif";
		document.getElementById(name).style.border = "1px solid #a1a1a1";
		document.getElementById(name).style.background = "#fff";
	}else if(name=="singlesignon_maritalstatus"){
		document['singlesignon_gender'].src= urlpath + "images/blank.gif";
		document.getElementById(name).style.border = "1px solid #a1a1a1";
		document.getElementById(name).style.background = "#fff";
	}else{
		document[name].src= urlpath + "images/blank.gif";
		document.getElementById(name).style.border = "1px solid #a1a1a1";
		document.getElementById(name).style.background = "#fff";
	}
}

function SingleSignOnUserNameDataBaseValidation(){
	var url = urlpath+"SingleSignOnCheckUserName.php?username="+trim(document.getElementById("singlesignon_username").value);
	httpObj.open("POST",url,true);
	httpObj.onreadystatechange = function(){
		if(httpObj.readyState==4){
			if(httpObj.responseText=='--1--'){
				SingleSignOnShowCross('singlesignon_username');
				SingleSignOnDisplayError('Username is already registered. Log-in.');
				SingleSignOnSetValue(httpObj.responseText);
			}else if(httpObj.responseText=='--2--'){
				SingleSignOnShowCross('singlesignon_username');
				SingleSignOnDisplayError('Username is blocked. Contact Support.');
				SingleSignOnSetValue(httpObj.responseText);
			}else{
				SingleSignOnRemoveCross('singlesignon_username');
				SingleSignOnHideError();
				SingleSignOnSetValue(0);
			}
		}
	}
	httpObj.send(null);
}

function SingleSignOnUserNameValidation(){
	var UserNameValue = trim(document.getElementById("singlesignon_username").value);
	var value = UserNameValidity(UserNameValue);
	if(UserNameValue == ''){
		SingleSignOnShowCross('singlesignon_username');
		return false;
	}else if(value) {
		SingleSignOnShowCross('singlesignon_username');
		SingleSignOnDisplayError(value);
		return false;	
	}else{
		SingleSignOnUserNameDataBaseValidation();
		if(document.getElementById("singlesignon_seterror").value=='--1--')	
			return false;
		else if(document.getElementById("singlesignon_seterror").value=='--2--')	
			return false;
	}
	return true;
}

function SingleSignOnCheckUserName(){
	if(!SingleSignOnUserNameValidation()) return false;
	else return true;
}

function SingleSignOnCheckPassword(){
	var PasswordValue = trim(document.getElementById("singlesignon_user_pass").value);
	var value = inValidPassword(PasswordValue);
	var status = 0;
	if(PasswordValue==''){
		SingleSignOnShowCross('singlesignon_user_pass');
	}else if(value){
		SingleSignOnShowCross('singlesignon_user_pass');
		SingleSignOnDisplayError(value);
		status = 1;
	}else{
		if(PasswordValue != ''){
			SingleSignOnRemoveCross('singlesignon_user_pass');
			SingleSignOnHideError();
		}
	}

	if(PasswordValue=='' || status==1){
		return false;
	}
	else{
		return true;
	}
}

function SingleSignOnCheckFirstName(){

	var FirstNameValue = trim(document.getElementById("singlesignon_f_name").value);
	var value = NameValidity(FirstNameValue);
	document.getElementById("singlesignon_f_name").value = trim(CapitalizeMe(FirstNameValue));
	
	
	if(FirstNameValue == ''){	
		document['singlesignon_l_name'].src = urlpath + "images/delete.png";
		document.getElementById("singlesignon_f_name").style.border = "1px solid #d12f19";
		document.getElementById("singlesignon_f_name").style.background = "#f7cbc2";
		return false;
	}else if(value){
		document['singlesignon_l_name'].src = urlpath + "images/delete.png";
		document.getElementById("singlesignon_f_name").style.border = "1px solid #d12f19";
		document.getElementById("singlesignon_f_name").style.background = "#f7cbc2";
		SingleSignOnDisplayError(value);
		return false;
	}else{
		if(FirstNameValue != ''){
			document['singlesignon_l_name'].src = urlpath + "images/blank.gif";
			document.getElementById("singlesignon_f_name").style.border = "1px solid #a1a1a1";
			document.getElementById("singlesignon_f_name").style.background = "#fff";
			SingleSignOnHideError();
			return true;
		}
	}

}

function SingleSignOnCheckLastName(){
	var LastNameValue = trim(document.getElementById("singlesignon_l_name").value);
	var value = NameValidity(LastNameValue);
	document.getElementById("singlesignon_l_name").value = trim(CapitalizeMe(LastNameValue));
	
	if(LastNameValue == ''){	
		SingleSignOnShowCross('singlesignon_l_name');
		return false;
	}else if(value){
		SingleSignOnShowCross('singlesignon_l_name');
		SingleSignOnDisplayError(value);
		return false;
	}else{ 
		if(LastNameValue != ''){
			document.getElementById("singlesignon_l_name").style.border = "1px solid #a1a1a1";
			document.getElementById("singlesignon_l_name").style.background = "#fff";
			if(SingleSignOnCheckFirstName()){
				document['singlesignon_l_name'].src = urlpath + "images/accept.png";
				SingleSignOnHideError();
				return true;
			}
		}
	}
}

function SingleSignOnCheckCountry(name){
	if(name == "singlesignon_country" || name == "singlesignon_city" || name == "singlesignon_gender" || name == "singlesignon_maritalstatus"){
		if(document.getElementById(name).value == '')
		{
			SingleSignOnShowCross(name);
			return false;
		}
		if(document.getElementById(name).value != '')
		{
			SingleSignOnRemoveCross(name);
			SingleSignOnHideError();
			return true;
		}
	}
}

function SingleSignOnCheckDob(name){
	if(name == "singlesignon_month"||name == "singlesignon_day"||name == "singlesignon_year"){
		if(document.getElementById(name).value == '')
		{
			document['singlesignon_year'].src = urlpath + "images/delete.png";
			document.getElementById(name).border = "1px solid #d12f19";
			document.getElementById(name).style.background = "#f7cbc2";
			return false;
		}
		if(document.getElementById(name).value != '')
		{
			if(document.getElementById('singlesignon_day').value!='' || document.getElementById('singlesignon_month').value!='' || document.getElementById('singlesignon_year').value!=''){
				if(!SingleSignOnCheckDate())return false;
				else return true;
			}else{
				if(name=="singlesignon_year" && document.getElementById('singlesignon_month').value!='' && document.getElementById('singlesignon_day').value!=''){
					document['singlesignon_year'].src = urlpath + "images/accept.png";
				}
				if(name=="singlesignon_month" && document.getElementById('singlesignon_year').value!='' && document.getElementById('singlesignon_day').value!=''){
					document['singlesignon_year'].src = urlpath + "images/accept.png";
				}
				if(name=="singlesignon_day" && document.getElementById('singlesignon_month').value!='' && document.getElementById('singlesignon_year').value!=''){
					document['singlesignon_year'].src = urlpath + "images/accept.png";
				}
					document.getElementById(name).border = "1px solid #a1a1a1";
					document.getElementById(name).style.background = "#ffffff";
					document.getElementById("singlesignon_error").innerHTML = '';
					document.getElementById("singlesignon_error").style.display = "none";
					return true;
			}
		}
	}
}

function SingleSignOnCheckDate(){
	var Day = document.getElementById("singlesignon_day").value;
	var Month = document.getElementById("singlesignon_month").value;
	var Year = document.getElementById("singlesignon_year").value;
	var Dob = Year+"-"+Month+"-"+Day;

	age = SingleSignOnqryHowOld(new Date(), Month + '/' + Day + '/' + Year );

		if(age.indexOf('Year') != -1) {
			age_count = age.substring( 0, age.indexOf('Year') );
			age_count = parseInt(age_count);
			if(age_count < 18) {
				SingleSignOnShowCross('singlesignon_year');
				SingleSignOnDisplayError("Your age must be 18+ to join!");
				return false;
			}else{
				SingleSignOnRemoveCross('singlesignon_year');
				SingleSignOnHideError();
			    return true;
			}
		}
	//return true;
}

function SingleSignOnqryHowOld(varAsOfDate, varBirthDate)
{
	var dtAsOfDate;
	var dtBirth;
	var dtAnniversary;
	var intSpan;
	var intYears;
	var intMonths;
	var intWeeks;
	var intDays;
	var intHours;
	var intMinutes;
	var intSeconds;
	var strHowOld;

	// get born date
	dtBirth = new Date(varBirthDate);

	// get as of date
	dtAsOfDate = new Date(varAsOfDate);

	// if as of date is on or after born date
	if ( dtAsOfDate >= dtBirth )
	{

		// get time span between as of time and birth time
		intSpan = ( dtAsOfDate.getUTCHours() * 3600000 +
		dtAsOfDate.getUTCMinutes() * 60000 +
		dtAsOfDate.getUTCSeconds() * 1000    ) -
		( dtBirth.getUTCHours() * 3600000 +
		dtBirth.getUTCMinutes() * 60000 +
		dtBirth.getUTCSeconds() * 1000       )

		// start at as of date and look backwards for anniversary

		// if as of day (date) is after birth day (date) or
		//    as of day (date) is birth day (date) and
		//    as of time is on or after birth time
		if ( dtAsOfDate.getUTCDate() > dtBirth.getUTCDate() ||
		( dtAsOfDate.getUTCDate() == dtBirth.getUTCDate() && intSpan >= 0 ) )
		{

			// most recent day (date) anniversary is in as of month
			dtAnniversary =
			new Date( Date.UTC( dtAsOfDate.getUTCFullYear(),
			dtAsOfDate.getUTCMonth(),
			dtBirth.getUTCDate(),
			dtBirth.getUTCHours(),
			dtBirth.getUTCMinutes(),
			dtBirth.getUTCSeconds() ) );

		}

		// if as of day (date) is before birth day (date) or
		//    as of day (date) is birth day (date) and
		//    as of time is before birth time
		else
		{

			// most recent day (date) anniversary is in month before as of month
			dtAnniversary =
			new Date( Date.UTC( dtAsOfDate.getUTCFullYear(),
			dtAsOfDate.getUTCMonth() - 1,
			dtBirth.getUTCDate(),
			dtBirth.getUTCHours(),
			dtBirth.getUTCMinutes(),
			dtBirth.getUTCSeconds() ) );

			// get previous month
			intMonths = dtAsOfDate.getUTCMonth() - 1;
			if ( intMonths == -1 )
			intMonths = 11;

			// while month is not what it is supposed to be (it will be higher)
			while ( dtAnniversary.getUTCMonth() != intMonths )

			// move back one day
			dtAnniversary.setUTCDate( dtAnniversary.getUTCDate() - 1 );

		}

		// if anniversary month is on or after birth month
		if ( dtAnniversary.getUTCMonth() >= dtBirth.getUTCMonth() )
		{

			// months elapsed is anniversary month - birth month
			intMonths = dtAnniversary.getUTCMonth() - dtBirth.getUTCMonth();

			// years elapsed is anniversary year - birth year
			intYears = dtAnniversary.getUTCFullYear() - dtBirth.getUTCFullYear();

		}

		// if birth month is after anniversary month
		else
		{

			// months elapsed is months left in birth year + anniversary month
			intMonths = (11 - dtBirth.getUTCMonth()) + dtAnniversary.getUTCMonth() + 1;

			// years elapsed is year before anniversary year - birth year
			intYears = (dtAnniversary.getUTCFullYear() - 1) - dtBirth.getUTCFullYear();

		}

		// to calculate weeks, days, hours, minutes and seconds
		// we can take the difference from anniversary date and as of date

		// get time span between two dates in milliseconds
		intSpan = dtAsOfDate - dtAnniversary;

		// get number of weeks
		intWeeks = Math.floor(intSpan / 604800000);

		// subtract weeks from time span
		intSpan = intSpan - (intWeeks * 604800000);

		// get number of days
		intDays = Math.floor(intSpan / 86400000);

		// subtract days from time span
		intSpan = intSpan - (intDays * 86400000);

		// get number of hours
		intHours = Math.floor(intSpan / 3600000);

		// subtract hours from time span
		intSpan = intSpan - (intHours * 3600000);

		// get number of minutes
		intMinutes = Math.floor(intSpan / 60000);

		// subtract minutes from time span
		intSpan = intSpan - (intMinutes * 60000);

		// get number of seconds
		intSeconds = Math.floor(intSpan / 1000);

		// create output string
		if ( intYears > 0 )
		if ( intYears > 1 )
		strHowOld = intYears.toString() + ' Years';
		else
		strHowOld = intYears.toString() + ' Year';
		else
		strHowOld = '';

		if ( intMonths > 0 )
		if ( intMonths > 1 )
		strHowOld = strHowOld + ' ' + intMonths.toString() + ' Months';
		else
		strHowOld = strHowOld + ' ' + intMonths.toString() + ' Month';

		if ( intWeeks > 0 )
		if ( intWeeks > 1 )
		strHowOld = strHowOld + ' ' + intWeeks.toString() + ' Weeks';
		else
		strHowOld = strHowOld + ' ' + intWeeks.toString() + ' Week';

		if ( intDays > 0 )
		if ( intDays > 1 )
		strHowOld = strHowOld + ' ' + intDays.toString() + ' Days';
		else
		strHowOld = strHowOld + ' ' + intDays.toString() + ' Day';

		if ( intHours > 0 )
		if ( intHours > 1 )
		strHowOld = strHowOld + ' ' + intHours.toString() + ' Hours';
		else
		strHowOld = strHowOld + ' ' + intHours.toString() + ' Hour';

		if ( intMinutes > 0 )
		if ( intMinutes > 1 )
		strHowOld = strHowOld + ' ' + intMinutes.toString() + ' Minutes';
		else
		strHowOld = strHowOld + ' ' + intMinutes.toString() + ' Minute';

		if ( intSeconds > 0 )
		if ( intSeconds > 1 )
		strHowOld = strHowOld + ' ' + intSeconds.toString() + ' Seconds';
		else
		strHowOld = strHowOld + ' ' + intSeconds.toString() + ' Second';

	}
	else
	strHowOld = 'Not Born Yet'

	// return string representation
	return strHowOld
}

function SingleSignOnCheckSexStatus(name){
	if(name == "singlesignon_gender"||name == "singlesignon_maritalstatus"){
		if(document.getElementById(name).value == '')
		{
			document['singlesignon_gender'].src = urlpath + "images/delete.png";
			document.getElementById(name).border = "1px solid #d12f19";
			document.getElementById(name).style.background = "#f7cbc2";
			return false;
		}
		if(document.getElementById(name).value != '')
		{
			if(name=="singlesignon_maritalstatus" && document.getElementById('singlesignon_gender').value!='' ){
				document['singlesignon_gender'].src = urlpath + "images/accept.png";
			}
			if(name=="singlesignon_gender" && document.getElementById('singlesignon_maritalstatus').value!=''){
				document['singlesignon_gender'].src = urlpath + "images/accept.png";
			}
			
			document.getElementById(name).border = "1px solid #a1a1a1";
			document.getElementById(name).style.background = "#ffffff";
			document.getElementById("singlesignon_newerror").innerHTML = '';
			document.getElementById("singlesignon_newerror").style.display = "none";
			return true;
		}
	}
}

function SingleSignOnMobileDataBaseValidation(){
	var url = urlpath+"SingleSignOnCheckMobile.php?mobile="+trim(document.getElementById('singlesignon_mobile').value);
	httpObj.open("POST",url,true);
	httpObj.onreadystatechange = function(){
		if(httpObj.readyState==4){
			if(httpObj.responseText == '--1--'){
				SingleSignOnShowCross('singlesignon_mobile');
				SingleSignOnDisplayError('Mobile is already registered. Log-in.');
				SingleSignOnSetValue(httpObj.responseText);
			}else if(httpObj.responseText == '--2--'){
				SingleSignOnShowCross('singlesignon_mobile');
				SingleSignOnDisplayError('Mobile is blocked. Contact Support.');
				SingleSignOnSetValue(httpObj.responseText);
			}else{
				SingleSignOnRemoveCross('singlesignon_mobile');
				SingleSignOnHideError();
				SingleSignOnSetValue(0);
			}
		}
	}
	httpObj.send(null);
}

function SingleSignOnMobileValidation(){
	var MobileValue = trim(document.getElementById('singlesignon_mobile').value);
	var value = MobileValidity(MobileValue);
	
	if(MobileValue == ''){
		SingleSignOnShowCross('singlesignon_mobile');
		return false;
	}else if(value){
		SingleSignOnShowCross('singlesignon_mobile');
		SingleSignOnDisplayError(value);
		return false;
	}else{
		SingleSignOnMobileDataBaseValidation();
		if(document.getElementById("singlesignon_seterror").value=='--1--')	
			return false;
		else if(document.getElementById("singlesignon_seterror").value=='--2--')	
			return false;
	}
	return true;
}

function SingleSignOnCheckMobile(){
	if(!SingleSignOnMobileValidation()) return false;
	else return true;
}

function SingleSignOnNriMobileValidation(){
	var MobileValue = trim(document.getElementById('singlesignon_mobile').value);
	var value = MobileValidityNRI(MobileValue);
	
	
	if(MobileValue == ''){
		SingleSignOnShowCross('singlesignon_mobile');
		return false;
	}else if(value){
		SingleSignOnShowCross('singlesignon_mobile');
		SingleSignOnDisplayError(value);
		return false;
	}else{
		SingleSignOnMobileDataBaseValidation();
		if(document.getElementById("singlesignon_seterror").value=='--1--')	
			return false;
		else if(document.getElementById("singlesignon_seterror").value=='--2--')	
			return false;
	}
	return true;
}

function SingleSignOnCheckNriMobile(){
	if(!SingleSignOnNriMobileValidation()) return false;
	else return true;
}

function SingleSignOnCallCityValue(value){
	if(value=='Other'){
		var rishi = ': <select name="singlesignon_city" id="singlesignon_city" class="selectstyle" onchange="javascript:SingleSignOnChanageCityOnSelection(this.value);" style=" width:110px; font-family:lucida grande, tahoma, verdana, arial, sans-serif; font-size:11px; border:1px solid #a1a1a1;">';
	}else{
		var rishi = ': <select name="singlesignon_city" id="singlesignon_city" class="selectstyle" onBlur="javascript:SingleSignOnCheckCountry(this.name);" onchange="javascript:SingleSignOnChanageCityOnSelection(this.value);" style=" width:215px; font-family:lucida grande, tahoma, verdana, arial, sans-serif; font-size:11px; border:1px solid #a1a1a1; ">';
	}
	for(i=0;i<SingleSignOnCityName.length;i++){
		if(SingleSignOnCityName[i]==value)
			rishi = rishi + '<option value="'+SingleSignOnCityName[i]+'" selected>'+SingleSignOnCityName[i]+'</option>';
		else
			rishi = rishi + '<option value="'+SingleSignOnCityName[i]+'">'+SingleSignOnCityName[i]+'</option>';
	}
	if(value=='Other'){
		rishi = rishi + '<option value="Other" selected>Other City</option>';
		rishi = rishi + '</select>&nbsp;<input name="singlesignon_othercity" id="singlesignon_othercity" type="text" style="width:97px;" onfocus="javascript:SingleSignOnClearCity();" onBlur="javascript:SingleSignOnSetOtherCity();" value="--Enter a city--"/><img width="16" height="16" name="singlesignon_city1" src="'+ urlpath + 'images/blank.gif" alt="" style="margin:0px 0px 4px 5px; vertical-align:middle;"/>';
	}
	else{
		rishi = rishi + '<option value="Other">Other City</option>';
		rishi = rishi + '</select><img width="16" height="16" name="singlesignon_city" src="'+ urlpath + 'images/blank.gif" alt="" style="margin:0px 0px 4px 4px; vertical-align:middle;"/>';
	}
	return rishi;
}	

function SingleSignOnClearCity(){
	if(document.getElementById("singlesignon_othercity").value=='--Enter a city--')
		document.getElementById("singlesignon_othercity").value="";
}

function SingleSignOnSetCityValue(divName,setcity){
	document.getElementById(divName).innerHTML = setcity;
}

function SingleSignOnChanageCityOnSelection(value){
	if(value!='Other'){
		setcity = SingleSignOnCallCityValue(value);
		document.getElementById("singlesignon_show_other_city").style.display = "none";
		document.getElementById("singlesignon_show_city").style.display = "block";
		SingleSignOnSetCityValue('singlesignon_show_city',setcity);
		document.getElementById('singlesignon_city').focus();
	}else{
		setcity = SingleSignOnCallCityValue(value);
		document.getElementById("singlesignon_show_city").style.display = "none";
		document.getElementById("singlesignon_show_other_city").style.display = "block";
		SingleSignOnSetCityValue('singlesignon_show_other_city',setcity);
		document.getElementById('singlesignon_othercity').focus();
	}
}

function SingleSignOnSetOtherCity(){
	if(document.getElementById("singlesignon_othercity").value=="")
		document.getElementById("singlesignon_othercity").value="--Enter a city--";
		
		var CityValue = document.getElementById('singlesignon_othercity').value;
		var value = CityValidity(CityValue);
		
		if(CityValue == '' || CityValue=='--Enter a city--'){
			SingleSignOnShowCross('singlesignon_city1');
			return false;
		}else if(value){
			SingleSignOnShowCross('singlesignon_city1');
			SingleSignOnDisplayError(value);
			return false;
		}else{
			SingleSignOnRemoveCross('singlesignon_city1');
			return true;
		}
	return true;
}

function SingleSignOnCheckCity(){
	if(document.getElementById("singlesignon_city").value==''){
		SingleSignOnShowCross('singlesignon_city');
		return false;	
	}else if(document.getElementById("singlesignon_city").value=='Other'){
		if(!SingleSignOnSetOtherCity()) return false;
		else return true;
	}else
		return true;
}


function SingleSignOnOpenCountryList(){
	document.getElementById('singlesignoncountrylist').style.display = 'block';
	document.getElementById('mask_div').style.visibility = 'visible';

	//var url = urlpath+"country.html";
	var url = urlpath+"singlesignoncountry.html";
	httpObj.open("POST",url,true);
	httpObj.onreadystatechange = function(){
		if(httpObj.readyState==1 || httpObj.readyState==2 || httpObj.readyState==3){
			document.getElementById('SinglSignOnLoadCountryLoadingDiv').style.display = "block";
		}
		if(httpObj.readyState==4){
			document.getElementById('SinglSignOnLoadCountryLoadingDiv').style.display = "none";
			document.getElementById('SinglSignOnLoadCountry').innerHTML = httpObj.responseText;
		}
	}
	httpObj.send(null);
}

function SingleSignOnCloseCountryList(){
	document.getElementById('singlesignoncountrylist').style.display = 'none';
	document.getElementById('mask_div').style.visibility = 'hidden';
}

function SingleSignOnOpenCountryListStandAlone(){
	document.getElementById('singlesignoncountrylist').style.display = 'block';
	//document.getElementById('mask_div').style.visibility = 'visible';

	var url = urlpath+"singlesignoncountrystandalone.html";
	httpObj.open("POST",url,true);
	httpObj.onreadystatechange = function(){
		if(httpObj.readyState==1 || httpObj.readyState==2 || httpObj.readyState==3){
			document.getElementById('SinglSignOnLoadCountryLoadingDiv').style.display = "block";
		}
		if(httpObj.readyState==4){
			document.getElementById('SinglSignOnLoadCountryLoadingDiv').style.display = "none";
			document.getElementById('SinglSignOnLoadCountry').innerHTML = httpObj.responseText;
		}
	}
	httpObj.send(null);
}

function SingleSignOnCloseCountryListStandAlone(){
	document.getElementById('singlesignoncountrylist').style.display = 'none';
	//document.getElementById('mask_div').style.visibility = 'hidden';
}

function SingleSignOnCheckTC(){
	if(document.getElementById("singlesignon_agreement").checked == false){
			SingleSignOnShowCross('singlesignon_agreement');
			return false;
	}else{
			SingleSignOnRemoveCross('singlesignon_agreement');
			return true;			
	}
}

function SingleSignOnCheckCaptchaCode(){
	if(trim(document.getElementById("singlesignon_user_verify").value)==''){
		SingleSignOnShowCross('singlesignon_user_verify');
		return false;
	}else if(trim(document.getElementById("singlesignon_user_verify").value)!=''){
		document['singlesignon_user_verify'].src = urlpath + "images/blank.gif";
		document.getElementById('singlesignon_user_verify').style.border = "1px solid #a1a1a1";
		document.getElementById('singlesignon_user_verify').style.background = "#fff";
		return true;
	}
}

var timer = 0;
var timer1 = 0;

function SingleSignOngotoRegStep2(){
	
	if(!SingleSignOnCheckFirstName()) return false;
	else if(!SingleSignOnCheckLastName()) return false;
	else if(!SingleSignOnMobileValidation()) return false;
	else if(!SingleSignOnCheckCity()) return false;
	else if(!SingleSignOnCheckCountry("singlesignon_city")) return false;
	else if(!SingleSignOnCheckDob("singlesignon_day")) return false;
	else if(!SingleSignOnCheckDob("singlesignon_month")) return false;
	else if(!SingleSignOnCheckDob("singlesignon_year")) return false;
	else if(!SingleSignOnCheckSexStatus("singlesignon_gender")) return false;
	else if(!SingleSignOnCheckSexStatus("singlesignon_maritalstatus")) return false;
	else if(!SingleSignOnUserNameValidation()) return false;
	else if(!SingleSignOnCheckPassword()) return false;
	else if(!SingleSignOnCheckTC("singlesignon_agreement")) return false;
	
	var username = document.getElementById("singlesignon_username").value;
	var f_name = document.getElementById("singlesignon_f_name").value;
	var l_name = document.getElementById("singlesignon_l_name").value;
	var email = document.getElementById("singlesignon_email").value;
	var pass1 = document.getElementById("singlesignon_user_pass").value;
	
	var city = document.getElementById("singlesignon_city").value;
	if(city=='Other'){
		var othercity = document.getElementById("singlesignon_othercity").value;
	}else{
		var othercity = '';
	}

	var month = document.getElementById("singlesignon_month").value;
	var day = document.getElementById("singlesignon_day").value;
	var year = document.getElementById("singlesignon_year").value;
	var dob = year+'-'+month+'-'+day;	
	
	var gender = document.getElementById("singlesignon_gender").value;
	var maritalstatus = document.getElementById("singlesignon_maritalstatus").value;
	var mobile = document.getElementById("singlesignon_mobile").value;
	//var user_verify = document.getElementById("singlesignon_user_verify").value;
	var user_verify = document.getElementById("myvalsinglesignon").value;
	
	document.getElementById('singlesignon_ValidationDiv').style.display = 'block';
	document.getElementById('singlesignon_form').style.display = 'none';
	document.getElementById("singlesignon_signinform").innerHTML = '<p style="margin:0 auto; margin-bottom:0px; font-weight:bold;font-family:lucida grande, tahoma, verdana, arial, sans-serif;font-size:20px; color:#1e56a1;">Verification in progress</p>';

	var url = urlpath+"SingleSignOnRegistrationStep1.php?f_name="+f_name+"&l_name="+l_name+"&email="+email+"&pass="+pass1+"&city="+city+"&othercity="+othercity+"&dob="+dob+"&gender="+gender+"&maritalstatus="+maritalstatus+"&mobile="+mobile+"&username="+username+"&user_verify="+user_verify+"&register=yes";
	//alert(url);return false;
	httpObj.open("POST",url,true);
	httpObj.onreadystatechange = function(){
		if(httpObj.readyState==1||httpObj.readyState==2||httpObj.readyState==3){
			document.getElementById('singlesignon_ValidationDiv').innerHTML = "<p style='width:290px;text-align:center;padding-top:40px;padding-bottom:40px; font-weight:bold; font-family:lucida grande, tahoma, verdana, arial, sans-serif; font-size:12px;'><img src='"+ urlpath + "images/loadinfo.net.gif'></p>";
		}
		if(httpObj.readyState==4){
			strContent=httpObj.responseText;
			//alert(strContent);
			if( strContent=='--1--' || strContent=='--2--' || strContent=='--3--'|| strContent=='--4--' || strContent=='--5--' || strContent=='--6--' || strContent=='--7--' || strContent=='--8--' || strContent=='--9--' || strContent=='--10--' || strContent=='--11--' || strContent=='--12--' || strContent=='--13--' || strContent=='--14--' || strContent=='--15--' || strContent=='--16--' || strContent=='--17--' || strContent=='--18--' ){
				document.getElementById('singlesignon_ValidationDiv').innerHTML = '';
				document.getElementById('singlesignon_ValidationDiv').style.display = 'none';
				document.getElementById("singlesignon_signinform").innerHTML = '<p style="margin:0 auto; color:#000000; margin-bottom:0px; color:#1e56a1; font-weight:bold;"> <img src="'+ urlpath + 'images/itsfree.gif" /></p>';
				document.getElementById('singlesignon_form').style.display = 'block';	
				
					if(strContent=='--1--'){
						SingleSignOnDisplayError('Please fill in all form fields.');
					}else if(strContent=='--2--'){
						SingleSignOnShowCross('singlesignon_l_name');
						SingleSignOnDisplayError('Name seems to be incorrect.');
					}else if(strContent=='--3--'){
						SingleSignOnShowCross('singlesignon_email');
						SingleSignOnDisplayError('Email seems to be incorrect.');
					}else if(strContent=='--4--'){
						SingleSignOnShowCross('singlesignon_email');
						SingleSignOnDisplayError('Email is already registered.');
					}else if(strContent=='--5--'){
						SingleSignOnShowCross('singlesignon_email');
						SingleSignOnDisplayError('YouMint email Id cannot be registered.');
					}else if(strContent=='--6--'){
						SingleSignOnShowCross('singlesignon_mobile');
						SingleSignOnDisplayError('Mobile seems to be incorrect.');
					}else if(strContent=='--7--'){
						SingleSignOnShowCross('singlesignon_mobile');
						SingleSignOnDisplayError('Mobile is already registered with us.');
					}else if(strContent=='--8--'){
						SingleSignOnShowCross('singlesignon_mobile');
						SingleSignOnDisplayError('Mobile is blocked.');
					}else if(strContent=='--14--'){
						SingleSignOnShowCross('singlesignon_username');
						SingleSignOnDisplayError('Username seems to be incorrect.');
					}else if(strContent=='--15--'){
						SingleSignOnShowCross('singlesignon_username');
						SingleSignOnDisplayError('UserName is already registered.');
					}else if(strContent=='--16--'){
						SingleSignOnShowCross('singlesignon_username');
						SingleSignOnDisplayError('UserName is blocked.');
					}else if(strContent=='--17--'){
						SingleSignOnShowCross('user_pass');
						SingleSignOnDisplayError('Password seems to be incorrect.');
					}else if(strContent=='--9--' || strContent=='--10--' || strContent=='--11--' || strContent=='--12--' || strContent=='--13--' || strContent=='--18--'){
						SingleSignOnDisplayError('Form values seems to be incorrect.');
					}
					
			}else{
				SingleSignOnHideError();
				document.getElementById('singlesignon_ValidationDiv').style.display = 'none';
				document.getElementById('singlesignon_RishiRajNigam').innerHTML = strContent;
				
				/* New Code */
				
				document.getElementById("singlesignon_signinform").innerHTML = '<p style="margin:0 auto; margin-bottom:0px; font-weight:bold;font-family:lucida grande, tahoma, verdana, arial, sans-serif;font-size:20px; color:#1e56a1;">Confirm Mobile</p>';
				document.getElementById('singlesignon_form1').style.display = 'block';
				document.getElementById('singlesignon_RishiRajNigam').style.display = 'block';
				
				/* End of New Code */

			}
		}
	}
	httpObj.send(null);
	//return false;
}

function SingleSignOngotoNriRegStep2(){
	
	if(!SingleSignOnCheckFirstName()) return false;
	else if(!SingleSignOnCheckLastName()) return false;
	else if(!SingleSignOnNriMobileValidation()) return false;
	else if(!SingleSignOnCheckCity()) return false;
	else if(!SingleSignOnCheckCountry("singlesignon_city")) return false;
	else if(!SingleSignOnCheckDob("singlesignon_day")) return false;
	else if(!SingleSignOnCheckDob("singlesignon_month")) return false;
	else if(!SingleSignOnCheckDob("singlesignon_year")) return false;
	else if(!SingleSignOnCheckSexStatus("singlesignon_gender")) return false;
	else if(!SingleSignOnCheckSexStatus("singlesignon_maritalstatus")) return false;
	else if(!SingleSignOnUserNameValidation()) return false;
	else if(!SingleSignOnCheckPassword()) return false;
	else if(!SingleSignOnCheckTC("singlesignon_agreement")) return false;
	
	var username = document.getElementById("singlesignon_username").value;
	var f_name = document.getElementById("singlesignon_f_name").value;
	var l_name = document.getElementById("singlesignon_l_name").value;
	var email = document.getElementById("singlesignon_email").value;
	var pass1 = document.getElementById("singlesignon_user_pass").value;
	
	var city = document.getElementById("singlesignon_city").value;
	if(city=='Other'){
		var othercity = document.getElementById("singlesignon_othercity").value;
	}else{
		var othercity = '';
	}

	var country = document.getElementById("singlesignon_country").value;
	var month = document.getElementById("singlesignon_month").value;
	var day = document.getElementById("singlesignon_day").value;
	var year = document.getElementById("singlesignon_year").value;
	var dob = year+'-'+month+'-'+day;	
	
	var gender = document.getElementById("singlesignon_gender").value;
	var maritalstatus = document.getElementById("singlesignon_maritalstatus").value;
	var mobile = document.getElementById("singlesignon_mobile").value;
	var isdcode = document.getElementById("singlesignon_isdcode").value;
	var countrycode = document.getElementById("singlesignon_countrycode").value;
	//var user_verify = document.getElementById("singlesignon_user_verify").value;
	var user_verify = document.getElementById("myvalsinglesignon").value;
	
	document.getElementById('singlesignon_ValidationDiv').style.display = 'block';
	document.getElementById('singlesignon_form').style.display = 'none';
	document.getElementById("singlesignon_signinform").innerHTML = '<p style="width:290px;margin:0 auto; margin-bottom:0px; font-weight:bold;font-family:lucida grande, tahoma, verdana, arial, sans-serif;font-size:20px; color:#1e56a1;">Verification in progress</p>';

	var url = urlpath+"SingleSignOnNriRegistrationStep1.php?f_name="+f_name+"&l_name="+l_name+"&email="+email+"&pass="+pass1+"&city="+city+"&country="+country+"&othercity="+othercity+"&dob="+dob+"&gender="+gender+"&maritalstatus="+maritalstatus+"&mobile="+mobile+"&isdcode="+isdcode+"&countrycode="+countrycode+"&username="+username+"&user_verify="+user_verify+"&register=yes";
	
	httpObj.open("POST",url,true);
	httpObj.onreadystatechange = function(){
		if(httpObj.readyState==1||httpObj.readyState==2||httpObj.readyState==3){
			document.getElementById('singlesignon_ValidationDiv').innerHTML = "<p style='text-align:center;padding-top:40px;padding-bottom:40px; font-weight:bold; font-family:lucida grande, tahoma, verdana, arial, sans-serif; font-size:12px;'><img src='"+ urlpath + "images/loadinfo.net.gif'></p>";
		}
		if(httpObj.readyState==4){
			strContent=httpObj.responseText;
			if( strContent=='--1--' || strContent=='--2--' || strContent=='--3--' || strContent=='--4--' || strContent=='--5--' || strContent=='--6--' || strContent=='--7--' || strContent=='--8--' || strContent=='--9--' || strContent=='--10--' || strContent=='--11--' || strContent=='--12--' || strContent=='--13--' || strContent=='--14--' || strContent=='--15--' || strContent=='--16--' || strContent=='--17--' ){
				document.getElementById('singlesignon_ValidationDiv').innerHTML = '';
				document.getElementById('singlesignon_ValidationDiv').style.display = 'none';
				document.getElementById("singlesignon_signinform").innerHTML = '<p style="margin:0 auto; color:#000000; margin-bottom:0px; color:#1e56a1; font-weight:bold;"> <img src="'+ urlpath + 'images/itsfree.gif" /></p>';
				document.getElementById('singlesignon_form').style.display = 'block';	

					if(strContent=='--1--'){
						SingleSignOnDisplayError('Please fill in all form fields.');
					}else if(strContent=='--2--'){
						SingleSignOnShowCross('singlesignon_l_name');
						SingleSignOnDisplayError('Name seems to be incorrect.');
					}else if(strContent=='--3--'){
						SingleSignOnShowCross('singlesignon_email');
						SingleSignOnDisplayError('Email seems to be incorrect.');
					}else if(strContent=='--4--'){
						SingleSignOnShowCross('singlesignon_email');
						SingleSignOnDisplayError('Email is already registered.');
					}else if(strContent=='--5--'){
						SingleSignOnShowCross('singlesignon_email');
						SingleSignOnDisplayError('YouMint email Id cannot be registered.');
					}else if(strContent=='--6--'){
						SingleSignOnShowCross('singlesignon_mobile');
						SingleSignOnDisplayError('Mobile seems to be incorrect.');
					}else if(strContent=='--7--'){
						SingleSignOnShowCross('singlesignon_mobile');
						SingleSignOnDisplayError('Mobile is already registered with us.');
					}else if(strContent=='--8--'){
						SingleSignOnShowCross('singlesignon_mobile');
						SingleSignOnDisplayError('Mobile is blocked.');
					}else if(strContent=='--13--'){
						SingleSignOnShowCross('singlesignon_username');
						SingleSignOnDisplayError('Username seems to be incorrect.');
					}else if(strContent=='--14--'){
						SingleSignOnShowCross('singlesignon_username');
						SingleSignOnDisplayError('UserName is already registered.');
					}else if(strContent=='--15--'){
						SingleSignOnShowCross('singlesignon_username');
						SingleSignOnDisplayError('UserName is blocked.');
					}else if(strContent=='--16--'){
						SingleSignOnShowCross('user_pass');
						SingleSignOnDisplayError('Password seems to be incorrect.');
					}else if(strContent=='--9--' || strContent=='--10--' || strContent=='--11--' || strContent=='--12--' || strContent=='--17--'){
						SingleSignOnDisplayError('Form values seems to be incorrect.');
					}				
			}else{
				SingleSignOnHideError();
				document.getElementById('singlesignon_ValidationDiv').style.display = 'none';
				document.getElementById('singlesignon_RishiRajNigam').innerHTML = strContent;
				
				/* New Code */
				
				document.getElementById("singlesignon_signinform").innerHTML = '<p style="margin:0 auto; margin-bottom:0px; font-weight:bold;font-family:lucida grande, tahoma, verdana, arial, sans-serif;font-size:20px; color:#1e56a1;">Confirm Mobile</p>';
				document.getElementById('singlesignon_form1').style.display = 'block';
				document.getElementById('singlesignon_RishiRajNigam').style.display = 'block';
								
				/* End of New Code */

			}
		}
	}
	httpObj.send(null);

}

function SingleSignOnMobileDataBaseValidationSecondStep(name){
	var url = urlpath+"SingleSignOnCheckMobile.php?mobile="+trim(document.getElementById(name).value);
	httpObj.open("POST",url,true);
	httpObj.onreadystatechange = function(){
		if(httpObj.readyState==4){
			if(httpObj.responseText == '--1--'){
				SingleSignOnShowCross(name);
				SingleSignOnDisplayError('Mobile is already registered. Log-in.');
				SingleSignOnSetValue(httpObj.responseText);
			}else if(httpObj.responseText == '--2--'){
				SingleSignOnShowCross(name);
				SingleSignOnDisplayError('Mobile is blocked. Contact Support.');
				SingleSignOnSetValue(httpObj.responseText);
			}else{
				SingleSignOnRemoveCross(name);
				SingleSignOnHideError();
				SingleSignOnSetValue(0);
			}
		}
	}
	httpObj.send(null);
}

function SingleSignOnMobileValidationSecondStep(name){
	var MobileValue = trim(document.getElementById(name).value);
	var value = MobileValidity(MobileValue);
	
	if(MobileValue == ''){
		SingleSignOnShowCross(name);
		return false;
	}else if(value){
		SingleSignOnShowCross(name);
		SingleSignOnDisplayError(value);
		return false;
	}else{
		SingleSignOnMobileDataBaseValidationSecondStep(name);
		if(document.getElementById("seterror").value=='--1--')	
			return false;
		else if(document.getElementById("seterror").value=='--2--')	
			return false;
	}
	return true;
}

function SingleSignOnCheckUserMobileNo(){
	if(!SingleSignOnMobileValidationSecondStep('singlesignon_enteredmobile')) return false;
	else if(!SingleSignOnMobileValidationSecondStep('singlesignon_confirmmobile')) return false;
		
	var OldMobile = document.getElementById('singlesignon_enteredmobile').value;
	var NewMobile = document.getElementById('singlesignon_confirmmobile').value;

	var url = urlpath+"SingleSignOnSendVerificationCode.php?oldmobile="+OldMobile+"&newmobile="+NewMobile;
	//alert(url);

	httpObj.open("POST",url,true);
	httpObj.onreadystatechange = function(){
		if(httpObj.readyState==1||httpObj.readyState==2||httpObj.readyState==3){
			
			document.getElementById('singlesignon_mobilebutton').value='verifying';
			document.getElementById('singlesignon_mobilebutton').disabled = 'true';
			
		}
		if(httpObj.readyState==4){
			var strContent = httpObj.responseText;
			//alert(strContent);
			if( strContent=='--1--' || strContent=='--2--' || strContent=='--3--' || strContent=='--4--' || strContent=='--5--' || strContent=='--6--' ){
				
				document.getElementById('singlesignon_form1').style.display = 'block';
				document.getElementById('singlesignon_mobilebutton').value='confirm';
				document.getElementById('singlesignon_mobilebutton').disabled = '';

				if(strContent=='--1--'){
					SingleSignOnDisplayError('Please fill in all form fields.');
				}else if(strContent=='--2--'){
					SingleSignOnShowCross('singlesignon_enteredmobile');
					SingleSignOnDisplayError('Mobile number seems to be incorrect.');
				}else if(strContent=='--3--'){
					SingleSignOnShowCross('singlesignon_confirmmobile');
					SingleSignOnDisplayError('Mobile number seems to be incorrect.');
				}else if(strContent=='--4--'){
					SingleSignOnShowCross('singlesignon_confirmmobile');
					SingleSignOnDisplayError('Mobile number mismatch.');
				}else if(strContent=='--5--'){
					SingleSignOnShowCross('singlesignon_confirmmobile');
					SingleSignOnDisplayError('Mobile number is already registered.');
				}else if(strContent=='--6--'){
					SingleSignOnShowCross('singlesignon_confirmmobile');
					SingleSignOnDisplayError('Mobile number is blocked.');
				}

			}else{
				SingleSignOnHideError();
				document.getElementById('singlesignon_RishiRajNigam').innerHTML = strContent;
				document.getElementById("singlesignon_signinform").innerHTML = '<p style="margin:0 auto; margin-bottom:0px; font-weight:bold;font-family:lucida grande, tahoma, verdana, arial, sans-serif;font-size:20px; color:#1e56a1;">Enter the Code</p>';
				document.getElementById('singlesignon_form1').style.display = 'block';
				document.getElementById('singlesignon_RishiRajNigam').style.display = 'block';
				timer = setTimeout(function(){SingleSignOnShowTimerDivNew()},30000);
			}
		}
	}
	httpObj.send(null);
}

/* New Code */
function SingleSignOnShowTimerDivNew(){
	document.getElementById('singlesignon_FirstTimeVerificationCode').style.display = 'block';
}
/* New Code */

function SingleSignOnNriMobileValidationSecondStep(name){
	var MobileValue = trim(document.getElementById(name).value);
	var value = MobileValidityNRI(MobileValue);

	if(MobileValue == ''){
		SingleSignOnShowCross(name);
		return false;
	}else if(value){
		SingleSignOnShowCross(name);
		SingleSignOnDisplayError(value);
		return false;
	}else{
		SingleSignOnMobileDataBaseValidationSecondStep(name);
		if(document.getElementById("seterror").value=='--1--')	
			return false;
		else if(document.getElementById("seterror").value=='--2--')	
			return false;
	}
	return true;
}

function SingleSignOnCheckNriUserMobileNo(){
	if(!SingleSignOnNriMobileValidationSecondStep('singlesignon_enteredmobile')) return false;
	else if(!SingleSignOnNriMobileValidationSecondStep('singlesignon_confirmmobile')) return false;
		
	var OldMobile = document.getElementById('singlesignon_enteredmobile').value;
	var NewMobile = document.getElementById('singlesignon_confirmmobile').value;

	var url = urlpath+"SingleSignOnSendVerificationCode.php?oldmobile="+OldMobile+"&newmobile="+NewMobile;
	httpObj.open("POST",url,true);
	httpObj.onreadystatechange = function(){
		if(httpObj.readyState==1||httpObj.readyState==2||httpObj.readyState==3){
			
			document.getElementById('singlesignon_mobilebutton').value='verifying';
			document.getElementById('singlesignon_mobilebutton').disabled = 'true';
			
		}
		if(httpObj.readyState==4){
			var strContent = httpObj.responseText;
			
			if( strContent=='--1--' || strContent=='--2--' || strContent=='--3--' || strContent=='--4--' || strContent=='--5--' || strContent=='--6--' ){
				
				document.getElementById('singlesignon_form1').style.display = 'block';
				document.getElementById('singlesignon_mobilebutton').value='confirm';
				document.getElementById('singlesignon_mobilebutton').disabled = '';

				if(strContent=='--1--'){
					SingleSignOnDisplayError('Please fill in all form fields.');
				}else if(strContent=='--2--'){
					SingleSignOnShowCross('singlesignon_enteredmobile');
					SingleSignOnDisplayError('Mobile number seems to be incorrect.');
				}else if(strContent=='--3--'){
					SingleSignOnShowCross('singlesignon_confirmmobile');
					SingleSignOnDisplayError('Mobile number seems to be incorrect.');
				}else if(strContent=='--4--'){
					SingleSignOnShowCross('singlesignon_confirmmobile');
					SingleSignOnDisplayError('Mobile number mismatch.');
				}else if(strContent=='--5--'){
					SingleSignOnShowCross('singlesignon_confirmmobile');
					SingleSignOnDisplayError('Mobile number is already registered.');
				}else if(strContent=='--6--'){
					SingleSignOnShowCross('singlesignon_confirmmobile');
					SingleSignOnDisplayError('Mobile number is blocked.');
				}
			}else{
				SingleSignOnHideError();
				document.getElementById('singlesignon_RishiRajNigam').innerHTML = strContent;
				document.getElementById("singlesignon_signinform").innerHTML = '<p style="margin:0 auto; margin-bottom:0px; font-weight:bold;font-family:lucida grande, tahoma, verdana, arial, sans-serif;font-size:20px; color:#1e56a1;">Enter the Code</p>';
				document.getElementById('singlesignon_form1').style.display = 'block';
				document.getElementById('singlesignon_RishiRajNigam').style.display = 'block';
				timer = setTimeout(function(){SingleSignOnShowTimerDivNew()},30000);
			}
		}
	}
	httpObj.send(null);
}

function SingleSignOncaptureHitEnter(e, func_with_param) {
	var characterCode;

	if(e && e.which){
		e = e
		characterCode = e.which
	}
	else{
		e = event
		characterCode = e.keyCode
	}
	if(characterCode == 13){
		eval(func_with_param);
		return false;
	}
	else{
			return true;
	}
}

function SingleSignOnVerificationCodeDataBaseValidation(){
	var url = urlpath+"SingleSignOnCheckMobileCode.php?code="+trim(document.getElementById("singlesignon_code").value);
	httpObj.open("POST",url,true);
	httpObj.onreadystatechange = function(){
		if(httpObj.readyState==4){
			if(httpObj.responseText == '--1--'){
				SingleSignOnShowCross('singlesignon_code');
				SingleSignOnDisplayError('Wrong code entered');
				SingleSignOnSetValue(httpObj.responseText);	
			}else{
				SingleSignOnRemoveCross('singlesignon_code');
				SingleSignOnHideError();
				SingleSignOnSetValue(0);
			}
		}
	}
	httpObj.send(null);
}

function SingleSignOnCodeValidation(){
		var CodeValue = document.getElementById("singlesignon_code").value;
		var value = CodeValidity(CodeValue);
		if(CodeValue == ''){
			SingleSignOnShowCross('singlesignon_code');
			return false;
		}else if(value){
			SingleSignOnShowCross('singlesignon_code');
			SingleSignOnDisplayError('Verification code entered seems to be incorrect.');
			return false;
		}else{
			SingleSignOnVerificationCodeDataBaseValidation();
			if(document.getElementById("singlesignon_seterror").value=='--1--')	
				return false;
		}
	return true;
}

function SingleSignOnCheckCode(){
	if(!SingleSignOnCodeValidation()) return false;
	else return true;
	
}

function SingleSignOngotoRegStep3(){
	if(!SingleSignOnCheckCode()) return false;
	
	document.getElementById('singlesignon_ValidationDiv').style.display = 'block';
	
	if(document.getElementById('singlesignon_form1').style.display == 'block'){
		document.getElementById('singlesignon_form1').style.display = 'none';
		var formname = 'singlesignon_form1';
	}

	if(document.getElementById('singlesignon_form2').style.display == 'block'){
		document.getElementById('singlesignon_form2').style.display = 'none';
		var formname = 'singlesignon_form2';
	}
	
	//alert(formname);
	var url = urlpath+"SingleSignOnVerifyMobileCode.php?code=" + trim(document.getElementById("singlesignon_code").value);
	httpObj.open("POST",url,true);
	httpObj.onreadystatechange = function(){
		if(httpObj.readyState==1||httpObj.readyState==2||httpObj.readyState==3){
			document.getElementById('singlesignon_ValidationDiv').innerHTML = "<p style='width:290px;text-align:center;margin-top:40px;margin-bottom:40px;'><img src='"+ urlpath + "images/loadinfo.net.gif'><br><img src='"+ urlpath + "images/loading.gif'></p>";
		}
		
		if(httpObj.readyState==4){
			var strContent=httpObj.responseText;
			if( strContent=='--1--' || strContent=='--2--' || strContent=='--3--'){
				document.getElementById('singlesignon_ValidationDiv').innerHTML = '';
				document.getElementById('singlesignon_ValidationDiv').style.display = 'none';
				document.getElementById(formname).style.display = 'block';
				
				if(strContent=='--1--'){
					SingleSignOnDisplayError('Please fill in all form fields.');
				}else if(strContent=='--2--'){
					SingleSignOnShowCross('singlesignon_code');
					SingleSignOnDisplayError('Code entered seems to be incorrect.');
				}else if(strContent=='--3--'){
					SingleSignOnShowCross('singlesignon_code');
					SingleSignOnDisplayError('Wrong code entered.');
				}

			}else{
				if(document.getElementById('singlesignon_isdcodevalue').value=='91'){
					window.location.href = "RegistrationInvite.php";
				}else{
					window.location.href = "RegistrationInvite.php";
				}
			}
		}
	}
	httpObj.send(null);
}

function SingleSignOnResendVerificationCode(mobile){
	
	document.getElementById('singlesignon_newerror').style.display = 'none';
	document.getElementById('singlesignon_ValidationDiv').style.display = 'block';
	document.getElementById('singlesignon_form1').style.display = 'none';
	document.getElementById("singlesignon_signinform").innerHTML = '<p style="margin:0 auto; margin-bottom:0px; font-weight:bold;font-family:lucida grande, tahoma, verdana, arial, sans-serif;font-size:20px; color:#1e56a1;">Verification in progress</p>';

	var url = urlpath+"SingleSignOnResendVerificationCode.php?mobile="+mobile;
	//alert(url);
	httpObj.open("POST",url,true);
	httpObj.onreadystatechange = function(){
		if(httpObj.readyState==1||httpObj.readyState==2||httpObj.readyState==3){
			document.getElementById('singlesignon_ValidationDiv').innerHTML = "<p style='text-align:center;padding-top:40px;padding-bottom:40px;font-weight:bold; font-family:lucida grande, tahoma, verdana, arial, sans-serif; font-size:12px;'><img src='"+ urlpath + "images/loadinfo.net.gif'><br><br>Re-sending Code to<br> your mobile...</p>";
		}
		if(httpObj.readyState==4){
			var strContent=httpObj.responseText;
			//alert(strContent);
			document.getElementById('singlesignon_RishiRajNigam1').innerHTML = strContent;
			document.getElementById('singlesignon_ValidationDiv').style.display = 'none';
			
			/* New Code */
			document.getElementById("singlesignon_signinform").innerHTML = '<p style="margin:0 auto; margin-bottom:0px; font-weight:bold;font-family:lucida grande, tahoma, verdana, arial, sans-serif;font-size:20px; color:#1e56a1;">Enter the Code</p>';
			document.getElementById('singlesignon_form2').style.display = 'block';
			document.getElementById('singlesignon_RishiRajNigam1').style.display = 'block';
			document.getElementById('singlesignon_ShowVerificationDiv').style.display = 'block';
			timer1 = setTimeout(function(){SingleSignOnShowTimerDivNew1()},30000);
			/* New Code */

		}	
	}
	httpObj.send(null);
}

function SingleSignOnShowTimerDivNew1(){
	document.getElementById('singlesignon_SecondTimeVerificationCode').style.display = 'block';
}

function SingleSignOnLoadNextStep(){

	if(document.getElementById('singlesignon_isdcodevalue').value=='91'){
		//location.href = "SingleSignOnRegistrationInvite.php";
		window.location.href = "RegistrationInvite.php";
	}else{
		//location.href = "SingleSignOnRegistrationInvite.php";	
		window.location.href = "RegistrationInvite.php";
	}

}
