function fnTopmenu(pagetop)
{
	var str="";
	str+="<tr><td class='top_pad' colspan='3'>";
	if(pagetop=='newsletter')
	{str+="<a href='newsletter.php' class='top_menu_active'>join e-newsletter</a>";}
	else
	{str+="<a href='newsletter.php' class='top_menu'>join e-newsletter</a>";}
	if(pagetop=='advertise')
	{str+="<a href='advertise.php' class='top_menu_active'>advertise</a>";}
	else
	{str+="<a href='advertise.php' class='top_menu'>advertise</a>";}
	if(pagetop=='terms')
	{str+="<a href='terms_conditions.php' class='top_menu_active'>terms & conditions</a>";}
	else
	{str+="<a href='terms_conditions.php' class='top_menu'>terms & conditions</a>";}
	str+="<a href='javascript:window.print();' class='top_menu'>print page</a>";
	if(pagetop=='sitemap')
	{str+="<a href='sitemap.php' class='top_menu_active'>site map</a>";}
	else
	{str+="<a href='sitemap.php' class='top_menu'>site map</a>";}
	str+="</td></tr>";
	document.write(str);
}

function fnTop(page)
{
	var str="";
	str+="<tr>";
	str+="<td rowspan='3'><img src='images/logo.gif' width='168' height='153' alt='Marben International' border='0' /></td>";
	str+="<td colspan='2' class='flash_bg'>";
	str+="<img src='/images/realizingthedream.gif'>";
	
	str+="</td>";
	str+="</tr>";
	str+="<tr >";
	str+="<td valign='top'tyle='border:1px solid #FF0000;'><img src='images/top_worldwide.jpg' width='396' height='55' alt='' border='0' /></td>";
	str+="<td class='contactinfo_bg'><b>Tel International.</b> (0034) 952 587 719<br /><b>Tel UK.</b> (0044) 207 193 7400<br /><b>Email. </b><a href='mailto:info@marbenrealestate.com' class='mail_link'>info@marbenrealestate.com</a></td>";
	str+="</tr>";
	str+="<tr><td colspan='2' valign='top'>";
	if(page=='home')
	{str+="<a href='index.php' onmouseout='MM_swapImgRestore()' onmouseover=MM_swapImage('Image5','','images/btn_home_over.gif',1)><img src='images/btn_home_over.gif' name='Image5' width='104' height='22' border='0' id='Image5' /></a>";}
	else
	{str+="<a href='index.php' onmouseout='MM_swapImgRestore()' onmouseover=MM_swapImage('Image5','','images/btn_home_over.gif',1)><img src='images/btn_home.gif' name='Image5' width='104' height='22' border='0' id='Image5' /></a>";}
	if(page=='about')
	{str+="<a href='about_us.php' onmouseout='MM_swapImgRestore()' onmouseover=MM_swapImage('Image6','','images/btn_about_over.gif',1)><img src='images/btn_about_over.gif' name='Image6' width='106' height='22' border='0' id='Image6' /></a>";}
	else
	{str+="<a href='about_us.php' onmouseout='MM_swapImgRestore()' onmouseover=MM_swapImage('Image6','','images/btn_about_over.gif',1)><img src='images/btn_about.gif' name='Image6' width='106' height='22' border='0' id='Image6' /></a>";}
	if(page=='buying')
	{str+="<a href='buying_abroad.php' onmouseout='MM_swapImgRestore()' onmouseover=MM_swapImage('Image7','','images/btn_buying_abroad_over.gif',1)><img src='images/btn_buying_abroad_over.gif' name='Image7' width='106' height='22' border='0' id='Image7' /></a>";}
	else
	{str+="<a href='buying_abroad.php' onmouseout='MM_swapImgRestore()' onmouseover=MM_swapImage('Image7','','images/btn_buying_abroad_over.gif',1)><img src='images/btn_buying_abroad.gif' name='Image7' width='106' height='22' border='0' id='Image7' /></a>";}
	if(page=='latest')
	{str+="<a href='latest_news.php' onmouseout='MM_swapImgRestore()' onmouseover=MM_swapImage('Image8','','images/btn_latest_news_over.gif',1)><img src='images/btn_latest_news_over.gif' name='Image8' width='106' height='22' border='0' id='Image8' /></a>";}
	else
	{str+="<a href='latest_news.php' onmouseout='MM_swapImgRestore()' onmouseover=MM_swapImage('Image8','','images/btn_latest_news_over.gif',1)><img src='images/btn_latest_news.gif' name='Image8' width='106' height='22' border='0' id='Image8' /></a>";}
	if(page=='link')
	{str+="<a href='links.php' onmouseout='MM_swapImgRestore()' onmouseover=MM_swapImage('Image9','','images/btn_links_over.gif',1)><img src='images/btn_links_over.gif' name='Image9' width='106' height='22' border='0' id='Image9' /></a>";}
	else
	{str+="<a href='links.php' onmouseout='MM_swapImgRestore()' onmouseover=MM_swapImage('Image9','','images/btn_links_over.gif',1)><img src='images/btn_links.gif' name='Image9' width='106' height='22' border='0' id='Image9' /></a>";}
	if(page=='contact')
	{str+="<a href='contact_us.php' onmouseout='MM_swapImgRestore()' onmouseover=MM_swapImage('Image10','','images/btn_contact_over.gif',1)><img src='images/btn_contact_over.gif' name='Image10' width='109' height='22' border='0' id='Image10' /></a>";}
	else
	{str+="<a href='contact_us.php' onmouseout='MM_swapImgRestore()' onmouseover=MM_swapImage('Image10','','images/btn_contact_over.gif',1)><img src='images/btn_contact.gif' name='Image10' width='109' height='22' border='0' id='Image10' /></a>";}
	str+="</td></tr>";
	str+="<tr><td class='white_bg' colspan='3'></td></tr>";
	document.write(str);
}

