﻿$(document).ready(function() {


		   var COOKIE_NAME = 'CRUISE';
           var options = { path: '/', expires: 90 };

                
		$('form[name="form1"]').submit(function () {
			$.cookie(COOKIE_NAME, 'shipper', options);
			return true;
		});
				
		if ($.cookie(COOKIE_NAME)){
			$(".bg").hide();
			$(".choicecontainer").hide();
		}
		else {
			$(".bg").delay(2000).fadeTo(2000, 0.50);
			$(".choicecontainer").delay(5000).fadeIn("slow");
		}
				

	$(".close").find("a").click( function() {
		$(".bg, .choicebox, .choicecontainer").hide();
		$.cookie(COOKIE_NAME, 'closeship');
		return true;
	});	
	
		if ($.cookie(COOKIE_NAME)){
			$(".bg").hide();
			$(".choicecontainer").hide();
		}
		else {
			$(".bg").delay(2000).fadeTo(2000, 0.50);
			$(".choicecontainer").delay(5000).fadeIn("slow");
		}

	
	$("#toplevel, #topskill").attr('checked', true);
 	$(".options").find(".chkOptions").click(function() {
		$(this).css({'color' : 'red' , 'font-weight' : '700'}).find('input[name="moo"]').attr('checked', true);
		$(".inputform").css({'border-color' : 'black'});
		$(".gray").hide();
		$(".submit").show();
	});
	$('input[type=text]').focus(function() {
    	$(this).val('');
 	});
 	$(".gray").click( function () {
		alert('Please Choose Your Level Above');
	});
 	$(".chkOptions").click(	function () {
    	var ntot = 0;
			$(".chk:checked").each(function () {
			    ntot += parseInt($(this).val());
			});
	    $('input[name="defaultar"]').val(ntot);
	    if (ntot == "519811"){ 
		    $("#two, #three").css({'color' : 'black' , 'font-weight' : '100'});
		}    
	    if (ntot == "519812"){ 
		    $("#one, #three").css({'color' : 'black' , 'font-weight' : '100'});
		} 
	    if (ntot == "519813"){ 
		    $("#one, #two").css({'color' : 'black' , 'font-weight' : '100'});
		} 				
	});	  
	
});
