// Bulletin/Blog Script Version 1.0
// Copyright (C)2008 GothMix.com Some Rights Reserved

goto = 'index.php?page=members';
serverProcessFile = 'index.php';

$(document).ready(function(){

	$(".button").css({"background-color":"#000000","border":"1px solid #999999","padding":"5px","cursor":"pointer","color":"#FFFFFF","font-weight":"bold"});
	$(".button2").css({"background-color":"red","border":"1px solid #999999","padding":"5px","cursor":"pointer","color":"#FFFFFF","font-weight":"bold"});	

})
function closeBulletin()
{
	$("#bulletin-box").fadeOut("slow");
}
function submitBulletin()
{		
	var poster = $("#poster").val();
	var bulletin = $("#bulletin").val();
	var subject = $("#subject2").val();

		$.post(serverProcessFile, { page: "manage_bulletin", ajax: "true", poster: poster, bulletin: bulletin, subject: subject },function(data){
	if(confirm(data + " Continue to view bulletins?")){document.location.href = goto;}else{$("#bulletin-box").fadeOut("slow");}
});
}

function submitVideo()
{		
	var poster = $("#poster").val();
	var url = $("#url").val();
	var title = $("#title").val();
		$.post(serverProcessFile, { page: "manage_videos", ajax: "true", poster: poster, url: url, title: title },function(data){
	//if(confirm(data + " Continue to view bulletins?")){document.location.href = goto;}else{$("#bulletin-box").fadeOut("slow");}
	alert(data);
	document.location = document.location;
});
}

function closeBulletin2()
{
	$("#bulletin-box2").fadeOut("slow");
}


//Capturing The Mouse Position in IE4-6 & NS4-6
//(C) 2000 www.CodeLifter.com
//Free for all users, but leave in this  header
function getMouseXY(e) {
  if (IE) { // grab the x-y pos.s if browser is IE
    tempX = event.clientX + document.body.scrollLeft
    tempY = event.clientY + document.body.scrollTop
  } else {  // grab the x-y pos.s if browser is NS
    tempX = e.pageX
    tempY = e.pageY
  }  
  // catch possible negative values in NS4
  if (tempX < 0){tempX = 0}
  if (tempY < 0){tempY = 0}  
  // show the position values in the form named Show
  // in the text fields named MouseX and MouseY
 //document.getElementById("bulletin-box2").style.left = tempX
 //document.getElementById("bulletin-box2").style.top = tempY
//$("#bulletin-box2").css({"color":"#000000","position":"absolute","top": 350,"left": width/2 - boxWidth/2});
 $("#bulletin-box2").css({"color":"#000000","position":"absolute","top": tempX,"left": tempY});
  return true
}


$(document).ready(function(){
	$(".blinks").click(function(e)
 {
	var boxHeight = $("#bulletin-box2").height();
	var boxWidth = $("#bulletin-box2").width(); 
	var leftVal=e.pageX+ 50 +"px";
	var topVal=e.pageY-(boxHeight/2)+"px";
    var bid = $(this).attr('id');
	
   	//$("#bulletin-box2").css({"color":"#000000","position":"absolute","top": 350,"left": width/2 - boxWidth/2});
	$("#bulletin-box2").css({"color":"#000000","position":"absolute","top":topVal,"left":leftVal});
	$("#bulletin-box2").fadeIn(1200);
	$.post(serverProcessFile, { page: "manage_bulletin", ajax: "true", bid: bid },function(data){$("#bulletin2").html(data);});
	});
})
	
function showBulletin(bid)
{
	var height = $(document).height();
	var width = $(document).width();
	var boxHeight = $("#bulletin-box2").height();
	var boxWidth = $("#bulletin-box2").width();
	$("#bulletin-box2").css({"color":"#000000","position":"absolute","top": 450,"left": width/2 - boxWidth/2});
	//$("#bulletin-box2").css({"color":"#000000","position":"absolute","top":topVal,"left":leftVal});
	$("#bulletin-box2").fadeIn(1200);
	$.post(serverProcessFile, { page: "manage_bulletin", ajax: "true", bid: bid },function(data){$("#bulletin2").html(data);});
}

$(document).ready(function(){
// ImageShow Function Copyright(c)2009 GothMix.com
if($(".overimage").length > 0) {
$(".overimage").hover(function(e2)
 {
    var img = $(this).attr('id');
	$("#the-image-box").attr({src: img});
	var boxHeight = $("#image-box").height();
	var boxWidth = $("#image-box").width(); 
	var leftVal=e2.pageX+ 65 +"px";
	var topVal=e2.pageY-(boxHeight/2)+"px";
  	$("#image-box").css({"background-color":"transparent","position":"absolute","top":topVal,"left":leftVal});
	$("#image-box").fadeIn(100);
	},
function (e2) {
//$("#image-box").fadeOut(1200);
$("#image-box").css({"display":"none"});
      }
	);
	}
})

