function validate() {
	var email=document.contactUsForm.txtEmail.value;
	var surname=document.contactUsForm.txtSurname.value;

	if (email=="")
	{
		alert("- Please fill in all required fields.");
		return false;
	}
	else if (surname=="")
	{
		alert("- Please fill in all required fields.");
		return false;
	}
	else if (document.contactUsForm.txtFirstname.value=="")
	{
		alert("- Please fill in all required fields.");
		return false;
	}
	else if (document.contactUsForm.txtComments.value=="")
	{
		alern("- Please fill in all required fields.");
		return false;
	}
	else if (email.indexOf("@")==-1)
	{
		alert("- Invalid email address.");
		return false;
	}
	else
	{
		return true;
	}
}

function FlashRefinance() {
    var liveURL = "http://www.maximlending.com.au";
    var devURL = "http://edsites2.itechne.com/fsdev/maxim/";
    var flashPath = "flash/";
    var flashName = "refinance-with-maxim3.swf";
    var completeFlashPath = flashPath + flashName + "?domain="+liveURL;

    if(location.href.indexOf('fsdev2') > 0 ) 
    {
        flashPath = "flash/";
        completeFlashPath = flashPath + flashName + "?domain="+devURL;
    }
    // <![CDATA[	
							
		var fo = new FlashObject(completeFlashPath, "flashRefinance", "177", "180", "7", "#FFFFFF");
		fo.write("flashRefinance");
     // ]]>     
}

function FlashSubRefinance() {
    var liveURL = "http://www.maximlending.com.au";
    var devURL = "http://edsites2.itechne.com/fsdev/maxim/";
    var flashPath = "flash/";
    var flashName = "sub-refinance-maxim3.swf";
    var completeFlashPath = flashPath + flashName + "?domain=" + devURL;

    if(location.href.indexOf('fsdev2') > 0 ) 
    {
        completeFlashPath = flashPath + flashName + "?domain="+devURL;
    }
    // <![CDATA[	
							
		var fo = new FlashObject("http://edsites2.itechne.com/fsdev/maxim/flash/sub-refinance-maxim3.swf", "flashSubRefinance", "177", "121", "7", "#FFFFFF");
		fo.write("flashSubRefinance");
     // ]]>     
}    

function popup(id) {
        identity = document.getElementById(id);
        
	    if (id == "banner01") {
            document.getElementById("banner02").style.visibility = "hidden";
            identity.style.visibility = "visible";
        }
        else if (id == "banner02") {
            document.getElementById("banner01").style.visibility = "hidden";
            identity.style.visibility = "visible";
        }
}

function open_win(url_add)
{
   window.open(url_add,'calculator','width=640,height=350,menubar=no,status=no,location=no,toolbar=no,scrollbars=no');
}

function hoverEffect(id) {
    if (id == "firstHomeBuyer") {
        document.getElementById("firstHomeBuyer").style.backgroundImage = "url(images/home/bg-first-home-buyers-over.gif)";
    }
    else if (id == "investingInProperty") {
        document.getElementById("investingInProperty").style.backgroundImage = "url(images/home/bg-investing-over.gif)";
    }
    else if (id == "movingHouses") {
        document.getElementById("movingHouses").style.backgroundImage = "url(images/home/bg-refinancing-over.gif)";
    }
    else if (id == "selfEmployed") {
        document.getElementById("selfEmployed").style.backgroundImage = "url(images/home/bg-self-employed-over.gif)";
    }
}

function rollOut(id) {
    if (id == "firstHomeBuyer") {
        document.getElementById("firstHomeBuyer").style.backgroundImage = "url(images/home/bg-first-home-buyers.gif)";
    }
    else if (id == "investingInProperty") {
        document.getElementById("investingInProperty").style.backgroundImage = "url(images/home/bg-investing.gif)";
    }
    else if (id == "movingHouses") {
        document.getElementById("movingHouses").style.backgroundImage= "url(images/home/bg-refinancing.gif)";
    }
    else if (id == "selfEmployed") {
        document.getElementById("selfEmployed").style.backgroundImage= "url(images/home/bg-self-employed.gif)";
    }
}

function FlashIntro() {   

    var server= "http://" + location.hostname + "/";
    var flashPath = "flash/";   

    if(location.href.indexOf('localhost') > 0 )
    {
        flashPath = "maxim/flash/";
        virDirPath = "maxim/";
    }
    if(location.href.indexOf('fsdev') > 0 )
    {
        flashPath = "fsdev/maxim/flash/";
        virDirPath = "fsdev/maxim/";
    }
    if(location.href.indexOf('staging.freestylemedia.com.au') > 0 )
    {
        flashPath = "sanitarium/maxim/flash/";
    }   
    var completeFlashPath = "/" +flashPath+"flashIntro.swf";



	// <![CDATA[	
							
		var fo = new FlashObject(completeFlashPath, "flashIntro", "501", "180", "7", "#FFFFFF");
		fo.write("flastIntro");
	// ]]>

    
}