
function add(mode) {
	$.post("http://admin.rentacar-delta.com/add_remove/add.php", { mode : "" + mode + ""	}, function(data) {
		location.reload();
	});

}

function addadv() {
	$.post("http://admin.rentacar-delta.com/add_remove/addadv.php", {}, function(data) {
		location.reload();
	});

}

function addcategory(catId) {
	$.post("http://admin.rentacar-delta.com/add_remove/addcategory.php",	{catId : "" + catId + ""}, function(data) {
				location.reload();
			});

}

function remove(id) {
	$.post("http://admin.rentacar-delta.com/add_remove/remove.php", {id : "" + id + ""}, function(data) {
		location.reload();
	});

}

function removeadv(id) {
	$.post("http://admin.rentacar-delta.com/add_remove/removeadv.php", {id : "" + id + ""}, function(data) {
		location.reload();
	});

}

function removecategory(id) {
	$.post("http://admin.rentacar-delta.com/add_remove/removecategory.php",{	id : "" + id + ""}, function(data) {
		location.reload();
	});

}

function deletelang(id) {
	$.post("http://admin.rentacar-delta.com/add_remove/deletelang.php",{	id : "" + id + ""}, function(data) {
		location.reload();
	});

}

function removecat(id) {
	$.post("http://admin.rentacar-delta.com/add_remove/removecat.php", {id : "" + id + ""}, function(data) {
		location.reload();
	});

}

function deleteimg(id) {
	$.post("http://admin.rentacar-delta.com/add_remove/deleteimg.php", {id : "" + id + ""}, function(data) {
		location.reload();
	});

}



$(document).ready(function() {

	$(".form_module").hide();
	//for contact management
	$("#form_module").show();
	$(".language_module").hide();
	$(".language_module_en").show();
	//general
	$(".lang_en").css("color", "red");
	$(".form_module_head").toggle(function() {
		$(this).addClass("form_module_head_active");
	}, function() {
		$(this).removeClass("form_module_head_active");

	});
	$(".form_module_head").click(function() {
		
		$(this).next(".form_module").slideToggle("fast");
		$('.form_module').hide();
		$(".lang").css("color", "black");
		$(".lang_en").css("color", "red");
		$(".language_module").hide();
		$(".language_module_en").show();
	});

});

$(document).ready(
		function() {$(function() {
			$("ul.order").sortable({
				handle : '.move',
				opacity : 0.6,
				cursor : 'move',
				update : function() {
					var order = $(this).sortable("serialize");
					$.post("http://admin.rentacar-delta.com/add_remove/order.php",order,function(theResponse) {
						location.reload();
					});
				}
			});
		});
});

$(document).ready(
		function() {$(function() {
			$("ul.order2").sortable({
				handle : '.move',
				opacity : 0.6,
				cursor : 'move',
				update : function() {
					var order = $(this).sortable("serialize");
					$.post("http://admin.rentacar-delta.com/add_remove/ordercat.php",order,function(theResponse) {
						location.reload();
					});
				}
			});
		});
});

$(document).ready(
		function() {$(function() {
			$("ul.order3").sortable({
				handle : '.move',
				opacity : 0.6,
				cursor : 'move',
				update : function() {
					var order = $(this).sortable("serialize");
					$.post("http://admin.rentacar-delta.com/add_remove/orderadv.php",order,function(theResponse) {
						location.reload();
					});
				}
			});
		});
});

$(document).ready(
		function() {
			$(".lang").click(function() {
				var lang = $(this).html();
				// lang = parseInt(num);
				$(".lang").css("color", "black");
				$(this).css("color", "red");
				$(this).parent(".languages").parent(".form_module").find(".language_module").hide();
				$(this).parent(".languages").parent(".form_module").find(".language_module_" + lang + "").show();
			});
		});

$(document).ready(function() {

	$(".manageBox").hide();
	$(".manage").toggle(function() {
		$(this).addClass("manageBox_active");
	}, function() {
		$(this).removeClass("manageBox_active");

	});
	$(".manage").click(function() {
		$(this).parent('.lang_row').next(".warning2").next(".manageBox").slideToggle("fast");
	});
});

