/* this is for the login button */
$(document).ready(function(){

	$('#login-btn').click(function() { 
		if($(this).attr('href') == "#") {
			$('#account').slideToggle(),
			$(this).toggleClass('login-hover');
		}
	});

	//tabs
	$('div.tabs').tabs({selected:0} );

	$("input, textarea").focus(function () {
		$(this).parent().parent().addClass("hover");

	}).blur(function(){
		$(this).parent().parent().removeClass("hover");
	});

	if($("div.form p.file-upload").length > 0){
		var pos = $("div.form p.file-upload input[type='button']").position();
		var width = $("div.form p.file-upload input[type='text']").width();
		$("div.form p.file-upload").css({'position' : 'relative'});
		$("div.form p.file-upload input[type='file']").css({'left' : (pos.left - 150) + 'px', 'position' : 'absolute', 'top' : pos.top + 'px', width : width + 'px' , 'opacity': 0, 'z-index' : 3});
		$("div.form p.file-upload input[type='file']").change(function(){
			$("div.form p.file-upload input[type='text']").val(this.value);
		});
	}
	
	$(".overlay-trigger").overlay({
		absolute: true,
		close: 'a.close-btn, a.button7',
		closeOnClick: false,
		expose: { 
		        color: '#000', 
		        loadSpeed: 200, 
		        opacity: 0.7 
		    },
		top: 'center',
		left: 'center'
		// ,
		// 		onBeforeLoad: function(){
		// 			// grab wrapper element inside content 
		// 			var wrap = this.getContent().find("div.wrap");
		// 			wrap.load(this.getTrigger().attr("href")); 
		// 		}
	});
	
	$('a.tooltip-trigger').hover(
		function(){
			$($(this).attr('href')).show();
			var offset = $(this).offset();
			$($(this).attr('href')).css( {"left" : offset.left - (375/2), "top" : offset.top - ($($(this).attr('href')).height() + $(this).height() + 5)} );
		}, 
		function(){
			$($(this).attr('href')).hide();
		}
	);
	
	
	
		 

	
});