var host = window.location.host;
var proto = window.location.protocol;
var ajax_url = proto + "//" + host;

//START DOCUMENT READY FUNCTION
$(document).ready(function() {

	//FORM VALIDATIONS VIA JQUERY

	//	ADMIN LOGIN FORM VALIDATION
	$("#AdminLogin").validate();

	//	ADMIN USER ADD FORM VALIDATION
	$("#userAddForm").validate();

	//	ADMIN USER EDIT FORM VALIDATION
	$("#userEditForm").validate();

	//	ADMIN SITEMAP MENU CATEGORY ADD FORM VALIDATION
	$("#sitemapCategoryAddForm").validate();

	//	ADMIN SITEMAP MENU CATEGORY EDIT FORM VALIDATION
	$("#sitemapCategoryEditForm").validate();

	//	PROMOTION EDIT FORM VALIDATION
	if($("#promotionEditForm").validate) {
		$("#promotionEditForm").validate({
			rules : {

				"promoimage" : {
					accept : "(jpe?g|gif|png)"
				},
				"document" : {
					accept : "(pdf|doc)"
				}

			},

			messages : {

				"promoimage" : {
					accept : 'Upload an Image with valid extention'
				},
				"document" : {
					accept : 'Upload a document with valid extention'
				}

			}
		});
	}

	//	TOP MENU ITEM ADD FORM VALIDATION
	if($("#topMenuAddForm").validate) {
		$("#topMenuAddForm").validate({
			rules : {
				"document" : {
					accept : "(pdf)"
				}

			},

			messages : {
				"document" : {
					accept : 'Upload a document with valid extention'
				}

			}
		});
	}

	//(Vikas Uniyal)TOP MENU ITEM EDIT FORM VALIDATION
	if($("#topMenuEditForm").validate) {
		$("#topMenuEditForm").validate({
			rules : {
				"document" : {
					accept : "(pdf)"
				}

			},

			messages : {
				"document" : {
					accept : 'Upload a document with valid extention'
				}

			}
		});
	}

	//	(Vikas Uniyal)BOTTOM MENU ITEM ADD FORM VALIDATION
	if($("#bottomMenuAddForm").validate) {
		$("#bottomMenuAddForm").validate({
			rules : {
				"document" : {
					accept : "(pdf)"
				}

			},

			messages : {
				"document" : {
					accept : 'Upload a document with valid extention'
				}

			}
		});
	}

	//(Vikas Uniyal)	BOTTOM MENU ITEM EDIT FORM VALIDATION
	if($("#bottomMenuEditForm").validate) {
		$("#bottomMenuEditForm").validate({
			rules : {
				"document" : {
					accept : "(pdf)"
				}

			},

			messages : {
				"document" : {
					accept : 'Upload a document with valid extention'
				}
			}
		});
	}

	//(Vikas Uniyal)SITE MAP MENU ITEM ADD FORM VALIDATION
	if($("#sitemapMenuAddForm").validate) {
		$("#sitemapMenuAddForm").validate({
			rules : {
				"document" : {
					accept : "(pdf)"
				}

			},

			messages : {
				"document" : {
					accept : 'Upload a document with valid extention'
				}

			}
		});
	}

	//(Vikas Uniyal)SITE MAP MENU ITEM EDIT FORM VALIDATION
	if($("#sitemapMenuEditForm").validate) {
		$("#sitemapMenuEditForm").validate({
			rules : {
				"document" : {
					accept : "(pdf)"
				}

			},

			messages : {
				"document" : {
					accept : 'Upload a document with valid extention'
				}

			}
		});
	}

	//	STAFF PROFIEL ADD FORM VALIDATION
	if($("#staffAddForm").validate) {
		$("#staffAddForm").validate({
			rules : {

				"profileimage" : {
					accept : "(jpe?g|gif|png)"
				}

			},

			messages : {

				"profileimage" : {
					accept : 'Upload an Image with valid extention'
				}
			}
		});
	}

	//	TOUR LEADER PROFIEL ADD FORM VALIDATION
	if($("#tourleaderAddForm").validate) {
		$("#tourleaderAddForm").validate({
			rules : {

				"profileimage" : {
					accept : "(jpe?g|gif|png)"
				}

			},

			messages : {

				"profileimage" : {
					accept : 'Upload an Image with valid extention'
				}
			}
		});
	}

	//	TOUR LEADER PROFIEL EDIT FORM VALIDATION
	if($("#tourleaderEditForm").validate) {
		$("#tourleaderEditForm").validate({
			rules : {

				"profileimage" : {
					accept : "(jpe?g|gif|png)"
				}

			},

			messages : {

				"profileimage" : {
					accept : 'Upload an Image with valid extention'
				}
			}
		});
	}

	//END OF FORM VALIDATIONS

	//SELECT CHECK BOXEX OF A FORM

	$("#all").live('click', function() {
		if($(this).is(":checked")) {
			$(".allchk").each(function() {
				$(this).attr("checked", "checked");
			});
		} else {
			$(".allchk").each(function() {
				$(this).attr("checked", "");
			});
		}
	});
	//END OF SELECT CHECK BOXEX OF A FORM

	// UPDATE STATUS OF USER

	$('.update-status-user').live('click', function() {

		//$("#ajax-loading-div").show();

		var rec_id = $(this).attr('id');
		$.ajax({
			url : ajax_url + "/admin/users/updateuser/" + rec_id,
			success : function(html) {
				$("#pagingDivParent").html(html);
				//$("#ajax-loading-div").hide();
			}
		});

	});
	// UPDATE STATUS OF USER

	$('.update-status-staff').live('click', function() {

		//$("#ajax-loading-div").show();

		var rec_id = $(this).attr('id');
		$.ajax({
			url : ajax_url + "/admin/information/updatestaff/" + rec_id,
			success : function(html) {
				$("#pagingDivParent").html(html);
				//$("#ajax-loading-div").hide();
			}
		});

	});
	// UPDATE STATUS OF TOUR LEADER

	$('.update-status-tourleader').live('click', function() {

		$("#ajax-loading-div").show();

		var rec_id = $(this).attr('id');
		$.ajax({
			url : ajax_url + "/admin/information/updatetourleader/" + rec_id,
			success : function(html) {
				$("#pagingDivParent").html(html);
				$("#ajax-loading-div").hide();
			}
		});

	});
	//BULK ENABLE / DISABLE

	//Bulk enable User
	$("#bulkEnableUser").live('click', function() {

		var ids = new Array()
		$(".allchk:checked").each(function() {
			ids.push(this.value)
		});
		if(ids == '') {

			alert("Please select records to be enable.");
			return false;

		} else {

			alert("Are you sure want to enable checked records?");
		}
		$("#ajax-loading-div").show();

		$.ajax({

			url : ajax_url + "/admin/users/bulkEnableUser/" + ids,
			success : function() {
				window.location.href = ajax_url + "/admin/users/userslist";
				$("#ajax-loading-div").hide();
			}
		});

	});
	//Bulk Disable User
	$("#bulkDisableUser").live('click', function() {

		var ids = new Array()
		$(".allchk:checked").each(function() {
			ids.push(this.value)
		});
		if(ids == '') {

			alert("Please select records to be disable.");
			return false;

		} else {

			alert("Are you sure want to disable checked records?");
		}
		$("#ajax-loading-div").show();

		$.ajax({

			url : ajax_url + "/admin/users/bulkDisableUser/" + ids,
			success : function() {
				window.location.href = ajax_url + "/admin/users/userslist";
				$("#ajax-loading-div").hide();
			}
		});

	});
	//Bulk enable Staff
	$("#bulkEnableStaff").live('click', function() {

		var ids = new Array()
		$(".allchk:checked").each(function() {
			ids.push(this.value)
		});
		if(ids == '') {

			alert("Please select records to be enable.");
			return false;

		} else {

			alert("Are you sure want to enable checked records?");
		}
		$("#ajax-loading-div").show();

		$.ajax({

			url : ajax_url + "/admin/information/bulkEnableStaff/" + ids,
			success : function() {
				window.location.href = ajax_url + "/admin/information/listStaff";
				$("#ajax-loading-div").hide();
			}
		});

	});
	//Bulk Disable Staff
	$("#bulkDisableStaff").live('click', function() {

		var ids = new Array()
		$(".allchk:checked").each(function() {
			ids.push(this.value)
		});
		if(ids == '') {

			alert("Please select records to be disable.");
			return false;

		} else {

			alert("Are you sure want to disable checked records?");
		}
		$("#ajax-loading-div").show();

		$.ajax({

			url : ajax_url + "/admin/information/bulkDisableStaff/" + ids,
			success : function() {
				window.location.href = ajax_url + "/admin/information/listStaff";
				$("#ajax-loading-div").hide();
			}
		});

	});
	//Bulk enable Tour Leader
	$("#bulkEnableTourLeader").live('click', function() {

		var ids = new Array()
		$(".allchk:checked").each(function() {
			ids.push(this.value)
		});
		if(ids == '') {

			alert("Please select records to be enable.");
			return false;

		} else {

			alert("Are you sure want to enable checked records?");
		}
		$("#ajax-loading-div").show();

		$.ajax({

			url : ajax_url + "/admin/information/bulkEnableTourLeader/" + ids,
			success : function() {
				window.location.href = ajax_url + "/admin/information/listTourLeaders";
				$("#ajax-loading-div").hide();
			}
		});

	});
	//Bulk Disable Tour Leader
	$("#bulkDisableTourLeader").live('click', function() {

		var ids = new Array()
		$(".allchk:checked").each(function() {
			ids.push(this.value)
		});
		if(ids == '') {

			alert("Please select records to be disable.");
			return false;

		} else {

			alert("Are you sure want to disable checked records?");
		}
		$("#ajax-loading-div").show();

		$.ajax({

			url : ajax_url + "/admin/information/bulkDisableTourLeader/" + ids,
			success : function() {
				window.location.href = ajax_url + "/admin/information/listTourLeaders";
				$("#ajax-loading-div").hide();
			}
		});

	});
	//Bulk enable Top Menu Item
	$("#bulkEnableTopMenu").live('click', function() {

		var ids = new Array()
		$(".allchk:checked").each(function() {
			ids.push(this.value)
		});
		if(ids == '') {

			alert("Please select records to be enable.");
			return false;

		} else {

			alert("Are you sure want to enable checked records?");
		}
		$("#ajax-loading-div").show();

		$.ajax({

			url : ajax_url + "/admin/menus/bulkEnableTopMenu/" + ids,
			success : function() {
				window.location.href = ajax_url + "/admin/menus/listTopMenu";
				$("#ajax-loading-div").hide();
			}
		});

	});
	//Bulk Disable Top Menu Item
	$("#bulkDisableTopMenu").live('click', function() {

		var ids = new Array()
		$(".allchk:checked").each(function() {
			ids.push(this.value)
		});
		if(ids == '') {

			alert("Please select records to be disable.");
			return false;

		} else {

			alert("Are you sure want to disable checked records?");
		}
		$("#ajax-loading-div").show();

		$.ajax({

			url : ajax_url + "/admin/menus/bulkDisableTopMenu/" + ids,
			success : function() {
				window.location.href = ajax_url + "/admin/menus/listTopMenu";
				$("#ajax-loading-div").hide();
			}
		});

	});
	//Bulk enable bottom Menu Item
	$("#bulkEnableBottomMenu").live('click', function() {

		var ids = new Array()
		$(".allchk:checked").each(function() {
			ids.push(this.value)
		});
		if(ids == '') {

			alert("Please select records to be enable.");
			return false;

		} else {

			alert("Are you sure want to enable checked records?");
		}
		$("#ajax-loading-div").show();

		$.ajax({

			url : ajax_url + "/admin/menus/bulkEnableBottomMenu/" + ids,
			success : function() {
				window.location.href = ajax_url + "/admin/menus/listBottomMenu";
				$("#ajax-loading-div").hide();
			}
		});

	});
	//Bulk Disable Bottom Menu Item
	$("#bulkDisableBottomMenu").live('click', function() {

		var ids = new Array()
		$(".allchk:checked").each(function() {
			ids.push(this.value)
		});
		if(ids == '') {

			alert("Please select records to be disable.");
			return false;

		} else {

			alert("Are you sure want to disable checked records?");
		}
		$("#ajax-loading-div").show();

		$.ajax({

			url : ajax_url + "/admin/menus/bulkDisableBottomMenu/" + ids,
			success : function() {
				window.location.href = ajax_url + "/admin/menus/listBottomMenu";
				$("#ajax-loading-div").hide();
			}
		});

	});
	//Bulk enable Sitemap Menu Item
	$("#bulkEnableSitemapMenu").live('click', function() {

		var ids = new Array()
		$(".allchk:checked").each(function() {
			ids.push(this.value)
		});
		if(ids == '') {

			alert("Please select records to be enable.");
			return false;

		} else {

			alert("Are you sure want to enable checked records?");
		}
		$("#ajax-loading-div").show();

		$.ajax({

			url : ajax_url + "/admin/menus/bulkEnableSitemapMenu/" + ids,
			success : function() {
				window.location.href = ajax_url + "/admin/menus/listSitemapMenu";
				$("#ajax-loading-div").hide();
			}
		});

	});
	//Bulk Disable Sitemap Menu Item
	$("#bulkDisableSitemapMenu").live('click', function() {

		var ids = new Array()
		$(".allchk:checked").each(function() {
			ids.push(this.value)
		});
		if(ids == '') {

			alert("Please select records to be disable.");
			return false;

		} else {

			alert("Are you sure want to disable checked records?");
		}
		$("#ajax-loading-div").show();

		$.ajax({

			url : ajax_url + "/admin/menus/bulkDisableSitemapMenu/" + ids,
			success : function() {
				window.location.href = ajax_url + "/admin/menus/listSitemapMenu";
				$("#ajax-loading-div").hide();
			}
		});

	});
	//Bulk enable Testimonial
	$("#bulkEnableTestimonial").live('click', function() {

		var ids = new Array()
		$(".allchk:checked").each(function() {
			ids.push(this.value)
		});
		if(ids == '') {

			alert("Please select records to be enable.");
			return false;

		} else {

			alert("Are you sure want to enable checked records?");
		}
		//$("#ajax-loading-div").show();

		$.ajax({

			url : ajax_url + "/admin/testimonials/bulkEnableTestimonial/" + ids,
			success : function() {
				window.location.href = ajax_url + "/admin/testimonials/listTestimonial";
				//$("#ajax-loading-div").hide();
			}
		});

	});
	//Bulk Disable Testimonial
	$("#bulkDisableTestimonial").live('click', function() {

		var ids = new Array()
		$(".allchk:checked").each(function() {
			ids.push(this.value)
		});
		if(ids == '') {

			alert("Please select records to be disable.");
			return false;

		} else {

			alert("Are you sure want to disable checked records?");
		}
		//$("#ajax-loading-div").show();

		$.ajax({

			url : ajax_url + "/admin/testimonials/bulkDisableTestimonial/" + ids,
			success : function() {
				window.location.href = ajax_url + "/admin/testimonials/listTestimonial";
				//$("#ajax-loading-div").hide();
			}
		});

	});
	//Bulk enable Testimonial
	$("#bulkEnableRecruite").live('click', function() {

		var ids = new Array()
		$(".allchk:checked").each(function() {
			ids.push(this.value)
		});
		if(ids == '') {

			alert("Please select records to be enable.");
			return false;

		} else {

			alert("Are you sure want to enable checked records?");
		}
		//$("#ajax-loading-div").show();

		$.ajax({

			url : ajax_url + "/admin/Recruitments/bulkEnableRecruitment/" + ids,
			success : function() {
				window.location.href = ajax_url + "/admin/Recruitments/listRecruitment";
				//$("#ajax-loading-div").hide();
			}
		});

	});
	//Bulk Disable Testimonial
	$("#bulkDisableRecruite").live('click', function() {

		var ids = new Array()
		$(".allchk:checked").each(function() {
			ids.push(this.value)
		});
		if(ids == '') {

			alert("Please select records to be disable.");
			return false;

		} else {

			alert("Are you sure want to disable checked records?");
		}
		//$("#ajax-loading-div").show();

		$.ajax({

			url : ajax_url + "/admin/Recruitments/bulkDisableRecruitment/" + ids,
			success : function() {
				window.location.href = ajax_url + "/admin/Recruitments/listRecruitment";
				//$("#ajax-loading-div").hide();
			}
		});

	});
	//Bulk enable Forum
	$("#bulkEnableForum").live('click', function() {

		var ids = new Array()
		$(".allchk:checked").each(function() {
			ids.push(this.value)
		});
		if(ids == '') {

			alert("Please select records to be enable.");
			return false;

		} else {

			alert("Are you sure want to enable checked records?");
		}
		//$("#ajax-loading-div").show();

		$.ajax({

			url : ajax_url + "/admin/travelForums/bulkEnableForum/" + ids,
			success : function() {
				window.location.href = ajax_url + "/admin/travelForums/listForum";
				//$("#ajax-loading-div").hide();
			}
		});

	});
	//Bulk Disable Forum
	$("#bulkDisableForum").live('click', function() {

		var ids = new Array()
		$(".allchk:checked").each(function() {
			ids.push(this.value)
		});
		if(ids == '') {

			alert("Please select records to be disable.");
			return false;

		} else {

			alert("Are you sure want to disable checked records?");
		}
		//$("#ajax-loading-div").show();

		$.ajax({

			url : ajax_url + "/admin/travelForums/bulkDisableForum/" + ids,
			success : function() {
				window.location.href = ajax_url + "/admin/travelForums/listForum";
				//$("#ajax-loading-div").hide();
			}
		});

	});
	//Bulk make Featured
	$("#bulkFeatured").live('click', function() {

		var ids = new Array()
		$(".allchk:checked").each(function() {
			ids.push(this.value)
		});
		if(ids == '') {

			alert("Please select records to make featured.");
			return false;

		} else {

			alert("Are you sure want to make featured the checked records?");
		}
		$("#ajax-loading-div").show();

		$.ajax({

			url : ajax_url + "/admin/Tours/bulkFeatured/" + ids,
			success : function() {
				window.location.href = ajax_url + "/admin/Tours/listTours";
				$("#ajax-loading-div").hide();
			}
		});

	});
	//END BULK ENABLE / DISABLE

	//PAGINATION a TABS in CMS
	$(".pagination a").live("click", function() {

		var acturl = $(this).attr('href');
		$('#element-box').addClass('loadingeffect');
		$("#ajax-loading-div").show();
		$.ajax({

			type : 'post',
			url : acturl,
			success : function(msg) {
				$("#pagingDivParent").html(msg);
				$("#ajax-loading-div").hide();
				$('#element-box').removeClass('loadingeffect');
			}
		});

		return false;

	});
	//PAGINATION a TABS in Front end
	$(".paging a").live("click", function() {

		window.scrollTo(1, 200);
		var acturl = $(this).attr('href');
		$('#contentwrap').addClass('loadingeffect');
		$("#ajax-loading-div").show();
		$.ajax({

			type : 'post',
			url : acturl,
			success : function(msg) {
				$("#PagingFront").html(msg);
				$("#ajax-loading-div").hide();
				$('#contentwrap').removeClass('loadingeffect');
			}
		});

		return false;

	});
	//END PAGINATION
	//END PAGINATION

	//RECORD SHOW PER PAGE
	$('#perPage').live('change', function() {
		if($('#perPage').val() == 'all') {
			var url = document.location + '/limit:500';
		} else {
			var url = document.location + '/limit:' + $("#perPage").val();
		}
		$("#pagingDivParent").load(unescape(url));
	});

	$("div.paging a").live("click", function() {
		var formId = $(this).parents('form').attr('id');
		var divId = $(this).parents('div').attr('id');
		//$("#loading").show();
		//show_overlay();
		$("#pagingDivParent").load(unescape($(this).attr("href")));
		//$(".black_overlay").hide();
		return false;
	});
	//END OF RECORD SHOW PER PAGE

});
//END OF DOCUMENT READY FUNCTION