function fnleft()
{
	var str="";
	str+="<td width='160' valign='top'>";
	str+="<table cellpadding='0' cellspacing='0' border='0' width='160'>";
	str+="<tr><td class='bottom_border'><img src='images/title_property_search.jpg' width='160' height='20' alt='' border='0' /></td></tr>";
	str+="<tr><td><img src='images/left_top_img.gif' width='160' height='4' alt='' border='0' /></td></tr>";
	str+="<tr><td class='left_content_bg'><b>Country</b>";
	str+="<div class='combox_pad'>";
	str+="<select class='cmbbox'>";
	str+="<option>please select</option>";
	str+="</select>";
	str+="</div>"; 
	str+="<b>Search Area</b>";
	str+="<div class='combox_pad'>";
	str+="<select class='cmbbox'>";
	str+="<option>search all</option>";
	str+="</select>";
	str+="</div>";
	str+="<b>Type of Property</b>";
	str+="<div class='combox_pad'>";
	str+="<select class='cmbbox'>";
	str+="<option>search all</option>";
	str+="</select>";
	str+="</div>";
	str+="<b>Minimum Bedrooms</b>";
	str+="<div class='combox_pad'>";
	str+="<select class='cmbbox'>";
	str+="<option>minimum</option>";
	str+="</select>";
	str+="</div>";
	str+="<b>Minimum Price</b>";
	str+="<div class='combox_pad'>";
	str+="<select class='cmbbox'>";
	str+="<option>minimum</option>";
	str+="</select>";
	str+="</div>";
	str+="<b>Maximum Price</b>";
	str+="<div class='combox_pad'>";
	str+="<select class='cmbbox'>";
	str+="<option>maximum</option>";
	str+="</select>";
	str+="</div>";
	str+="<b>Newly Built Homes</b>";
	str+="<div class='combox_pad'>";
	str+="<select class='cmbbox'>";
	str+="<option>new and resale</option>";
	str+="</select>";
	str+="</div>";	 	   
	str+="<b>Newly Built Homes</b>";
	str+="<div class='combox_pad'>";
	str+="<select class='cmbbox'>";
	str+="<option>new and resale</option>";
	str+="</select>";
	str+="</div>";	   
	str+="<b>Sort by Price</b>";
	str+="<div class='combox_pad'>";
	str+="<select class='cmbbox'>";
	str+="<option>highest first</option>";
	str+="</select>";
	str+="</div>";
	str+="<div class='left_btnpad'><img src='images/btn_find_properties.gif' width='150' height='20' alt='Find Properties' border='0' /></div>";
	str+="</td></tr>";
	str+="<tr><td><img src='images/left_bottom_img.gif' width='160' height='3' alt='' border='0' /></td></tr>";
	str+="<tr><td><img src='images/btn_new_development.gif' width='160' height='28' alt='New Development Search' border='0' /></td></tr>";
	str+="<tr><td><img src='images/left_top_img.gif' width='160' height='4' alt='' border='0' /></td></tr>";
	str+="<tr><td class='left_content_bg'><b>Country</b>";
	str+="<div class='combox_pad'>";
	str+="<select class='cmbbox'>";
	str+="<option>please select</option>";
	str+="</select>";
	str+="</div>";  
	str+="<b>Development</b>";
	str+="<div class='combox_pad'>";
	str+="<select class='cmbbox'>";
	str+="<option>search all</option>";
	str+="</select>";
	str+="</div>";
	str+="<div class='left_btnpad'><img src='images/btn_find_development.gif' width='150' height='20' alt='Find Development' border='0' /></div>";	 	   
	str+="</td></tr>";
	str+="<tr><td><img src='images/left_bottom_img.gif' width='160' height='3' alt='' border='0' /></td></tr>";
	str+="<tr><td><img src='images/btn_property_reference.gif' width='160' height='28' alt='Property Reference' border='0' /></td></tr>";
	str+="<tr><td><img src='images/left_top_img.gif' width='160' height='4' alt='' border='0' /></td></tr>";
	str+="<tr><td class='left_content_bg'><b>Reference code</b>";
	str+="<div class='combox_pad'><input type='text' class='txtbox' value='i.e. M0001' name='i.e. M0001' /></div>";
	str+="<div class='left_btnpad'><img src='images/btn_find_property.gif' width='150' height='20' alt='Find Property' border='0' /></div>";
	str+="</td></tr>";
	str+="<tr><td class='bottom_border'><img src='images/left_bottom_img.gif' width='160' height='3' alt='' border='0' /></td></tr>";
	str+="<tr><td class='left_flash_bg'>";
	str+="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='158' height='266' title='spain'><param name='movie' value='media/spain_158x266.swf' /><param name='quality' value='high' />";
	str+="<embed src='media/spain_158x266.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='158' height='266'></embed>";
	str+="</object>";
	str+="</td></tr>";
	str+="<tr><td height='4'></td></tr>";
	str+="<tr><td class='left_flash_bg'>";
	str+="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='158' height='266' title='spain'><param name='movie' value='media/spain_158x266.swf' /><param name='quality' value='high' />";
	str+="<embed src='media/spain_158x266.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='158' height='266'></embed>";
	str+="</object>";
	str+="</td></tr>";
	str+="<tr><td height='4'></td></tr>";
	str+="</table>";
	str+="</td>";
	str+="<td width='4'></td>";
	document.write(str);
}

