function autoFill(id, v){
	$(id).attr({ value: v }).focus(function(){
		if($(this).val()==v){
			$(this).val("");
		}
	}).blur(function(){
		if($(this).val()==""){
			$(this).val(v);
		}
	});

}

function checkExperience(){
	if($('#no-experience').attr('checked'))
	{
		$('.experience').hide();
		$('#no-experience-value').val('yes');
	}
	
	else{
		$('.experience').show();
		$('#no-experience-value').val('no');
	}
}


function selectWorkOptions(){
if($('#work1').val()!="na"){$('#work2').removeAttr('disabled')}
if($('#work2').val()!="na"){$('#work3').removeAttr('disabled')}
if($('#workC1').val()!="na"){$('#workC2').removeAttr('disabled')}
if($('#workC2').val()!="na"){$('#workC3').removeAttr('disabled')}
}

function enableWorkOptions(){

	if($('#positiontype').val()=="1100"){
		$('#workC1').css("display","none")
		$('#workC2').css("display","none")
		$('#workC3').css("display","none")
		$('#work1').css("display","block")
		$('#work2').css("display","block")
		$('#work3').css("display","block")
		$('#work1').val("na")
		$('#work2').val("na")
		//$('#work2').attr('disabled','')
		$('#work3').val("na")
		//$('#work3').attr('disabled','')
	}
	else if($('#positiontype').val()=="1101") {
		$('#work1').css("display","none")
		$('#work2').css("display","none")
		$('#work3').css("display","none")
		$('#workC1').css("display","block")
		$('#workC2').css("display","block")
		$('#workC3').css("display","block")
		$('#workC1').val("na")
		$('#workC2').val("na")
		//$('#workC2').attr('disabled','')
		$('#workC3').val("na")
		//$('#workC3').attr('disabled','')
	}

}

//check if employe before
function employe_before_no(){
	if($('#employe_before_no').attr('checked'))
	{
		$('#have-you-ever td *').hide();
		$('#employe_before').val('no')
	}
	
	else{
		$('#have-you-ever td *').show();
	}
}

function employe_before_yes(){
	if($('#employe_before_yes').attr('checked'))
	{
		$('#have-you-ever td *').show();
		$('#employe_before').val('yes')
	}
	
	else{
		$('#have-you-ever td *').hide();
	}
}

//check if worked before
function worked_before_no(){
	if($('#worked_before_no').attr('checked'))
	{
		$('#have-you-franchise td *').hide();
		$('#worked_before').val('no')
	}
	
	else{
		$('#have-you-franchise td *').show();
	}
}

function worked_before_yes(){
	if($('#worked_before_yes').attr('checked'))
	{
		$('#have-you-franchise td *').show();
		$('#worked_before').val('yes')
	}
	
	else{
		$('#have-you-franchise td *').hide();
	}
}

//under age
function under_age_no(){
	if($('#under_age_no').attr('checked'))
	{
		$('#under-age td *').show();
		$('#underage').val('no')
	}
	
	else{
		$('#under-age td *').hide();
	}
}

