/* navigation links */
function toggleLinks(id, holder) {
	$('#n'+id).slideToggle(300, function() {	
		if(holder.className == "area open") {
			$(holder).removeClass("open");
			$(holder).addClass("close");
		} else {
			$(holder).addClass("open");
			$(holder).removeClass("close");
		}
	});
}
<!--FLASH ROTATE-->

$(function() {
	if(document.getElementById('fl')) {
		document.getElementById('ftext').innerHTML = document.getElementById('fl').innerHTML;
		document.getElementById('fl').innerHTML = '';
		$('#fl').hide();
	}
});
$(document).ready(function() {	
	/*var flashvars = {};
	var params = {};
	params.play = "true";
	params.wmode = "transparent";
	var attributes = {};
	swfobject.embedSWF("flash/flash.swf", "image-cycle", "720", "440", "9.0.0", false, flashvars, params, attributes);*/
});
<!--  JCYCLE -->

function showNewText() {
	$('#ftext').slideDown(500);
	$('.ftextlink').html('<img src="images/down.png" alt="" border="0">');
}

$(document).ready(function() {
	$("a#inline").fancybox({
		'titlePosition'		: 'inside',
		'autoScale' :false,
		'scrolling' :false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'margin'			: '0',
		'padding'			: '0',
		'overlayColor'		: '#000000',
		'overlayOpacity'	: '0.4'
	});
	
	$('.formerror').hide();
	$('.success').hide();
	//Enquiry Form 1
	$("form#enquiry-form").submit(function() { 
	$('.success').hide();
	$('.formerror').hide();
     var name     = $('#name').attr('value');
	 if (name == " ") {
      $("label#enquiryform_error").show();
      $("input#name").focus();
      return false;
    }
	 var email     = $('#email').attr('value');  
	 $('.formerror').hide();
	 if (email == " ") {
      $("label#enquiryform_error").show();
      $("input#email").focus();
      return false;
    }
	var telephone  = $('#telephone').attr('value');
	 $('.formerror').hide();
	 if (telephone == " ") {
      $("label#enquiryform_error").show();
      $("input#telephone").focus();
      return false;
    }
     var enquirybox   = $('#enquirybox').attr('value');
	 $('.formerror').hide();
	 if (enquirybox == "") {
      $("label#enquiryform_error").show();
      $("input#enquirybox").focus();
      return false;
    }
	var robotest = $('#robotest').attr('value');
     $.ajax({  
     type: "POST",  
     url: "modules/sendenquiryajax.php",  
     data: "name="+ name+ "& telephone="+ telephone+ "& email="+ email+ "& enquirybox="+ enquirybox+ "& robotest="+ robotest,  
     success: function(){  
                /* $('.formerror').hide(function(){$('.success').fadeIn();});  
				 $(':input','#enquiry-form')
 				.not(':button, :submit, :reset, :hidden')
 				.val('')
 				.removeAttr('checked')
 				.removeAttr('selected');  */
				var url = "http://www.haughtondesign.co.uk/enquiry-submitted.php"; 
				$(location).attr('href',url); 
             }  
         });  
     return false;  
     }); 
	 $('.error').hide();

//Arrange a call back form
	$("form#callback").submit(function() { 
	$('.error').hide();
	$('.callbacksuccess').hide();
	 var name   = $('#callname').attr('value');
	 $('.error').hide();
	 if (name == " ") {
      $("label#callback_error").show();
      $("input#callname").focus();
      return false;
    }
	 var company   = $('#callcompany').attr('value');
	 $('.error').hide();
	 if (company == " ") {
      $("label#callback_error").show();
      $("input#callcompany").focus();
      return false;
    }
	var telephone   = $('#calltelephone').attr('value');
	 $('.error').hide();
	 if (telephone == " ") {
      $("label#callback_error").show();
      $("input#calltelephone").focus();
      return false;
    }
	 var email   = $('#callemail').attr('value');
	 $('.error').hide();
	 if (email == " ") {
      $("label#callback_error").show();
      $("input#callemail").focus();
      return false;
    }	
	 var reason   = $('#callreason').attr('value');
	 $('.error').hide();
	 if (reason == " ") {
      $("label#callback_error").show();
      $("input#callreason").focus();
      return false;
    }		
	var robotest = $('#robotest').attr('value');
	var callbackrequest = $('#callbackrequest').attr('value');
	//var time = $("input[@name='time']:checked").val();
     $.ajax({  
     type: "POST",  
     url: "modules/sendenquiryajax.php",   
     data: "callname="+ name+ "& callemail="+ email+ "& calltelephone="+ telephone+ "& robotest="+ robotest+ "& callbackrequest="+ callbackrequest+ "& company="+ company+ "& reason="+ reason,  
     success: function(){  
                 //$('form#callback').hide(function(){$('.callbacksuccess').fadeIn();});  
   				var url = "http://www.haughtondesign.co.uk/callback-submitted.php"; 
				$(location).attr('href',url);
             }  
         });  
     return false;  
	 
     });
});

(function ($) {
if (!$) return;
$.fn.extend({
    fixPNG: function(sizingMethod, forceBG) {
            if (!($.browser.msie)) return this;
            var emptyimg = "images/x.gif"; //Path to empty 1x1px GIF goes here
            sizingMethod = sizingMethod || "scale"; //sizingMethod, defaults to scale (matches image dimensions)
            this.each(function() {
                    var isImg = (forceBG) ? false : jQuery.nodeName(this, "img"),
                            imgname = (isImg) ? this.src : this.currentStyle.backgroundImage,
                            src = (isImg) ? imgname : imgname.substring(5,imgname.length-2);
                    this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "', sizingMethod='" + sizingMethod + "')";
                    if (isImg) this.src = emptyimg;
                    else this.style.backgroundImage = "url(" + emptyimg + ")";
            });
            return this;
    }
});
})(jQuery);




