function showPasswordObjects()
{ 
	document.getElementById('divForgotPassObjects').style.display="inline";
	document.getElementById('divForgotPassMessage').style.display="none";
}

function GetXmlHttpObject()
{
	varObjXMLHttp=null;
	try
	  {
	  // Firefox, Opera 8.0+, Safari
	  varObjXMLHttp=new XMLHttpRequest();
	  }
	catch (e)
	  {
	  // Internet Explorer
	  try
	    {
	    varObjXMLHttp=new ActiveXObject("Msxml2.XMLHTTP");
	    }
	  catch (e)
	    {
	    try
	      {
	      varObjXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
	      }
	    catch (e)
	      {
	      alert("Your browser does not support AJAX!");
	      //return false;
	      }
	    }
	  }
	return varObjXMLHttp;
}
//-------------------------------------------------------------------------------------------------------------------//

function sendContactUsForm()
{
var xmlHttpSendContactForm;
var inquiry = escape(document.getElementById("Inquiry").value)
var name = escape(document.getElementById("Name").value)
var email = escape(document.getElementById("ContactEmail").value)
var subject = escape(document.getElementById("Subject").value)
var message = escape(document.getElementById("Message").value)
var humanbeing = escape(document.getElementById("HumanBeing").value)

var strParam="HumanBeing="+humanbeing+"&inquiry="+inquiry+"&name="+name+"&email="+email+"&subject="+subject+"&message="+message;
xmlHttpSendContactForm=GetXmlHttpObject();

if (xmlHttpSendContactForm==null)
{
	alert("Browser does not support HTTP Request")
	return;
}

	if (xmlHttpSendContactForm!=null)
	{
		xmlHttpSendContactForm.onreadystatechange=function()
	    {
	    if(xmlHttpSendContactForm.readyState==4)
	      {
			document.getElementById("msgBoxContact").className= "border_3_gray red padding_all_5";
	        document.getElementById("msgBoxContact").innerHTML= xmlHttpSendContactForm.responseText
	      }
		else
		  {
			document.getElementById("msgBoxContact").innerHTML= "<img src=/images/ajax-loader-small.gif class=align_button_withtext> <span class=black>Sending message...</span>"
		  }
	    }
		
		xmlHttpSendContactForm.open("POST", "/builder-v5/business/process-contactus.asp", true);
		xmlHttpSendContactForm.setRequestHeader("Content-type", "application/x-www-form-urlencoded;charset=Windows-1251");
		xmlHttpSendContactForm.setRequestHeader("Content-length", strParam.length);
		xmlHttpSendContactForm.setRequestHeader("Connection", "close");
		xmlHttpSendContactForm.send(strParam);
	}
}



function saveLinkExchange()
{
var xmlHttpSaveLink;
var humanbeing = escape(document.getElementById("HumanBeing").value)
var type = escape(document.getElementById("Type").value)
var title = escape(document.getElementById("Title").value)
var url = escape(document.getElementById("URL").value)
var linkurl = escape(document.getElementById("LinkPageURL").value)
var contactname = escape(document.getElementById("ContactName").value)
var email = escape(document.getElementById("Email").value)
var country = escape(document.getElementById("Country").value)
var description = escape(document.getElementById("Description").value)
var comment = escape(document.getElementById("Comment").value)


var strParam="HumanBeing="+humanbeing+"&Type="+type+"&Title="+title+"&URL="+url;
strParam = strParam + "&LinkPageURL="+linkurl+"&ContactName="+contactname+"&Email="+email+"&Country="+country;
strParam = strParam + "&Description="+description+"&Comment="+comment;

xmlHttpSaveLink=GetXmlHttpObject();

if (xmlHttpSaveLink==null)
{
	alert("Browser does not support HTTP Request")
	return;
}

	if (xmlHttpSaveLink!=null)
	{
		xmlHttpSaveLink.onreadystatechange=function()
	    {
	    if(xmlHttpSaveLink.readyState==4)
	      {
			document.getElementById("msgBoxLink").className= "border_3_gray red padding_all_5";
	        document.getElementById("msgBoxLink").innerHTML= xmlHttpSaveLink.responseText
	      }
		else
		  {
			document.getElementById("msgBoxLink").innerHTML= "<img src=/images/ajax-loader-small.gif class=align_button_withtext> <span class=black>Loading...</span>"
		  }
	    }
		
		xmlHttpSaveLink.open("POST", "/business/links-submit.asp", true);
		xmlHttpSaveLink.setRequestHeader("Content-type", "application/x-www-form-urlencoded;charset=Windows-1251");
		xmlHttpSaveLink.setRequestHeader("Content-length", strParam.length);
		xmlHttpSaveLink.setRequestHeader("Connection", "close");
		xmlHttpSaveLink.send(strParam);
	}
}

