/*

	CONTACT PAGE

*/

$(document).ready(function() {

  //employment checkbox
  if (!$('#contact-form #employment').attr('checked')){
	 $('#employmentText').hide();
	}
	$('#employment').click( function() {
		$('#employmentText').toggle("fast");
    if ($(this).attr('checked')){
      $('#contact_submit').hide();
    } else {
      if ((!$('#contact-form #workExperience').attr('checked')) && (!$('#contact-form #outSourcing').attr('checked'))) {
        $('#contact_submit').show();
      }
    }
	});

	//work experience checkbox
  if (!$('#contact-form #workExperience').attr('checked')){
	 $('#workExperienceText').hide();
	}
	$('#workExperience').click( function() {
		$('#workExperienceText').toggle("fast");
    if ($(this).attr('checked')){
      $('#contact_submit').hide();
    } else {
      if ((!$('#contact-form #employment').attr('checked')) && (!$('#contact-form #outSourcing').attr('checked'))) {
        $('#contact_submit').show();
      }
    }
	});

  //outsourcing checkbox
  if (!$('#contact-form #outSourcing').attr('checked')){
	 $('#outSourcingText').hide();
	}
	$('#outSourcing').click( function() {
		$('#outSourcingText').toggle("fast");
    if ($(this).attr('checked')){
      $('#contact_submit').hide();
    } else {
      if ((!$('#contact-form #employment').attr('checked')) && (!$('#contact-form #workExperience').attr('checked'))) {
        $('#contact_submit').show();
      }
    }
	});

  $('#contact_submit').click(function(){
    if (($('#contact-form #employment').attr('checked')) || ($('#contact-form #workExperience').attr('checked')) || ($('#contact-form #outSourcing').attr('checked'))) {
      return false;
    }
  });

	//work type
	$('.workType').click( function() {
		if($(this).attr('id') == 'workExp') {
			$('#workExperienceTextDL').show("fast");
		} else {
			$('#workExperienceTextDL').hide("fast");
		}
	});
	if (!$('#contact-form #workExp').attr('checked')){
	 $('#workExperienceTextDL').hide("fast");
	}

	//other checkbox
  if (!$('#contact-form #otherCheck').attr('checked')){
	 $('#otherText').hide();
	}
	$('#otherCheck').click( function() {
		$('#otherText').toggle("fast");
	});

});

/*

	REQUEST A QUOTE PAGE

*/

$(document).ready(function() {
	//web development checkbox
	if (!$('#contact-form #typeWeb').attr('checked')){
	 $('#contentWeb').hide();
	}
	$('#typeWeb').click( function() {
		$('#contentWeb').toggle("fast");
		if (!$('#contact-form #domainYes').attr('checked')){
  	 $('.currentDomain').hide();
  	}
  	if (!$('#contact-form #domainNo').attr('checked')){
  	 $('.newDomain').hide();
  	}
	});

	//graphic checkbox
  if (!$('#contact-form #typeGraphic').attr('checked')){
	 $('#contentGraphic').hide();
	}
	$('#typeGraphic').click( function() {
		$('#contentGraphic').toggle("fast");
	});

	//current domain checkbox
	$('.domainOption').click( function() {
		if($(this).attr('id') == 'domainYes') {
			$('.currentDomain').show("fast");
			$('.newDomain').hide("fast");
		} else {
			$('.currentDomain').hide("fast");
			$('.newDomain').show("fast");
		}
	});

	//search engine
  if ($('#contact-form #hear').val() != 1){
	 $('.searchEngine').hide();
	}

  if ($('#contact-form #hear').val() != 2){
	 $('.institute').hide();
  }

	if ($('#contact-form #hear').val() != 4){
	 $('.referral').hide();
	}

	if ($('#contact-form #hear').val() != 5){
	 $('.otherOther').hide();
	}

	 $('#hear').change( function() {
		 selectValue = $(this).val();
		 switch(selectValue){
		 	case '1':
		 		$('.hear').hide("fast");
		 		$('.instituteOther').hide("fast");
		 		$('.searchEngine').show("fast");
		 		if ($('#searchEngine').val() != 4){
		 		 $('.searchEngineOther').hide("fast");
		 		} else {
		 		 $('.searchEngineOther').show("fast");
		 		}
		 	break;
		 	case '2':
		 		$('.hear').hide("fast");
		 		if ($('#institute').val() != 6){
		 		 $('.instituteOther').hide("fast");
		 		} else {
		 		 $('.instituteOther').show("fast");
		 		}
		 		$('.institute').show("fast");
		 	break;
		 	case '4':
		 		$('.hear').hide("fast");
		 		$('.instituteOther').hide("fast");
		 		$('.referral').show("fast");
		 	break;
		 	case '5':
		 		$('.hear').hide("fast");
		 		$('.otherOther').show("fast");
		 	break;
		 	default:
		 		$('.instituteOther').hide("fast");
		 		$('.hear').hide("fast");
		 	break;
	 	}
	 });

	//search engine other
	$('.searchEngineOther').hide();
	if ($('#hear').val() == 1 && $('#searchEngine').val() == 4){
	 $('.searchEngineOther').show();
	}
	$('.searchEngine select').change( function() {
		if($(this).val() == '4') {
			$('.searchEngineOther').show("fast");
		} else {
			$('.searchEngineOther').hide("fast");
		}
	});

	//institute other
	$('.instituteOther').hide();
	if ($('#hear').val() == 2 && $('#institute').val() == 6){
	 $('.instituteOther').show();
	}
	$('.institute select').change( function() {
		if($(this).val() == '6') {
			$('.instituteOther').show("fast");
		} else {
			$('.instituteOther').hide("fast");
		}
	});

});