﻿function GetFlash()
{
    document.write('This gallery uses Flash. To view, please upgrade your Flash plugin by clicking this <a href="http://www.macromedia.com/go/getflash/">link</a><br/><br/>');
    document.write('<img src="images/0907_1.jpg" height="500" alt="Bespoke chiffon and crepe bridal gown" style="border:solid 10px black;"/>');
}

function ValidateForm() 
{
    var okSoFar=true
    with (document.phpformmailer)
    {
        if (name.value=="" && okSoFar)
        {
            okSoFar=false
            alert("Please enter your name.")
            thesubject.focus()
        }
        
        if (email.value=="" && telephone.value=="" && okSoFar)
        {
            okSoFar = false
            alert ("Please enter a valid email address or a telephone number.")
            email.focus()
        }

        if (email.value!="" && okSoFar)
        {
            var foundAt = email.value.indexOf("@",0)
            if (foundAt < 1 && okSoFar)
            {
                okSoFar = false
                alert ("Please enter a valid email address.")
                email.focus()
            }
            var e1 = email.value
            var e2 = email2.value
            if (!(e1==e2) && okSoFar)
            {
                okSoFar = false
                alert ("Email addresses you entered do not match.  Please re-enter the confirmation email address.")
                email.focus()
            }
        }

        if (thesubject.value=="" && okSoFar)
        {
            okSoFar=false
            alert("Please enter the subject.")
            thesubject.focus()
        }
        if (themessage.value=="" && okSoFar)
        {
            okSoFar=false
            alert("Please enter the details for your enquiry.")
            themessage.focus()
        }
        
         if (reference.value=="" && okSoFar)
        {
            okSoFar=false
            alert("Please enter how you heard about The Bridal House.")
            reference.focus()
        }

        if (okSoFar==true)  
        {
            return true;
        }
    }
    
    return false;
}

function load() 
{
  var mapDiv = document.getElementById('map');
  mapDiv.style.visibility = 'visible';
  mapDiv.style.width = '500px'; 
  mapDiv.style.height = '400px';
  
  if (GBrowserIsCompatible()) 
  {
    var map = new GMap2(document.getElementById("map"));
    var point = new GLatLng(53.36853060388083, -1.4980030059814453);

    map.setCenter(point, 15);
    map.addControl(new GSmallMapControl());
    map.addControl(new GMapTypeControl());
    map.setMapType(G_NORMAL_MAP);

    var marker = new GMarker(point);
    //var html = "The Bridal House";
    //GEvent.addListener(marker, 'click', function() { marker.openInfoWindowHtml(html); });

    map.addOverlay(marker);

    //marker.openInfoWindowHtml(html);
  }
}

function initialize() 
{

    var mapDiv = document.getElementById('map_canvas');
    mapDiv.style.visibility = 'visible';
    mapDiv.style.width = '500px';
    mapDiv.style.height = '400px';

    var myLatlng = new google.maps.LatLng(53.36853060388083, -1.4980030059814453);
    var myOptions = {
        zoom: 15,
        center: myLatlng,
        mapTypeId: google.maps.MapTypeId.ROADMAP
    }
    var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

    var marker = new google.maps.Marker({
        position: myLatlng,
        map: map,
        title: "The Bridal House"
    });   
}
    
function LoadEnquiry()
{
    document.getElementById('enquiryDiv').style.visibility = 'visible';
}