function updateProfile(intNumberOfFields)
{
var xmlHttpUpdateProfile;
var i;
var objFieldValue = new Array();
var strParam="";

	for (var i=1; i<intNumberOfFields; i++)	{
		objFieldValue[i] = escape(document.getElementById("Spec"+i).value);
		strParam = strParam+"Spec"+i+"="+objFieldValue[i]+"&"
	}
strParam = strParam.substring(0,strParam.length-1) 
xmlHttpUpdateProfile=GetXmlHttpObject();

if (xmlHttpUpdateProfile==null)
{
	alert("Browser does not support HTTP Request")
	return;
}

	if (xmlHttpUpdateProfile!=null)
	{
		xmlHttpUpdateProfile.onreadystatechange=function()
	    {
	    if(xmlHttpUpdateProfile.readyState==4)
	      {
	        document.getElementById("message_container").innerHTML= xmlHttpUpdateProfile.responseText
	      }
		else
		  {
			document.getElementById("message_container").innerHTML= "<img src=/images/ajax-loader-small.gif class=align_button_withtext> <span class=black>Loading...</span>"
		  }
	    }
		
		xmlHttpUpdateProfile.open("POST", "/members/profile-specs-update.asp", true);
		xmlHttpUpdateProfile.setRequestHeader("Content-type", "application/x-www-form-urlencoded;charset=Windows-1251");
		xmlHttpUpdateProfile.setRequestHeader("Content-length", strParam.length);
		xmlHttpUpdateProfile.setRequestHeader("Connection", "close");
		xmlHttpUpdateProfile.send(strParam);
	}
}

function updateAccountSettings(strNewsletterFormat)
{
var xmlHttpUpdateAccount;
var pwd = escape(document.getElementById("Password").value)
var pwd2 = escape(document.getElementById("Password2").value)
var newsletter = escape(document.getElementById("Newsletter").value)
var newsletterformat = escape(strNewsletterFormat)
var timedif = escape(document.getElementById("TimeDif").value)

if ((pwd) != (pwd2)) {
	document.getElementById("message_container").innerHTML="";
	alert("There are problems with the data you submitted.");
	displayMsg("Both the Password and the Verifying Password must be the same.", "Password2");
	return;
}

var strParam="password="+pwd+"&newsletter="+newsletter+"&newsletterformat="+newsletterformat+"&timedif="+timedif;

xmlHttpUpdateAccount=GetXmlHttpObject();

if (xmlHttpUpdateAccount==null)
{
	alert("Browser does not support HTTP Request")
	return;
}

	if (xmlHttpUpdateAccount!=null)
	{
		xmlHttpUpdateAccount.onreadystatechange=function()
	    {
	    if(xmlHttpUpdateAccount.readyState==4)
	      {
	        document.getElementById("message_container").innerHTML= xmlHttpUpdateAccount.responseText
	      }
		else
		  {
			document.getElementById("message_container").innerHTML= "<img src=/images/ajax-loader-small.gif class=align_button_withtext> <span class=black>Loading...</span>"
		  }
	    }
		
		xmlHttpUpdateAccount.open("POST", "/members/profile-accountsettings-update.asp", true);
		xmlHttpUpdateAccount.setRequestHeader("Content-type", "application/x-www-form-urlencoded;charset=Windows-1251");
		xmlHttpUpdateAccount.setRequestHeader("Content-length", strParam.length);
		xmlHttpUpdateAccount.setRequestHeader("Connection", "close");
		xmlHttpUpdateAccount.send(strParam);
	}
}

