window.status="Area de Administracion";
function showorhide(id)
{
   alert(document.getElementById(id));
   if(document.getElementById(id))
{    //check the element exists and can be accessed
       var ele = document.getElementById(id);    //get hold of the element
       if(ele.style.display=="none"){   //see if display property is set to none, show the box
           ele.style.display="block";       
       }else{
           ele.style.display="none";     
       }
   }
}
function popup(dir,left,top,w,h){
	window.open(dir,'','top='+top+',left='+left+',width='+w+',height='+h+',toolbar=0,resizable=0,location=0,status=0,menubar=0,scrollbars=0');
}
function reqschedule(inm,left,top,w,h){
	window.open('/listings/schedule.php?inm='+inm,'','top='+top+',left='+left+',width='+w+',height='+h+',toolbar=0,resizable=0,location=0,status=0,menubar=0,scrollbars=0');
}
function detailOffice(idOficina){
	window.location.href='/our_team/office/'+idOficina;
}

function additionalinfo(inm,left,top,w,h){
	window.open('/listings/additionalinfo.php?inm='+inm,'','top='+top+',left='+left+',width='+w+',height='+h+',toolbar=0,resizable=0,location=0,status=0,menubar=0,scrollbars=0');
}
function sendlisting(inm,listing,left,top,w,h){
	window.open('/listings/sendfriend.php?inm='+inm+'&url='+listing,'','top='+top+',left='+left+',width='+w+',height='+h+',toolbar=0,resizable=0,location=0,status=0,menubar=0,scrollbars=0');
}
function printflyer(id_inm,left,top,w,h,lang){
	if (lang=="en")
	window.open('/includes/printflyer.php?lang=en&id_inm='+id_inm,'','top='+top+',left='+left+',width='+w+',height='+h+',toolbar=0,resizable=0,location=0,status=1,menubar=0,scrollbars=1');
	if (lang=="es")
	window.open('/includes/printflyer.php?lang=es&id_inm='+id_inm,'','top='+top+',left='+left+',width='+w+',height='+h+',toolbar=0,resizable=0,location=0,status=1,menubar=0,scrollbars=1');
}
function validator(frm){	
	var minValue = frm.v_ivalor.options[frm.v_ivalor.selectedIndex].value;
	var maxValue = frm.v_fvalor.options[frm.v_fvalor.selectedIndex].value;
	
	if(minValue != '' && maxValue != '') {
		var minPrice = parseInt(minValue)
		var maxPrice = parseInt(maxValue)
		if(minPrice > maxPrice  &&  maxPrice > 0) {
			alert('Maximum price should be greater than minimum price.\n\nPlease correct this before continuing.');
			frm.v_ivalor.focus();
			return false;
		}
		else {
			if(minPrice == maxPrice  &&  maxPrice > 0) {
				return confirm('This will cause your search to find ONLY listings with a current list price of EXACTLY');
			}else{
			return true;
			}
		}
	}
}
function clicktext(){	
	document.frm_mlssearch.v_mls_num.focus();
    document.frm_mlssearch.v_mls_num.select(); 
}