/***********************************************
* jQuery functions execute
***********************************************/

$(document).ready(function() {                
              
	/*cmx form */

	if(jQuery.browser.mozilla) {
		$('form.cmxform').hide().find('label:not(.nocmx)').each(function(){
                          	var $labelContent = $(this).html();
                                       var $labelWidth = $(this).css('width');
                                       $(this).empty();
                                       $(this).append('<span style="display: block; width: '+$labelWidth+';">');
                                       $(this).prepend('</span>');
                                       $(this).css('display', '-moz-inline-box');
                                       $(this).find('span').html($labelContent);
                                       $('form.cmxform').show();
                                });
                };             


	/*external link*/
	$('a[@rel$="external"]').click(function(){this.target = "_blank";});


	/*set hover class for anything*/
	$('form.cmxform input.send').hover(function() {$(this).addClass('sendhover');}, function() {$(this).removeClass('sendhover');});
	/* horizontal dropdown IE fix */
	$("ul#nav li").hover(function() {$(this).addClass("over");},function() {$(this).removeClass("over");});
		
	/*hide and show single items*/
	$('ul.product_range li> ul').hide();
	$('ul.product_range li> a').click(function() {
	$(this).next('ul').slideToggle('fast')
	.parent().siblings('li').find('ul:visible').slideUp('fast');
  });

		
});

/***********************************************
* Safe email links
***********************************************/

function hideEmail() {
	var s1 = "hecsfire";
			var s2 = "@";
			var s3 = "bigpond.com";
			var s4 = "?Subject=Enquiry%20from%20Hecs%20Fire%20Website";
			var s5 = s1 + s2 + s3;
			document.write("<a href=" + "mail" + "to:" + s1 + s2 + s3 + s4 + ">" + s5 + "</a>");
}

function hideEmail1() {
	var s1 = "hecsfire";
			var s2 = "@";
			var s3 = "bigpond.com";
			var s4 = "?Subject=Enquiry%20from%20Hecs%20Fire%20Website";
			var s5 = "Email Us";
			document.write("<a href=" + "mail" + "to:" + s1 + s2 + s3 + s4 + ">" + s5 + "</a>");
}

 