/**************************************************************************************************
MAIL TO
**************************************************************************************************/
function getMailto(user,domain){
	locationstring = "mailto:" + user + "@" + domain;
	window.location = locationstring;
}

/**************************************************************************************************
SCROLLTOP & TARGET BLANK
**************************************************************************************************/
$(document).ready(function() {
	//SCROLL TOP
	jQuery.easing.easeOut = function (x, t, b, c, d) {
		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
	}
	$('a[href*=#]').click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
			var target = $(this.hash);
			var scspeed = 800;
			target = target.length && target;
			if (target.length) {
				var targetOffset = target.offset().top;
				$('html,body').animate({
					scrollTop: targetOffset}, {duration: scspeed, easing: "easeOut"
				});
				return false;
			}
		}
	});

	//TARGET BLANK
	$('a[@href^="http://"].blank').click(function(){
		window.open(this.href, '_blank');
		return false;
	});

	//ROLLOVER
	function initRollOverImages() {
		var image_cache = new Object();
		$("img.rollover").not("[@src*='_on.']").each(function(i) {
			var imgsrc = this.src;
			var dot = this.src.lastIndexOf('.');
			var imgsrc_on = this.src.substr(0, dot) + '_on' + this.src.substr(dot, 4);
			image_cache[this.src] = new Image();
			image_cache[this.src].src = imgsrc_on;
			$(this).hover(
				function() { this.src = imgsrc_on; },
				function() { this.src = imgsrc; }
			);
		});
		$(".rollover > img").not("[@src*='_on.']").each(function(i) {
			var imgsrc = this.src;
			var dot = this.src.lastIndexOf('.');
			var imgsrc_on = this.src.substr(0, dot) + '_on' + this.src.substr(dot, 4);
			image_cache[this.src] = new Image();
			image_cache[this.src].src = imgsrc_on;
			$(this).hover(
				function() { this.src = imgsrc_on; },
				function() { this.src = imgsrc; }
			);
		});
	}
	$(document).ready(initRollOverImages);

});