$(document).ready(function(){
	
	$('.warning').hide();
	$('.remove').click(function(){
		$(this).parent('.form_module_bottom').next('.warning').show();
	});
	$('.no').click(function(){
		$(this).parent('.warning').hide();
	});
	
});

$(document).ready(function(){
	
	$('.warning2').hide();
	$('.delete').click(function(){
		$(this).parent('.lang_row').next('.warning2').show();
	});
	$('.no2').click(function(){
		$(this).parent('.warning2').hide();
	});
	
});

$(document).ready(function(){
	
	$('.warning3').hide();
	$('.deleteimg').click(function(){
		$(this).parent('div').next('.warning3').show();
	});
	$('.no3').click(function(){
		$(this).parent('.warning3').hide();
	});
	
});

$(document).ready(function(){
	
	$('.warning4').hide();
	$('.remove').click(function(){
		$(this).next('.warning4').show();
	});
	$('.no4').click(function(){
		$(this).parent('.warning4').hide();
	});
	
});

$(document).ready(function(){
	
	$('.warningArch').hide();
	$('.orderColumnArch').click(function(){
		$(this).parent('.orderRow').next('.warningArch').show();
	});
	$('.no5').click(function(){
		$(this).parent('.warningArch').hide();
	});
	
});


$(document).ready(function() {

	$(".add-new-cat-input").hide();
	$(".add-new-cat").toggle(function() {
		$(this).addClass("add-new-cat-input_active");
	}, function() {
		$(this).removeClass("add-new-cat-input_active");

	});
	$(".add-new-cat").click(function() {
		$(this).next(".add-new-cat-input").slideToggle("fast");
	});
});

/*
$(document).ready(function() {
	$("#num").val(0);
	$('.btnAdd').click(function() {
		var num		= $(this).parent('.button_holder').prev('.clonedInput').length;
		var newNum	= new Number(num + 1);
		//$("#num").val(newNum);
		
		var newElem = $('#input' + num).clone().attr('id', 'input' + newNum);
		newElem.children(':first').attr('id', 'name' + newNum).attr('name', 'name' + newNum);
		
		//newElem.find('.name').next('.name_val').attr('id', 'name' + newNum + '_val').attr('name', 'name' + newNum + '_val');
		//newElem.children(':second').attr('id', 'upload_target' + newNum).attr('name', 'upload_target' + newNum);
		$('#input' + num).after(newElem);
		
		$('.btnDel').attr('disabled','');
		if (newNum == 5)
			$('.btnAdd').attr('disabled','disabled');
	});

	$('.btnDel').click(function() {
		var num	= $('.clonedInput').length;
		$('#input' + num).remove();

		$('.btnAdd').attr('disabled','');

		if (num-1 == 1)
			$('.btnDel').attr('disabled','disabled');
	});

	$('.btnDel').attr('disabled','disabled');
});*/

$(document).ready(function() {
	$('.btnDel').attr('disabled','disabled');
});
function btnAdd(pid){
	var num		= $('.clonedInput' + pid).length;
	
	var newNum	= new Number(num + 1);
	//$("#num").val(newNum);
	
	var newElem = $('#input' + pid + '_' + num).clone().attr('id', 'input' + pid + '_'  + newNum);
	//newElem.children(':first').attr('id', 'name' + pid + '_' + newNum).attr('name', 'name' + pid + '_' + newNum);
	newElem.find('.image').attr('id', 'image' + pid + '_' + newNum).attr('name', 'image' + pid + '_' + newNum);
	
	//newElem.find('.name').next('.name_val').attr('id', 'name' + newNum + '_val').attr('name', 'name' + newNum + '_val');
	//newElem.children(':second').attr('id', 'upload_target' + newNum).attr('name', 'upload_target' + newNum);
	$('#input' + pid + '_' + num).after(newElem);
	
	$('.btnDel' + pid).attr('disabled','');
	//if (newNum == 5)
		//$('.btnAdd').attr('disabled','disabled');
}
function btnDel(pid){
	var num	= $('.clonedInput' + pid).length;
	$('#input' + pid + '_' + num).remove();

	$('.btnAdd' + pid).attr('disabled','');

	if (num-1 == 1)
		$('.btnDel' + pid).attr('disabled','disabled');
}

