$(document).ready(function() {
	$("#nl_submit").click(function(event){
		   $.ajax({
			   type: "POST",
			   url: "ajaxtpl/nl_subscriber.php",
			   data: "news_name="+$("#news_name").val()+"&news_email="+$("#news_email").val(),
			   success: function(msg){
			   $("#news_name").val("");
			   $("#news_email").val("");
				 alert( "" + msg );
			   }
			 });
		 });
	$("#post_blog").click(function(event){
		   $.ajax({
			   type: "POST",
			   url: "ajaxtpl/post_blogs.php",
			   data: "name="+$("#name").val()+"&email="+$("#email").val()+"&comment="+$("#comment").val()+"&rano="+$("#rano").val(),
			   success: function(msg){
					if(msg == 'Your blog has been posted successfully.'){
					$("#name").val("");
					$("#email").val("");
					$("#comment").val("");
					}
			   $("#rano").val("");
				 alert( "" + msg );
			   }
			 });
		 });
		 	$("#comment").keyup(function(event){
			if($("#comment").val().length > 100)
			{
			$("#comment").val($("#comment").val().substring(0, 100));
			}
		   else
		   {
		   var length_str = 100-$("#comment").val().length; 
		   if(length_str == 0)
		   $("#char").html("0");
		   else
		   $("#char").html(length_str);
		   }
		 });
		 $("a.video_testimonials").fancybox({ 'hideOnContentClick': false, 'frameWidth': 520, 'frameHeight': 375, 'callbackOnShow': loadLargeTestimonial, 'callbackOnClose': unloadLargeTestimonial });
});
function popitup(url) 
	{var newwindow = '';
		if (newwindow.location && !newwindow.closed) 
		{ newwindow.location.href = url; newwindow.focus(); } 
		else 
		{ newwindow=window.open(url,'call_now','menubar=0,resizable=0,location=0,status=0,scrollbars=0,width=606,height=440') ; }
	}
function full_screen() {
	   $("a.video_testimonials").click();
	}
/*function loadLargeTestimonial(){
	var soTestimonial = new SWFObject("tv/flash/tv_ad.swf", "large_testimonial_video", "512", "288", "9", "");
	soTestimonial.addParam("allowFullScreen","true");	
	soTestimonial.addParam("allowScriptAccess","sameDomain");
	soTestimonial.addParam("wmode","transparent");
	soTestimonial.addParam('FlashVars','var_tvad_path=http://www.exa.com.au/tv/flash/hi_res.flv&var_tvad_skin=http://www.exa.com.au/tv/flash/ArcticOverAll.swf');	
	soTestimonial.write("large_testimonial_video");
}

function unloadLargeTestimonial(){
$('#large_testimonial_video').html("");
}*/