//Bulk Disable Media Items
$("#bulkEnableMedia").live('click', function() {

	var ids = new Array()
	$(".allchk:checked").each(function() {
		ids.push(this.value)
	});
	if(ids == '') {

		alert("Please select records to be enable.");
		return false;

	} else {

		alert("Are you sure want to enable checked records?");
	}
	//$("#ajax-loading-div").show();

	$.ajax({

		url : ajax_url + "/admin/Media/bulkEnableMedia/" + ids,
		success : function() {
			window.location.href = ajax_url + "/admin/Media/listMedia";
			//$("#ajax-loading-div").hide();
		}
	});

});
//Bulk Disable Media Items

//Bulk Disable Media Itema
$("#bulkDisableMedia").live('click', function() {

	var ids = new Array()
	$(".allchk:checked").each(function() {
		ids.push(this.value)
	});
	if(ids == '') {

		alert("Please select records to be disable.");
		return false;

	} else {

		alert("Are you sure want to disable checked records?");
	}
	//$("#ajax-loading-div").show();

	$.ajax({

		url : ajax_url + "/admin/Media/bulkDisableMedia/" + ids,
		success : function() {
			window.location.href = ajax_url + "/admin/Media/listMedia";
			//$("#ajax-loading-div").hide();
		}
	});

});
//END BULK ENABLE / DISABLE

