/*<![CDATA[*/
		   
/*****************************************************************************
//-> START General Functions
*****************************************************************************/
// --> Start label2value
this.label2value = function(){
	// function
	$("label.quick").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);
				};
			});
		};
	});
};

/*****************************************************************************
//-> END General Functions
*****************************************************************************/

/*****************************************************************************
//-> START Window Load
*****************************************************************************/

$(window).load(function () {

// --> Start Cycle
	// Add 'scrollVert' functionality for scroll boxe
	(function($) {

		$.fn.cycle.transitions.scrollVert = function($cont, $slides, opts) {
		    $cont.css('overflow','hidden');
		    opts.before.push(function(curr, next, opts, fwd) {
		        $(this).show();
		        var currH = curr.offsetHeight, nextH = next.offsetHeight;
		        opts.cssBefore = fwd ? { top: -nextH } : { top: nextH };
		        opts.animIn.top = 0;
		        opts.animOut.top = fwd ? currH : -currH;
		        $slides.not(curr).css(opts.cssBefore);
		    });
		    opts.cssFirst = { top: 0 };
		    opts.cssAfter = { display: 'none' }
		};

	})(jQuery);
	
	// Init scroll
	$('div.scroll ul').cycle({ 
	    fx: 'scrollVert',
		speed: 850,
		rev: true,
		next:   'div.scroll ol li.next', 
	    prev:   'div.scroll ol li.previous',
		timeout: 6000
	});

// --> Init Image cycle
	$("#scroll2 ul").cycle({ 
		fx:     'fade', 
		speed:  2500, 
		timeout: 5000, 
		sync:1
	});	
	
	// --> Init FancyBox
	$("a[rel*='iframe']").fancybox({
		titleShow		:false,
		transitionIn	:'elastic',
		transitionOut	:'elastic',
		easingIn		:'easeOutBack',
		easingOut		:'easeInBack',
		overlayOpacity	:0.0,
		type			:'iframe',
		width			:450,
		height			:400
	});
	
// --> Start Disable '#' links from being clicked
	$("a[href^='#']").click(function() {
		return false;
	});

// --> Init External Links
	$("a[rel*='external']").attr("target","_blank");
	
// --> Stripping a tags with: class="remove"
	$("a[class*='strip']").each(function(){
		$(this).replaceWith($(this).html()); 
	});
	
// --> Init SPAM Email links
	$("a[href^='mailto:']").each(function(){
		var mail = $(this).attr("href").replace("mailto:","");
		var replaced = mail.replace("/at/","@");
		$(this).attr("href","mailto:"+replaced);
		if($(this).text() == mail){ 
			$(this).text(replaced);
		}
	});

// --> Init Label2Value
	label2value();
});

/*****************************************************************************
//-> END Window Load
*****************************************************************************/

/*]]>*/