$(document).ready(function(){
	$(".num").val(0);
	var num = $(".num").val();
	//$('.form_row1').show();
	//var i;
	$('.removeImage').hide();
	for(i=1;i<11;i++){
		$('.form_row' + i).hide();
	}
	
	$('.addImage').click(function() {
		//var num	= $(this).parent('.common2').find('.form_row').length;
		var num = $(this).parent('.common2').find(".num").val();
		num++;
		$(this).parent('.common2').find('.form_row' + num + '').show();
		$(this).parent('.common2').find('.num').val(num);
		$(this).parent('.common2').find('.removeImage').show();
		//alert(num);
	});
	$('.removeImage').click(function() {
		var num = $(this).parent('.common2').find('.num').val();
		$(this).parent('.common2').find('.form_row' + num + '').hide();
		num--;
		$(this).parent('.common2').find('.num').val(num);
		if(num == 0){
			$(this).parent('.common2').find('.removeImage').hide();
		}
		//alert(num);
	});
});


$(document).ready(function(){
	
	$('.form_row_edit').hide();
	$('.cancel').hide();
	$('.ind').val(0);
	$('.edit').click(function(){
		$(this).next('.cancel').show();
		$(this).next('.cancel').next('.form_row_edit').show();
		$(this).prev('.ind').val(1);
		$(this).hide();
	});
	$('.cancel').click(function(){
		$(this).next('.form_row_edit').hide();
		$(this).prev('.edit').show();
		$(this).prev('.edit').prev('.ind').val(0);
		$(this).hide();
	});
});

$(document).ready(function() {
	var difSess = $('#diffSess').val();
	if(difSess!=1){
		$('#diff').val(0);
	}
	$('.book_row_dropoff').hide();
	/*$('.different').change(function(){
		if($('.book_row_dropoff').css('display') == 'none'){
			$('.book_row_dropoff').show();
			$('#diff').val(1);
		}else{
			$('.book_row_dropoff').hide();
			$('#diff').val(0);
		}
	});*/
	
	$('.different').change(function(){
		if($(this).is(':checked')){
			$('.book_row_dropoff').show();
			$('#diff').val(1);
		}else{
			$('.book_row_dropoff').hide();
			$('#diff').val(0);
		}
	});
	if($('.different').is(':checked')){
		$('#dropoff').show();
		$('.book_row_dropoff').show();
		$('#diff').val(1);
	}else{
		$('#dropoff').hide();
		$('.book_row_dropoff').hide();
		$('#diff').val(0);
	}
	$('.different').change(function(){
		if($(this).is(':checked')){
			$('#dropoff').show();
			$('#diff').val(1);
		}else{
			$('#dropoff').hide();
			$('#diff').val(0);
		}
	});
});

$(document).ready(function() {
	
	$('.cancelDate').hide();
	$('.orderColumnInput').hide();
	$('.indDatePick').val(0);
	
	$('.editDate').click(function(){
		$(this).prev('.orderColumn').hide();
		$(this).next('.indDatePick').next('.orderColumnInput').next('.cancelDate').show();
		$(this).next('.indDatePick').next('.orderColumnInput').show();
		$(this).hide();
		$(this).next('.indDatePick').val(1);
	});
	$('.cancelDate').click(function(){
		$(this).prev('.orderColumnInput').prev('.indDatePick').prev('.editDate').show();
		$(this).prev('.orderColumnInput').prev('.indDatePick').prev('.editDate').prev('.orderColumn').show();
		$(this).prev('.orderColumnInput').hide();
		$(this).hide();
		$(this).prev('.orderColumnInput').prev('.indDatePick').val(0);
	});
});