function getMyPictures(pagenum, currpage, me_id, username, ismyprofile)
{
var xmlHttpGetMyPictures;
var strParam="pagenum="+pagenum+"&currpage="+currpage+"&me_id="+me_id+"&username="+username+"&ismyprofile="+ismyprofile;

xmlHttpGetMyPictures=GetXmlHttpObject();

if (xmlHttpGetMyPictures==null)
{
	alert("Browser does not support HTTP Request")
	return;
}

	if (xmlHttpGetMyPictures!=null)
	{
		xmlHttpGetMyPictures.onreadystatechange=function()
	    {
	    if(xmlHttpGetMyPictures.readyState==4)
	      {
	        document.getElementById("mypicture_container").innerHTML= xmlHttpGetMyPictures.responseText
	      }
		else
		  {
			document.getElementById("mypicture_container").innerHTML= "<img src=/images/ajax-loader.gif>"
		  }
	    }
		
		xmlHttpGetMyPictures.open("POST", "/builder-v5/pictures/function-process-mypictures.asp", true);
		xmlHttpGetMyPictures.setRequestHeader("Content-type", "application/x-www-form-urlencoded;charset=Windows-1251");
		xmlHttpGetMyPictures.setRequestHeader("Content-length", strParam.length);
		xmlHttpGetMyPictures.setRequestHeader("Connection", "close");
		xmlHttpGetMyPictures.send(strParam);
	}
}

function getPassword()
{
var xmlHttpGetPassword;
var email = document.getElementById('lostPassEmail').value;
var strParam="email="+email;

xmlHttpGetPassword=GetXmlHttpObject();

if (xmlHttpGetPassword==null)
{
	alert("Browser does not support HTTP Request")
	return;
}

	if (xmlHttpGetPassword!=null)
	{
		xmlHttpGetPassword.onreadystatechange=function()
	    {
	    if(xmlHttpGetPassword.readyState==4)
	      {
			document.getElementById('divForgotPassObjects').style.display="none";
			document.getElementById('divForgotPassMessage').style.display="inline";
	        document.getElementById("divForgotPassMessage").innerHTML= xmlHttpGetPassword.responseText
	      }
		else
		  {
			document.getElementById('divForgotPassObjects').style.display="none";
			document.getElementById('divForgotPassMessage').style.display="inline";
			document.getElementById("divForgotPassMessage").innerHTML= "Sending email... Please wait."
		  }
	    }
		xmlHttpGetPassword.open("POST", "/members/send-account-details.asp", true);
		xmlHttpGetPassword.setRequestHeader("Content-type", "application/x-www-form-urlencoded;charset=Windows-1251");
		xmlHttpGetPassword.setRequestHeader("Content-length", strParam.length);
		xmlHttpGetPassword.setRequestHeader("Connection", "close");
		xmlHttpGetPassword.send(strParam);
	}
}

