/* -------- */
function antispam(name,domain) {
	document.location = "mailto:" + name + "@" + domain;
}
$(document).ready(function(){
	// colorbox fn
	
	function doComplete(){
		$('#videoBox object').css('visibility','hidden');
		}
	function doClosed(){
		$('#videoBox object').css('visibility','visible');
		}
	
	$.fn.colorbox.settings.transition = "ease";
	$.fn.colorbox.settings.speed = 150;
	$.fn.colorbox.settings.opacity = 0.9;
	$.fn.colorbox.settings.current = "{current} / {total}";
	$.fn.colorbox.settings.initialWidth = 200;
	$.fn.colorbox.settings.initialHeight = 200;
	$.fn.colorbox.settings.close = "close";
	$.fn.colorbox.settings.onComplete = doComplete;
	$.fn.colorbox.settings.onClosed = doClosed;
	
	
	$(".boxmeHtml").colorbox({
			width:"750", height:"550", iframe:true});

	
	$('.boxmeImg').colorbox({
		onComplete:function(){
			//$('#videoBox object').css('visibility','hidden');
			},
		onClosed:function(){
			//$('#videoBox object').css('visibility','visible');
			}
		});
	// ----------------- //
	// ----------------- //
	// fadeLink fn
	// fadeMe(alpha over/out, alpha rollover, vel)
	jQuery.fn.fadeMe = function(start,end,vel){
		return this.each(function() {			
			$(this).hover(
				function(){$(this).animate({"opacity":end}, vel);},
				function(){$(this).animate({"opacity":start}, vel);}
			);
			$(this).css({"opacity":start});
		});
	}
	// ----------------- //
	// ----------------- //
	// ChangeImgOver fn / ex.: the_image.gif & the_image_over.gif
	jQuery.fn.ChangeImgOver = function(){
		return this.each(function() {			
			$(this).hover(
				function(){
					imgsrc = $(this).attr("src");
					matches = imgsrc.match(/_over/);
					if (!matches) {
						imgsrcON = imgsrc.replace(/.gif$/ig,"_over.gif");
						$(this).attr("src", imgsrcON);
					}
				},
				function(){
					$(this).attr("src", imgsrc);
				}
			);
			rollsrc = $(this).attr("src");
			rollON = rollsrc.replace(/.gif$/ig,"_over.gif");
			$("<img>").attr("src", rollON);
		});
	}
	// ----------------- //
	// ----------------- //
	// General forms focus/blur, etc
	$('input[type="text"], textarea').focus(function() {
		if (this.value == this.defaultValue){ 
			this.value = '';
		}
		if(this.value != this.defaultValue){
			this.select();
		}
	});
	$('input[type="text"], textarea').blur(function() {
		if ($.trim(this.value) == ''){
			this.value = (this.defaultValue ? this.defaultValue : '');
		}
	});
	// ----------------- //
	// ----------------- //
	/* easings */
	$.easing.bouncy = function (x, t, b, c, d) { 
		var s = 1.70158; 
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; 
		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; 
	} 
	$.easing.backEaseIn = function(p, n, firstNum, diff) {
		var s = 1.70158;
		var c=firstNum+diff;
		return c*(p/=1)*p*((s+1)*p - s) + firstNum;
	}
	/* easings END */
	// ----------------- //
	// ----------------- //
});
/* -------- */
