/* ---------------------FUNCTIONS01. Label2ValueJQUERY02. Label2Value Initializers03. MA Logo Animation04. External Windows05. Random Draw Subpage Images--------------------- ----------------------------------------------------------01. LABEL2VALUE - FORMS---------------------------------------------------------- * label2value * jquery based script for using form labels as text field values * more info on http://cssglobe.com/post/1500/using-labels-  * * Copyright (c) 2008 Alen Grakalic (cssglobe.com) * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * */this.label2value = function(){		// CSS class names	// put any class name you want	// define this in external css (example provided)	var inactive = "inactive";	var active = "active";	var focused = "focused";		// function	$("label").each(function(){				obj = document.getElementById($(this).attr("for"));		if(($(obj).attr("type") == "text") || (obj.tagName.toLowerCase() == "textarea")){						$(obj).addClass(inactive);						var text = $(this).text();			$(this).css("display","none");						$(obj).val(text);			$(obj).focus(function(){					$(this).addClass(focused);				$(this).removeClass(inactive);				$(this).removeClass(active);								  				if($(this).val() == text) $(this).val("");			});				$(obj).blur(function(){					$(this).removeClass(focused);													 				if($(this).val() == "") {					$(this).val(text);					$(this).addClass(inactive);				} else {					$(this).addClass(active);						};							});						};		});		};$(document).ready(function(){		/*	----------------------------------------------------------	02 INITIALIZERS	---------------------------------------------------------- */	label2value();	/*	----------------------------------------------------------	03. MA LOGO ANIMATION	---------------------------------------------------------- */	$("#moncur span").hide();	$("#moncur a").hover(function() {		$(this).prev("span").animate({opacity: "show", left: "18"}, "slow");	}, function() {		$(this).prev("span").animate({opacity: "hide"}, "fast");	});			/*	----------------------------------------------------------	04. EXTERNAL WINDOWS	---------------------------------------------------------- */	$(function(){	    $('a.external').click(function(){		   window.open(this.href);		   return false;	    });	});			/*	----------------------------------------------------------	05. RANDOM DRAW IMAGES & FADE	---------------------------------------------------------- */	// var totalNum = 4;	// 	var rndNum = Math.floor(Math.random() * totalNum) + 1;	// 	//$("body#home").css("background-image","url(/assets/images/bg_" + rndNum + ".jpg)");	// 	$("body#home").css("background-image","url(/assets/images/bg_" + rndNum + ".jpg)");		// HOMEPAGE	var totalNum = 4;	var rndNum = Math.floor(Math.random() * totalNum) + 1;	$("#image-fade").css("opacity",0.05);	$("#image-fade").css("background-image","url(/assets/images/bg_" + rndNum + ".jpg)");	$("#image-fade").fadeTo(2000, 01);			// SUBPAGES		$("body.sub #image-fade").css("opacity",0.05);	$("body.sub #image-fade").fadeTo(2000, 01);				});