document.getElementsByTagName('html')[0].className += ' js';

//IE png fix with background-repeat and background-position
document.write('<!--[if IE 6]><script type="text/javascript">DD_belatedPNG.fix(\'div, span, a\');</script><![endif]-->');

(function($){
    $(document).ready(function(){
        $('#slideshow').cycle({
            timeout: 5000
        });
        
        $('#slideshow').toggle(
			function(){
	            $(this).cycle('pause');
	        }, 
			function(){
	            $(this).cycle('resume', true);
	        }
		);
        
        
        $("#contactForm").validate({
            rules: {
                name: "required",
                phone: "required",
                email: {
                    required: true,
                    email: true
                },
                enquiry: "required"
            }
        
        });
    })
})(jQuery);


Cufon.replace(['h1', 'h2', 'h3', 'h4', 'h5', 'h6']);

function externalLinks(){
    if (!document.getElementsByTagName) 
        return;
    var anchors = document.getElementsByTagName("a");
    for (var i = 0; i < anchors.length; i++) {
        var anchor = anchors[i];
        if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
            anchor.target = "_blank";
        }
    }
};
window.onload = externalLinks;
