﻿var path = '/www.digitalmechanics.com.au/';

// Shadowbox setup
if (typeof(Shadowbox) != "undefined") {
	Shadowbox.loadSkin("classic", path + "js/skin");
}

$(function() {

	// Initialise Shadowbox
	if (typeof (Shadowbox) != "undefined") {
		var options = {
			flvPlayer: path + "flash/flvplayer.swf",
			overlayOpacity: 0.7/*,
				onOpen: function(el) {
						$("#shadowbox #main_title").text('DM ' + el.gallery);
						}*/
		};
		Shadowbox.init(options);
	}

	if (window.print&&$("#n-email").length>0) {
		$("#n-email").before('<li id="n-print-page"><a href="#" title="Print this page">Print this page<\/a><\/li>');
		$("#n-print-page").click(function(){ window.print(); return false; });
	}
	if ($(".p-home #flash").length>0) {
		swfobject.embedSWF("flash/home-feature.swf", "flash", "921", "315", "9.0.0", "flash/expressInstall.swf");
	}
	var clearSearch = function(){
		var el = $("#search input[type='text']");
		var defaultText = "Search";
		el.focus(function(){
			if ($(this).val()==defaultText) { $(this).val(""); }
		});
		el.blur(function(){
			if ($(this).val()=="") { $(this).val(defaultText); }
		});
	} ();

});