//Bulk Disable News Items
$("#bulkEnableNews").live('click', function() {

	var ids = new Array()
	$(".allchk:checked").each(function() {
		ids.push(this.value)
	});
	if(ids == '') {

		alert("Please select records to be enable.");
		return false;

	} else {

		alert("Are you sure want to enable checked records?");
	}
	//$("#ajax-loading-div").show();

	$.ajax({

		url : ajax_url + "/admin/News/bulkEnableNews/" + ids,
		success : function() {
			window.location.href = ajax_url + "/admin/News/listNews";
			//$("#ajax-loading-div").hide();
		}
	});

});
//Bulk Disable News Items

//Bulk Disable News Itema
$("#bulkDisableNews").live('click', function() {

	var ids = new Array()
	$(".allchk:checked").each(function() {
		ids.push(this.value)
	});
	if(ids == '') {

		alert("Please select records to be disable.");
		return false;

	} else {

		alert("Are you sure want to disable checked records?");
	}
	//$("#ajax-loading-div").show();

	$.ajax({

		url : ajax_url + "/admin/News/bulkDisableNews/" + ids,
		success : function() {
			window.location.href = ajax_url + "/admin/News/listNews";
			//$("#ajax-loading-div").hide();
		}
	});

});
//END BULK ENABLE / DISABLE