function bulletinPost()
{
	$("#bulletin").val("");
	var height = $(document).height();
	var width = $(document).width();
	var boxHeight = $("#bulletin-box").height();
	var boxWidth = $("#bulletin-box").width();
	$("#bulletin-box").css({"color":"#FFFFFF","position":"absolute","top": 500,"left": width/2 - boxWidth/2});
//height/2 - boxHeight/2
	$("#bulletin-box").fadeIn(1200);
}


$(document).ready(function(){
	$(".bpost").click(function(e)
 {
 	$("#bulletin").val("");
	var boxHeight = $("#bulletin-box2").height();
	var boxWidth = $("#bulletin-box2").width(); 
	var leftVal=e.pageX+ 50 +"px";
	var topVal=e.pageY-(boxHeight/2)+"px";
  	$("#bulletin-box").css({"color":"#FFFFFF","position":"absolute","top":topVal,"left":leftVal});
	$("#bulletin-box").fadeIn(1200);
	});
})


// start blog code

$(document).ready(function(){

	$(".button").css({"background-color":"#000000","border":"1px solid #999999","padding":"5px","cursor":"pointer","color":"#FFFFFF","font-weight":"bold"});
	$(".button2").css({"background-color":"red","border":"1px solid #999999","padding":"5px","cursor":"pointer","color":"#FFFFFF","font-weight":"bold"});	

})
function closeBlog()
{
	$("#blog-box").fadeOut("slow");
}
function submitBlog()
{		
	var poster = $("#poster3").val();
	var blog = $("#blogText").val();
	var subject = $("#subject3").val();
	
	//alert(blog);

		$.post(serverProcessFile, { page: "manage_blog", ajax: "true", poster: poster, blog: blog, subject: subject },function(data){
	if(confirm(data + " Continue to view blogs?")){location.reload(true);}else{$("#blog-box").fadeOut("slow");}
});
}

function closeBlog2()
{
	$("#blog-box2").fadeOut("slow");
}

function showBlog(bid)
{
	var height = $(document).height();
	var width = $(document).width();
	var boxHeight = $("#blog-box2").height();
	var boxWidth = $("#blog-box2").width();
	$("#blog-box2").css({"color":"#000000","position":"absolute","top": 350,"left": 300});
$("#blog-box2").fadeIn(1200);
	$.post(serverProcessFile, { page: "manage_blog", ajax: "true", bid: bid },function(data){$("#blog2").html(data);});

}

$(document).ready(function(){
	$(".blinks2").click(function(e)
 {
	var boxHeight = $("#blog-box2").height();
	var boxWidth = $("#blog-box2").width();
	var leftVal=e.pageX + 50 +"px";
	var topVal=e.pageY-(boxHeight/2)+"px";
	var bid = $(this).attr('id');
	
	//alert(bid);
	
	$("#blog-box2").css({"color":"#000000","position":"absolute","top": topVal,"left": leftVal});
	$("#blog-box2").fadeIn(1200);
	$.post(serverProcessFile, { page: "manage_blog", ajax: "true", bid: bid },function(data){$("#blog2").html(data);});
	});
})


$(document).ready(function(){
	$(".blinks3").click(function(e)
 {
 
 //alert('test');
 
	var boxHeight = $("#blog-box2").height();
	var boxWidth = $("#blog-box2").width();
	var leftVal=e.pageX + 50 +"px";
	var topVal=e.pageY-(boxHeight/2)+"px";
	var bid = $(this).attr('id');
	
	//alert(bid);
	
	$("#blog-box2").css({"color":"#000000","position":"absolute","top": topVal,"left": leftVal});
	$("#blog-box2").fadeIn(1200);
	$.post(serverProcessFile, { page: "manage_blog", ajax: "true", bid: bid },function(data){$("#blog2").html(data);});
	});
})

function popBlog(id)
{
	var e = document.getElementById(id);
	//var e = window.event;
	var boxHeight = $("#blog-box2").height();
	var boxWidth = $("#blog-box2").width();
	var leftVal=e.pageX + 50 +"px";
	var topVal=e.pageY-(boxHeight/2)+"px";
	var bid = $("#" + id + "").attr('id');
	$("#blog-box2").css({"color":"#000000","position":"absolute","top": topVal,"left": leftVal});
	$("#blog-box2").fadeIn(1200);
	$.post(serverProcessFile, { page: "manage_blog", ajax: "true", bid: bid },function(data){$("#blog2").html(data);});
}

function blogPost()
{
	$("#blog").val("");
	var height = $(document).height();
	var width = $(document).width();
	var boxHeight = $("#blog-box").height();
	var boxWidth = $("#blog-box").width();
	$("#blog-box").css({"color":"#FFFFFF","position":"absolute","top": 300,"left": width/2 - boxWidth/2});
//height/2 - boxHeight/2
	$("#blog-box").fadeIn(1200);
}