$(document).ready(function() {
	
	$('.cancelDate').hide();
	$('.orderColumnInput').hide();
	$('.indDateDrop').val(0);
	
	$('.editDate').click(function(){
		$(this).prev('.orderColumn').hide();
		$(this).next('.indDateDrop').next('.orderColumnInput').next('.cancelDate').show();
		$(this).next('.indDateDrop').next('.orderColumnInput').show();
		$(this).hide();
		$(this).next('.indDateDrop').val(1);
	});
	$('.cancelDate').click(function(){
		$(this).prev('.orderColumnInput').prev('.indDateDrop').prev('.editDate').show();
		$(this).prev('.orderColumnInput').prev('.indDateDrop').prev('.editDate').prev('.orderColumn').show();
		$(this).prev('.orderColumnInput').hide();
		$(this).hide();
		$(this).prev('.orderColumnInput').prev('.indDateDrop').val(0);
	});
});

$(document).ready(function() {
	
	$('.cancelPrice').hide();
	$('.orderColumnInput').hide();
	$('.indPrice').val(0);
	
	$('.editPrice').click(function(){
		$(this).prev('.orderColumn').hide();
		$(this).next('.indPrice').next('.orderColumnInput').next('.cancelPrice').show();
		$(this).next('.indPrice').next('.orderColumnInput').show();
		$(this).hide();
		$(this).next('.indPrice').val(1);
	});
	$('.cancelPrice').click(function(){
		$(this).prev('.orderColumnInput').prev('.indPrice').prev('.editPrice').show();
		$(this).prev('.orderColumnInput').prev('.indPrice').prev('.editPrice').prev('.orderColumn').show();
		$(this).prev('.orderColumnInput').hide();
		$(this).hide();
		$(this).prev('.orderColumnInput').prev('.indPrice').val(0);
	});
});


