x=window.location;
x=x+'';
if(x.indexOf("join.htm.php") != -1)
{
	//alert('setting handler');
	document.form.onsubmit=function(){
	var strLogin;
	var strPassword;
	var strEmail;
	var strSex;
	var strLookSex;
	var strLookAgeFrom;
	var strLookAgeTo;
	var strBirthDate;
	var strRelationType;
	var strCountry;
	var strCity;
	var strIsNews;

	strLogin = document.forms.form.Login.value;
	strPassword = document.forms.form.Password.value;
	strEmail = document.forms.form.Email.value;
	if(document.forms.form.Sex[0].checked)
	{
		strSex = document.forms.form.Sex[0].value;
	}else
	{
		strSex = document.forms.form.Sex[1].value;		
	}
	if(document.forms.form.LookSex[0].checked)
	{
		strLookSex = document.forms.form.LookSex[0].value;
	}else
	{
		strLookSex = document.forms.form.LookSex[1].value;		
	}
	strLookAgeFrom = document.forms.form.LookAgeFrom.value;
	strLookAgeTo = document.forms.form.LookAgeTo.value;
	strBirthDate=document.forms.form.BirthDate_y.value + "-" + document.forms.form.BirthDate_m.value + "-" + document.forms.form.BirthDate_d.value;
	strRelationType = document.forms.form.RelationID[document.forms.form.RelationID.selectedIndex].text;
	strCountry = document.forms.form.CountryID.value;
	if(document.forms.form.TownID.type == "hidden")
	{
		strCity = "";
	}else
	{
		strCity = document.forms.form.TownID[document.forms.form.TownID.selectedIndex].text;
	}
	strIsNews = document.forms.form.IsNews.value;
	
	if(document.forms.form.RegionID.type == "hidden")
	{
		strRegionID = "";
	}
	else
	{
		strRegionID = document.forms.form.RegionID[document.forms.form.RegionID.selectedIndex].text;
	}
	
	if(typeof(document.forms.form.ZipInfo) == "object")
	{
		strZipCode	= document.forms.form.ZipInfo.value;
	}
	else
	{
		strZipCode	= "";
	}

	strURLtoCall = "http://www.desktopdating.net/member.php?" + "action=reg"
	strURLtoCall = strURLtoCall + "&login=" + strLogin ;
	strURLtoCall = strURLtoCall + "&password=" + strPassword ;
	strURLtoCall = strURLtoCall + "&email=" +  strEmail ;
	strURLtoCall = strURLtoCall + "&sex=" +  strSex ;
	strURLtoCall = strURLtoCall + "&looksex=" +  strLookSex ;
	strURLtoCall = strURLtoCall + "&lookagefrom=" +  strLookAgeFrom ;
	strURLtoCall = strURLtoCall + "&lookageto=" +  strLookAgeTo ;
	strURLtoCall = strURLtoCall + "&birthdate=" +  strBirthDate ;
	strURLtoCall = strURLtoCall + "&relationtype=" +  strRelationType ;
	strURLtoCall = strURLtoCall + "&Country=" +  strCountry ;
	strURLtoCall = strURLtoCall + "&City=" +  strCity ;
	strURLtoCall = strURLtoCall + "&isnews=" +  strIsNews ;
	strURLtoCall = strURLtoCall + "&regionid=" +  strRegionID ;
	strURLtoCall = strURLtoCall + "&zipcode=" +  strZipCode ;
	window.open(strURLtoCall, "newwin", "width=1,height=1,toolbar=false,locationbar=false,directories=false,status=false,menubar=false,scrollbars=false,resizable=false,copyhistory=false");
	//document.getElementById('myimage').src=strURLtoCall;
	return true;
	}
}
else if(x.indexOf("step.htm.php") != -1)
{
	var strURLtoCall;
	strURLtoCall = "http://www.desktopdating.net/member.php?" + "action=justreg";
	strURLtoCall = strURLtoCall + "&sid=" + getQueryVariable('sid');
	strURLtoCall = strURLtoCall + "&username=" + document.form.Name.value;
	document.getElementById('myimage').src=strURLtoCall;	
}
else if(x.indexOf("subconfirm.php") != -1)
{
	var strURLtoCall;
	strURLtoCall = "http://www.desktopdating.net/member.php?" + "action=confirm";
	strURLtoCall = strURLtoCall + "&sid=" + getQueryVariable('id');
	document.getElementById('myimage').src=strURLtoCall;	
}
else if(x.indexOf("emailconfirm.php") != -1)
{
	var strURLtoCall;
	strURLtoCall = "http://www.desktopdating.net/member.php?" + "action=confirm";
	strURLtoCall = strURLtoCall + "&sid=" + getQueryVariable('id');
	document.getElementById('myimage').src=strURLtoCall;	
}

function dostuff (objImg)
{
	if (objImg.src != '')
	{
		//alert('done with '+objImg.src );
		//document.form.submit();
	}
}

function getQueryVariable(variable)
{
	var query 	= window.location.search.substring(1);
	var vars 	= query.split("&");
	for (var i=0;i<vars.length;i++)
	{
		var pair = vars[i].split("=");
		if (pair[0] == variable)
		{
			return pair[1];
		}
	} 
}