function fnleft1()
{
	var str="";
	str+="<td width='160' valign='top'>";
	str+="<table cellpadding='0' cellspacing='0' border='0' width='160'>";
	str+="<tr><td class='bottom_border'><img src='images/title_property_search.jpg' width='160' height='20' alt='' border='0' /></td></tr>";
	str+="<tr><td><img src='images/left_top_img.gif' width='160' height='4' alt='' border='0' /></td></tr>";
	str+="<tr><td class='left_content_bg'><b>Country</b>";
	str+="<div class='combox_pad'>";
	str+="<select class='cmbbox'>";
	str+="<option>please select</option>";
	str+="</select>";
	str+="</div>"; 
	str+="<b>Search Area</b>";
	str+="<div class='combox_pad'>";
	str+="<select class='cmbbox'>";
	str+="<option>search all</option>";
	str+="</select>";
	str+="</div>";
	str+="<b>Type of Property</b>";
	str+="<div class='combox_pad'>";
	str+="<select class='cmbbox'>";
	str+="<option>search all</option>";
	str+="</select>";
	str+="</div>";
	str+="<b>Minimum Bedrooms</b>";
	str+="<div class='combox_pad'>";
	str+="<select class='cmbbox'>";
	str+="<option>minimum</option>";
	str+="</select>";
	str+="</div>";
	str+="<b>Minimum Price</b>";
	str+="<div class='combox_pad'>";
	str+="<select class='cmbbox'>";
	str+="<option>minimum</option>";
	str+="</select>";
	str+="</div>";
	str+="<b>Maximum Price</b>";
	str+="<div class='combox_pad'>";
	str+="<select class='cmbbox'>";
	str+="<option>maximum</option>";
	str+="</select>";
	str+="</div>";
	str+="<b>Newly Built Homes</b>";
	str+="<div class='combox_pad'>";
	str+="<select class='cmbbox'>";
	str+="<option>new and resale</option>";
	str+="</select>";
	str+="</div>";	 	   
	str+="<b>Newly Built Homes</b>";
	str+="<div class='combox_pad'>";
	str+="<select class='cmbbox'>";
	str+="<option>new and resale</option>";
	str+="</select>";
	str+="</div>";	   
	str+="<b>Sort by Price</b>";
	str+="<div class='combox_pad'>";
	str+="<select class='cmbbox'>";
	str+="<option>highest first</option>";
	str+="</select>";
	str+="</div>";
	str+="<div class='left_btnpad'><img src='images/btn_find_properties.gif' width='150' height='20' alt='Find Properties' border='0' /></div>";
	str+="</td></tr>";
	str+="<tr><td><img src='images/left_bottom_img.gif' width='160' height='3' alt='' border='0' /></td></tr>";
	str+="<tr><td><img src='images/btn_new_development.gif' width='160' height='28' alt='New Development Search' border='0' /></td></tr>";
	str+="<tr><td><img src='images/left_top_img.gif' width='160' height='4' alt='' border='0' /></td></tr>";
	str+="<tr><td class='left_content_bg'><b>Country</b>";
	str+="<div class='combox_pad'>";
	str+="<select class='cmbbox'>";
	str+="<option>please select</option>";
	str+="</select>";
	str+="</div>";  
	str+="<b>Development</b>";
	str+="<div class='combox_pad'>";
	str+="<select class='cmbbox'>";
	str+="<option>search all</option>";
	str+="</select>";
	str+="</div>";
	str+="<div class='left_btnpad'><img src='images/btn_find_development.gif' width='150' height='20' alt='Find Development' border='0' /></div>";	 	   
	str+="</td></tr>";
	str+="<tr><td><img src='images/left_bottom_img.gif' width='160' height='3' alt='' border='0' /></td></tr>";
	str+="<tr><td><img src='images/btn_property_reference.gif' width='160' height='28' alt='Property Reference' border='0' /></td></tr>";
	str+="<tr><td><img src='images/left_top_img.gif' width='160' height='4' alt='' border='0' /></td></tr>";
	str+="<tr><td class='left_content_bg'><b>Reference code</b>";
	str+="<div class='combox_pad'><input type='text' class='txtbox' value='i.e. M0001' name='i.e. M0001' /></div>";
	str+="<div class='left_btnpad'><img src='images/btn_find_property.gif' width='150' height='20' alt='Find Property' border='0' /></div>";
	str+="</td></tr>";
	str+="<tr><td class='bottom_border'><img src='images/left_bottom_img.gif' width='160' height='3' alt='' border='0' /></td></tr>";
	str+="<tr><td class='left_flash_bg'></td></tr>";
	str+="<tr><td height='4'></td></tr>";
	//str+="<tr><td class='left_flash_bg'></td></tr>";
	//str+="<tr><td height='4'></td></tr>";
	str+="</table>";
	str+="</td>";
	str+="<td width='4'></td>";
	document.write(str);
}

