function checkMoveInCertifiedForm(f)
{
	if (f.address.value == "")
	{
		alert("You must enter a valid address, such as 123 S MAIN ST.");
		return false;
	}
	if (f.city.value == "")
	{
		alert("You must enter a valid city, such as DENVER.");
		return false;
	}
	return true;
}

function createMoveInCertifiedStylesheet()
{
	url = 'http://www.moveincertified.com/widgets/default/widget.css';
	if(document.createStyleSheet)
	{
		document.createStyleSheet(url);
	}
	else
	{
		var styles = "@import url('" + url + "');";
		var newSS = document.createElement('link');
		newSS.rel = 'stylesheet';
		newSS.href = 'data:text/css,' + escape(styles);
		document.getElementsByTagName("head")[0].appendChild(newSS);
	}
}

function printMoveInCertifiedForm()
{
	var form = '<form id="moveInCertifiedForm" action="http:\/\/www.moveincertified.com\/reports" method="get" onsubmit="return checkMoveInCertifiedForm(this);">';
	form += '<table width="450" bgcolor="#E4E4C8" border="0" cellpadding="7" cellspacing="0">';
	form += '  <tr>';
	form += '    <td class="desc" colspan="2">';
	form += '      <img src="http:\/\/www.moveincertified.com\/widgets\/default\/logo.gif" alt="Move In Certified Logo" width="85" height="75" align="left" \/>';
	form += '      MoveInCertified homes have been pre-inspected by InterNACHI certified inspectors and the sellers confirm that there are no major systems in need of immediate repair or replacement and no known safety hazards.';
	form += '    <\/td>';
	form += '  <\/tr>';
	form += '  <tr>';
	form += '    <th width="-1%" nowrap="nowrap" align="left" scope="row">Address:<\/th>';
	form += '    <td width="100%"><input type="text" size="45" class="wide" id="search-address" name="address" \/><\/td>';
	form += '  <\/tr>';
	form += '  <tr>';
	form += '    <th width="-1%" nowrap="nowrap" align="left" scope="row">City:<\/th>';
	form += '    <td width="100%"><input type="text" size="40" id="search-city" name="city" \/><\/td>';
	form += '  <\/tr>';
	form += '  <tr>';
	form += '    <th width="-1%" nowrap="nowrap" align="left" scope="row">State:<\/th>';
	form += '    <td width="100%"><input type="text" size="2" id="search-state" name="state" \/> ';
	form += '    <span style="color:#727264;font-size:90%;">(if Canada, enter Province)<\/span><\/td>';
	form += '  <\/tr>';
	form += '  <tr>';
	form += '    <td colspan="2" align="center"><input type="image" name="submit" id="submit" alt="Download Pre-Inspection Report" src="http:\/\/www.moveincertified.com\/widgets\/default\/button.gif" \/><\/td>';
	form += '  <\/tr>';
	form += '  <tr>';
	form += '    <td class="footer" align="right" colspan="2"><a href="http:\/\/www.moveincertified.com">About Move In Certified<\/a><\/td>';
	form += '  <\/tr>';
	form += '<\/table>';
	form += '<div>&nbsp;<\/div>';
	form += '<\/form>';
	document.write(form);
}

createMoveInCertifiedStylesheet()
printMoveInCertifiedForm();
