$(document).ready(function () {
    $(".subscribe, .unsubscribe").hide();
	$("input").focus(function () {
		var label = $(this).attr("id");
		$("#"+label+"_label").fadeOut(100);
		$("#"+label).css("background","#dddddd");
    });
	$("input").blur(function () {
		var value = $(this).val();
		if (value == ""){
			var label = $(this).attr("id");
			$("#"+label+"_label").fadeIn(100);
		}
		$("#"+label).css("background","transparent");
    });
    $(".signs").hover(function(){
    	$(this).find(".pastimg").fadeOut(100);
    	$(this).find(".pastinfo").fadeIn(100);
    },function(){
    	$(this).find(".pastimg").fadeIn(100);
    	$(this).find(".pastinfo").fadeOut(100);
    });
    $(".pastinfo").click(function(){
    	var href = $(this).parent().find(".pastimg a").attr("href");
    	window.location = href;
    });
	$("#sub_email").keypress(function() {
   		$(".subscribe").fadeIn(200);
   	});
	$("#unsub_email").keypress(function() {
   		$(".unsubscribe").fadeIn(200);
   	});    
    nextimgtip();
});

function image(k,e,d){
	$("#eximage").load("/php/getimage.php",{k:k,e:e,d:d},function (){
		nextimgtip()}
	);
}

function nextimgtip(){
	$('#nextimg').tooltip({ 
	    track: false, 
	    delay: 100, 
	    showURL: false, 
	    showBody: " - ", 
    	fade: 250
	});
}