$(document).ready(function() {
	$('#price').text(0);
	
	var price13 = $('#days13').val();
	var price37 = $('#days37').val();
	var price714 = $('#days714').val();
	var range = $('#range').val();
	var special = $('#special').val();
	price13 = Number(price13);
	price37 = Number(price37);
	price714 = Number(price714);
	
	var pickupdateCurrent = $('#pickupdate').val();
	var dropoffdateCurrent = $('#dropoffdate').val();
	if(pickupdateCurrent == '' || dropoffdateCurrent == ''){
		var priceCurrent = 0;
	}else{
		if(pickupdateCurrent != '' && dropoffdateCurrent != ''){
			var priceCurrent = priceCalc(pickupdateCurrent, dropoffdateCurrent, price13, price37, price714, range, special);
			
		}
	}
	$('#price').text(priceCurrent);
	$('#priceCalc').val(priceCurrent);
	var test = $('#price').text();
	if(!isNaN(test)){
		$('#euro').text('€');
	}else{
		$('#euro').text('');
	}
	var priceSess = $('#priceSess').val();
	if(priceSess != ''){
		$('#price').text(priceSess);
		$('#priceCalc').val(priceSess);
		var test = $('#price').text();
		if(!isNaN(test)){
			$('#euro').text('€');
		}else{
			$('#euro').text('');
		}
	}else{
		$('#price').text(0);
		$('#priceCalc').val(0);
		var test = $('#price').text();
		if(!isNaN(test)){
			$('#euro').text('€');
		}else{
			$('#euro').text('');
		}
	}
	
	$('#dropoffdate').change(function(){
		if($('#pickupdate').val()!= ''){
			var pickupdate = $('#pickupdate').val();
			var dropoffdate = $(this).val();
			var price13 = $('#days13').val();
			var price37 = $('#days37').val();
			var price714 = $('#days714').val();
			price13 = Number(price13);
			price37 = Number(price37);
			price714 = Number(price714);
			
			var price = priceCalc(pickupdate, dropoffdate, price13, price37, price714, range, special);
			
			$('#price').text(price);
			$('#priceCalc').val(price);
			var test = $('#price').text();
			if(!isNaN(test)){
				$('#euro').text('€');
			}else{
				$('#euro').text('');
			}
			
		}
		
		
	});
	$('#pickupdate').change(function(){
		var date = $('#date').val();
		
		/*var j;
		
		var datedd = '';
		for(j=0;j<2;j++){
			datedd = datedd + date[j];
		}
		datedd = Number(datedd);
		alert(datedd);
		var datemm = '';
		for(j=3;j<5;j++){
			datemm = datemm + date[j];
		}
		datemm = Number(datemm);
		alert(datemm);
		var dateyy = '';
		for(j=6;j<10;j++){
			dateyy = dateyy + date[j];
		}
		dateyy = Number(dateyy);
		alert(dateyy);
		*/
		var pickupdate = $(this).val();
		//var check = checkToday(date, pickupdate);
		//if(check == true){
		if($('#dropoffdate').val()!= ''){
			var dropoffdate = $('#dropoffdate').val();
			//var pickupdate = $(this).val();
			//var check2 = checkRange(pickupdate, dropoffdate);
			//if(check2 == true){
				var price13 = $('#days13').val();
				var price37 = $('#days37').val();
				var price714 = $('#days714').val();
				price13 = Number(price13);
				price37 = Number(price37);
				price714 = Number(price714);
				
				var price = priceCalc(pickupdate, dropoffdate, price13, price37, price714, range, special);
				
				$('#price').text(price);
				$('#priceCalc').val(price);
				var test = $('#price').text();
				if(!isNaN(test)){
					$('#euro').text('€');
				}else{
					$('#euro').text('');
				}
			//}else{
				//alert(range);
			//}
		}
		/*}else{
			alert(range);
			$('#dropoffdate').val('');
			$('#pickupdate').val('');
			$('#price').text(0);
			$('#priceCalc').val(0);
		}*/
	});
});
function checkToday(date, pickupdate){
	//var date = $('#date').val();
	//alert(date);
	var j;
	
	var datedd = '';
	for(j=0;j<4;j++){
		datedd = datedd + date[j];
	}
	datedd = Number(datedd);
	
	var datemm = '';
	for(j=5;j<7;j++){
		datemm = datemm + date[j];
	}
	datemm = Number(datemm);
	
	var dateyy = '';
	for(j=8;j<10;j++){
		dateyy = dateyy + date[j];
	}
	dateyy = Number(dateyy);
	
	var i;
	
	var pickdd = '';
	for(i=8;i<10;i++){
		pickdd = pickdd + pickupdate[i];
	}
	pickdd = Number(pickdd);
	
	var pickmm = '';
	for(i=5;i<7;i++){
		pickmm = pickmm + pickupdate[i];
	}
	pickmm = Number(pickmm);
	
	var pickyy = '';
	for(i=0;i<4;i++){
		pickyy = pickyy + pickupdate[i];
	}
	pickyy = Number(pickyy);
	
	
	
	if(pickyy < dateyy){
		return false;
	}else{
		if(pickmm < datemm){
			return false;
		}else{
			if(pickdd < datedd){
				return false;
			}else{
				return true;
			}
		}
	}
}
function checkRange(pickupdate, dropoffdate){
	var i;
	
	var pickdd = '';
	for(i=8;i<10;i++){
		pickdd = pickdd + pickupdate[i];
	}
	pickdd = Number(pickdd);
	
	var pickmm = '';
	for(i=5;i<7;i++){
		pickmm = pickmm + pickupdate[i];
	}
	pickmm = Number(pickmm);
	
	var pickyy = '';
	for(i=0;i<4;i++){
		pickyy = pickyy + pickupdate[i];
	}
	pickyy = Number(pickyy);
	
	var dropoffdd = '';
	for(i=8;i<10;i++){
		dropoffdd = dropoffdd + dropoffdate[i];
	}
	dropoffdd = Number(dropoffdd);
	var dropoffmm = '';
	for(i=5;i<7;i++){
		dropoffmm = dropoffmm + dropoffdate[i];
	}
	dropoffmm = Number(dropoffmm);
	var dropoffyy = '';
	for(i=0;i<4;i++){
		dropoffyy = dropoffyy + dropoffdate[i];
	}
	dropoffyy = Number(dropoffyy);
	
	if(dropoffyy < pickyy){
		return false;
	}else{
		if(dropoffmm < pickmm){
			return false;
		}else{
			if(dropoffdd < pickdd){
				return false;
			}else{
				return true;
			}
		}
	}
	
}
function priceCalc(pickupdate, dropoffdate, price13, price37, price714, range, special){
	
	var j;
	var date = $('#date').val();
	
	if(date != null){
		var dateyy = '';
		for(j=8;j<10;j++){
			dateyy = dateyy + date[j];
		}
		dateyy = Number(dateyy);
	}
	var i;
	
	if(pickupdate !=null){
		var pickdd = '';
		for(i=8;i<10;i++){
			pickdd = pickdd + pickupdate[i];
		}
		pickdd = Number(pickdd);
		var pickmm = '';
		for(i=5;i<7;i++){
			pickmm = pickmm + pickupdate[i];
		}
		pickmm = Number(pickmm);
		var pickyy = '';
		for(i=0;i<4;i++){
			pickyy = pickyy + pickupdate[i];
		}
		pickyy = Number(pickyy);
	}
	
	if(dropoffdate!=null){
		var dropoffdd = '';
		for(i=8;i<10;i++){
			dropoffdd = dropoffdd + dropoffdate[i];
		}
		dropoffdd = Number(dropoffdd);
		var dropoffmm = '';
		for(i=5;i<7;i++){
			dropoffmm = dropoffmm + dropoffdate[i];
		}
		dropoffmm = Number(dropoffmm);
		var dropoffyy = '';
		for(i=0;i<4;i++){
			dropoffyy = dropoffyy + dropoffdate[i];
		}
		dropoffyy = Number(dropoffyy);
	}
	
	if(dropoffyy < pickyy){
	alert(range);
	   $('#dropoffdate').val('');
	   $('#pickupdate').val('');
	   $('#price').text(0);
	   $('#priceCalc').val(0);
		alert(range);
		//$(this).val('');
	}else{
		if(dropoffyy == pickyy){
			if(dropoffmm < pickmm){
				$('#dropoffdate').val('');
				$('#pickupdate').val('');
				$('#price').text(0);
				$('#priceCalc').val(0);
				alert(range);
			}else{
				if(dropoffmm == pickmm){
					if(dropoffdd < pickdd){
						$('#dropoffdate').val('');
						$('#pickupdate').val('');
						$('#price').text(0);
						$('#priceCalc').val(0);
						alert(range);
						//$(this).val('');
					}else{
						var d = (dropoffdd - pickdd);
						if(d > 14){
							var price = special;
							//alert(price);
							return price;
						}else{
							if((d >=1 && d <=3) || d==0){
								var price = price13;
								//alert(price);
								return price;
							}
							if(d >3 && d <=7){
								var price = price37;
								//alert(price);
								return price;
							}
							if(d >7 && d <=14){
								var price = price714;
								//alert(price);
								return price;
							}
						}
					}
				}else{
					var m = dropoffmm - pickmm;
					if(m == 1){
						switch(pickmm){
							case 1 : var diff = 31;break;case 3 : var diff = 31;break;case 5 : var diff = 31;break;
							case 7 : var diff = 31;break;case 8 : var diff = 31;break;case 10 : var diff = 31;break;
							case 12 : var diff = 31;break;
							case 4 : var diff = 30;break;case 6 : var diff = 30;break;case 11 : var diff = 30;break;
							case 2 : 
								if(dateyy == 2012 || dateyy == 2016){
									var diff = 29;
								}else{
									var diff = 28;
								}
								break;
							default: var diff = 100;
						}
						var d = ((diff-pickdd) + dropoffdd) ;
						if(d > 14){
							var price = special;
							return price;
							//alert(price);
						}else{
							if((d >=1 && d <=3) || d==0){
								var price = price13;
								//alert(price);
								return price;
							}
							if(d >3 && d <=7){
								var price = price37;
								//alert(price);
								return price;
							}
							if(d >7 && d <=14){
								var price = price714;
								//alert(price);
								return price;
							}
						}
					}else{
						if(m == 0){
							var d = (dropoffdd - pickdd);
							if(d > 14){
								var price = special;
								//alert(price);
								return price;
							}else{
								if((d >=1 && d <=3) || d==0){
									var price = price13;
									//alert(price);
									return price;
								}
								if(d >3 && d <=7){
									var price = price37;
									//alert(price);
									return price;
								}
								if(d >7 && d <=14){
									var price = price714;
									//alert(price);
									return price;
								}
							}
						}else{
							var price = special;
							//alert(price);
							return price;
						}
					}

				}
			}
		}else{
			var y = dropoffyy - pickyy;
			if( y == 1){
				var m = dropoffmm + (12 - pickmm);
				if(m > 1){
					var price = special;
					//alert(price);
					return price;
				}else{
					var d = (dropoffdd + (31 - pickdd)) ;
					if(d > 14){
						var price = special;
						//alert(price);
						return price;
					}else{
						if((d >=1 && d <=3) || d==0){
							var price = price13;
							//alert(price);
							return price;
						}
						if(d >3 && d <=7){
							var price = price37;
							//alert(price);
							return price;
						}
						if(d >7 && d <=14){
							var price = price714;
							//alert(price);
							return price;
						}
					}
				}
			}else{
				var price = special;
				//alert(price);
				return price;
			}
		}
	}
}

