jQuery(document).ready(function(){
    Cufon.replace('#content h1, #top-text .inner li p, #navigation li a, #navigation label, #sidebar h2, #address, #content h2.rss-title, #follow-us p', {
        fontFamily: 'Akzidenz'
    });
    
    jQuery.support.borderRadius = false;
    jQuery.each(['BorderRadius','MozBorderRadius','WebkitBorderRadius'], function() {
        if(document.body.style[this] !== undefined) jQuery.support.borderRadius = true;
        return (!jQuery.support.borderRadius);
    });

    if ( jQuery.support.borderRadius == false ) {
        jQuery('#top-text .inner').corner('cc:#97BF0D right bl');
        jQuery('#top-text .inner').corner('cc:#6A1873 tl');
        jQuery('#navigation').corner('cc:#97BF0D all');
        jQuery('#sidebar').corner('cc:#8EB40C top');
        jQuery('#sidebar').corner('cc:#e7e7e7 bottom');
        jQuery('#follow-us').corner('cc:#313131 all');
        jQuery('.info').corner('cc:#e7e7e7 keep');
    }

    jQuery(".more a").colorbox({width:"800px", inline:true, href:"#read-more"});
    
    jQuery('#form-slide').click(function(){
        if (jQuery('#form-wrap').not('visible')) {
            jQuery('#form-wrap').slideDown('slow');
        }
    });

    jQuery("ul.gallery li:nth-child(3n)").addClass("no-margin");
    jQuery("#latest-news .quote:odd").addClass("odd");
    jQuery("li.entry:odd").addClass("odd");
    jQuery(".entry").click(function(){
    	window.location = $(this).attr("url");
    	return false;
    });

    jQuery("a[rel='thickbox']").colorbox({iframe:true, innerWidth:425, innerHeight:344});

    jQuery("#top-text ul").cycle({
        timeout:       4000,
        speed:         1000
    });
    jQuery("#header-top ul").cycle({
        timeout:       4000,
        speed:         1000
    });
    jQuery("a[rel='external']").attr('target','_blank');
    
    $('#content form').validate({
        rules: {
            description: "required",
            name: "required",
            email: {
                required:   true,
                email:      true
            },
            "town[]": "required"
        },
        messages: {
            description: "Please enter your message",
            name: "Please enter your name",
            email: {
                required: "Please enter your email",
                email:"Please enter your valid email"
            },
            "town[]": "Please tick any town"
        },
        errorElement: "span"
    });

    
    
    
});