//Bulk Disable General Pages
$("#bulkEnableGenPage").live('click', function() {

	var ids = new Array()
	$(".allchk:checked").each(function() {
		ids.push(this.value)
	});
	if(ids == '') {

		alert("Please select records to be enable.");
		return false;

	} else {

		alert("Are you sure want to enable checked records?");
	}
	//$("#ajax-loading-div").show();

	$.ajax({

		url : ajax_url + "/admin/GeneralPages/bulkEnableGeneralPage/" + ids,
		success : function() {
			window.location.href = ajax_url + "/admin/GeneralPages/listGeneralPages";
			//$("#ajax-loading-div").hide();
		}
	});

});
//Bulk Disable General Pages

//Bulk Disable General Pages
$("#bulkDisableGenPage").live('click', function() {

	var ids = new Array()
	$(".allchk:checked").each(function() {
		ids.push(this.value)
	});
	if(ids == '') {

		alert("Please select records to be disable.");
		return false;

	} else {

		alert("Are you sure want to disable checked records?");
	}
	//$("#ajax-loading-div").show();

	$.ajax({

		url : ajax_url + "/admin/GeneralPages/bulkDisableGeneralPage/" + ids,
		success : function() {
			window.location.href = ajax_url + "/admin/GeneralPages/listGeneralPages";
			//$("#ajax-loading-div").hide();
		}
	});

});
//END BULK ENABLE / DISABLE

