$(document).ready(function(){
	
	/* jquery flash */
	if ($('#animation-1').length > 0 ){ // check if element is on page
		 jQuery('#animation-1').flash(
			{
				src: '/css/skins/default/flash/sc_anim_loading.swf', //sc_anim_v1.swf
				width: 500,
				height: 500,
				wmode:'transparent'
			},
			{ 
				version: 8,
				update: false //don't automatically show flash installation message if flash not detected, degrades gracefully.
			}
		)
	}//check
	
	
	/* jquery facebox */
	$('a[rel*=facebox]').facebox({
		loading_image : 'loading.gif'
    })	
	
	$('#close-fb a').livequery('click', function(event) { 
        jQuery(document).trigger('close.facebox'); 
        return false; 
    }); 
 

	if ($('#form-contact').length > 0 ){ // check if element is on page	
		//contact form
		$("#form-contact").livequery(function(){
			$(this).validate({
				rules: {
					txt_title: "required",
					txt_firstname: "required",
					txt_surname: "required",
					txa_address: "required",
					txt_postcode: "required",
					txt_tel: "required",
					txt_mobile: "required",
					txt_email: {
						required: true,
						email: true
					},
					txt_hearaboutscm: "required",
					txa_message: "required"
				},
				messages: {
					txt_title: "Please enter your title.",
					txt_firstname: "Please enter your firstname.",
					txt_surname: "Please enter your surname.",
					txa_address: "Please enter your address.",
					txt_postcode: "Please enter your postcode.",
					txt_tel: "Please enter your telephone number.",
					txt_mobile: "Please enter your mobile.",
					txt_email: "Please enter a valid email address.",
					txt_hearaboutscm: "Please enter where you heard about us.",
					txa_message: "Please enter your message."
				}
			});
		});
	 }//check


	/* EMBED MEDIA */
	if ($('a.media').length > 0 ){ // check if element is on page	
		$('a.media').media();
	}//check
	

});