function saveNewsletterSubscriber(name, email)
{
	var returnMsg = "";
	if (!checkNonNumeric(name) || name=="Enter Name")
	{
		returnMsg = returnMsg + "\n- Enter your name. Numbers and special characters are not allowed."
	}
	if (!checkEmail(email))
	{
		returnMsg = returnMsg + "\n- Enter a valid email address."
	}
	
	if (returnMsg!="")
	{
		alert("Please check the following:\n"+returnMsg);
	}
 	else
	{
		var xmlHttpSaveSubscriber;
		var strParam="email="+email;
		strParam = strParam + "&name="+escape(name);

		xmlHttpSaveSubscriber=GetXmlHttpObject();

		if (xmlHttpSaveSubscriber==null)
		{
			alert("Browser does not support HTTP Request")
			return;
		}

			if (xmlHttpSaveSubscriber!=null)
			{
				xmlHttpSaveSubscriber.onreadystatechange=function()
			    {
			    if(xmlHttpSaveSubscriber.readyState==4)
			      {
			        document.getElementById("divJoinNewsletterWide").innerHTML= xmlHttpSaveSubscriber.responseText
			      }
				else
				  {
					document.getElementById("divJoinNewsletterWide").innerHTML= "Sending email... Please wait."
				  }
			    }
				xmlHttpSaveSubscriber.open("POST", "/builder-v5/news/page-join-newsletter.asp", true);
				xmlHttpSaveSubscriber.setRequestHeader("Content-type", "application/x-www-form-urlencoded;charset=Windows-1251");
				xmlHttpSaveSubscriber.setRequestHeader("Content-length", strParam.length);
				xmlHttpSaveSubscriber.setRequestHeader("Connection", "close");
				xmlHttpSaveSubscriber.send(strParam);
			}
	} 
}

function updateExtendedSettings()
{
var xmlHttpSendContactForm;
var aboutMe = escape(document.getElementById("AboutMe").value)
var hobbies = escape(document.getElementById("Hobbies").value)
var quote = escape(document.getElementById("Quote").value)
var company = escape(document.getElementById("Company").value)
var school = escape(document.getElementById("School").value)
var books = escape(document.getElementById("Books").value)
var movies = escape(document.getElementById("Movies").value)
var music = escape(document.getElementById("Music").value)
var tvshows = escape(document.getElementById("TVShows").value)

var c1TypeA = document.getElementById("C1Type")
var c1TypeB = escape(c1TypeA.options[c1TypeA.selectedIndex].value)
var c1id = escape(document.getElementById("C1ID").value)
var c2TypeA = document.getElementById("C2Type")
var c2TypeB = escape(c2TypeA.options[c2TypeA.selectedIndex].value)
var c2id = escape(document.getElementById("C2ID").value)
var c3TypeA = document.getElementById("C3Type")
var c3TypeB = escape(c3TypeA.options[c3TypeA.selectedIndex].value)
var c3id = escape(document.getElementById("C3ID").value)
var c4TypeA = document.getElementById("C4Type")
var c4TypeB = escape(c4TypeA.options[c4TypeA.selectedIndex].value)
var c4id = escape(document.getElementById("C4ID").value)
var c5TypeA = document.getElementById("C5Type")
var c5TypeB = escape(c5TypeA.options[c5TypeA.selectedIndex].value)
var c5id = escape(document.getElementById("C5ID").value)

var w1TypeA = document.getElementById("W1Type")
var w1TypeB = escape(w1TypeA.options[w1TypeA.selectedIndex].value)
var w1url = escape(document.getElementById("W1URL").value)
var w2TypeA = document.getElementById("W2Type")
var w2TypeB = escape(w2TypeA.options[w2TypeA.selectedIndex].value)
var w2url = escape(document.getElementById("W2URL").value)
var w3TypeA = document.getElementById("W3Type")
var w3TypeB = escape(w3TypeA.options[w3TypeA.selectedIndex].value)
var w3url = escape(document.getElementById("W3URL").value)
var w4TypeA = document.getElementById("W4Type")
var w4TypeB = escape(w4TypeA.options[w4TypeA.selectedIndex].value)
var w4url = escape(document.getElementById("W4URL").value)
var w5TypeA = document.getElementById("W5Type")
var w5TypeB = escape(w5TypeA.options[w5TypeA.selectedIndex].value)
var w5url = escape(document.getElementById("W5URL").value)

var strParam="AboutMe="+aboutMe+"&Hobbies="+hobbies+"&Quote="+quote+"&Company="+company+"&School="+school+"&Books="+books+"&Movies="+movies+"&Music="+music+"&TVShows="+tvshows+"&C1Type="+c1TypeB+"&C1ID ="+c1id+"&C2Type="+c2TypeB+"&C2ID ="+c2id+"&C3Type="+c3TypeB+"&C3ID ="+c3id+"&C4Type="+c4TypeB+"&C4ID ="+c4id+"&C5Type="+c5TypeB+"&C5ID ="+c5id+"&W1Type="+w1TypeB+"&W1URL ="+w1url+"&W2Type="+w2TypeB+"&W2URL ="+w2url+"&W3Type="+w3TypeB+"&W3URL ="+w3url+"&W4Type="+w4TypeB+"&W4URL ="+w4url+"&W5Type="+w5TypeB+"&W5URL ="+w5url;

xmlHttpSendContactForm=GetXmlHttpObject();

if (xmlHttpSendContactForm==null)
{
	alert("Browser does not support HTTP Request")
	return;
}

	if (xmlHttpSendContactForm!=null)
	{
		xmlHttpSendContactForm.onreadystatechange=function()
	    {
	    if(xmlHttpSendContactForm.readyState==4)
	      {
			document.getElementById("message_container").className= "border_3_gray red padding_all_5";
	        document.getElementById("message_container").innerHTML= xmlHttpSendContactForm.responseText
	      }
		else
		  {
			document.getElementById("message_container").innerHTML= "<img src=/images/ajax-loader-small.gif class=align_button_withtext> <span class=black>Updating profile...</span>"
		  }
	    }
		
		xmlHttpSendContactForm.open("POST", "/members/profile-extended-update.asp", true);
		xmlHttpSendContactForm.setRequestHeader("Content-type", "application/x-www-form-urlencoded;charset=Windows-1251");
		xmlHttpSendContactForm.setRequestHeader("Content-length", strParam.length);
		xmlHttpSendContactForm.setRequestHeader("Connection", "close");
		xmlHttpSendContactForm.send(strParam);
	}
}

