function validate_required(field,alerttxt)
{
with (field)
  {
  if (value==null||value=="")
    {
    alert(alerttxt, "Lebogroup.com");return false;
    }
  else
    {
    return true;
    }
  }
}

function validate_form(thisform) {
    with (thisform) {
        if (validate_required(name,"Name must be filled out!")==false) {
            name.focus();
            return false;
        }
        
        if (validate_required(phone,"Phone must be filled out!")==false) {
            phone.focus();
            return false;
        }
        
        if (validate_required(email,"Email must be filled out!")==false) {
            email.focus();
            return false;
        }
        
        SetURL(thisform);
    }
}

function SetURL(thisform) {
    with (thisform) {
        url.value = GetURL();
    }
}

function GetURL()
{
    var url = location.href;
    var DocName =(url.substring(url.lastIndexOf("\\")+1,url.length)) // for windows 
    var DocName =(url.substring(url.lastIndexOf("\/")+1,url.length)) // for *nix 
    
    return DocName;
}

function GetPageTitle()
{
    var title = document.title;
    title = title.replace("Overview", "");
    return title.replace("The Lebo Group - ", "")
}

function GetPageTitle2()
{
    var title = document.title;
    return title.replace("The Lebo Group - ", "")
}


function NavaigateToSearch()
{
    window.location.href = "../\../\search.aspx?property=" + GetPageTitle2();
}