function fnRight_content(argpage)
{
	var str="";
	str+="<td valign='top' width='207'>";
	str+="<table cellpadding='0' cellspacing='0' border='0' width='207'>";
	str+="<tr><td><img src='images/index_right_img.jpg' width='207' height='88' alt='' border='0' /></td></tr>";
	str+="<tr><td valign='top'><img src='images/title_property_spain.gif' width='207' height='27' alt='Property in spain' border='0' /></td></tr>";
	str+="<tr><td class='right_contpad'>";
	str+="Culture and beaches for a relaxing life in the sun. Hot properties added daily. Click here for more great deals from Marben Real Estate.";
	str+="<ul class='bullet1'>";
	str+="<li><a href='#' class='mainlink'>Visit Spanish property Website</a></li>";
	str+="</ul>";
	str+="</td></tr>";
	str+="<tr><td><img src='images/featured_img.jpg' width='207' height='165' alt='Featured Property' border='0' /></td></tr>";
	str+="<tr><td><img src='images/title_mar_spain.gif' width='207' height='27' alt='Mar Menor Spain' border='0' /></td></tr>";
	str+="<tr><td class='right_contpad'>";
	str+="Offering a selection of 2 and 3 bedroom apartments and townhouses and front-line villas with 2, 3 and 4 bedrooms, the resort caters for everyone. The high quality specifications ensure the properties match the quality of the golf course and amenities.</div>";
	str+="<ul class='bullet1'>";
	str+="<li><a href='#' class='mainlink'>Visit Spanish property Website</a></li>";
	str+="</ul>";
	str+="</td></tr>";
	/*str+="<tr><td><img src='images/title_enquiry.gif' width='207' height='33' alt='Make a Enquiry' border='0' /></td></tr>";
	str+="<tr><td class='right_contpad'>";
	str+="Complete your details below and our Customer Services team will call you back at a convenient time for you.";
	str+="</td></tr>";
	str+="<tr><td class='form_pad'>";
	str+="<form name='enquiryFrm' onSubmit='submitEnquiry();'>";
	if(argpage=='doubleflash')
	str+="<table cellpadding='0' cellspacing='0' border='0' height='152'>";
	else
	str+="<table cellpadding='0' cellspacing='0' border='0' height='166'>";
	str+="<tr><td>Name</td></tr>";
	str+="<tr><td><input type='text' name='name' class='txtbox1'/></td></tr>";
	str+="<tr><td>Telephone</td></tr>";
	str+="<tr><td><input type='text' class='txtbox1'/></td></tr>";
	str+="<tr><td>Email</td></tr>";
	str+="<tr><td><input type='text' name='email' class='txtbox1'/></td></tr>";
	str+="<tr><td>Nature of your enquiry</td></tr>";
	str+="<tr><td>";
	str+="<select class='cmbbox1' name='enquiry_nature'>";
	str+="<option value=''>please select</option>";
	str+="<option value='Agent'>Agent</option>";
	str+="<option value='Country Specific'>Country Specific</option>";
	str+="<option value='Developer'>Developer</option>";
	str+="<option value='Finance Enquiry'>Finance Enquiry</option>";
	str+="<option value='General Advice'>General Advice</option>";
	str+="<option value='Partner Enquiry'>Partner Enquiry</option>";
	str+="<option value='Other'>Other</option>";
	str+="</select>";
	str+="</td></tr>";
	str+="<tr><td>Comments</td></tr>";
	str+="<tr><td><text area  name='comment' class='txtarea1'> </textarea></td></tr>";
	str+="</table></form>";
	str+="</td></tr>";
	str+="<tr><td height='30'> &nbsp; <input type='checkbox' name='Join' />Join our mailing list</td></tr>";
	str+="<tr><td><input type='image' src='images/btn_submit_enquiry.gif' width='207' height='25' alt='' border='0' /></td></tr>";*/
	str+="</table>";
	str+="</td>";
	document.write(str);
}

