$(document).ready(function(){
	var _host = document.location.host;
	var _url = document.location.href.substring(document.location.href.indexOf(_host)+_host.length);
	
	// Initializing drop down menus
	$(".dropdown li").hover(function(){$(this).addClass("sfhover");},function(){$(this).removeClass("sfhover");});

	// Set selected page
	$('.menu li a').each(function(){if($(this).attr('href') == _url){$(this).parent().addClass('selected');}});

	// Zebra-Striping tables
	$('.zebra tr:nth-child(odd)').addClass('odd');

	$('.click-clear').each(function(){
		$(this).bind('click', function(e){
			if($(this).val() == $(this).val()){
				$(this).val('');
			}
		});
	});

	if($("#tour-dates")){
		$("#tour-dates td.buy a").each(function(){
			if($(this).attr("href") == ""){
				$(this).remove();
			}
		});
		if($("#tour-dates table").size() == 0){
			$("#no-tour-dates").show();			
		}
	}
	
	if($("#tour-dates-container")){		
		if($("#tour-dates-container #tour-dates table").size() == 0){
			$("#ad-rotator-container").show();			
		}
		if($("#tour-dates-container #tour-dates table").size() >= 1){
			$("#tour-dates-container").show();
		}
	}
	
	if($("#tour-date")){
		$("#tour-date td.buy a").each(function(){
			if($(this).attr("href") == ""){
				$(this).remove();
			}
		});
	}
	if($("#form_payment")){
		//PaymentMethodType_1 = Credit Card
		//PaymentMethodType_2
		//PaymentMethodType_3
		//PaymentMethodType_4
		//PaymentMethodType_5 = PayPal
		//PaymentMethodType_6
		$("#PaymentMethodType_1").bind("change",function(e){
			if(this.checked){
				$(".field_credit-card").css({display:'block'});
			}
		});
		$("#PaymentMethodType_5").bind("change",function(e){
			if(this.checked){
				$(".field_credit-card").css({display:'none'});
			}
		});

	}

// force adrotator 
// $("#ad-rotator-container").show();	
	
});