$(document).ready(function() {
	
	$('.search-result a[href*="gurmetur"]').parent().parent().remove();
	
	$("h1:empty").remove();
	if($(".airline").text() == " ile" || $(".airline").text() == "ile" ){ 
		$(".airline").remove();
	}
	$(".cm .amount:empty").parent().remove();
	$(".pm .amount:empty").parent().remove();
	//$(".dates:not(:contains('20'))").remove();
	$('.pm .spot').filter(function () {
		 return $.trim($(this).find('div').text()).length == 0;
	}).hide();
	
	$(".pm .pagination").remove();
	$(".desc:has(iframe)").css('padding','0').parents().find('.pm-top, h1').remove();
	$(".am .slides-img:empty").parent().remove();
	
	var locPathSplit = location.pathname.split("/")[1];
	//var locPathSplit = ' a[href^="/' + location.pathname.split("/")[1] + '"]'; 
	if(locPathSplit.split("-")[1] == "news" || locPathSplit == "news" ){ 
		$('.menu a[href*="news"]').addClass('active');
	}
	/*if(locPathSplit.split("-")[1] == "TravelClub-Geziler" || locPathSplit == "TravelClub-Geziler" ){ 
		$('.menu a[href*="Yurtdisi-Geziler"]').addClass('active');
	}*/	
	
	if( $('.slides-item[title*="Incoming"]').length ){ 
		$('.menu a[href*="Incoming"]').addClass('active');
	}
	/*if( $('.slides-item[title*="Geziler"]').length ){ 
		$('.menu a[href*="Geziler"]').addClass('active');
	}*/
	
	if ( $("#CAT_Custom_161654").length){
	  if ( $("#CAT_Custom_161654").val().length > 0 ){
		  $("#CAT_Custom_161654").parent().hide();
		}
	}
	if ( $("#CAT_Custom_161655").length){
	  if ( $("#CAT_Custom_161655").val().length > 0 ){
		  $("#CAT_Custom_161655").parent().hide();
		}
	}

	$('input[name="CAT_Custom_239301"]').live('click',wayStatus);
	$("#CAT_Custom_239314").change(displayVals);
	$('.flight-corporate input[name="CAT_Custom_239331"]').live('click',rezStatus);
	displayVals();
	wayStatus();
	rezStatus();
	$('#CAT_Custom_239310').change(function(){
		if($("#CAT_Custom_239310").val() == 0){ 
			$("#CAT_Custom_239313").val(1);
		}
	});
	$('#CAT_Custom_239313').change(function(){
		if($("#CAT_Custom_239313").val() == 0){ 
			$("#CAT_Custom_239310").val(1);
		}
	});
	$('.flight-corporate #CAT_Custom_239331_0').attr('checked', false);
	$('.flight-corporate .webform').hide();
	
});
$(window).load(function() { 
	//setEqualHeight($(".thumbs > .item"));
	$('.pm').slides({ container: 'slides', fadeSpeed: 250, slideSpeed: 250, play: 10000, pause: 15000, crossfade: true, autoHeight: true, bigTarget: false }); 
	$('.cm').slides({ container: 'slide-s', generatePagination: false, fadeSpeed: 150, slideSpeed: 250, play: 2000, pause: 5000, crossfade: false, autoHeight: false, bigTarget: true });
});

function wayStatus() {
	if($('#CAT_Custom_239301_0').is(':checked')){ 
		$('.src-roundtrip').show();
		$('.src-multi').hide();
		$("#CAT_Custom_239314").val(3);
		$('.txt-multi1 span').hide();
	} else if($('#CAT_Custom_239301_2').is(':checked')){
		$('.src-roundtrip').hide();
		$('.src-multi1').show();
		$('.src-multi2').show();
		$('.txt-multi1 span').show();
		$('#CAT_Custom_239314').val(2);
	} else {
		$('.src-roundtrip').hide();
		$('.src-multi').hide();
		$("#CAT_Custom_239314").val(1);
		$('.txt-multi1 span').hide();
	}
}
function rezStatus() {
	if($('#CAT_Custom_239331_1').is(':checked')){ 
		$("#CAT_Custom_239310").val('9+');
		$('.flight-corporate .webform').show();
	} else if ($('#CAT_Custom_239331_0').is(':checked')){
		$("#CAT_Custom_239310").val('1');
		$('.flight-corporate .webform').show();
	} else {
		//$("#CAT_Custom_239310").val('1');
	}
}

function displayVals() {
	var singleValues = $("#CAT_Custom_239314").val();
	if(singleValues == 1 ){ 
		$('.src-multi').hide();
		if($('#CAT_Custom_239301_2').is(':checked')){ 
			$('#CAT_Custom_239301_1').attr('checked','checked');
			$('.src-multi1').hide();
			$('.txt-multi1 span').hide();
		} 
	} else if(singleValues == 2 ){ 
		$('.src-multi').hide();
		$('.src-multi1').show();
		$('.src-multi2').show();
	} else if(singleValues == 3 ){ 
		$('.src-multi').hide();
		$('.src-multi1').show();
		$('.src-multi2').show();
		$('.src-multi3').show();
	} else if(singleValues == 4 ){ 
		$('.src-multi').hide();
		$('.src-multi1').show();
		$('.src-multi2').show();
		$('.src-multi3').show();
		$('.src-multi4').show();
	} else if(singleValues == 5 ){ 
		$('.src-multi').hide();
		$('.src-multi1').show();
		$('.src-multi2').show();
		$('.src-multi3').show();
		$('.src-multi4').show();
		$('.src-multi5').show();
	}
	//$('.src-multi').hide();
	//$('.src-multi'+singleValues).show();
}

    