function updatePersonalSettings()
{
var xmlHttpSendContactForm;
var DOBa = document.getElementById("DOBa")
var DOBaa = escape(DOBa.options[DOBa.selectedIndex].value)
var DOBb = document.getElementById("DOBb")
var DOBbb = escape(DOBb.options[DOBb.selectedIndex].value)
var DOBc = document.getElementById("DOBc")
var DOBcc = escape(DOBc.options[DOBc.selectedIndex].value)
var DOBMode = document.getElementById("BirthMode")
var DOBModee = escape(DOBMode.options[DOBMode.selectedIndex].value)
var Gender = document.getElementById("Gender")
var Genderr = escape(Gender.options[Gender.selectedIndex].value)
var Country = document.getElementById("Country")
var Countryy = escape(Country.options[Country.selectedIndex].value)

var FirstName = escape(document.getElementById("FirstName").value)
var LastName = escape(document.getElementById("LastName").value)
var MarStatus = document.getElementById("MarStatus")
var MarStatuss = escape(MarStatus.options[MarStatus.selectedIndex].value)
var Height = escape(document.getElementById("Height").value)
var Weight = escape(document.getElementById("Weight").value)
var Occupation = escape(document.getElementById("Occupation").value)
var Address = escape(document.getElementById("Address").value)
var PostCode = escape(document.getElementById("PostCode").value)
var City = escape(document.getElementById("City").value)

var Email = escape(document.getElementById("Email").value)
var EmailMode = document.getElementById("EmailMode")
var EmailModee = escape(EmailMode.options[EmailMode.selectedIndex].value)
var Telephone = escape(document.getElementById("Telephone").value)
var Mobile = escape(document.getElementById("Mobile").value)

var strParam="DOBa="+DOBaa+"&DOBb="+DOBbb+"&DOBc="+DOBcc+"&DOBMode="+DOBModee+"&Gender="+Genderr+"&Country="+Countryy+"&FirstName="+FirstName+"&LastName="+LastName+"&MarStatus="+MarStatuss+"&Height="+Height+"&Weight="+Weight+"&Occupation="+Occupation+"&Address ="+Address+"&PostCode="+PostCode+"&City ="+City+"&Email="+Email+"&EmailMode ="+EmailModee+"&Telephone="+Telephone+"&Mobile="+Mobile;

xmlHttpSendContactForm=GetXmlHttpObject();

if (xmlHttpSendContactForm==null)
{
	alert("Browser does not support HTTP Request")
	return;
}

	if (xmlHttpSendContactForm!=null)
	{
		xmlHttpSendContactForm.onreadystatechange=function()
	    {
	    if(xmlHttpSendContactForm.readyState==4)
	      {
			document.getElementById("message_container").className= "border_3_gray red padding_all_5";
	        document.getElementById("message_container").innerHTML= xmlHttpSendContactForm.responseText
	      }
		else
		  {
			document.getElementById("message_container").innerHTML= "<img src=/images/ajax-loader-small.gif class=align_button_withtext> <span class=black>Updating profile...</span>"
		  }
	    }
		
		xmlHttpSendContactForm.open("POST", "/members/profile-personal-update.asp", true);
		xmlHttpSendContactForm.setRequestHeader("Content-type", "application/x-www-form-urlencoded;charset=Windows-1251");
		xmlHttpSendContactForm.setRequestHeader("Content-length", strParam.length);
		xmlHttpSendContactForm.setRequestHeader("Connection", "close");
		xmlHttpSendContactForm.send(strParam);
	}
}

