//------------------------------------------------------------------------------------------------------------------
function Members_Search(){

	var cacheBuster = GetUniqueCode();
	
	var source = "search";
	var companyName = document.frmMain.txtCompanyName.value;
	var city = document.getElementById("Siteskin_selCity").value;

	document.frmMain.action = "sfm_members_results.aspx?qsCb=" + cacheBuster + 
	                            "&qsSource=" + source + "&qsCompany=" + escape(companyName) + "&qsCity=" + escape(city);
	document.frmMain.target = "fraResults";
	document.frmMain.submit();

}
//------------------------------------------------------------------------------------------------------------------
function Members_Clear(){

	var cacheBuster = GetUniqueCode();
	
	document.frmMain.reset();

	var source = "clear";
	var companyName = "";
	var city = "";

	document.frmMain.action = "sfm_members_results.aspx?qsCb=" + cacheBuster + 
	                            "&qsSource=" + source + "&qsCompany=" + escape(companyName) + "&qsCity=" + escape(city);
	document.frmMain.target = "fraResults";
	document.frmMain.submit();

}
//------------------------------------------------------------------------------------------------------------------
function GetUniqueCode(){

	var dateObject = new Date();
	var uniqueCode = "" + dateObject.getYear() + dateObject.getMonth() + 
		dateObject.getDate() + dateObject.getHours() +
		dateObject.getMinutes() + dateObject.getSeconds() + dateObject.getMilliseconds();
		
	return uniqueCode;

}
//----------------------------------------------------------------------------------------
function LoadEmailForm(toEmail, subject){		

	var cacheBuster = GetUniqueCode();
	var href = "frm_email_agent.aspx" +
									"?qsTo=" + toEmail + 	
									"&qsSubject=" + subject +								
									"&qsCb=" + cacheBuster;
									
	//Define the left and top coordinates:	
	var width = 550;
	var height = 350;
	var left;
	var top;			
			
	left = (document.body.offsetWidth / 2) - (width / 2) + document.body.scrollLeft;			
	top = (document.body.clientHeight / 2) - (height / 2) +	document.body.scrollTop;	
	
	var features = "location=no,menubar=no,resizable=no,toolbar=no," +
		"top=" + top + ",left=" + left + ",width=" + width + ",height=" + height;

	window.open(href, "", features);

}
//----------------------------------------------------------------------------------------
function LoadAgentSite(url){		
	
	var href = url;
									
	//Define the left and top coordinates:	
	var width = 599;
	var height = 500;
	var left;
	var top;			
			
	left = (document.body.offsetWidth / 2) - (width / 2) + document.body.scrollLeft;			
	top = (document.body.clientHeight / 2) - (height / 2) +	document.body.scrollTop;	
	
	var features = "location=yes,menubar=yes,resizable=yes,toolbar=yes,scrollbars=yes," +
		"top=" + top + ",left=" + left + ",width=" + width + ",height=" + height;

	window.open(href, "", features);

}
//----------------------------------------------------------------------------------------




