$(document).ready(function(){
	$(".apparel, .accessories-gifts, .visit, .about, .events").animate({
		opacity: 0
	}, 1)
	/*$(".frgd_image").bind('mouseenter', function (event) {
		$(this).css('background-position','-'+$(this).width()+'px 0');
	}).bind('mouseleave', function (event) {
		$(this).css('background-position','0 0');
	}).bind('click', function (event) {
		changePage($(this).attr('data-page'));
	});*/
	$(".apparel, .accessories-gifts, .visit, .about, .events").bind('mouseenter', function (event) {
		var myClass=$(this).attr('class');
		$('.text_nav').each(function(index) {
			if($(this).attr('page-id')==myClass){
				$(this).addClass('highlight');
			} else {
				$(this).removeClass('highlight');
			}
		});
		$("."+myClass).stop().animate({
			opacity: .6
		}, 250);
		if(myClass=='events'){
			$(".events_text").stop().animate({
			opacity: 1
			}, 250);
		}
	}).bind('mouseleave', function (event) {
		var myClass=$(this).attr('class');
		$('.text_nav').each(function(index) {
			if($(this).attr('page-id')==myClass){
				$(this).removeClass('highlight');
			}
		});
		$("."+myClass).stop().animate({
			opacity: 0
		}, 350);
		if(myClass=='events'){
			$(".events_text").stop().animate({
			opacity: 0
			}, 350);
		}
	});
	$(".text_nav").bind('mouseenter', function (event) {
		var myClass=$(this).attr('page-id');
		$(this).addClass('highlight');
		$("."+myClass).stop().animate({
			opacity: .6
		}, 350);
	}).bind('mouseleave', function (event) {
		var myClass=$(this).attr('page-id');
		$(this).removeClass('highlight');
		$("."+myClass).stop().animate({
			opacity: 0
		}, 350);
	}).bind('click', function (event) {
		changePage($(this).attr('page-id'));
	});
	$(".apparel, .accessories-gifts, .visit, .about, .home").bind('click', function (event) {
		changePage($(this).attr('class'));
	});
	
	$(".list_nav").bind('mouseenter', function (event) {
		$(this).addClass('highlight');
	}).bind('mouseleave', function (event) {
		$(this).removeClass('highlight');
	}).bind('click', function (event) {
		$(".list_nav").removeClass('selected');
		changeLabel($(this).attr('data-label'));
		$(this).addClass('selected');
	});
	
	$(".submit_btn").bind('mouseenter', function (event) {
		$(this).addClass('highlight');
	}).bind('mouseleave', function (event) {
		$(this).removeClass('highlight');
	}).bind('click', function (event) {
		var name=$('#myname').val();
		var email=$('#myemail').val();
		var message=$('#mymessage').val();
		if(name=='' || email=='' || message==''){
			return false;
		} else {
			$.post("_assets/_scripts/sendit.php", { name: name, email: email, message: message},
			function(data){
				$('#myname, #myemail, #mymessage').val('');
				$('#thankyou').html('Thank you for your message. Someone will<br>respond to you as soon as possible.');
			});
		}
	});
	
	$("#logo").bind('click', function (event) {
		changePage('home');
	});
	$(".facebook").bind('click', function (event) {
		window.open("https://www.facebook.com/pages/3-BOUTIQUE/118230821524906");
	});
	$("#specialoffer").bind('click', function (event) {
		window.open("downloads/coupon.pdf");
	});
	
});

$(window).load(function () {
	$(".apparel, .accessories-gifts, .visit, .about, .events, .events_text").css('opacity','0');
	$(".apparel, .accessories-gifts, .visit, .about, .events, .home, .events_text").css('visibility','visible');
	
	
});

function init(){
}

function changePage(url){
	window.location = url+".php";
}
function changeLabel(label){
	$('#lead_text').html($('#'+label+'_text').html());	
}