//Bulk Enable Tours
$("#bulkEnableTours").live('click', function() {

	var ids = new Array()
	$(".allchk:checked").each(function() {
		ids.push(this.value)
	});
	if(ids == '') {

		alert("Please select records to be enable.");
		return false;

	} else {

		alert("Are you sure want to enable checked records?");
	}
	//$("#ajax-loading-div").show();

	$.ajax({

		url : ajax_url + "/admin/Tours/bulkEnableTours/" + ids,
		success : function() {
			window.location.href = ajax_url + "/admin/Tours/listTours";
			//$("#ajax-loading-div").hide();
		}
	});

});
//Bulk Disable Tours
$("#bulkDisableTours").live('click', function() {

	var ids = new Array()
	$(".allchk:checked").each(function() {
		ids.push(this.value)
	});
	if(ids == '') {

		alert("Please select records to be disable.");
		return false;

	} else {

		alert("Are you sure want to disable checked records?");
	}
	//$("#ajax-loading-div").show();

	$.ajax({

		url : ajax_url + "/admin/Tours/bulkDisableTours/" + ids,
		success : function() {
			window.location.href = ajax_url + "/admin/Tours/listTours";
			//$("#ajax-loading-div").hide();
		}
	});

});
//END BULK ENABLE / DISABLE