function under_age_yes(){
	if($('#under_age_yes').attr('checked'))
	{
		$('#under-age td *').hide();
		$('#underage').val('yes')
	}
	
	else{
		$('#under-age td *').show();
	}
}
function checkValue(){
//will show/hide row that has rel value equals to input's class
$(this).parent().children('input[type=hidden]').val($(this).val());
var rowtoshow=$(this).attr('class');
if($(this).val()=='Yes'){
	try{
		$('tr.[rel='+rowtoshow+']').show();
	}
	catch(err){alert('nop');}
	}
else{
try{$('tr.[rel='+rowtoshow+']').hide();}
catch(err){}

}

}
$(document).ready(function() {

$(".form-franchise input:radio").click(checkValue);
$(".form-franchise input:checked").click();


$('#positiontype').change(function(){

	//1100 restaurant
	//1101 corporate

	if ($('#positiontype').val()==1100){
		$('#restaurant_locations').show();
		$('#corporate_locations').hide();
	}
	if ($('#positiontype').val()==1101){
		$('#restaurant_locations').hide();
		$('#corporate_locations').show();
	}

});

$('#positiontype').change();


$('#under_age_yes').click(function(){$('#underage').val('yes')})
$('#under_age_no').click(function(){$('#underage').val('no')})

$('#under_age_work_permit_yes').click(function(){$('#under_age_work_permit').val('yes')})
$('#under_age_work_permit_no').click(function(){$('#under_age_work_permit').val('no')})

$('#legal_employe_yes').click(function(){$('#legal_employe').val('yes')})
$('#legal_employe_no').click(function(){$('#legal_employe').val('no')})

$('#employe_before_yes').click(function(){$('#employe_before').val('yes')})
$('#employe_before_no').click(function(){$('#employe_before').val('no')})

$('#worked_before_yes').click(function(){$('#worked_before').val('yes')})
$('#worked_before_no').click(function(){$('#worked_before').val('no')})


$('#full_time').click(function(){$('#full_part_either').val('full_time')})
$('#part_time').click(function(){$('#full_part_either').val('part_time')})
$('#either_time').click(function(){$('#full_part_either').val('either_time')})


//check experience
checkExperience();

$('#no-experience').click(function(){checkExperience();});

//check if worked before
employe_before_no();
employe_before_yes();
$('#employe_before_no').change(function(){employe_before_no();});
$('#employe_before_yes').change(function(){employe_before_yes();});

worked_before_no();
worked_before_yes();
$('#worked_before_no').change(function(){worked_before_no();});
$('#worked_before_yes').change(function(){worked_before_yes();});

under_age_no();
under_age_yes();
$('#under_age_no').change(function(){under_age_no();});
$('#under_age_yes').change(function(){under_age_yes();});

//autofill
autoFill($("#emailEclub"), "email");			//email field						   
						   
						   
/*main menu items*/
        var ourFood = false;
		$("#nav_ourFood").hover(function(){          
		   if (ourFood) clearTimeout(ourFood);
            $("#dropdown_ourFood").show();
			$(this).addClass("nav_ourFood_active");
        }, function() {
			ourFood = setTimeout(function() {$("#dropdown_ourFood").hide();});
			$("#nav_ourFood").removeClass("nav_ourFood_active");
        });
        $("#dropdown_ourFood").hover(function(){
            if (ourFood) clearTimeout(ourFood);
            $("#nav_ourFood").addClass("nav_ourFood_active");
        }, function() {
			ourFood = setTimeout(function() {$("#dropdown_ourFood").hide();});
			$("#dropdown_ourFood").stop().show();
			$("#nav_ourFood").removeClass("nav_ourFood_active");
        });

        var aboutSizzler = false;
		$("#nav_aboutSizzler").hover(function(){          
		   if (aboutSizzler) clearTimeout(aboutSizzler);
            $("#dropdown_aboutSizzler").show();
			$(this).addClass("nav_aboutSizzler_active");
        }, function() {
			aboutSizzler = setTimeout(function() {$("#dropdown_aboutSizzler").hide();});
			$("#nav_aboutSizzler").removeClass("nav_aboutSizzler_active");
        });
        $("#dropdown_aboutSizzler").hover(function(){
            if (aboutSizzler) clearTimeout(aboutSizzler);
            $("#nav_aboutSizzler").addClass("nav_aboutSizzler_active");
        }, function() {
			aboutSizzler = setTimeout(function() {$("#dropdown_aboutSizzler").hide();});
			$("#dropdown_aboutSizzler").stop().show();
			$("#nav_aboutSizzler").removeClass("nav_aboutSizzler_active");
        });
        
        var careers = false;
		$("#nav_careers").hover(function(){          
		   if (careers) clearTimeout(careers);
            $("#dropdown_careers").show();
			$(this).addClass("nav_careers_active");
        }, function() {
			careers = setTimeout(function() {$("#dropdown_careers").hide();});
			$("#nav_careers").removeClass("nav_careers_active");
        });
        $("#dropdown_careers").hover(function(){
            if (careers) clearTimeout(careers);
            $("#nav_careers").addClass("nav_careers_active");
        }, function() {
			careers = setTimeout(function() {$("#dropdown_careers").hide();});
			$("#dropdown_careers").stop().show();
			$("#nav_careers").removeClass("nav_careers_active");
        });
        
        var franchising = false;
		$("#nav_franchising").hover(function(){          
		   if (franchising) clearTimeout(franchising);
            $("#dropdown_franchising").show();
			$(this).addClass("nav_franchising_active");
        }, function() {
			franchising = setTimeout(function() {$("#dropdown_franchising").hide();});
			$("#nav_franchising").removeClass("nav_franchising_active");
        });
        $("#dropdown_franchising").hover(function(){
            if (franchising) clearTimeout(franchising);
            $("#nav_franchising").addClass("nav_franchising_active");
        }, function() {
			franchising = setTimeout(function() {$("#dropdown_franchising").hide();});
			$("#dropdown_franchising").stop().show();
			$("#nav_franchising").removeClass("nav_franchising_active");
        });
		
		
		 var contactUs = false;
		$("#nav_contactUs").hover(function(){          
		   if (contactUs) clearTimeout(contactUs);
            $("#dropdown_contactUs").show();
			$(this).addClass("nav_contactUs_active");
        }, function() {
			contactUs = setTimeout(function() {$("#dropdown_contactUs").hide();});
			$("#nav_contactUs").removeClass("nav_contactUs_active");
        });
        $("#dropdown_contactUs").hover(function(){
            if (contactUs) clearTimeout(contactUs);
            $("#nav_contactUs").addClass("nav_contactUs_active");
        }, function() {
			contactUs = setTimeout(function() {$("#dropdown_contactUs").hide();});
			$("#dropdown_contactUs").stop().show();
			$("#nav_contactUs").removeClass("nav_contactUs_active");
        });
		
		/* promo boxes*/
		var gift = false;
		$("#giftCards").hover(function(){          
		   if (gift) clearTimeout(gift);
            $("#giftCardsBig").show();
			$(this).addClass("");
        }, function() {
			gift = setTimeout(function() {$("#giftCardsBig").hide();});
			$("#giftCardsBig").removeClass("");
        });
        $("#giftCardsBig").hover(function(){
            if (gift) clearTimeout(gift);
            $("#giftCards").addClass("");
        }, function() {
			gift = setTimeout(function() {$("#giftCardsBig").hide();});
			$("#giftCardsBig").stop().show();
			$("#giftCards").removeClass("");
        });
		
		
		var sizzlin = false;
		$("#sizzlinSpecial").hover(function(){          
		   if (sizzlin) clearTimeout(sizzlin);
            $("#sizzlinSpecialBig").show();
			$(this).addClass("");
        }, function() {
			sizzlin = setTimeout(function() {$("#sizzlinSpecialBig").hide();});
			$("#sizzlinSpecialBig").removeClass("");
        });
        $("#sizzlinSpecialBig").hover(function(){
            if (sizzlin) clearTimeout(sizzlin);
            $("#sizzlinSpecial").addClass("");
        }, function() {
			sizzlin = setTimeout(function() {$("#sizzlinSpecialBig").hide();});
			$("#sizzlinSpecialBig").stop().show();
			$("#sizzlinSpecial").removeClass("");
        });
		
		var quickPoll = false;
		$("#quickPoll").hover(function(){          
		   if (quickPoll) clearTimeout(quickPoll);
            $("#quickPollBig").show();
			$(this).addClass("");
        }, function() {
			quickPoll = setTimeout(function() {$("#quickPollBig").hide();});
			$("#quickPollBig").removeClass("");
        });
        $("#quickPollBig").hover(function(){
            if (quickPoll) clearTimeout(quickPoll);
            $("#quickPoll").addClass("");
        }, function() {
			quickPoll = setTimeout(function() {$("#quickPollBig").hide();});
			$("#quickPollBig").stop().show();
			$("#quickPoll").removeClass("");
        });
		
		/*end promo boxes*/
		
		
/*end main menu items*/	

//even / odd style
//$(".acc-title:odd").css("background-color", "#bfc75b");


/* locations accordion*/
$("#accordion-locations").accordion({ 
    header: 'div.acc-title', 
    active: false, 
    alwaysOpen: false, 
    animated: false, 
    autoheight: false 
});
/* end locations accordion*/


/* faqs accordion*/
$("#faqs-accordion").accordion({ 
    header: 'div.acc-title', 
    active: false, 
    alwaysOpen: false, 
    animated: false, 
    autoheight: false 
});

$("#faqs-accordion li").accordion({ 
    header: 'div.acc-sub-title', 
    active: false, 
    alwaysOpen: false, 
    animated: false, 
    autoheight: false 
});
/* end faqs accordion*/




/*job-listing-accordion*/
$("#job-listing-accordion").accordion({ 
    header: 'div.acc-title', 
    active: false, 
    alwaysOpen: false, 
    animated: false, 
    autoheight: false 
});


/**/



/* sizzlin special accordion*/
$("#sizzlin-special-accordion").accordion({ 
    header: 'div.acc-title', 
    active: false, 
    alwaysOpen: false, 
    animated: false, 
    autoheight: false 
});
/* end sizzlin special accordion*/

	
});


