
// This function is used for the Suckerfish (flyout) menus

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

if (!document.getElementById)
    document.getElementById = function() { return null; }

function initializeMenu(menuId, actuatorId) {
    var menu = document.getElementById(menuId);
    var actuator = document.getElementById(actuatorId);

    if (menu == null || actuator == null) return;

    //if (window.opera) return; // I'm too tired

   actuator.parentNode.style.background = "url(img/arrow-down-sm.gif) 90% 10px no-repeat";
    actuator.onclick = function() {
        var display = menu.style.display;
        this.parentNode.style.background =
            (display == "block") ? "url(img/arrow-down-sm.gif) 90% 10px no-repeat" : "url(../img/arrow-up-sm.gif) 90% 10px no-repeat";
        menu.style.background = "url(img/square.gif)";
        menu.style.display = (display == "block") ? "none" : "block";

        return false;
    }
}


// Preload images

function Preload() {
 	var args = simplePreload.arguments;
	document.imageArray = new Array(args.length);
	for(var i=0; i<args.length; i++) {
		document.imageArray[i] = new Image;
		document.imageArray[i].src = args[i];
	}
   }

//Dreamweaver Functions
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->


//open window

    function validate(frm_det){
        if (frm_det.frm_name.value == ""){
            alert("Plese enter your name");
            frm_det.frm_name.focus();
            return false;
        }   
        if (frm_det.frm_email.value == ""){
            alert("Plese enter your email id");
            frm_det.frm_email.focus();
            return false;
        }   
        return true;
    }
    
    function openWin(windowURL){ 
        return window.open(windowURL,'poll','toolbar=0,location=0,status=1,menubar=0,scrollbars=1,resizable=1,width=700,height=530');
    }
	
	    function openWinP(windowURL){ 
        return window.open(windowURL,'poll','toolbar=0,location=0,status=1,menubar=0,scrollbars=1,resizable=1,width=700,height=530');
    }

    function eliminate(ids)
    {
                
        document.frm_req.action = "email_listing.asp";
        document.frm_req.innerHTML = document.frm_req.innerHTML + "<input type=hidden name=id value='" + ids +"'>";
        document.frm_req.submit();
    }
    function eliminate1(ids){
    document.frm_req.action = 'request_showing.asp';
    document.frm_req.innerHTML = document.frm_req.innerHTML + "<input type=hidden name=id value='" + ids +"'>";
    document.frm_req.submit();
    }
	
	function validate(frm_det){
	if (frm_det.frm_name.value == ""){
			alert("Plese enter your name");
			frm_det.frm_name.focus();
			return false;
		}	
		if (frm_det.frm_email.value == ""){
			alert("Plese enter your email id");
			frm_det.frm_email.focus();
			return false;
		}	
		else{
			var retval=emailCheck(frm_det.frm_email.value)
			if (retval == false){
				frm_det.frm_email.focus();
				return false;
			}
		}
	}
	function showCal(dob, dte){
		showCalendar(dob, dte);
	}	
	function eliminate(){
		
	}
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}



//property detail form validation

     function echeck(str) {

    var at="@"
    var dot="."
    var lat=str.indexOf(at)
    var lstr=str.length
    var ldot=str.indexOf(dot)
    if (str.indexOf(at)==-1){
       alert("Email Not Valid")
       return false
    }

    if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
       alert("Email Not Valid")
       return false
    }

    if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
        alert("Email Not Valid")
        return false
    }

     if (str.indexOf(at,(lat+1))!=-1){
        alert("Email Not Valid")
        return false
     }

     if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
        alert("Email Not Valid")
        return false
     }

     if (str.indexOf(dot,(lat+2))==-1){
        alert("Email Not Valid")
        return false
     }
    
     if (str.indexOf(" ")!=-1){
        alert("Email Not Valid")
        return false
     }

      return true          
  }

    function validate(frm_det){
        if (frm_det.frm_name.value == ""){
            alert("Plese enter your name");
            frm_det.frm_name.focus();
            return false;
        }   
        if (frm_det.frm_email.value == ""){
            alert("Plese enter your email id");
            frm_det.frm_email.focus();
            return false;
        }

          if(frm_det.frm_email.value != ""  )
  {
  
  var emailID=frm_det.frm_email;

  if (echeck(emailID.value)==false){
    emailID.value="";
    emailID.focus();
    return false;
  }


  } 
        return true;
    }
    
    function openWin(windowURL){ 
        return window.open(windowURL,'poll','toolbar=1,location=0,status=1,menubar=0,scrollbars=1,resizable=1,width=640,height=400');
    }
    function eliminate(ids)
    {
                
        document.frm_req.action = "email_listing.asp";
        document.frm_req.innerHTML = document.frm_req.innerHTML + "<input type=hidden name=id value='" + ids +"'>";
        document.frm_req.submit();
    }
    function eliminate1(ids){
    document.frm_req.action = 'request_showing.asp';
    document.frm_req.innerHTML = document.frm_req.innerHTML + "<input type=hidden name=id value='" + ids +"'>";
    document.frm_req.submit();
    }
	
	
	
	
		
	<!-- Begin Validate Form
function vform (form) 
    {
          if (form.name.value == "" ) { alert( "Please enter your name." );
        form.name.focus();
        return false; }
        if (form.address.value == "" ) { alert( "Please enter your mailing address." );
        form.address.focus();
        return false; }

    // ** End checkform **
    return true;
    }