//Bulk Disable General Pages
$("#bulkEnableDestinations").live('click', function() {

	var ids = new Array()
	$(".allchk:checked").each(function() {
		ids.push(this.value)
	});
	if(ids == '') {

		alert("Please select records to be enable.");
		return false;

	} else {

		alert("Are you sure want to enable checked records?");
	}
	//$("#ajax-loading-div").show();

	$.ajax({

		url : ajax_url + "/admin/Tours/bulkEnableDestinations/" + ids,
		success : function() {
			window.location.href = ajax_url + "/admin/Tours/list_destinations";
			//$("#ajax-loading-div").hide();
		}
	});

});
//Bulk Disable General Pages

//Bulk Disable General Pages
$("#bulkDisableDestinations").live('click', function() {

	var ids = new Array()
	$(".allchk:checked").each(function() {
		ids.push(this.value)
	});
	if(ids == '') {

		alert("Please select records to be disable.");
		return false;

	} else {

		alert("Are you sure want to disable checked records?");
	}
	//$("#ajax-loading-div").show();

	$.ajax({

		url : ajax_url + "/admin/Tours/bulkDisableDestinations/" + ids,
		success : function() {
			window.location.href = ajax_url + "/admin/Tours/list_destinations";
			//$("#ajax-loading-div").hide();
		}
	});

});
// Enable/Disable Specifics

