$(function(){
	$("#our-portfolio .gallery a").lightBox();
	$("#about-us,#our-portfolio,#contact-us").hide();
	$("#google-map,.info,#our-portfolio").corner();
	$('#footer').corner({
		tl: { radius: 0 },
		tr: { radius: 0 },
		bl: { radius: 6 },
		br: { radius: 6 }
	});
	
	$("#back").click(function(){
		$("#about-us").hide();
		$("#our-portfolio").hide();
		$("#contact-us").hide();
		$("#home").fadeIn();
	});
	
	$("#about").click(function(){
		$("#home").hide();
		$("#our-portfolio").hide();
		$("#contact-us").hide();
		$("#about-us").fadeIn();
	});
	
	$("#portfolio").click(function(){
		$("#home").hide();
		$("#about-us").hide();
		$("#contact-us").hide();
		$("#our-portfolio").fadeIn();
	});
	
	$("#contact").click(function(){
		$("#home").hide();
		$("#about-us").hide();
		$("#our-portfolio").hide();
		$("#thank-you").hide();
		$("form").fadeIn();
		$("#contact-us").fadeIn();
		$("form input[type='text'],form textarea").val("");
		$("#name").css("border","3px solid #393").css("background","#fff");
		$("#email").css("border","3px solid #393").css("background","#fff");
		$("#number").css("border","3px solid #393").css("background","#fff");
		$("#message").css("border","3px solid #393").css("background","#fff");
	});
	
	$("#sendmail").ajaxForm(function() {
		if (($("#name").val()=="")|($("#email").val()=="")|($("#number").val()=="")|($("#message").val()=="")) {
			if ($("#name").val()=="") {
			$("#name").css("border","3px solid #f00").css("background","#fcc");
			}
			if ($("#email").val()=="") {
			$("#email").css("border","3px solid #f00").css("background","#fcc");
			}
			if ($("#number").val()=="") {
			$("#number").css("border","3px solid #f00").css("background","#fcc");
			}
			if ($("#message").val()=="") {
			$("#message").css("border","3px solid #f00").css("background","#fcc");
			}
		} else {
			$("form").hide();
			$("#thank-you").fadeIn();
		}
	});
	
	$("#name,#email,#number,#message").blur(function() {
		if ($(this).val()!="") {
			$(this).css("border","3px solid #393").css("background","#fff");
		}
	}).keypress(function() {
		if ($(this).val()!="") {
			$(this).css("border","3px solid #393").css("background","#fff");
		}
	});
});

function load() {
    if (GBrowserIsCompatible()) {

        var map = new GMap2(document.getElementById("map"));
        map.setCenter(new GLatLng(53.287166,-3.02536), 9);
    }
    
    var blueIcon = new GIcon(G_DEFAULT_ICON);
    blueIcon.image = "images/map-overlay.png";
    blueIcon.shadow = "";
    blueIcon.iconSize = new GSize(128,128);
    markerOptions = { icon:blueIcon };
    var point = new GLatLng(53.35022084201148,-3.207294921875);
    map.addOverlay(new GMarker(point, markerOptions));

}