// JavaScript Document
$(document).ready(function(){
	applyFancybox();
});
function applyFancybox(){
	$('a[rel*=modal], area[rel*=modal]').fancybox({
		'scrolling'			:	'no',
		'centerOnScroll'	:	true,
		'overlayColor'		:	'#000',
		'overlayOpacity'	:	'.8',
		'showNavArrows'		:	false,
		'titlePosition'		:	'over',
		'onComplete'		:	applyCufon,
		'margin'			:	0,
		'padding'			:	0,
		'onStart'			:	function(){
			$("#logo").stop(this).animate({width:226,height:100},1000,"easeInOutExpo");
		},
		'onClosed'			:	function(){
			$("#logo").stop(this).animate({width:479,height:212},1000,"easeInOutExpo");
		}
	});
}
function applyCufon(){
	Cufon.replace('#fancybox-title, .tits');
}
function isEmail(e){
  if (e.length==0)
    return false;
  if (e.indexOf(" ") != -1)
    return false;
  else if (e.indexOf("@") == -1)
    return false;
  else if (e.indexOf("@") == 0)
    return false;
  else if (e.indexOf("@") == (e.length-1))
    return false;
  var ee = e.split("@");
  if (ee[1].indexOf(".") == -1)
    return false;
  else if (ee[1].indexOf(".") == 0)
    return false;
  else if (ee[1].charAt(ee[1].length-1) == ".") {
    return false;
  }
  return true;
}
function closePop(){
	$.fancybox.close();
}