$(document).ready(function() {
	
	$('.shortDesc').hide();
	var cat = $('.category').val();
	$('.shortDesc' + cat).show();
	
	var days13 = $('#days13' + cat).text();
	var days37 = $('#days37' + cat).text();
	var days714 = $('#days714' + cat).text();
	
	$('#days13').val(days13);
	$('#days37').val(days37);
	$('#days714').val(days714);
	
	$('.category').change(function(){
		var cat = $(this).val();
		$('.shortDesc').hide();
		$('.shortDesc' + cat).show();
		var days13 = $('#days13' + cat).text();
		var days37 = $('#days37' + cat).text();
		var days714 = $('#days714' + cat).text();
		
		
		$('#days13').val(days13);
		$('#days37').val(days37);
		$('#days714').val(days714);
		
		var price13 = $('#days13').val();
		var price37 = $('#days37').val();
		var price714 = $('#days714').val();
		var range = $('#range').val();
		var special = $('#special').val();
		price13 = Number(price13);
		price37 = Number(price37);
		price714 = Number(price714);
		
		var pickupdateCurrent = $('#pickupdate').val();
		var dropoffdateCurrent = $('#dropoffdate').val();
		if(pickupdateCurrent == '' || dropoffdateCurrent == ''){
			var priceCurrent = 0;
		}else{
			if(pickupdateCurrent != '' && dropoffdateCurrent != ''){
				var priceCurrent = priceCalc(pickupdateCurrent, dropoffdateCurrent, price13, price37, price714, range, special);
				
			}
		}
		
		$('#price').text(priceCurrent);
		$('#priceCalc').val(priceCurrent);
		var test = $('#price').text();
		if(!isNaN(test)){
			$('#euro').text('€');
		}else{
			$('#euro').text('');
		}
	});
});

$(document).ready(function(){
	
	
	$('.message-head').click(function(){
		var display = $(this).parent('.message').find('.message-cont').css('display');
		if(display == 'none'){
			$(this).parent('.message').find('.message-cont').show();
			$(this).find('.explander').text('-');
		}else{
			$(this).parent('.message').find('.message-cont').hide();
			$(this).find('.explander').text('+');
		}
	});
	
	
	
});
