//AJAX / jQuery FUNCTIONS


// slideshow
// initialize the slideshow when the DOM is ready 

	$(document).ready(function() {
    	$('div#slideshow').cycle({
			fx: 'fade',
			timeout: 4000,
      speed:  1500
			});
	});
	
	
// focus higlight
$(document).ready(function() {
			$('input[type="text"]').addClass("idleField");
       		$('input[type="text"]').focus(function() {
       			$(this).removeClass("idleField").addClass("focusField");
    		    if (this.value == this.defaultValue){ 
    		    	this.value = '';
				}
				if(this.value != this.defaultValue){
	    			this.select();
	    		}
    		});
    		$('input[type="text"]').blur(function() {
    			$(this).removeClass("focusField").addClass("idleField");
    		    if ($.trim(this.value) == ''){
			    	this.value = (this.defaultValue ? this.defaultValue : '');
				}
    		});
		});			
		
// frontpage map hover
$(document).ready(function(){

$("a.america, area.america").hover(
function() {
$("img.america").stop().animate({"opacity": "1"}, "slow");
$("img.asia").stop().animate({"opacity": "0"}, "slow");
$("img.emea").stop().animate({"opacity": "0"}, "slow");
$("img.zero").stop().animate({"opacity": "0"}, "slow");
},
function() {
/*$("img.asia").stop().animate({"opacity": "1"}, "slow");
$("img.emea").stop().animate({"opacity": "1"}, "slow");*/
$("img.zero").stop().animate({"opacity": "1"}, "slow");
}); 


$("a.emea, area.emea").hover(
function() {
$("img.emea").stop().animate({"opacity": "1"}, "slow");
$("img.america").stop().animate({"opacity": "0"}, "slow");
$("img.asia").stop().animate({"opacity": "0"}, "slow");
$("img.zero").stop().animate({"opacity": "0"}, "slow");
},

function() {
/*$("img.america").stop().animate({"opacity": "1"}, "slow");
$("img.asia").stop().animate({"opacity": "1"}, "slow");*/
$("img.zero").stop().animate({"opacity": "1"}, "slow");
}); 

$("a.asia, area.asia").hover(
function() {
$("img.asia").stop().animate({"opacity": "1"}, "slow");
$("img.america").stop().animate({"opacity": "0"}, "slow");
$("img.emea").stop().animate({"opacity": "0"}, "slow");
$("img.zero").stop().animate({"opacity": "0"}, "slow");
},

function() {
/*$("img.america").stop().animate({"opacity": "1"}, "slow");
$("img.emea").stop().animate({"opacity": "1"}, "slow");*/
$("img.zero").stop().animate({"opacity": "1"}, "slow");
}); 


});


