$(document).ready(function(){
	var Base = $('base').attr('href');
	//
	$('a.delete').click(function(){
		return confirm('Are you sure that you want to delete this record?');
	});
	//
	$('a.update').click(function(){
		return confirm('Are you sure that you want to update this record?');
	});
	$('a.activate').click(function(){
		return confirm('Are you sure that you want to Activate/Suspend this user?');
	});
	
	$('a.lockproject').click(function(){
		return confirm('Are you sure that you want to Activate/Suspend the project?');
	});
	//
	$('a.admin').click(function(){
		return confirm('Are you sure that you want to Promote/Demote this user?');
	});
	
	$('a.lockprayer').click(function(){
		return confirm('Are you sure that you want to Activate/Suspend the prayer?');
	});
	
	$('a.locktestimony').click(function(){
		return confirm('Are you sure that you want to Activate/Suspend the testimony?');
	});
	
	$('a.delete_photo').click(function(){
		return confirm('Are you sure that you want to delete this photograph?');
	});
	
	// Main Menu...
	$(".nav_bar a").click(function(){ return false;});
	$(".nav_bar").mouseover(function(){
		$(".nav_bar").removeClass('nav_bar_down');
		$(this).addClass('nav_bar_down');
		$("div.sub_menu").css({display:'none'});
		$($('a', this).attr('href')).css({display:'block'});
	});
	
	$("td#LinkHome.nav_bar, td#LinkHome.nav_bar a").click(function(){ window.location.href = Base;});
//	$("td#LinkAbout.nav_bar, td#LinkAbout.nav_bar a").click(function(){ window.location.href = Base + 'about-view/';});
	$("td#LinkContact.nav_bar, td#LinkContact.nav_bar a").click(function(){ window.location.href = Base + 'contact-view/';});
	
	//$("td#LinkBlog.nav_bar, td#LinkBlog.nav_bar a").click(function(){ window.location.href = Base + 'blog-list/';});
	$("td#LinkBlog.nav_bar, td#LinkBlog.nav_bar a").click(function(){ window.location.href = 'http://blog.godreports.com';});
	$("td#CreateGodRep1.nav_bar, td#CreateGodRep1.nav_bar a").click(function(){ window.location.href = Base + 'user-signin/';});
	$("td#CreateGodRep2.nav_bar, td#CreateGodRep2.nav_bar a").click(function(){ window.location.href = Base + 'user-account/';});
	$("td#CreateGodRep3.nav_bar, td#CreateGodRep3.nav_bar a").click(function(){ window.location.href = Base + 'organization-profile/';});
	$("td#CreateGodRep4.nav_bar, td#CreateGodRep4.nav_bar a").click(function(){ window.location.href = Base + 'user-profile/';});
	
	$("td#LinkGotoGodReport1.nav_bar, td#LinkGotoGodReport1.nav_bar a").click(function(){ window.location.href = Base + 'user-signin/';});
	$("td#LinkGotoGodReport2.nav_bar, td#LinkGotoGodReport2.nav_bar a").click(function(){ window.location.href = Base + 'user-account/';});
	$("td#LinkGotoGodReport3.nav_bar, td#LinkGotoGodReport3.nav_bar a").click(function(){ window.location.href = Base + 'organization-view/' + $('#userid').val();});
	$("td#LinkGotoGodReport4.nav_bar, td#LinkGotoGodReport4.nav_bar a").click(function(){ window.location.href = Base + 'ministry-view/' + $('#userid').val();});


		$("#report_but").click(function(){
			var x = $("#report_mis").html();
			var xFm = {};
			$.prompt(x,
				{
					submit: function(v, m, f){
						var args = {
							name: $("input[name='misName']", "#brownJqi").val(),
							email: $("input[name='misEmail']", "#brownJqi").val(),
							comments: $("textarea[name='misTxt']", "#brownJqi").val(),
							url: window.location.href
						};
						//=-
						if(v && xFm.form()){
							$.post("contact-misuse-do/", args, function(data){ alert(data); }, "text");
							return true;
						}else if(v){
							xFm.showErrors();
							return false;
						}
						return true;
					},
					buttons: {Ok:true, Cancel:false},
					prefix: 'brownJqi',
					zIndex: 2000,
					loaded:function(){
						xFm = $("#brownJqi form" ).validate({
							rules: {
								misName : "required",
								misEmail: {required:true,email:true},
								misTxt: "required"
							}
						});
					}
				});
			return false; 
		});

	$("#ShowVideo").click(function(){
		$("div#DivVideo").slideDown("slow");
	});
	$("#CloseVideo").click(function(){
		$("div#DivVideo").slideUp("slow");
	});

/*
	$("div.menu ul a").click(function(){
		alert($(this).attr('href'));				  
		if( '#' == $(this).attr('href')){
			return false;
		}
		return true;
	});
	
	$("ul.jd_menu").jdMenu();
*/
});

