
jQuery(function($) {

$(".check-selection").each(function(i)
{

var inc = $(this);

$(this).find('a.no-check').click(function()
{

inc.replaceWith('<span class="crossed"><img src="/images/check_cross.gif" width="48" height="48" /></span>');

return false;

});

$(this).find('a.yes-check').click(function()
{

inc.replaceWith('<span class="ticked"><img src="/images/check_tick.gif" width="48" height="48" /></span>');

return false;

});

});

if($("#homecontact").length > 0)
{

$("#homecontact").validate({

tag: '.inputreq',
script: 'http://www.aushomes.com.au/design_enquiry_send.php'

});

}

$("#nav").lavaLamp({ fx: "backout", speed: 700 });
	
$("#page-container h1").each(function()
{

$(this).sifr({ font: "kozuka", path: "/fonts", color: "#e61a2e", textAlign: "left" }); 

});

$("#content-sidebar h1, #content-leftbar h1").each(function()
{

$(this).sifr({ font: "kozuka", path: "/fonts", color: "#37282b", textAlign: "left" }); 

});

if($('#display-map').length>0)
{

$('#display-map').each(function()
{

var address = $(this).text();

if(address.length>0)
{

$(this).html('<div id="id' + Math.floor(Math.random()*5) + '" class="location_map"></div>');

var dat = encodeURIComponent(address);

$.ajax({

type: "POST",
url: "http://www.aushomes.com.au/geo.php",
data: "loc=" + dat,
success: function(coord)
{

var coord_array = coord.split("::");

var latitude = coord_array[0];

var longitude = coord_array[1];

var latlon = [latitude,longitude];

    $('.location_map:last').jmap('init', {'mapType':'map','mapCenter':latlon,'mapZoom':16,'mapShowjMapsIcon':false});
	
	$('.location_map:last').jmap('AddMarker', {'pointLatLng':latlon},function(marker, options)
	{
	
	});

}

});

}

});


}

if($('#colourboard-help-container').length>0)
{

var height = $(window).height();
var width = $(document).width();

$("#colourboard-help").click(function()
{

$.blockUI({ 
																																																																									  message: $('#colourboard-help-container'),																																																																								  fadeIn: 700,																																																																								  fadeOut: 700,																																																																								  centerY: false,																																																																					  centerX: false,
																																																																												  css: {
                width: '600px',
                top: '50px',
				left: (width/2)-300+'px',
                top: (height/2)-200+'px',
				border: 'none',
                cursor: 'default'
		},
        
   overlayCSS:  { 
        backgroundColor: '#cccccc',
        cursor: 'default'
    }
																																																																												   });

return false;

});                                                                                                                                                                          
																																																																							
$('.close-modal').click(function()
								 {
									 $.unblockUI();
									 
									 $("#colourboard-help-container").hide();
									 
									 return false;
								 
								 });
                                 
}

});