this.imagePreview = function(){	
	/* CONFIG */
		
		
		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
		
	/* END CONFIG */
	$("img.preview").hover(function(e){
		this.t = this.title;
		this.title = "";	
		//alert(this.rel);
		
		if($(this).attr("rel")=='potd') {
			xOffset = -535;
			yOffset = -350;
		} else {
			xOffset = -235;
			yOffset = -50;	
		}
		var c = (this.t != "") ? "<br/>" + this.t : "";
		$("body").append("<p id='preview'><img src='"+ this.src +"' alt='Image preview' />"+ c +"</p>");								 
		$("#preview")
			.css("top",(e.pageY + yOffset) + "px")
			.css("left",(e.pageX + xOffset) + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = this.t;	
		$("#preview").remove();
    });	
	$("img.preview").mousemove(function(e){
				
		$("#preview")
			.css("top",(e.pageY + yOffset) + "px")
			.css("left",(e.pageX + xOffset) + "px");
	});			
};

var commentinputtime = setTimeout("",0);
$(document).ready(function () {

$('.remove_ssotd').click(function () {
								   $.post("ssotd.php", { actswitch: $(this).attr('rel') } );
								   $(this).parent().parent().parent().toggleClass('ssotd_inact');
								   return false;
								   });
imagePreview();
//$('.admin').toggle();
$('#commentinput').focus(function () {
								   		$(this).attr('style','height:150px;');
										clearTimeout(commentinputtime);
								   });
$('#commentinput').blur(function () {
   								   		commentinputtime = setTimeout("$('#commentinput').attr('style','height:25px;');",1000);
								   });
$('#disableadmin').click(function() {
										$('.admin').toggleClass('nadmin');
										return false;
									});
$('#signin input').focus(function () {
	$(this).attr('style','color:#000;');
});
$('#signin input').blur(function () {
	$(this).attr('style','');
});
});
function randomString() {
	var chars = "ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
	var string_length = 8;
	var randomstring = '';
	for (var i=0; i<string_length; i++) {
		var rnum = Math.floor(Math.random() * chars.length);
		randomstring += chars.substring(rnum,rnum+1);
	}
	return randomstring;
}