// Colorplex Document

$(function() { 
	$('div.cat_contain form').submit(function() {
		qty = $('input[name="qty"]', this).val();
		type = $('input[name="type"]:checked', this).val();
		if(qty == '') {
			alert("Please type in a quantity to add to the cart.");
			return false;
		}
		else {
			return true;
		}
	});
	
	$('div.checkout_procedure form').submit(function() {
		zip = $('input[name="s_zip"]', this).val();
		if(zip == '') {
			alert("Please type in a shipping zip code to checkout.");
			return false;
		}
		else {
			return true;
		}
	});
	
	$('#same').click(function() {
		$('#s_first').attr('value', $('#b_first').val());
		$('#s_last').attr('value', $('#b_last').val());
		$('#s_address1').attr('value', $('#b_address1').val());
		$('#s_address2').attr('value', $('#b_address2').val());
		$('#s_city').attr('value', $('#b_city').val());
		$('#s_state').attr('value', $('#b_state').val());
		$('#s_email').attr('value', $('#b_email').val());
		$('#s_phone').attr('value', $('#b_phone').val());
	});
	
	$("#banner").jCarouselLite({
        btnNext: ".next",
        btnPrev: ".prev",
		visible: 1,
		scroll: 1,
		speed: 800
    });
	
	$(".slide_content1").jCarouselLite({
        btnNext: ".next1",
        btnPrev: ".prev1",
		visible: 1,
		scroll: 1,
		speed: 800,
		start: 0
    });
	
	$(".slide_content2").jCarouselLite({
        btnNext: ".next2",
        btnPrev: ".prev2",
		visible: 1,
		scroll: 1,
		speed: 800,
		start: 0
    });
	
	$(".slide_content3").jCarouselLite({
        btnNext: ".next3",
        btnPrev: ".prev3",
		visible: 1,
		scroll: 1,
		speed: 800,
		start: 0
    });
	
	$(".slide_content4").jCarouselLite({
        btnNext: ".next4",
        btnPrev: ".prev4",
		visible: 1,
		scroll: 1,
		speed: 800,
		start: 0
    });
	
	$(".slide_content5").jCarouselLite({
        btnNext: ".next5",
        btnPrev: ".prev5",
		visible: 1,
		scroll: 1,
		speed: 800,
		start: 0
    });
	$('.slide_content_container').hide();
	$('div.first_slide div.title_bar').css('background', '#000');
	$('div.first_slide').find('span.header img').css('display', 'inline');
	$('div.first_slide').find('.slide_content_container').css('display', 'block');
	
	$('.home_slide').mouseover(function() {
		$('.slide_content_container').css('display', 'none');
		$('.title_bar').css('background', 'none');
		$(this).find('.title_bar').css('background', '#000');
		$('span.header img').css('display', 'none');
		$(this).find('span.header img').css('display', 'inline');
		$(this).find('.slide_content_container').css('display', 'block');
	});
	
	$('.home_slide').mouseout(function() {
		$(this).css('background', 'none');
	});
	
	
	

	$('#bottom_left ul li').mouseover(function() {
		$('#bottom_left ul li').css('background', 'none');
		$(this).css('background', '#FFF');
		if($(this).attr('class') !== 'first_event') {
			$('#bottom_left ul li.first_event').find('span.teaser a').css('color', '#FFF');
			$(this).find('span.teaser a').css('color', '#477787');
		}
		else {
			// first event
			
		}
	});
	
	$('#bottom_left ul li').mouseout(function() {
		$(this).css('background', 'none');
		$('#bottom_left ul li.first_event').css('background', '#FFF');
		if($(this).attr('class') !== 'first_event') {
			$('#bottom_left ul li.first_event span.teaser a').css('color', '#477787');
			$(this).find('span.teaser a').css('color', '#FFF');
		}
		else {
			// first event
			$(this).find('span.teaser a').css('color', '#477787');
		}
	});
	
	
	
	$('#right ul.events li').mouseover(function() {
		$('#right ul.events li').css('background', 'none');
		$(this).css('background', '#FFF');
		if($(this).attr('class') !== 'first_event') {
			$('#right ul.events li.first_event').find('span.teaser a').css('color', '#FFF');
			$(this).find('span.teaser a').css('color', '#477787');
		}
		else {
			// first event
			
		}
	});
	
	$('#right ul.events li').mouseout(function() {
		$(this).css('background', 'none');
		$('#right ul.events li.first_event').css('background', '#FFF');
		if($(this).attr('class') !== 'first_event') {
			$('#right ul.events li.first_event span.teaser a').css('color', '#477787');
			$(this).find('span.teaser a').css('color', '#FFF');
		}
		else {
			// first event
			$(this).find('span.teaser a').css('color', '#477787');
		}
	});
	
	/*$('div.system_header').click(function() {
		var status = $(this).next('div.system_info').css('display');
		if(status == 'block') {
			$(this).next('div.system_info').slideUp('fast');
		}
		else {
			$(this).next('div.system_info').slideDown('slow');
		}
	});*/

});