Cufon.replace('h1,h2',{
							 
							  color: '-linear-gradient(#017838, #00441f)',
							   textShadow: '#fff 1px 1px, #eee 0px 0px'
							  });	
		
Cufon.replace('h3',{ color: '-linear-gradient(#017838, #00441f)'});

jQuery(document).ready(function(){
										  
			
			jQuery(".social li a img").stop().fadeTo("fast", 0.7);					  
			
			$(".social a").simpletooltip();
			hoverbuttonReverse();
			
			// Adds hover-function for buttons exept on IE
			if(!jQuery.browser.msie){
					hoverbutton();
				}  
			

			 
			jQuery(".zoom").hover(function(){
			jQuery(this).stop().fadeTo("medium", 0.2);
			},function(){
			jQuery(this).stop().fadeTo("slow", 1.0); 
			});
			
			jQuery(".preloader img").hover(function(){
			jQuery(this).stop().fadeTo("medium", 0.6);
			},function(){
			jQuery(this).stop().fadeTo("slow", 1.0); 
			});
			
			
			
			
	
			
			jQuery(".opensearch").click(function(){
			
				//jQuery("#content-wrapper").stop().fadeTo("medium", 0.2);
				jQuery('#ss:hidden').eq(0).fadeIn(400);
				});
				
				jQuery(".closesearch").click(function(){
				//jQuery("#content-wrapper").stop().fadeTo("medium", 1);
				jQuery('#ss').eq(0).fadeOut(200);
			});
		
			
		
	
	});


function hoverbutton(){
		jQuery(".btn, #submitbutton, #submit").hover(function(){
			jQuery(this).stop().fadeTo("medium", 0.6);
			},function(){
			jQuery(this).stop().fadeTo("slow", 1.0); 
			});	
}

function hoverbuttonReverse(){
		jQuery(".clearborder").hover(function(){
			jQuery(this).stop().fadeTo("fast", 1);
			},function(){
			jQuery(this).stop().fadeTo("medium", 0.7); 
			});
		
}




			var i = 0;//initialize
			var int=0;//Internet Explorer Fix
			jQuery(window).bind("load", function() {//The load event will only fire if the entire page or document is fully loaded
			var int = setInterval("doThis(i)",100);//500 is the fade in speed in milliseconds
			});

			function doThis() {
			var images = jQuery('img').length;//count the number of images on the page
			if (i >= images) {// Loop the images
			clearInterval(int);//When it reaches the last image the loop ends
			}
			jQuery('.preloader img:hidden').eq(0).fadeIn(400);//fades in the hidden images one by one
			i++;//add 1 to the count
	}
	

// Reverses the z-indexing for correcting ie7 z-index issues
/*$(function() {
	var zIndexNumber = 1000;
	$('div').each(function() {
		$(this).css('zIndex', zIndexNumber);
		zIndexNumber -= 10;
	});
});*/


	
	

// JavaScript Document

/* 
 * Cross-browser event handling, by Scott Andrew
 */
function addEvent(element, eventType, lamdaFunction, useCapture) {
    if (element.addEventListener) {
        element.addEventListener(eventType, lamdaFunction, useCapture);
        return true;
    } else if (element.attachEvent) {
        var r = element.attachEvent('on' + eventType, lamdaFunction);
        return r;
    } else {
        return false;
    }
}











/*
 * Clear Default Text: functions for clearing and replacing default text in
 * <input> elements.
 *
 * by Ross Shannon, http://www.yourhtmlsource.com/
 */

addEvent(window, 'load', init, false);

function init() {
    var formInputs = document.getElementsByTagName('input');
    for (var i = 0; i < formInputs.length; i++) {
        var theInput = formInputs[i];
        
        if (theInput.type == 'text' && theInput.className.match(/\bcleardefault\b/)) {  
            /* Add event handlers */          
            addEvent(theInput, 'focus', clearDefaultText, false);
            addEvent(theInput, 'blur', replaceDefaultText, false);
            
            /* Save the current value */
            if (theInput.value != '') {
                theInput.defaultText = theInput.value;
            }
        }
    }
}

function clearDefaultText(e) {
    var target = window.event ? window.event.srcElement : e ? e.target : null;
    if (!target) return;
    
    if (target.value == target.defaultText) {
        target.value = '';
    }
}

function replaceDefaultText(e) {
    var target = window.event ? window.event.srcElement : e ? e.target : null;
    if (!target) return;
    
    if (target.value == '' && target.defaultText) {
        target.value = target.defaultText;
    }
}

/**
*
*	simpleTooltip jQuery plugin, by Marius ILIE
*	visit http://dev.mariusilie.net for details
*
**/
(function($){ $.fn.simpletooltip = function(){
	return this.each(function() {
		var text = $(this).attr("title");
		$(this).attr("title", "");
		if(text != undefined) {
			$(this).hover(function(e){
				var tipX = e.pageX + 12;
				var tipY = e.pageY + 12;
				$(this).attr("title", ""); 
				$("body").append("<div id='simpleTooltip' class='shadowbox' style='position:absolute; z-index: 9999; display: none;'>" + text + "</div>");
				if($.browser.msie) var tipWidth = $("#simpleTooltip").outerWidth(true)
				else var tipWidth = $("#simpleTooltip").width()
				$("#simpleTooltip").width(tipWidth);
				$("#simpleTooltip").css("left", tipX).css("top", tipY).fadeIn("medium");
			}, function(){
				$("#simpleTooltip").remove();
				$(this).attr("title", text);
			});
			$(this).mousemove(function(e){
				var tipX = e.pageX - 10;
				var tipY = e.pageY - 50;
				var tipWidth = $("#simpleTooltip").outerWidth(true);
				var tipHeight = $("#simpleTooltip").outerHeight(true);
				if(tipX + tipWidth > $(window).scrollLeft() + $(window).width()) tipX = e.pageX - tipWidth;
				if($(window).height()+$(window).scrollTop() < tipY + tipHeight) tipY = e.pageY - tipHeight;
				$("#simpleTooltip").css("left", tipX).css("top", tipY).fadeIn("medium");
			});
		}
	});
}})(jQuery);

$(function() {
	$('a[rel*=external]').click( function() {
		window.open(this.href);
		return false;
	});
});