//Bulk Enable Specific
$("#bulkEnableSpecific").live('click', function() {

	var ids = new Array()
	$(".allchk:checked").each(function() {
		ids.push(this.value)
	});
	if(ids == '') {

		alert("Please select records to be enable.");
		return false;

	} else {

		alert("Are you sure want to enable checked records?");
	}
	//$("#ajax-loading-div").show();

	$.ajax({

		url : ajax_url + "/admin/Tours/bulkEnableSpecifics/" + ids,
		success : function() {
			window.location.href = ajax_url + "/admin/Tours/list_specifics/" + $('#hiddenBroadId').val();

		}
	});

});
//Bulk Disable Specific
$("#bulkDisableSpecifics").live('click', function() {

	var ids = new Array()
	$(".allchk:checked").each(function() {
		ids.push(this.value)
	});
	if(ids == '') {

		alert("Please select records to be disable.");
		return false;

	} else {

		alert("Are you sure want to disable checked records?");
	}
	//$("#ajax-loading-div").show();

	$.ajax({

		url : ajax_url + "/admin/Tours/bulkDisableSpecifics/" + ids,
		success : function(resp) {
			if(resp != '') {
				alert(resp);
			}

			//window.location.href= ajax_url+"/admin/Tours/list_specifics/"+$('#hiddenBroadId').val();
		}
	});

});
// Delete All Specififcs

$("#bulkDeleteSpecifics").live('click', function() {

	var ids = new Array()
	$(".allchk:checked").each(function() {
		ids.push(this.value)
	});
	if(ids == '') {

		alert("Please select records to be disable.");
		return false;

	} else {

		alert("Are you sure want to delete checked records?");
	}
	//$("#ajax-loading-div").show();

	$.ajax({

		url : ajax_url + "/Tours/delete_all_specific/" + ids,
		success : function(resp) {
			//window.location.href= ajax_url+"/admin/Tours/list_specifics/"+$('#hiddenBroadId').val();
			if(resp != '') {
				alert(resp);
			} else {
				$('.adminlist').children('tbody').fadeOut(500);
			}
		}
	});

});
// Eanble/Disable Specifics