function fnCopy()
{
	var str="";
	str+="<tr><td colspan='3'><img src='images/copy_bg.gif' width='425' height='2' border='0' /></td></tr>";
	str+="<tr><td colspan='3' class='copy_pad'>© Copyright 2007 Marben International (a Marben Real Estate company)</td></tr>";
	str+="<tr><td colspan='3' height='7'></td></tr>";
	document.write(str);
}


function fnBottom()
{
	var str="";
	str+="<tr><td height='4' colspan='3'></td></tr>";
	str+="<tr>";
	str+="<td><img src='images/bottom_logo.gif' width='165' height='61' alt='Marben International' border='0' /></td>";
	str+="<td width='5'></td>";
	str+="<td class='footer_bg'>Marben Real Estate S.L, PO Box 43, Las Sabinas 8, La Manga Club, 30385 Los Belones, Cartagena, Murcia, Spain | <br />International (0034) 968 175 174 | United Kingdom (0044) 207 193 7400 | Fax (0034) 968 175 174 | Email <a href='mailto:info@marbenrealestate.com' class='mail_link'>info@marbenrealestate.com</a></td>";
	str+="</tr>";
	str+="<tr><td colspan='3' class='txtsoquo'>Design by SoQuo<br /><br /></td></tr>";
	
	document.write(str);
}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function submitEnquiry() {	
	var url = 'actions.php';
	var params = 'action=submitEnquiry&name='+document.enquiryFrm.name.value+'&email='+document.enquiryFrm.email.value+'&join_newsletter='+document.enquiryFrm.join_newsletter.value+'&enquiry_nature='+document.enquiryFrm.enquiry_nature.options[document.enquiryFrm.enquiry_nature.selectedIndex].value+'&date='+(new Date().getTime())+'&telephone='+document.enquiryFrm.telephone.value+'&comment='+document.enquiryFrm.comment.value;
	if(document.enquiryFrm.join_newsletter.checked) params += '&join_newsletter=1';
	if(isNull(document.enquiryFrm.name,'Name')) return false
	if(isNull(document.enquiryFrm.telephone,'Telephone')) return false
	if(isNull(document.enquiryFrm.email,'Email')) return false
	if(notEmail(document.enquiryFrm.email,'Email')) return false
	if(notSelected(document.enquiryFrm.enquiry_nature,'Nature of your enquiry')) return false
	if(isNull(document.enquiryFrm.comment,'Comments')) return false
	 
	
	//document.enquiryFrm.buttonSbt.disabled=true;
	var myAjax = new Ajax.Request(
			url, 
			{
				method: 'get', 
				parameters: params, 
				onComplete: checkCountryExistsResponse
			});
	return false
}
function checkCountryExistsResponse(originalRequest) {
	//	alert(originalRequest.responseText);
		if(document.enquiryFrm.join_newsletter.checked) params += '&join_newsletter=1';
		document.enquiryFrm.name.value='';
		document.enquiryFrm.telephone.value='';
		document.enquiryFrm.email.value='';
		document.enquiryFrm.enquiry_nature.selectedIndex=0;
		document.enquiryFrm.comment.value='';
		document.enquiryFrm.join_newsletter.checked=false
	   //if(notSelected(document.enquiryFrm.enquiry_nature,'Nature of your enquiry')) return false	   
   		window.location.href="thanks.php";
		return false;

}

