// JavaScript Document

//selectbox
$(document).ready(function() {
	jQuery('.clearfix').parent().append('<div class="clear"></div>');
	jQuery('.clearafter').after('<div class="clear"></div>');
	jQuery(".nav-bar li:last-child").addClass('last-child');
	jQuery(".left-plane li:nth-child(3n)").addClass('third-child');
	jQuery(".footer-rightbx li li:first-child").addClass('first-child');
	jQuery(".gallery ul.listing-images:nth-child(3n)").addClass('third-child');
	jQuery(".round-box-listing li:nth-child(4n)").addClass('fourth-child');
	jQuery("ul li:nth-child(odd)").addClass('odd');
	jQuery("ul li:nth-child(even)").addClass('even');
	jQuery('.commentlist li>ul').addClass('reply-list');
	jQuery('.commentlist li>ul li>div').css('padding-bottom','15px');
	jQuery('ul.sub-menu').parent().addClass('with_sub');
	//menu dropdown functions
		jQuery('.menu-header ul.menu li').hover(function(){
			//jQuery(this).addClass('hover').find('ul.sub-menu ul.sub-menu').hide();
			jQuery(this).addClass('hover').find('>ul.sub-menu').slideDown(100);
		},function(){
			jQuery(this).removeClass('hover').find('ul.sub-menu').fadeOut(100);
		});
		
	 jQuery('.inner-navigation').width(jQuery('#tab').width());	
	
		jQuery('.inner-navigation li a').click(function() {
  		jQuery('.inner-navigation li a.active').removeClass('active');
		jQuery(this).addClass('active');
		});
		
		jQuery('.arrow-links li a').click(function() {
  		jQuery('.right-content li a.active').removeClass('active');
		jQuery(this).addClass('active');
		
		jQuery('.listing-images li').append('<div class="green-corner"><a href="#">z</a></div>'); 
	});
	if ( $("#FormValue_EmailAddress").val().length > 0 )
			{
				$('.news-input-txtfeild label').hide();
			} else {
				$('.news-input-txtfeild label').fadeIn(500);
			}
	
	$('#FormValue_EmailAddress').blur(function() {
		if ( $("#FormValue_EmailAddress").val().length > 0 )
			{
				
			} else {
				$('.news-input-txtfeild label').fadeIn(500);
			}
	});
	$('#FormValue_EmailAddress').focus(function() {
  		$('.news-input-txtfeild label').fadeOut(500);
	});
		//Center align Pagination
		var leftval= (jQuery('.navigation').width()/2) - (jQuery('.wp-paginate').width()/2);
		jQuery('.wp-paginate').css('margin-left', leftval);

});		
//Secondary Navigation Background Effect

window.onload = function(){
	//imageReset();
}

function tab01() {
	$('.tab_item').hide();
	$('#tab01').fadeIn(600);
}
function tab02() {
	$('.tab_item').hide();
	$('#tab02').fadeIn(600);
}
function tab03() {
	$('.tab_item').hide();
	$('#tab03').fadeIn(600);
}