function postComment(site, id, section, me_id)
{
var Regemail = /^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9])+(\.[a-zA-Z0-9_-]+)+$/
var xmlHttpPostAffComment;
var name = escape(document.getElementById("txtName").value)
var email = escape(document.getElementById("txtEmail").value)
var website = escape(document.getElementById("txtWebsite").value)
var comment = escape(document.getElementById("txtComment").value)

if (name == "") {
	document.getElementById("message_container").innerHTML="";
	alert("Please enter your name.");
	return;
}
else if (email == ""){
	document.getElementById("message_container").innerHTML="";
	alert("Please enter your email address.");
	return;
}

else if (comment == ""){
	document.getElementById("message_container").innerHTML="";
	alert("Please enter your comment.");
	return;
}

if (email.search(Regemail)==-1){
	document.getElementById("message_container").innerHTML="";
	alert("Please enter a valid email address.");
	return;
}


var strParam="ME_ID="+me_id+"&section="+section+"&name="+name+"&email="+email+"&website="+website+"&comment="+comment+"&site="+site+"&said="+id;
xmlHttpPostAffComment=GetXmlHttpObject();

if (xmlHttpPostAffComment==null)
{
	alert("Browser does not support HTTP Request")
	return;
}

	if (xmlHttpPostAffComment!=null)
	{
		xmlHttpPostAffComment.onreadystatechange=function()
	    {
	    if(xmlHttpPostAffComment.readyState==4)
	      {
	        document.getElementById("message_container").innerHTML= xmlHttpPostAffComment.responseText
	      }
		else
		  {
			document.getElementById("message_container").innerHTML= "<img src=/images/ajax-loader-small.gif class=align_button_withtext> <span class=black>Loading...</span>"
		  }
	    }
		
		xmlHttpPostAffComment.open("POST", "/builder-v5/shared/process-post-comments.asp", true);
		xmlHttpPostAffComment.setRequestHeader("Content-type", "application/x-www-form-urlencoded;charset=Windows-1251");
		xmlHttpPostAffComment.setRequestHeader("Content-length", strParam.length);
		xmlHttpPostAffComment.setRequestHeader("Connection", "close");
		xmlHttpPostAffComment.send(strParam);
	}
}