/***********************************************
* 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*/

		$('.bor').hover(function() {$(this).addClass('hovered');}, function() {$(this).removeClass('hovered');});
		$('input.send').hover(function() {$(this).addClass('inputhover');}, function() {$(this).removeClass('inputhover');});
		$('input.send1').hover(function() {$(this).addClass('inputhover');}, function() {$(this).removeClass('inputhover');});
		$('form.form input.send').hover(function() {$(this).addClass('sendhover');}, function() {$(this).removeClass('sendhover');});
		$('ul.listings li').hover(function() {$(this).addClass('blockhover');}, function() {$(this).removeClass('blockhover');});
		$('a.compare').hover(function() {$(this).addClass('comparehover');}, function() {$(this).removeClass('comparehover');});

});


/*simple show + hide*/

      $(document).ready(function() {
			  $('div.unsubscribe').hide();
		
        $('a.unsub').click(function() {
          $('div.unsubscribe').toggle(400);
          return false;
        });
      });

/* zoom effect */

$(document).ready(function(){
	$("a.zoomlink").click(function(){return false});

	$("img.jqzoom").jqueryzoom({
		xzoom: 300, 
		yzoom: 300,
		offset: 10, 
		position: "left"
	});
});


/***********************************************
* Safe email links
***********************************************/

function hideEmail() {
	var s1 = "info";
			var s2 = "@";
			var s3 = "gorgeousgems.com.au";
			var s4 = "?Subject=Enquiry%20from%20" + s3;
			var s5 = s1 + s2 + s3;
			document.write("<a href=" + "mail" + "to:" + s1 + s2 + s3 + s4 + ">" + s5 + "</a>");
}
