/*
--------------------------------------------------
Kendle Bell Common Javascript Functions
Last revised 2010/07/19 by ajcolburn@sur.co.uk
--------------------------------------------------
*/

$(document).ready(function() {
 
 	// video presentation
 
 	$("#home_video").colorbox({iframe:true, opacity:0.4, innerWidth:605, innerHeight:364});
 	
 	// breadcrumb generate
	
	$.post('/_ajax/breadcrumb.php', function(data) {
  		$('.breadcrumb').html(data);
	});
	
	// quick contact validation
	
	$('#quick_contact .button').attr('onclick', '');
	
	$('#quick_contact .button').bind('click', quick_contact_validate);
	
	function quick_contact_validate(){
	
		if($('#quick_contact_name').val() == '' || $('#quick_contact_email').val() == ''){
		
			alert('Please enter your name and email address.');
			
			return false;
		
		}else{
		
			$('#quick_contact').submit();
		
		}
	
	}
	
	// quick callback link
	
	$("#telephone a.button").attr('href','http://ivr.encoded.co.uk/public/customers/intouch/surfer/InTouch.jsp?id=3895');

 	$("#telephone a.button").colorbox({iframe:true, opacity:0.4, innerWidth:655, innerHeight:450});
 	
 	if($('#news_content').length > 0){ 	
 		$.get('/news/index.php?view=summary', function(data) {
  			$('#news_content').html(data);
		});
	}
 	
 	// remove skype plugin
 	
 	window.setTimeout(function() {
		$('.skype_pnh_container').html('');
		$('.skype_pnh_print_container').removeClass('skype_pnh_print_container');
	}, 800);
	
	
});
