
var waktu=0;  
function kiri(){
document.getElementById('xdiv').scrollLeft = document.getElementById('xdiv').scrollLeft - 10;
waktu=setTimeout('kiri()',60);
}

function kanan(){
document.getElementById('xdiv').scrollLeft = document.getElementById('xdiv').scrollLeft + 10; 
waktu=setTimeout('kanan()',60);
}

function selesai() {
clearTimeout(waktu);
}

function hide_tabs(tb_id) {

if(tb_id == 'about'){
titel= "About Us";
} else if (tb_id == 'faq') {
titel= "FAQ ";
} else if (tb_id == 'founders') {
titel= "Founders ";
} else if (tb_id == 'mission') {
titel= "Mission Statement";
} else if (tb_id == 'story') {
titel= "Story of the Maasai";
}
//document.getElementById('page_title').innerHTML = titel;
}

   var J = jQuery.noConflict();
	
	  // When the document loads do everything inside here ...
	  J(document).ready(function(){
		
		// When a link is clicked
		J("a.tab").click(function () {
			
			
			// switch all tabs off
			J(".active").removeClass("active");
			
			// switch this tab on
			J(this).addClass("active");
			
			// slide all content up
			J(".content").slideUp();
			
			// slide this content up
			var content_show = J(this).attr("title");
			J("#"+content_show).slideDown();
		  
		});
	
	  });
	  
	  
	  
	  
function verifyContact()

{

   var filter = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,6})+$/;

   var msg = '';

  if ( document.getElementById('name').value == '')

   {

      document.getElementById('name').style.background = '#FFFFCC';

      msg += "\n * First and Last Name";

   }

    

   if ( document.getElementById('email').value == '' || !filter.test(document.getElementById('email').value) )

   {

      document.getElementById('email').style.background = '#FFFFCC';

      msg += "\n * Email";

   }

   if ( msg != '' ) {

      alert( "Please fill out the following required items:\n" + msg );

          return false;

   } else {
   
   document.getElementById('upload_div').style.display='block';
   //document.getElementById('upload_div').style.height = document.getElementById('hl_div').style.height + 'px';
   
     
   return true;
   }

}



J(document).ready(function(){

	J("#send_subs").submit(function (event) {
	
		event.preventDefault();
		var filter = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,6})+$/;
		announcements = J("#check1").attr('checked');
		updates = J("#check2").attr('checked');
		email = J("#email").attr('value');
		
		if ( email == '' || !filter.test(email) )

	   {
	
		  alert('please enter valid email address');
		  
	
	   } else {
		   
		   	J.get("add_subscriber.php",{email: email,announcements: announcements,updates: updates}, function(data){
		
				J("#subscribe").html(data);
			
			})
	   }
		
		
		
	
	})

})
