// JavaScript Document

var j = jQuery.noConflict();



function isEmail( strValue) {

 var objRegExp = /^[a-z]\w*([.\-]\w+)*@[a-z]\w*([.\-]\w+)*\.[a-z]{2,3}$/i;

 return objRegExp.test(strValue);

}



function CheckPhoneNumber(TheNumber) {

 var valid = 1

 var GoodChars = "0123456789()-+.$ "

 var i = 0

 if (TheNumber=="") {

 // Return false if number is empty

 valid = 0

 }

 for (i =0; i <= TheNumber.length -1; i++) {

 if (GoodChars.indexOf(TheNumber.charAt(i)) == -1) {

// Note: Remove the comments from the following line to see this

// for loop in action.

// alert(TheNumber.charAt(i) + " is no good.")

 valid = 0

 } // End if statement

 } // End for loop

 return valid

}



function trim(str, chars) {

	return ltrim(rtrim(str, chars), chars);

}

 

function ltrim(str, chars) {

	chars = chars || "\\s";

	return str.replace(new RegExp("^[" + chars + "]+", "g"), "");

}

 

function rtrim(str, chars) {

	chars = chars || "\\s";

	return str.replace(new RegExp("[" + chars + "]+$", "g"), "");

}



function isValidURL(url){

    var RegExp = /^(([\w]+:)?\/\/)?(([\d\w]|%[a-fA-f\d]{2,2})+(:([\d\w]|%[a-fA-f\d]{2,2})+)?@)?([\d\w][-\d\w]{0,253}[\d\w]\.)+[\w]{2,4}(:[\d]+)?(\/([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)*(\?(&?([-+_~.\d\w]|%[a-fA-f\d]{2,2})=?)*)?(#([-+_~.\d\w]|%[a-fA-f\d]{2,2})*)?$/;

    if(RegExp.test(url)){

        return true;

    }else{

        return false;

    }

}



function checkValidation(){



	var business_name = document.registration.business_name.value;



	var username = document.registration.username.value;

	

	var type = document.registration.type.value;



	var password = document.registration.password.value;



	var street = document.registration.street.value;



	var city = document.registration.city.value;

	

	var main_image = document.registration.main_image.value;



	var state = document.registration.state.value;



	var zip = document.registration.zip.value;



	var street1 = document.registration.street1.value;

	

	var phone = document.registration.phone.value;



	var email = document.registration.email.value;

	

	var business_website = document.registration.url.value;

	

	var main_cat = document.registration.main_cat.value;



	var sub_cat = document.registration.sub_cat_new.value;



	var comment = document.registration.comment.value;



	var product = document.registration.product.value;



	var memo1 = tinyMCE.get('memo1').getContent();



	var review = tinyMCE.get('review').getContent();









	var why2 = "";



	if(business_name == ""){

	

	 why2+="Please enter your business name<br />";

	

	}

	

	if(username == ""){

	

	 why2+="Please enter your username<br />";

	

	}

	if(username !=""){

	

	 var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>? ";



	  for (var i = 0; i < document.registration.username.value.length; i++) {

		if (iChars.indexOf(document.registration.username.value.charAt(i)) != -1) {

		//alert ("Your username has special characters. \nThese are not allowed.\n Please remove them and try again.");

		var checkusername = true;

		}

	  }

	  

		if(checkusername)

		why2+="Please remove special characters or extra space in your username and try again.<br />";	

		else{

		var html= j.ajax({



			 type: "POST",



			url: 'http://www.mspinfo.com/getsubCat.php?checkuser',



			 async: false,		



			data: "Name="+encodeURIComponent(trim(username))



		 }).responseText;

		

		if(html == "1")

		 why2+="Please choose another username, already exist in our database. <br />";		

		}

	}



	if(type == ""){

	

	 why2+="Please enter business type<br />";

	

	}

	

	if(password == ""){

	

	 why2+="Please enter your password<br />";

	

	}	


	if(password !=""){

	

	 var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>? ";



	  for (var i = 0; i < document.registration.password.value.length; i++) {

		if (iChars.indexOf(document.registration.password.value.charAt(i)) != -1) {

		//alert ("Your username has special characters. \nThese are not allowed.\n Please remove them and try again.");

		var checkpassword = true;

		}

	  }

	  

		if(checkpassword)
		{
			why2+="Please remove special characters or extra space in your password and try again.<br />";	
		}


	}


	if(street == ""){

	

	 why2+="Please enter Street name<br />";

	

	}

	

	if(city == ""){

	

	 why2+="Please enter City<br />";

	

	}	





/*	if(main_image == ""){

	

	 why2+="Please Choose your business image<br />";

	

	}
*/
	

	if(state == ""){

	

	 why2+="Please enter your state<br />";

	

	}	





	if(zip == ""){

	

	 why2+="Please enter your zip code<br />";

	

	}

	

/*	if(street1 == ""){

	

	 why2+="Please enter your nearest street<br />";

	

	}	
*/




	if(phone == ""){

	

	 why2+="Please enter your phone number<br />";

	

	}

	

	if(CheckPhoneNumber(phone)==false)

	{

		why2 +="Please enter valid phone number<br />";

	}		

	

	

	if(email == ""){

	

	 why2+="Please enter your email<br />";

	

	}	



	if(email != ""){

		if(isEmail(email)==false){

	

		 why2+="Please enter a valid email address <br />";

	

		}

		else

		{

			



		var html= j.ajax({



			 type: "POST",



			url: 'http://www.mspinfo.com/getEmail.php?checkuser',



			 async: false,		



			data: "Email="+encodeURIComponent(trim(email))



		 }).responseText;

		

		if(html == "1")

		 why2+="Your email id already registered in our database. <br />";		

			

		}

	}





	if(business_website != ""){

	    if(!isValidURL(business_website)){

        why2 += "Please enter a valid website URL<br />";

		} 

	}	

	else

	{

/*		if(memo1 == ""){

		

		 why2+="Please enter your business memo<br />";

		

		}	

	

		if(review == ""){

		

		 why2+="Please enter your business reviews<br />";

		

		}	
*/
	}



	if(main_cat == ""){

	

	 why2+="Please select business main category<br />";

	

	}

	

	if(sub_cat == ""){

	

	 why2+="Please select business sub category<br />";

	

	}	





/*	if(comment == ""){

	

	 why2+="Please enter your business comment<br />";

	

	}

	

	if(product == ""){

	

	 why2+="Please enter your business products<br />";

	

	}	
*/


	var terms = "";


		 terms+='<iframe src="privacy.php" width="100%" height="300" border="0"></iframe><br /><br /><input type="button" name="accept" value="Agree" onClick="document.forms[\'registration\'].submit();">&nbsp;&nbsp;<input type="button" name="notaccept" value="Not Agree" onClick="hideDialog();">';		
	

	if(why2!="")
	{
	showDialog('MSPinfo.com -- Business Registration Form',why2,'warning');
	return false;
	}
	else
	{
	showDialog('MSPinfo.com -- Terms Of Registration',terms,'warning');
	return false;
	}



	



}





function checkValidationIndividual(){



	var firstname = document.registrationIndividual.firstname.value;

	

	var lastname = document.registrationIndividual.lastname.value;



	var username = document.registrationIndividual.username.value;

	

	var password = document.registrationIndividual.password.value;



	var street = document.registrationIndividual.street.value;



	var city = document.registrationIndividual.city.value;

	

	var state = document.registrationIndividual.state.value;



	var zip = document.registrationIndividual.zip.value;



	var phone = document.registrationIndividual.phone.value;



	var email = document.registrationIndividual.email.value;





	var why2 = "";



	if(firstname == ""){

	

	 why2+="Please enter your first name<br />";

	

	}

	

	if(lastname == ""){

	

	 why2+="Please enter your last name<br />";

	

	}

	

	if(username == ""){

	

	 why2+="Please enter your username<br />";

	

	}

	if(username !=""){

	

	 var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>? ";



	  for (var i = 0; i < document.registrationIndividual.username.value.length; i++) {

		if (iChars.indexOf(document.registrationIndividual.username.value.charAt(i)) != -1) {

		//alert ("Your username has special characters. \nThese are not allowed.\n Please remove them and try again.");

		var checkusername = true;

		}

	  }

	  

		if(checkusername)

		why2+="Please remove special characters or extra space in your username and try again.<br />";	

		else{

		var html= j.ajax({



			 type: "POST",



			url: 'http://www.mspinfo.com/getsubCat.php?checkuser',



			 async: false,		



			data: "Name="+encodeURIComponent(trim(username))



		 }).responseText;

		

		if(html == "1")

		 why2+="Please choose another username, already exist in our database. <br />";		

		}

	}





	if(password == ""){

	

	 why2+="Please enter your password<br />";

	

	}	


	if(password !=""){

	

	 var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>? ";



	  for (var i = 0; i < document.registrationIndividual.password.value.length; i++) {

		if (iChars.indexOf(document.registrationIndividual.password.value.charAt(i)) != -1) {

		//alert ("Your username has special characters. \nThese are not allowed.\n Please remove them and try again.");

		var checkpassword = true;

		}

	  }

	  

		if(checkpassword)
		{
			why2+="Please remove special characters or extra space in your password and try again.<br />";	
		}


	}



	if(street == ""){

	

	 why2+="Please enter Street name<br />";

	

	}

	

	if(city == ""){

	

	 why2+="Please enter City<br />";

	

	}	







	if(state == ""){

	

	 why2+="Please enter your state<br />";

	

	}	





	if(zip == ""){

	

	 why2+="Please enter your zip code<br />";

	

	}

	

	if(phone == ""){

	

	 why2+="Please enter your phone number<br />";

	

	}

	

	if(CheckPhoneNumber(phone)==false)

	{

		why2 +="Please enter valid phone number<br />";

	}		

	

	

	if(email == ""){

	

	 why2+="Please enter your email<br />";

	

	}	



	if(email != ""){

		if(isEmail(email)==false){

	

		 why2+="Please enter a valid email address <br />";

	

		}

		else

		{

			



		var html= j.ajax({



			 type: "POST",



			url: 'http://www.mspinfo.com/getEmail.php?checkuser',



			 async: false,		



			data: "Email="+encodeURIComponent(trim(email))



		 }).responseText;

		

		if(html == "1")

		 why2+="Your email id already registered in our database. <br />";		

			

		}		

	}



	var terms = "";


		 terms+='<iframe src="privacy.php" width="100%" height="300" border="0"><p>Your browser does not support iframes.</p></iframe><br /><br /><input type="button" name="accept" value="Agree" onClick="document.forms[\'registrationIndividual\'].submit();">&nbsp;&nbsp;<input type="button" name="notaccept" value="Not Agree" onClick="hideDialog();">';		



	if(why2!="")
	{
	showDialog('MSPinfo.com -- Individual Registration Form',why2,'warning');

	return false;

	}
	else
	{
	showDialog('MSPinfo.com -- Terms Of Registration',terms,'warning');
	return false;
	}

}





function selectBusinessSubCat(mainvalue){

	

			var html= j.ajax({

			 type: "POST",

			url: '/getbusinesssubCat.php?',

			 async: false,		

			data: "mcat="+encodeURIComponent(mainvalue)

		 }).responseText;

		

		var split_str = html.split('@|@|');

		var Txt = split_str[0];

		var firstCount = split_str[1];



		

		document.getElementById("business_subCatId").innerHTML = Txt;

		document.form3.sub_cat_new1.value = firstCount;

		

	}		

	

function selectClassifieldsSubCat(mainvalue){

	

			var html= j.ajax({

			 type: "POST",

			url: '/getbusinesssubCat.php?classifields',

			 async: false,		

			data: "mcat="+encodeURIComponent(mainvalue)

		 }).responseText;

		

		var split_str = html.split('@|@|');

		var Txt = split_str[0];

		var firstCount = split_str[1];



		

		document.getElementById("business_subCatId").innerHTML = Txt;

		document.form3.sub_cat_new.value = firstCount;

		

	}			

function businessSearchSubmit(){



	if(document.form3.city.value == 'Enter a City Name')

		document.form3.city.value = '';	

	

	if(document.form3.street.value == 'Enter a Street Name')

		document.form3.street.value = '';	



	if(document.form3.business_classifieds3.value == 'Enter your search word here')

		document.form3.business_classifieds3.value = '';

	var category = document.getElementById("category").value;
	
	document.getElementById("sub_cat_new1").value = document.getElementById("sub_cat_new").value;	
	
	document.form3.submit();

	return false;

}

function changeValue(Subcatvalue){
	document.form3.sub_cat_new1.value = Subcatvalue;	
}

function showalertYes(){



}



function showalertNo(){

	

	if(document.getElementById("busiessForm").style.display == 'block')

	document.getElementById("busiessForm").style.display = 'none';

	

	if(document.getElementById("IndividualForm").style.display == 'block')

	document.getElementById("IndividualForm").style.display = 'none';

	

	alert("You Should be older than 14 age to register with us");

	return false;

}





function showIndividual(){

	if(document.RegId.older[0].checked != true){

	alert("You Should be older than 14 age to register with us");

	return false;

	}

	else{

	if(document.getElementById("busiessForm").style.display == 'block')

	document.getElementById("busiessForm").style.display = 'none';

	

	document.getElementById("IndividualForm").style.display = 'block';

	

	}

}



function showBusiness(){



	if(document.RegId.older[0].checked != true){

	alert("You Should be older than 14 age to register with us");

	return false;

	}

	else{

	if(document.getElementById("IndividualForm").style.display == 'block')

	document.getElementById("IndividualForm").style.display = 'none';

	

	document.getElementById("busiessForm").style.display = 'block';

	

	}

}



function checkValidationSchool(){



	var firstname = document.School_registration.firstname.value;

	

	var lastname = document.School_registration.lastname.value;



	var username = document.School_registration.username.value;

	

	var password = document.School_registration.password.value;

	

	var repassword = document.School_registration.password2.value;



	var school_name = document.School_registration.school_name.value;



	var phone = document.School_registration.phone.value;



	var email = document.School_registration.email.value;



	var fax = document.School_registration.fax.value;





	var info = tinyMCE.get('info').getContent();



	var mission = tinyMCE.get('mission').getContent();



	var p_message = tinyMCE.get('p_message').getContent();



	var c_message = tinyMCE.get('c_message').getContent();





	var why2 = "";



	if(firstname == ""){

	

	 why2+="Please enter your first name<br />";

	

	}

	

	if(lastname == ""){

	

	 why2+="Please enter your last name<br />";

	

	}

	

	if(username == ""){

	

	 why2+="Please enter your username<br />";

	

	}

	if(username !=""){

	

	 var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>? ";



	  for (var i = 0; i < document.School_registration.username.value.length; i++) {

		if (iChars.indexOf(document.School_registration.username.value.charAt(i)) != -1) {

		//alert ("Your username has special characters. \nThese are not allowed.\n Please remove them and try again.");

		var checkusername = true;

		}

	  }

	  

		if(checkusername)

		why2+="Please remove special characters or extra space in your username and try again.<br />";	

		else{

		var html= j.ajax({



			 type: "POST",



			url: 'http://www.mspinfo.com/getschoolEmail.php?checkuser',



			 async: false,		



			data: "Name="+encodeURIComponent(trim(username))



		 }).responseText;

		

		if(html == "1")

		 why2+="Please choose another username, already exist in our database. <br />";		

		}

	}





	if(password == ""){

	

	 why2+="Please enter your password<br />";

	

	}	

	if(password !=""){

	 var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>? ";


	  for (var i = 0; i < document.School_registration.password.value.length; i++) {

		if (iChars.indexOf(document.School_registration.password.value.charAt(i)) != -1) {

		//alert ("Your username has special characters. \nThese are not allowed.\n Please remove them and try again.");

		var checkpassword = true;

		}

	  }

	  

		if(checkpassword)
		{
			
		why2+="Please remove special characters or extra space in your password and try again.<br />";	
		
		}



	}


	if(repassword == ""){

	

	 why2+="Please Re enter your password<br />";

	

	}	


	if(repassword !=""){

	 var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>? ";


	  for (var i = 0; i < document.School_registration.password2.value.length; i++) {

		if (iChars.indexOf(document.School_registration.password2.value.charAt(i)) != -1) {

		//alert ("Your username has special characters. \nThese are not allowed.\n Please remove them and try again.");

		var checkpassword2 = true;

		}

	  }

	  

		if(checkpassword2)
		{
			
		why2+="Please remove special characters or extra space in your re password and try again.<br />";	
		
		}



	}


	if(password != repassword){

	

	 why2+="Re enter Password should be same as Password<br />";

	

	}	





	if(school_name == ""){

	

	 why2+="Please enter School Name<br />";

	

	}

	

	if(phone == ""){

	

	 why2+="Please enter your phone number<br />";

	

	}

	

	if(CheckPhoneNumber(phone)==false)

	{

		why2 +="Please enter valid phone number<br />";

	}		

	

	

	if(email == ""){

	

	 why2+="Please enter your email<br />";

	

	}	



	if(email != ""){

		if(isEmail(email)==false){

	

		 why2+="Please enter a valid email address <br />";

	

		}

		else

		{

			



		var html= j.ajax({



			 type: "POST",



			url: 'http://www.mspinfo.com/getschoolEmail.php?',



			 async: false,		



			data: "Email="+encodeURIComponent(trim(email))



		 }).responseText;

		

		if(html == "1")

		 why2+="Your email id already registered in our database. <br />";		

			

		}		

	}





	if(info == ""){

	

	 why2+="Please enter School Information<br />";

	

	}



	if(mission == ""){

	

	 why2+="Please enter School Mission Statement<br />";

	

	}





	if(p_message == ""){

	

	 why2+="Please enter School Principal Message<br />";

	

	}





	if(c_message == ""){

	

	 why2+="Please enter School Council Message<br />";

	

	}









	if(why2!="")



	{



	showDialog('MSPinfo.com -- School Registration Form',why2,'warning');



	return false;



	}



	



}



function checkValidationSchoolrequest(){



	var firstname = document.School_registration.firstname.value;

	

	var lastname = document.School_registration.lastname.value;



	var username = document.School_registration.username.value;

	

	var password = document.School_registration.password.value;

	

	var repassword = document.School_registration.password2.value;



	var school_name = document.School_registration.school_name.value;



	var phone = document.School_registration.phone.value;



	var email = document.School_registration.email.value;



	var fax = document.School_registration.fax.value;





	var why2 = "";



	if(firstname == ""){

	

	 why2+="Please enter your first name<br />";

	

	}

	

	if(lastname == ""){

	

	 why2+="Please enter your last name<br />";

	

	}

	

	if(username == ""){

	

	 why2+="Please enter your username<br />";

	

	}

	if(username !=""){

	

	 var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>? ";



	  for (var i = 0; i < document.School_registration.username.value.length; i++) {

		if (iChars.indexOf(document.School_registration.username.value.charAt(i)) != -1) {

		//alert ("Your username has special characters. \nThese are not allowed.\n Please remove them and try again.");

		var checkusername = true;

		}

	  }

	  

		if(checkusername)

		why2+="Please remove special characters or extra space in your username and try again.<br />";	

		else{

		var html= j.ajax({



			 type: "POST",



			url: 'http://www.mspinfo.com/getschoolEmail.php?checkuser',



			 async: false,		



			data: "Name="+encodeURIComponent(trim(username))



		 }).responseText;

		

		if(html == "1")

		 why2+="Please choose another username, already exist in our database. <br />";		

		}

	}





	if(password == ""){

	

	 why2+="Please enter your password<br />";

	

	}	

	if(password !=""){

	

	 var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>? ";



	  for (var i = 0; i < document.School_registration.password.value.length; i++) {

		if (iChars.indexOf(document.School_registration.password.value.charAt(i)) != -1) {

		//alert ("Your username has special characters. \nThese are not allowed.\n Please remove them and try again.");

		var checkpassword = true;

		}

	  }

	  

		if(checkpassword)
		{
		why2+="Please remove special characters or extra space in your password and try again.<br />";	
		}


	}



	if(repassword == ""){

	

	 why2+="Please Re enter your password<br />";

	

	}	

	

	if(password != repassword){

	

	 why2+="Re enter Password should be same as Password<br />";

	

	}	





	if(school_name == ""){

	

	 why2+="Please enter School Name<br />";

	

	}

	

	if(phone == ""){

	

	 why2+="Please enter your phone number<br />";

	

	}

	

	if(CheckPhoneNumber(phone)==false)

	{

		why2 +="Please enter valid phone number<br />";

	}		

	

	

	if(email == ""){

	

	 why2+="Please enter your email<br />";

	

	}	



	if(email != ""){

		if(isEmail(email)==false){

	

		 why2+="Please enter a valid email address <br />";

	

		}

		else

		{

			



		var html= j.ajax({



			 type: "POST",



			url: 'http://www.mspinfo.com/getschoolEmail.php?',



			 async: false,		



			data: "Email="+encodeURIComponent(trim(email))



		 }).responseText;

		

		if(html == "1")

		 why2+="Your email id already registered in our database. <br />";		

			

		}		

	}





	if(why2!="")



	{



	showDialog('MSPinfo.com -- School login Request Form',why2,'warning');



	return false;



	}



	



}



function checkValidationCalendar(check){





	var title = document.calenderForm.title.value;

	

	var event_desc = tinyMCE.get('event_desc').getContent();



	var event_memo = tinyMCE.get('event_memo').getContent();



	var event_address = tinyMCE.get('event_address').getContent();



	var event_website = document.calenderForm.event_website.value;

	

	var event_start_date = document.calenderForm.event_start_date.value;



	var event_end_date = document.calenderForm.event_end_date.value;

	

	var event_time = document.calenderForm.event_time.value;



	var event_contact_number = document.calenderForm.event_contact_number.value;



	var event_email = document.calenderForm.event_email.value;

	

	var event_mapquest_url = document.calenderForm.event_mapquest_url.value;

	

	var image1 = document.calenderForm.image1.value;





	var why2 = "";



	if(title == ""){

	

	 why2+="Please enter event title<br />";

	

	}

	

	if(event_start_date == ""){

	

	 why2+="Please choose event start date<br />";

	

	}	





	if(event_end_date == ""){

	

	 why2+="Please choose event end date<br />";

	

	}

	

	if(event_time == ""){

	

	 why2+="Please enter event time<br />";

	

	}	



	if(event_desc == ""){

	

	 why2+="Please enter event description<br />";

	

	}

	

	if(event_website != ""){

	    if(!isValidURL(event_website)){

        why2 += "Please enter a valid URL<br />";

		} 

	}	

	else

	{

	if(event_memo == ""){

	

	 why2+="Please enter event memo<br />";

	

	}

	

	if(event_address == ""){

	

	 why2+="Please enter event address<br />";

	

	}



	if(event_contact_number == ""){

	

	 why2+="Please enter event contact number<br />";

	

	}

	

	if(CheckPhoneNumber(event_contact_number)==false)

	{

		why2 +="Please enter valid contact number<br />";

	}		

	

	

	if(event_email == ""){

	

	 why2+="Please enter event contact email<br />";

	

	}	



	if(event_email != ""){

		if(isEmail(event_email)==false){

	

		 why2+="Please enter a valid email address <br />";

	

		}

	}





	if(event_mapquest_url == ""){

	

	 why2+="Please enter mapquest url<br />";

	

	}	



	if(image1 == ""){

	

	 why2+="Please choose image<br />";

	

	}	



}

	if(why2!="")



	{



	showDialog('MSPinfo.com -- Calendar Form',why2,'warning');



	return false;



	}



}







function checkValidationclassifieds(check,checkstore){

	

	var name = document.vstoreform.name.value;

	

	var colors = document.vstoreform.colors.value;



	var price = document.vstoreform.price.value;

	

	var qty = document.vstoreform.qty.value;



	if(checkstore == "confirm"){

	var store_clas_cat_main = document.vstoreform.store_clas_cat_main.value;



	var store_clas_cat_sub = document.vstoreform.store_clas_cat_sub.value;

	}



	var clas_cat = document.vstoreform.clas_cat.value;



	var clas_sub = document.vstoreform.clas_sub.value;

	

	var image1 = document.vstoreform.image1.value;	

	

	var keyword = document.vstoreform.keyword.value;

	

	var des = tinyMCE.get('des').getContent();	

	

	var product_detail_title_1 = document.vstoreform.product_detail_title_1.value;	

	

	var product_detail_des_1 = tinyMCE.get('product_detail_des_1').getContent();

	



	var why2 = "";



	if(name == ""){

	

	 why2+="Please enter product name<br />";

	

	}

	

	if(colors == ""){

	

	 why2+="Please enter product colors<br />";

	

	}

	

	if(price == ""){

	

	 why2+="Please enter product price<br />";

	

	}

	

	if(qty == ""){

	

	 why2+="Please enter product quantity<br />";

	

	}	





	if(clas_cat == ""){

	

	 why2+="Please choose classified category<br />";

	

	}

	

	if(clas_sub == ""){

	

	 why2+="Please choose classified sub category<br />";

	

	}	

	

	if(checkstore == "confirm"){



	if(store_clas_cat_main == ""){

	

	 why2+="Please create Store category and choose the correct category<br />";

	

	}

	

	if(store_clas_cat_sub == ""){

	

	 why2+="Please create Store sub category and choose the correct category<br />";

	

	}

	

	}





if(check == 'new')

{

	if(image1 == ""){

	

	 why2+="Please choose image<br />";

	

	}	



}



	if(keyword == ""){

	

	 why2+="Please enter product keyword<br />";

	

	}

	

	

	if(des == ""){

	

	 why2+="Please enter product detail description<br />";

	

	}	

	

	if(product_detail_title_1 == ""){

	

	 why2+="Please enter product detail page title 1<br />";

	

	}	





	if(product_detail_des_1 == ""){

	

	 why2+="Please enter product detail description 1(detail page)<br />";

	

	}	

	

	if(why2!="")



	{



	showDialog('MSPinfo.com -- Classified Form',why2,'warning');



	return false;



	}



}



function loginfail(storeId){

	alert("you should login to add this product to your wishlist");

window.location.href= 'http://www.mspinfo.com/login.php?redirect=store&storeId='+storeId;	

}



function loginsuccess(userId,storeId,productId){

	

	var why2 = "";

	

		var html= j.ajax({



			 type: "POST",



			url: 'http://www.mspinfo.com/addwishlist.php?',



			 async: false,		



			data: "userId="+encodeURIComponent(trim(userId))+"&storeId="+encodeURIComponent(trim(storeId))+"&productId="+encodeURIComponent(trim(productId))



		 }).responseText;

		

		if(html == "1"){

		 alert("Product added successfully to your wishlist");		

		 document.getElementById(productId).innerHTML = "<font color='green'>Added to your Wishlist</font>";

		}

	

		if(html == "2")

		 alert("Oops. problem when adding this product to your wishlist. Please refresh this page and try again");		



		if(html == "3"){			

		 alert("you should login to add this product to your wishlist");		

			window.location.href= 'http://www.mspinfo.com/login.php?redirect=store&storeId='+storeId;			 

		}

		if(html == "4")

		 alert("Oops. problem when adding this product to your wishlist. Please refresh this page and try again");		

		 

		if(html == "5")

		 alert("This Product already in your wishlist");		



	return false;



	

}



function loginfail1(storeId){

	alert("you should login to add this store to your favorite");

window.location.href= 'http://www.mspinfo.com/login.php?redirect=favorite&storeId='+storeId;	

}



function loginsuccess1(userId,storeId){

	

	var why2 = "";

	

		var html= j.ajax({



			 type: "POST",



			url: 'http://www.mspinfo.com/addfavorite.php?',



			 async: false,		



			data: "userId="+encodeURIComponent(trim(userId))+"&storeId="+encodeURIComponent(trim(storeId))



		 }).responseText;

		

		if(html == "1"){

		 alert("Store added to you favorite successfully");		

		 document.getElementById("favid").innerHTML = "<font color='green'>Added to your favorite</font>";

		}

	

		if(html == "2")

		 alert("Oops. problem when adding this store to your favorite. Please refresh this page and try again");		



		if(html == "3"){			

		 alert("you should login to add this store to your favorite");		

			window.location.href= 'http://www.mspinfo.com/login.php?redirect=addfavorite&storeId='+storeId;			 

		}

		if(html == "4")

		 alert("Oops. problem when adding this store to your favorite. Please refresh this page and try again");		

		 

		if(html == "5")

		 alert("This Store already in your favorite");		



	return false;



	

}



function addfriends(userId,friendId){



	var why2 = "";

	

		var html= j.ajax({



			 type: "POST",



			url: 'http://www.mspinfo.com/addfriends.php?',



			 async: false,		



			data: "userId="+encodeURIComponent(trim(userId))+"&friendId="+encodeURIComponent(trim(friendId))



		 }).responseText;

		

		if(html == "1"){

		 alert("Friend request sent successfully");		

		 document.getElementById(friendId).innerHTML = "<font color='green'>Friend Request Sent</font>";

		}

	

		if(html == "2")

		 alert("Oops. problem when adding this friend to your friends List. Please refresh this page and try again");		



		if(html == "3"){			

		 alert("you should login to add friends to your friends list");		

			window.location.href= 'http://www.mspinfo.com/login.php';			 

		}

		if(html == "4")

		 alert("Oops. problem when adding this friend to your friends List. Please refresh this page and try again");		

		 

		if(html == "5")

		 alert("This user already Added to your FriendsList");		



	return false;



}



function removefriends(userId,friendId,requestnum){



	var why2 = "";

	

		var html= j.ajax({



			 type: "POST",



			url: 'http://www.mspinfo.com/addfriends.php?remove',



			 async: false,		



			data: "userId="+encodeURIComponent(trim(userId))+"&friendId="+encodeURIComponent(trim(friendId))+"&requestnum="+encodeURIComponent(trim(requestnum))



		 }).responseText;

		

		if(html == "1"){

		 alert("Friend removed successfully");		

		 document.getElementById(friendId).innerHTML = "<font color='green'>Removed From Friends List</font>";

		}

	

		if(html == "2")

		 alert("Oops. problem when removing this friend from your friends List.");		



		if(html == "3"){			

		 alert("you should login to remove friends from your friends list");		

			window.location.href= 'http://www.mspinfo.com/login.php';			 

		}

		if(html == "4")

		 alert("Oops. problem when removing this friend from your friends List. Please refresh this page and try again");		



	return false;



}



function checkValidationBusinessrequest(){



	var firstname = document.Business_registration.firstname.value;

	

	var lastname = document.Business_registration.lastname.value;



	var username = document.Business_registration.username.value;

	

	var password = document.Business_registration.password.value;

	

	var repassword = document.Business_registration.password2.value;



	var business_name = document.Business_registration.business_name.value;



	var phone = document.Business_registration.phone.value;



	var email = document.Business_registration.email.value;



	var fax = document.Business_registration.fax.value;





	var why2 = "";



	if(firstname == ""){

	

	 why2+="Please enter your first name<br />";

	

	}

	

	if(lastname == ""){

	

	 why2+="Please enter your last name<br />";

	

	}

	

	if(username == ""){

	

	 why2+="Please enter your username<br />";

	

	}

	if(username !=""){

	

	 var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>? ";



	  for (var i = 0; i < document.Business_registration.username.value.length; i++) {

		if (iChars.indexOf(document.Business_registration.username.value.charAt(i)) != -1) {

		//alert ("Your username has special characters. \nThese are not allowed.\n Please remove them and try again.");

		var checkusername = true;

		}

	  }

	  

		if(checkusername)

		why2+="Please remove special characters or extra space in your username and try again.<br />";	

		else{

		var html= j.ajax({



			 type: "POST",



			url: 'http://www.mspinfo.com/getsubCat.php?checkuser',



			 async: false,		



			data: "Name="+encodeURIComponent(trim(username))



		 }).responseText;

		

		if(html == "1")

		 why2+="Please choose another username, already exist in our database. <br />";		

		}

	}





	if(password == ""){

	

	 why2+="Please enter your password<br />";

	

	}	
	

	if(password !=""){

	

	 var iChars = "!@#$%^&*()+=-[]\\\';,./{}|\":<>? ";



	  for (var i = 0; i < document.Business_registration.password.value.length; i++) {

		if (iChars.indexOf(document.Business_registration.password.value.charAt(i)) != -1) {

		//alert ("Your username has special characters. \nThese are not allowed.\n Please remove them and try again.");

		var checkpassword = true;

		}

	  }

	  

		if(checkpassword)
		{
			why2+="Please remove special characters or extra space in your password and try again.<br />";	
		}

	}



	if(repassword == ""){

	

	 why2+="Please Re enter your password<br />";

	

	}	

	

	if(password != repassword){

	

	 why2+="Re enter Password should be same as Password<br />";

	

	}	

	

	if(business_name == ""){

	

	 why2+="Please enter Business Name<br />";

	

	}

	

	if(phone == ""){

	

	 why2+="Please enter your phone number<br />";

	

	}

	

	if(CheckPhoneNumber(phone)==false)

	{

		why2 +="Please enter valid phone number<br />";

	}		

	

	

	if(email == ""){

	

	 why2+="Please enter your email<br />";

	

	}	



	if(email != ""){

		if(isEmail(email)==false){

	

		 why2+="Please enter a valid email address <br />";

	

		}

		else

		{

			



		var html= j.ajax({



			 type: "POST",



			url: 'http://www.mspinfo.com/getEmail.php?checkuser',



			 async: false,		



			data: "Email="+encodeURIComponent(trim(email))



		 }).responseText;

		

		if(html == "1")

		 why2+="Your email id already registered in our database. <br />";		

			

		}		

	}













	if(why2!="")



	{



	showDialog('MSPinfo.com -- Business Registration Form',why2,'warning');



	return false;



	}



}



function checkExt(){

var filename = document.video_form.video.value;

var filelength = parseInt(filename.length) - 3;

var fileext = filename.substring(filelength,filelength + 3);

var imagefilename = document.video_form.image.value;

var title = document.video_form.title.value;

var youtubeVideo = document.video_form.youtubeVideo.value;


if(title == '')

{

	alert ("Please enter the title for this video");	

	return false;

}

	else if(imagefilename == '')

	{

		alert ("Please upload a thumb image for this video file");	

		return false;

	}
	if(youtubeVideo == '')
	{
		if(filename == '')
		{
	
			alert ("Please upload video file");	
	
			return false;
	
		}else{
	
		// Check file extenstion
	
		if (fileext.toLowerCase() != "mp4" && fileext.toLowerCase() != "mov" && fileext.toLowerCase() != "f4v" && fileext.toLowerCase() != "flv" && fileext.toLowerCase() != "3gp" && fileext.toLowerCase() != "3g2" && fileext.toLowerCase() != "aac" && fileext.toLowerCase() != "m4a" && fileext.toLowerCase() != "mp3"){
	
		alert ("You can only upload only mp4 (or) mov (or) f4v (or) flv (or) 3gp (or) 3g2 (or) aac (or) m4a (or) mp3 .");
	
		document.video_form.video.focus();
	
			return false;
	
		}else{
	
			return true;
	
		}
	
		}

}
else
{
	var _videoUrl = youtubeVideo;
	
		var matches = _videoUrl.match(/embed src=/);
		
		var matches1 = _videoUrl.match(/<iframe/);
		
		
		if (matches || matches1)
		{
			return true;
		}
		else
		{
			alert("Please enter valid youtube url");
			return false;
		}
				
}

}


function editcheckExt(){

var filename = document.video_form.video.value;

var filelength = parseInt(filename.length) - 3;

var fileext = filename.substring(filelength,filelength + 3);

var imagefilename = document.video_form.image.value;

var title = document.video_form.title.value;

var youtubeVideo = document.video_form.youtubeVideo.value;


if(title == '')

{

	alert ("Please enter the title for this video");	

	return false;

}

else if(filename != '')

{

	// Check file extenstion

	if (fileext.toLowerCase() != "mp4" && fileext.toLowerCase() != "mov" && fileext.toLowerCase() != "f4v" && fileext.toLowerCase() != "flv" && fileext.toLowerCase() != "3gp" && fileext.toLowerCase() != "3g2" && fileext.toLowerCase() != "aac" && fileext.toLowerCase() != "m4a" && fileext.toLowerCase() != "mp3"){

	alert ("You can only upload only mp4 (or) mov (or) f4v (or) flv (or) 3gp (or) 3g2 (or) aac (or) m4a (or) mp3 .");

	document.video_form.video.focus();

		return false;

	}else{

		return true;

	}

	}
else if(youtubeVideo != '')
{
	var _videoUrl = youtubeVideo;
	
		var matches = _videoUrl.match(/embed src=/);
		
		var matches1 = _videoUrl.match(/<iframe/);
		
		
		if (matches || matches1)
		{
			return true;
		}
		else
		{
			alert("Please enter valid youtube url");
			return false;
		}
					
}

}



function openwindow(url,widthNew,heightNew)

{

	window.open(url,"mywindow",'menubar=1,resizable=1,scrollbars=1,width='+widthNew+',height='+heightNew+'');

}



function showPreview(currentImage)

{ 

	document.getElementById('gallery-midd').innerHTML = 'loading...';		

	

var html= j.ajax({

			 type: "POST",

			url: '/getAjax.php?gallery&',

			 async: false,		

			data: "imageid="+encodeURIComponent(currentImage)

		 }).responseText;

		var myimageArray=html.split("|||");



	

		document.getElementById('gallery-left').innerHTML = '<br />' + myimageArray[0];

		document.getElementById('gallery-midd').innerHTML = myimageArray[1];		

		

		return false;

}

function showsubjectPreview(currentImage)

{ 

	document.getElementById('gallery-midd').innerHTML = 'loading...';		

	

var html= j.ajax({

			 type: "POST",

			url: '/getAjax.php?subjectgallery&',

			 async: false,		

			data: "imageid="+encodeURIComponent(currentImage)

		 }).responseText;

		var myimageArray=html.split("|||");



	

		document.getElementById('gallery-left').innerHTML = '<br />' + myimageArray[0];

		document.getElementById('gallery-midd').innerHTML = myimageArray[1];		

		

		return false;

}

function showPreviewvideo(currentImage)

{ 

	document.getElementById('gallery-left').innerHTML = 'loading...';		

	

var html= j.ajax({

			 type: "POST",

			url: '/getAjax.php?videos&',

			 async: false,		

			data: "imageid="+encodeURIComponent(currentImage)

		 }).responseText;




	

		document.getElementById('gallery-left').innerHTML = html;

		//document.getElementById('gallery-midd').innerHTML = myimageArray[1];		

		

		return false;

}


function showsubjectPreviewvideo(currentImage)

{ 

	document.getElementById('gallery-left').innerHTML = 'loading...';		

	

var html= j.ajax({

			 type: "POST",

			url: '/getAjax.php?subjectvideos&',

			 async: false,		

			data: "imageid="+encodeURIComponent(currentImage)

		 }).responseText;




	

		document.getElementById('gallery-left').innerHTML = html;

		//document.getElementById('gallery-midd').innerHTML = myimageArray[1];		

		

		return false;

}




function getValid(){



	var userId = document.idSearchForm.userId.value;

	

	var why2 = "";



	if(userId == ""){

	

	 why2+="Please enter your friend ID<br />";

	

	}

	else{

		if(CheckPhoneNumber(userId)==false)

		{

			why2 +="Please enter valid number<br />";

		}else{

			if(userId !=""){

	  

					var html= j.ajax({

		

					 type: "POST",

		

					url: 'http://www.mspinfo.com/getAjax.php?',

		

					 async: false,		

		

					data: "userId="+encodeURIComponent(trim(userId))

		

				 }).responseText;

			

				if(html == "1"){

					window.location.href = 'http://'+document.domain+'/'+'personal.php?userId='+userId;

				}

				else{

				showDialog('MSPinfo.com -- Search Form','User ID Not exist','warning');

				return false;					

				}

	}	

		}

	}

	if(why2!="")

	{

	showDialog('MSPinfo.com -- Search Form',why2,'warning');

	return false;

	}

}





function getValidbusiness(){



	var business_name = document.businessSearchForm.business_classifieds2.value;

	

	var why2 = "";



	if(business_name == ""){

	

	 why2+="Please enter Business Name <br />";

	

	}



	if(why2!="")

	{

	showDialog('MSPinfo.com -- Search Form',why2,'warning');

	return false;

	}

	

	document.businessSearchForm.submit();

}



function getValidation(){



	var full_name = document.registerForm.full_name.value;

	

	var why2 = "";



	if(full_name == ""){

	

	 why2+="Please enter your Full Name<br />";

	

	}



	if(why2!="")

	{

	showDialog('MSPinfo.com -- Notebook Form',why2,'warning');

	return false;

	}

}

function onChangepageType(pageId, pageType, thisvalue){

			var html= j.ajax({

			 type: "POST",

			url: '/changePageStatus.php?',

			 async: false,		

			data: "pageId="+encodeURIComponent(pageId)+"&pageType="+encodeURIComponent(pageType)+"&changevalue="+encodeURIComponent(thisvalue)

		 }).responseText;

		
		if(html == 'success')
		{
			if(thisvalue == 0)
				alert("Page Changed as Private");
	
			if(thisvalue == 1)
				alert("Page Changed as Public");
				
			if(thisvalue == 2)
				alert("Page Changed as Family");
	
			if(thisvalue == 3)
				alert("Page Changed as Friend");			
		}
		else
		{
				alert("OOPS !!.. There is some problem when updating your page...");						
		}
		
		return false;

	}			
	
function onChangeSubjectpageType(pageId, pageType, thisvalue){

			var html= j.ajax({

			 type: "POST",

			url: '/changePageStatus.php?subject',

			 async: false,		

			data: "pageId="+encodeURIComponent(pageId)+"&pageType="+encodeURIComponent(pageType)+"&changevalue="+encodeURIComponent(thisvalue)

		 }).responseText;

		
		if(html == 'success')
		{
			if(thisvalue == 0)
				alert("Page Changed as Private");
	
			if(thisvalue == 1)
				alert("Page Changed as Public");
				
			if(thisvalue == 2)
				alert("Page Changed as Family");
	
			if(thisvalue == 3)
				alert("Page Changed as Friend");			
		}
		else
		{
				alert("OOPS !!.. There is some problem when updating your page...");						
		}
		
		return false;

	}			
	


function onChangeSubmit(userId,uniqueNumber,valid){

	var groupType = document.getElementById("Group_page_"+userId).value;
	


	var message = "";

	if(groupType == "" || groupType == "0"){

	 message+="Please select the group<br />";

	}
	
	if(message!="")

	{

	showDialog('MSPinfo.com -- Group',message,'warning');

	return false;

	}

	if(valid == "2")
	window.location.href= 'view-friends.php?approve&userId='+userId+'&friendGroup='+groupType+'&requestnum='+uniqueNumber;		
	else
	window.location.href= 'view-friends-request.php?approve&userId='+userId+'&friendGroup='+groupType+'&requestnum='+uniqueNumber;			
	
	}			
	
	
	
function checking(){

	var category = document.getElementById("category").value;
	
	var sub_cat = document.getElementById("sub_cat").value;	
	
	alert(category);
	alert(sub_cat);	
	
}				

function jqCheckAll() {
    j("input:checkbox").attr('checked','checked');
}

function jqunCheckAll() {
    j("input:checkbox").attr('checked','');
}

 function getSelected() {
            var selected = new Array();
            var index = 0;
			//alert(document.getElementById('mailIds').value);
			opt = document.getElementsByName('mailIds');
            for (var intLoop = 0; intLoop < opt.length; intLoop++) {
               if ((opt[intLoop].selected) ||
                   (opt[intLoop].checked)) {
                  index = selected.length;
                  selected[index] = new Object;
                  selected[index].value = opt[intLoop].value;
                  selected[index].index = intLoop;
               }
            }
            return selected;
 	}
	
function readSelected(page) {
            var sel = getSelected();
            var strSel = "";
            for (var item in sel)       
               strSel += sel[item].value + "|||";
			   
	
		var html= j.ajax({

			 type: "POST",

			url: '/ajaxRequests.php?markasread',

			 async: false,		

			data: "Selected="+encodeURIComponent(strSel)

		 }).responseText;

		if(html == 'success')
		{
				alert("Changed as Read");			
				window.location.href= 'view-all-mails.php?page='+page;		
				
		}
		else
		{
				alert("OOPS !!.. There is some problem when updating your email...");						
		}
		
		return false;
		
         }	

function CalAdvertisement(gameId, Clickpixel)
{


	var why2 = "";

	var iframecontent = "";


/*	iframecontent+='<iframe src="show-ads.php?gameId='+gameId+'&Clickpixel='+Clickpixel+'" width="96%" height="430" border="0"><p>Your browser does not support iframes.</p></iframe><br /><br />';		
*/
		var html= j.ajax({

			 type: "POST",

			url: '/show-ads.php?',

			 async: false,		

			data: "gameId="+encodeURIComponent(trim(gameId))+"&Clickpixel="+encodeURIComponent(trim(Clickpixel))

		 }).responseText;

cinterval = setInterval('time_dec()', 1000);

	showDialog('MSPinfo.com -- Games Result',html,'warning');
	return false;

	
}
// This is to display 15 second count down to tell about the prize status

var time_left = 15;
var cinterval;

function time_dec(){

if(time_left <= 0)
time_left = 15;

  time_left--;
  document.getElementById('countdown').innerHTML = time_left;
  if(time_left == 0){
  document.getElementById('1').style.display = 'none';
  document.getElementById('2').style.display = 'block';
    clearInterval(cinterval);
  }
}

function claimPrize(insertId)
{


	var why2 = "";

	var iframecontent = "";


/*	iframecontent+='<iframe src="show-ads.php?gameId='+gameId+'&Clickpixel='+Clickpixel+'" width="96%" height="430" border="0"><p>Your browser does not support iframes.</p></iframe><br /><br />';		
*/
		var html= j.ajax({

			 type: "POST",

			url: '/ajaxRequests.php?claimPrize',

			 async: false,		

			data: "insertId="+encodeURIComponent(insertId)

		 }).responseText;


	showDialog('MSPinfo.com -- Games Result',html,'warning');
	return false;

	
}

function submitclaimPrize(insertId)
{

	var ClaimId = document.getElementById("ClaimId").value;

	var firstname = document.getElementById("firstname").value;

	var phone = document.getElementById("phone").value;

	var email = document.getElementById("email").value;

	var address = document.getElementById("address").value;	
	
	var validationMsg = "";

	if(firstname == ""){

	 validationMsg+="Please enter your Full Name<br />";

	}

	if(phone == ""){

	 validationMsg+="Please enter your Phone Number<br />";

	}

	if(email == ""){

	 validationMsg+="Please enter your Email<br />";

	}

	if(email != ""){

		if(isEmail(email)==false){

		 validationMsg+="Please enter a valid email address <br />";

		}
	}
	
	if(address == ""){

	 validationMsg+="Please enter your Address<br />";

	}

if(validationMsg =="")
{
		var ajaxReturn= j.ajax({

			 type: "POST",

			url: '/ajaxRequests.php?claimPrizeupdate',

			 async: false,		

			data: "ClaimId="+encodeURIComponent(trim(ClaimId))+"&firstname="+encodeURIComponent(trim(firstname))+"&phone="+encodeURIComponent(trim(phone))+"&email="+encodeURIComponent(trim(email))+"&address="+encodeURIComponent(trim(address))

		 }).responseText;
		
		if(ajaxReturn == "success")
		{
			validationMsg += "Thanks for your information, you will get a call from the site admin.. <br /> <br /> <br /> <br /><a href='http://www.mspinfo.com'>Return to Home Page</a>";
		}
		else
		{
			validationMsg += "There is a problem when updating your information, you will get a call from the site admin.. <br /> <br /> <br /> <br /> <a href='http://www.mspinfo.com'>Return to Home Page</a>";			
		}

}
else
{
validationMsg += '<br /><br /><a style="color:#FFFFFF;" class="button blue" href="javascript:claimPrize('+ClaimId+');">Try Again</a>';
}

	showDialog('MSPinfo.com -- Claiming Information',validationMsg,'warning');
	return false;

	
}

function submitclaimRewards(userId)
{

	var unclaimed = document.getElementById("unclaimed").value;

	var claimPoints = document.getElementById("claimPoints").value;

	var fullname = document.getElementById("fullname").value;

	var contactNumber = document.getElementById("contactNumber").value;

	var email = document.getElementById("email").value;

	var address = document.getElementById("address").value;	
	
	var validationMsg = "";

	if(claimPoints == ""){

	 validationMsg+="Please enter your Claim Points<br />";

	}
	
	if(unclaimed < claimPoints ){

	 validationMsg+="you dont have "+claimPoints+" sufficient point to withdraw<br />";

	}
	

	if(fullname == ""){

	 validationMsg+="Please enter your Full Name<br />";

	}

	if(contactNumber == ""){

	 validationMsg+="Please enter your Phone Number<br />";

	}

	if(email == ""){

	 validationMsg+="Please enter your Email<br />";

	}

	if(email != ""){

		if(isEmail(email)==false){

		 validationMsg+="Please enter a valid email address <br />";

		}
	}
	
	if(address == ""){

	 validationMsg+="Please enter your Address<br />";

	}

if(validationMsg =="")
{
		var ajaxReturn= j.ajax({

			 type: "POST",

			url: '/ajaxRequests.php?claimRedeemupdate',

			 async: false,		

			data: "unclaimed="+encodeURIComponent(trim(unclaimed))+"&fullname="+encodeURIComponent(trim(fullname))+"&contactNumber="+encodeURIComponent(trim(contactNumber))+"&email="+encodeURIComponent(trim(email))+"&address="+encodeURIComponent(trim(address))+"&claimPoints="+encodeURIComponent(trim(claimPoints))

		 }).responseText;

		if(ajaxReturn == "success")
		{
			validationMsg += "Thanks for your information, you will get a call from the site admin..";
			window.location.href = 'http://'+document.domain+'/'+'rewards.php?userId='+userId;

		}
		else if(ajaxReturn == "fail")
		{
			validationMsg += "There is a problem when updating your information, you will get a call from the site admin.. <br /> <br /> <br /> <br /> <a href='http://www.mspinfo.com'>Return to Home Page</a>";
		}		
		else
		{
			validationMsg += ajaxReturn;			
		}

}

	showDialog('MSPinfo.com -- Claiming Information',validationMsg,'warning');
	return false;

	
}

function onChangebusiness(thisvalue){

			var html= j.ajax({

			 type: "POST",

			url: 'ajaxRequests.php?changeBusiness',

			 async: false,		

			data: "changevalue="+encodeURIComponent(thisvalue)

		 }).responseText;

		
		if(html == 'success')
		{
				window.location.href= 'http://www.mspinfo.com/main.php';	
		}
		else
		{
				alert("OOPS !!.. There is some problem when changing your business...");						
		}
		
		return false;

	}			
	

function addusers(userId,friendId,businessId){



	var why2 = "";

	

		var html= j.ajax({



			 type: "POST",



			url: 'http://www.mspinfo.com/add-users.php?',



			 async: false,		



			data: "userId="+encodeURIComponent(trim(userId))+"&friendId="+encodeURIComponent(trim(friendId))+"&businessId="+encodeURIComponent(trim(businessId))



		 }).responseText;

		

		if(html == "1"){

		 alert("User Added successfully");		

		 document.getElementById(friendId).innerHTML = "<font color='green'>User Added successfully</font>";

		}

	

		if(html == "2")

		 alert("Oops. problem when adding this user to your secondary List. Please refresh this page and try again");		



		if(html == "3"){			

		 alert("you should login to add users as your secondary users");		

			window.location.href= 'http://www.mspinfo.com/login.php';			 

		}

		if(html == "4")

		 alert("Oops. problem when adding this user to your secondary List. Please refresh this page and try again");		

		 

		if(html == "5")

		 alert("This user already Added to your secondary List");		



	return false;



}

function removeusers(userId,friendId,requestnum){



	var why2 = "";

	

		var html= j.ajax({



			 type: "POST",



			url: 'http://www.mspinfo.com/add-users.php?remove',



			 async: false,		



			data: "userId="+encodeURIComponent(trim(userId))+"&friendId="+encodeURIComponent(trim(friendId))+"&requestnum="+encodeURIComponent(trim(requestnum))



		 }).responseText;

		

		if(html == "1"){

		 alert("Removed successfully");		

		 document.getElementById(friendId).innerHTML = "<font color='green'>Removed successfully</font>";

		}

	

		if(html == "2")

		 alert("Oops. problem when removing this user from your secondary List.");		



		if(html == "3"){			

		 alert("you should login to remove user from your secondary list");		

			window.location.href= 'http://www.mspinfo.com/login.php';			 

		}

		if(html == "4")

		 alert("Oops. problem when removing this user from your secondary List. Please refresh this page and try again");		



	return false;



}

function onChangepersonal(thisvalue){

			var html= j.ajax({

			 type: "POST",

			url: 'ajaxRequests.php?changePersonal',

			 async: false,		

			data: "changevalue="+encodeURIComponent(thisvalue)

		 }).responseText;

		
		if(html == 'success')
		{
				window.location.href= 'http://www.mspinfo.com/main.php';	
		}
		else
		{
				alert("OOPS !!.. There is some problem when changing your business...");						
		}
		
		return false;

	}			
	

