$(document).ready(function(){

	/*
	----------------------------------------------------------
	GENERAL
	---------------------------------------------------------- */
	
	// HOVER FADE
	$('.fade').hover(function() {
		$(this).animate({opacity: 0.7}, "fast");
	}, function() {
		$(this).animate({opacity: 1}, "fast");
	});

	
	// CLEAR VALUE ON FOCUS
	$('.labelvalue').each(function() {
	    var default_value = this.value;
	    $(this).focus(function() {
	        if(this.value == default_value) {
	            this.value = '';
	        }
	    });
	    $(this).blur(function() {
	        if(this.value == '') {
	            this.value = default_value;
	        }
	    });
	});
	
	
	// EXTERNAL WINDOWS
	$('a[rel="external"]').click( function() {
        window.open( $(this).attr('href') );
        return false;
    });
	
	
	// MAKE ENTIRE AREA CLICKABLE
	$(".highlight").click(function(){
		if($(this).find("a").attr("rel") == "external") {
		    window.open($(this).find("a").attr("href"))
		} else{
		    window.location=$(this).find("a").attr("href"); return false;
		    return;
		}
	});
	
	
	// MONCUR LOGO ANIM
	$("#moncur a em").hide();
	$("#moncur a").hover(function() {
		$(this).find("em").animate({opacity: "show"}, "slow");
	}, function() {
		$(this).find("em").animate({opacity: "hide"}, "fast");
	});


});


// END ON READY


/*
----------------------------------------------------------
COOKIES
---------------------------------------------------------- */
function readCookie(name, delimit) {


    if (document.cookie == '') {
        return false;
    }
    else {
        var fC, lC;
        var mcookie = unescape(document.cookie);
        fC = mcookie.indexOf(name);
        var ph = fC + name.length;
        if ((fC != -1) && (mcookie.charAt(ph) == '=')) {
            fC += name.length + 1;
            lC = mcookie.indexOf(delimit, fC);
            if (lC == -1) lC = mcookie.length;
            return unescape(mcookie.substring(fC, lC));
        }
        else {
            return false;
        }
    }
}
