/*<![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 Menu
	$("ul.topnav ul").css({display: "none"}); // Opera Fix
	
	$("ul.topnav li.open").each(function(){
										 
		var linkWidth = $(this).find('a').width();
		var ulWidth = linkWidth+80;
		var aWidth = linkWidth+72;
		//var flag = $("a.title.selected");
		$(this).find('ul').css({"width":ulWidth});
		$(this).find('ul li a').css({"width":aWidth});
		
		$(this).hover(function(){
				//$(this).find('a.title, bdo').css({"background":"#d7edce"}).parent().parent().filter(".open").prepend('<div class="white"></span>');
				//$(this).filter(".open").css({"padding": "0px 0px 14px 0px"});
				//$(this).find('a.title').css({"line-height": "14px"});
				$(this).find('ul:first').css({visibility: "visible",display: "none"}).slideDown("fast");
			},function(){
				if(!$(this).find('a.title.selected').is("a.title.selected")){
					//$(this).find('a.title, bdo').css({"background":"#ffffff"});
				}
				//$(this).find('a.title, bdo').parent().parent().find(".white").remove();
				//$(this).filter(".open").css({"padding": "0px"});
				//$(this).find('a.title').css({"line-height": "14px"});
				$(this).find('ul:first').css({visibility: "hidden"});
		});
	});
// --> Start slider
	$('#slider').nivoSlider({
		effect:'fade', //Specify sets like: 'fold,fade,sliceDown'
		slices:15,
		animSpeed:800,
		pauseTime:6000,
		startSlide:0, //Set starting Slide (0 index)
		directionNav:false, //Next & Prev
		directionNavHide:true, //Only show on hover
		controlNav:false, //1,2,3...
		controlNavThumbs:false, //Use thumbnails for Control Nav
		controlNavThumbsFromRel:false, //Use image rel for thumbs
		controlNavThumbsSearch: '.jpg', //Replace this with...
		controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
		keyboardNav:false, //Use left & right arrows
		pauseOnHover:false, //Stop animation while hovering
		manualAdvance:false, //Force manual transitions
		captionOpacity:0.8, //Universal caption opacity
		beforeChange: function(){},
		afterChange: function(){},
		slideshowEnd: function(){} //Triggers after all slides have been shown
	});
// --> 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);
		}
	});
});

/*****************************************************************************
//-> END Window Load
*****************************************************************************/

/*]]>*/
