// Custom Jquery Codes
$(document).ready(function(){
	// Navigation Margin Fix
	$('.nav-main li:first-child').css("margin","0 20px 0 0px");
	// Home Video Listing Margin Fix
	$('.index-mid-plane ul li:last-child').css("margin-right","0px");
	$('ul.books li:nth-child(even)').css("margin-right","0px");
	
	$('ul.famous-speakers li:nth-child(even)').css("margin-right","0px");
	
	// Custom Tab
	$('ul#tab_ul li:last-child').css("background","none");
	$('.tab_box').hide();
	$($('#tab_ul li.active').find('a').attr('title')).show();
	$('#tab1').show();
	$('#tab_ul li').click(function() 
		{
			$('.tab_box').hide();		
			$('#tab_ul li a').removeClass('active');
			$($(this).find('a').attr('title')).show();
			$(this).find('a').addClass("active");	
	  });
	  
	  // Custom Side Tab
	$('ul#tab_ul_side li:last-child').css("background","none");
	$('.tab_box_side').hide();
	$($('#tab_ul_side li.active').find('a').attr('title')).show();
	$('#tab1').show();
	$('#tab_ul_side li').click(function() 
		{
			$('.tab_box_side').hide();		
			$('#tab_ul_side li a').removeClass('active');
			$($(this).find('a').attr('title')).show();
			$(this).find('a').addClass("active");	
	  });
	  
	
	// Banner Slider
	$('.banner-holder figure img.active').siblings().hide();
	$('#nav01').click(function(){
		$('.banner-holder nav ul').find('span').remove();
		$('.banner-holder nav ul li#nav01').append('<span></span>');
		$('.banner-holder figure img').removeClass('active');
		$('.banner-holder figure img#banner01').addClass('active');
		$('.banner-holder figure img#banner01').show();
		$('.banner-holder figure img.active').siblings().hide();
	});
	$('#nav02').click(function(){
		$('.banner-holder nav ul').find('span').remove();
		$('.banner-holder nav ul li#nav02').append('<span></span>');
		$('.banner-holder figure img').removeClass('active');
		$('.banner-holder figure img#banner02').addClass('active');
		$('.banner-holder figure img.active').siblings().hide();
		$('.banner-holder figure img#banner02').show();
		$('.banner-holder figure img.active').siblings().hide();
	});
	$('#nav03').click(function(){
		$('.banner-holder nav ul').find('span').remove();
		$('.banner-holder nav ul li#nav03').append('<span></span>');
		$('.banner-holder figure img').removeClass('active');
		$('.banner-holder figure img#banner03').addClass('active');
		$('.banner-holder figure img.active').siblings().hide();
		$('.banner-holder figure img#banner03').show();
		$('.banner-holder figure img.active').siblings().hide();
	});
	
	
	$('input[type="text"], textarea').addClass("idleField");
       		$('input[type="text"], textarea').focus(function() {  
			    jQuery(this).removeClass("idleField").addClass("focusField");			
    		    if (this.value == this.defaultValue){
    		    	this.value = '';
				}
				if(this.value != this.defaultValue){
	    			this.select();
	    		}
    		});
    		$('input[type="text"], textarea').blur(function() {	
						
    		    if (jQuery.trim(this.value) == ''){					
			    	this.value = (this.defaultValue ? this.defaultValue : '');
					jQuery(this).removeClass("focusField").addClass("idleField");
				}
    		});
	
	
	$("iframe").each(function(){
      var ifr_source = $(this).attr('src');
      var wmode = "wmode=transparent";
      if(ifr_source.indexOf('?') != -1) $(this).attr('src',ifr_source+'&'+wmode);
      else $(this).attr('src',ifr_source+'?'+wmode);
});
	
});



