
						
// Plugins
	// Cookie
		jQuery.cookie=function(key,value,options){if(arguments.length>1&&(value===null||typeof value!=="object")){options=jQuery.extend({},options);if(value===null){options.expires=-1;}
		if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setDate(t.getDate()+days);}
		return(document.cookie=[encodeURIComponent(key),'=',options.raw?String(value):encodeURIComponent(String(value)),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''));}
		options=value||{};var result,decode=options.raw?function(s){return s;}:decodeURIComponent;return(result=new RegExp('(?:^|; )'+encodeURIComponent(key)+'=([^;]*)').exec(document.cookie))?decode(result[1]):null;};
	// JSON Cookie
		(function($){var isObject=function(x){return(typeof x==='object')&&!(x instanceof Array)&&(x!==null);};$.extend({getJSONCookie:function(cookieName){var cookieData=$.cookie(cookieName);return cookieData?JSON.parse(cookieData):{};},setJSONCookie:function(cookieName,data,options){var cookieData='';options=$.extend({expires:90,path:'/'},options);if(!isObject(data)){throw new Error('JSONCookie data must be an object');}
		cookieData=JSON.stringify(data);return $.cookie(cookieName,cookieData,options);},removeJSONCookie:function(cookieName){return $.cookie(cookieName,null);},JSONCookie:function(cookieName,data,options){if(data){$.setJSONCookie(cookieName,data,options);}
		return $.getJSONCookie(cookieName);}});})(jQuery);
// Local vars
	var FreeReportCookieName = "FreeReport";
	var CookieDaysExpire = 30;
// Salary Calculator JavaScript	
	$(document).ready(function(){
//repopulate the BlackOpt and RotatingQuestionsform fields
	for (i=1; i<4;i++){
	 BOFields_i(); 
	 RQFields_i();
	 }
//end repopulate the BlackOpt form fields

		///////////////////////////////////////////////////
		// AUTOCOMPLETE ENHANCED
		///////////////////////////////////////////////////
		// Determine if "Autocomplete_Enhanced" plugin is required
			if($.plugin("Autocomplete_Enhanced").isNeeded() == true){
				// REQUIRED
					// Get plugin files
						$.plugin('Autocomplete_Enhanced').get(function(){
							// Convert text input into enhanced jQuery autocomplete widget
								// Job Title Lookups
									$("input.AutoComplete.Job")
										.autocomplete_enhanced({  
											source: Global.Server + "?FuseAction=AutoSuggest.JobTitles&DisableGuardDog=1",
											emptyText: "No matching job titles found",
											hiddenInputID: 'JobID',
											minLength: 2,
											maxHeight: 200
										});
										
								// Location Lookups
									$("input.AutoComplete.Location")
										.autocomplete_enhanced({  
											source: Global.Server + "?FuseAction=AutoSuggest.Cities&CountryIDList=&DisplayCountryName=0&DisableGuardDog=1",
											emptyText: "No matching cities found",
											hiddenInputID: 'CityID',
											minLength: 2,
											maxHeight: 200
										});
											
								// Certification Look-ups
									$("input.AutoComplete.Certification")
										.autocomplete_enhanced({
											source: Global.Server + "?FuseAction=AutoSuggest.Certifications&DisableGuardDog=1",
											addRecords: true,
											addRecordsURL: Global.Server + "?FuseAction=AutoSuggest.AddUserInput&InputType=certification&DisableGuardDog=1&Source=" + Global.Server,
											emptyText: "No license/certification found matching that term",
											hiddenInputID: 'CertificationID',
											minLength: 2,
											maxHeight: 200
										});
								
								// Industry Look-ups
									$("input.AutoComplete.Industry")
										.autocomplete_enhanced({  
											source: Global.Server + "?FuseAction=AutoSuggest.eSICTitles&v=2&DisableGuardDog=1&DisableGuardDog=1",
											emptyText: "No industries found matching that term",
											hiddenInputID: 'IndustryID',
											minLength: 2,
											maxHeight: 200
										});
										
								// Education Discipline Look-ups
									$("input.AutoComplete.EducationDiscipline")
										.autocomplete_enhanced({  
											source: Global.Server + "?FuseAction=AutoSuggest.EducationDiscipline&DisableGuardDog=1",
											addRecords: true,
											addRecordsURL: Global.Server + "?FuseAction=AutoSuggest.AddUserInput&InputType=education&DisableGuardDog=1&Source=" + Global.Server,
											emptyText: "No education discipline found matching that term",
											hiddenInputID: 'CIP',
											minLength: 2,
											maxHeight: 200
										});

								// University Look-ups
									$("input.AutoComplete.University")
										.autocomplete_enhanced({  
											source: Global.Server + "?FuseAction=AutoSuggest.Universities&DisableGuardDog=1",
											addRecords: true,
											addRecordsURL: Global.Server + "?FuseAction=AutoSuggest.AddUserInput&InputType=university&DisableGuardDog=1&Source=" + Global.Server,
											emptyText: "Academic institution not found, please retype or add below",
											hiddenInputID: 'UniversityID',
											minLength: 2,
											maxHeight: 200
										});		
			
						});
			}
						
		///////////////////////////////////////////////////
		// VALIDATE
		///////////////////////////////////////////////////
		// Determine if "Validate" plugin is required
			if($.plugin("Validate").isNeeded() == true){
				// REQUIRED
					// Get plugin files
						$.plugin('Validate').get(function(){
							// Setup
								$.validity.setup({
								    // You may change the output mode with this property.
								    outputMode: "summary",// summary | label | modal
								
								    // When this property is set to true, validity will scroll the browser viewport so that the first error is visible when validation fails.
								    scrollTo: false,
								
								    // If this setting is true, modal errors will disappear when they are clicked on.
								    modalErrorsClickable: true,
								
								    // If a field name cannot be otherwise inferred, this will be used.
								    defaultFieldName: "This field"
								});
							
							// Validate Form
								$("form.Validate").validity();
						});	
			}	
		
			
		// Get Checked Radio Button's Label
			/* Example Usage:	
				<!--- JS --->
					var myCheckedLabel = getCheckedRadioLabel('myRadioButtonListName');
				<!--- HTML --->
					<input type="radio" id="Radio1" name="myRadioButtonListName" value="1"><label for="Radio1">Label 1</label>
					<input type="radio" id="Radio2" name="myRadioButtonListName" value="2"><label for="Radio2">Label 2</label>
					<input type="radio" id="Radio3" name="myRadioButtonListName" value="3"><label for="Radio3">Label 3</label>
			*/		
			function getCheckedRadioLabel(RadioButtonListName){
				var $checkRadioButton = $('input[name=' + RadioButtonListName + ']:checked');
				var checkRadioButtonID = $checkRadioButton.attr('id');
				var $radioLabel = $("label[for=" + checkRadioButtonID + "]");
				var radioLabel = $radioLabel.text();
				return radioLabel;
			}
			
		// 
			$('a.button.ProcessQuestionnaire')
				.click(function(event){
					event.preventDefault();
					processQuestionnaire();
					return false;
				});
		
		// Process Questionnaire		
			function processQuestionnaire(){
				var proceed = true;
				// Get current step
					var curStep = parseInt($('input[name="CurStep"]').val());
				// 
					switch(curStep){
						case 1:
						  	// Job/Location
								// Begin   
									$.validity.start(); 
										$("#SEQuestionnaire #AutoComplete_Job").require('Job is required.');	
										$("#SEQuestionnaire #AutoComplete_Location").require('Location is required.');
										$("#SEQuestionnaire #Year").require('Year is required.'); 
									// Set Validation Result	
										var result = $.validity.end();
									// Determine if validation passed
										if(!result.valid){
											// FAILED
												proceed=false;
										}
						  		break;
						case 2:
							// Certifications
						  		break;
						case 3:
							// Employer
								// Begin   
									$.validity.start();
										// Validation
											$("#SEQuestionnaire #EmployerName").require();	
											$("#SEQuestionnaire #EmployerSize").require().match('number');	
											$("#SEQuestionnaire #EmployerName").require();	
											$("#SEQuestionnaire #Autocomplete_EmployerIndustry").require("Industry is required.");									
								// Set Validation Result	
									var result = $.validity.end();
								// Determine if validation passed
									if(!result.valid){
										// FAILED
											proceed=false;
									}
						  		break;
						case 4:
							// Education
						  		break;
						case 5:
							// Income
								// Begin   
									$.validity.start();
										// Validation
											$("#SEQuestionnaire #Income").require().match('number');								
								// Set Validation Result	
									var result = $.validity.end();
								// Determine if validation passed
									if(!result.valid){
										// FAILED
											proceed=false;
									}
						  		break;
						case 6:

						
							// Confirmation
								var JobStatus = parseInt($('#SEQuestionnaire input[name="JobStatus"]:checked').val());
								if(JobStatus == 1){
									// Presently employed in this job
										// Begin   
											$.validity.start();
												// Validation
													$("#SEQuestionnaire #EmployerName").require();	
													$("#SEQuestionnaire #EmployerSize").require().match('number');		
													$("#SEQuestionnaire #Autocomplete_EmployerIndustry").require("Industry is required.");	
													$("#SEQuestionnaire #Income").require().match('number');								
										// Set Validation Result	
											var result = $.validity.end();
										// Determine if validation passed
											if(!result.valid){
												// FAILED
													proceed=false;
											}
								}
								
								if(proceed == true){
									// Get report inputs
										var JobID = $('#SEQuestionnaire input[name="Job"]').val();
										var JobTitle =$('#SEQuestionnaire input[name="JobTitle"]').val();
										var Income = $('#SEQuestionnaire #Income').val();
										var CurJobYears = $('#SEQuestionnaire input[name="Year"]').val();
										var UniversityID = $('#SEQuestionnaire #UniversityID').val();
										var University = $('#SEQuestionnaire #Autocomplete_University').val();
										var CertificationID = $('#SEQuestionnaire #CertificationID').val();
										var Certification = $('#SEQuestionnaire #Autocomplete_Certification').val();
										var CertificationID_2 = $('#SEQuestionnaire #CertificationID_2').val();
										var Certification_2 = $('#SEQuestionnaire #Autocomplete_Certification_2').val();
										var CertificationID_3 = $('#SEQuestionnaire #CertificationID_3').val();
										var Certification_3 = $('#SEQuestionnaire #Autocomplete_Certification_3').val();
										var CertificationID_4 = $('#SEQuestionnaire #CertificationID_4').val();
										var Certification_4 = $('#SEQuestionnaire #Autocomplete_Certification_4').val();
										var EducationDisciplineID = $('#SEQuestionnaire #CIP').val();		
										var EducationDiscipline = $('#SEQuestionnaire #Autocomplete_EducationDiscipline').val();	
										var Area = $('#SEQuestionnaire input[name="Area"]').val();
										var Zip = $('#SEQuestionnaire input[name="Zip"]').val();
										var CityID = $('#SEQuestionnaire input[name="CityID"]').val();
										var CountryID = $('#SEQuestionnaire input[name="CountryID"]').val();
										var JobStatus = parseInt($('#SEQuestionnaire input[name="JobStatus"]:checked').val());
										var EmployerName = $('#SEQuestionnaire #EmployerName').val();
										var EmployerSize = $('#SEQuestionnaire #EmployerSize').val();
										var IndustryID = $('#SEQuestionnaire #IndustryID').val();
										var Industry = $('#SEQuestionnaire #AutoComplete_Industry').val();
										var PayType = $('#SEQuestionnaire #PayType option:selected').val();
										var EducationLevel = $('#SEQuestionnaire #EducationLevel option:selected').val();
										
										setCookie("EDOTJobTitleText", $('#SEQuestionnaire input[name="JobTitle"]').val()); 
										setCookie("EDOTJobTitle", $('#SEQuestionnaire input[name="Job"]').val());
										
										if (JobStatus==1)
										{
											setCookie("holdPosition", ("0"));
										}
										else										
										{
											setCookie("holdPosition", ("1"));
										}
									// Update Free Report Data
										FreeReport= {"JobID":JobID,
													"JobTitle":JobTitle,
													 "Income":Income,
													 "CurJobYears":CurJobYears,
													 "UniversityID":UniversityID,
													 "University":University,
													 "CertificationID":CertificationID,
													 "Certification":Certification,
													 "CertificationID_2":CertificationID_2,
													 "Certification_2":Certification_2,
													  "CertificationID_3":CertificationID_3,
													 "Certification_3":Certification_3,
													  "CertificationID_4":CertificationID_4,
													 "Certification_4":Certification_4,
													 "EducationDisciplineID":EducationDisciplineID,
													 "EducationDiscipline":EducationDiscipline,
													 "Area":Area,
													 "CityID":CityID,
													 "CountryID":CountryID,
													 "JobStatus":JobStatus ,
													 "Zip":Zip,
													 "EmployerName":EmployerName,
													 "EmployerSize":EmployerSize,
													 "IndustryID":IndustryID,
													 "Industry":Industry,
													 "PayType": PayType,
													 "EducationLevel" : EducationLevel										 
													 };
			
									// Create JSON Obj
										eval('jsonObj = ' + JSON.stringify(FreeReport), window);
									// Set Free Report cookie
										$.JSONCookie(FreeReportCookieName,jsonObj,{expires: CookieDaysExpire});
								}
						  		break;	  
					}
				// Submit Questionnaire 
					if(proceed == true){
						$('#SEQuestionnaire').submit();
					}
					else{
						scrollToAnchor('Top');
					}
			}
			
		function getFreeReportCookie(){
			/*
				// Get Free Report Cookie
					var VarName = getFreeReportCookie();
					alert(VarName.JobID);
			*/
			// Determine if free report cookie exists
				var FreeReportCookie = "";
				var cookieVal = $.cookie("FreeReport");
				if(!cookieVal){
					// DOES NOT EXIST
						
				}
				else{
					// EXISTS
						// Get free report cookie value
							FreeReportCookie = $.JSONCookie("FreeReport");
							
				}
				return FreeReportCookie;
		}
		
		// Confirmation Edit Button
		// <a href="##" step="5" class="EditLnk">edit</a>
			$('#SEQuestionnaire table.confirmation a.EditLnk')
				.click(function(event){
					$this = $(this);
					event.preventDefault();
					// get step
						var gotoStep = $this.attr('step');
							gotoStep = parseInt(gotoStep) - 1;
					// hide confirmation step	
						$("#step6").hide();
                	// show goto step	
						$("#step" + gotoStep).show();
					return false;
				});
				
		// "Add Certificate" Button
			$('#SEQuestionnaire #AddCertificate')
				.click(function(event){
					var maxCertifications = 5;
					$this = $(this);
					event.preventDefault();
					var inputCnt = $('input[id^="CertificationID"]').size();
					var newInputNumber = (parseInt(inputCnt) + 1)
					if(inputCnt < maxCertifications){
						// MAX CERTIFICATIONS NOT REACHED
							var inputID = "Autocomplete_Certification_" + newInputNumber;
							var hiddenInputID = "CertificationID_" + newInputNumber;
							var $NewInput = $('<tr class="CertificateInputContainer"><td class="labelContainer"></td><td><input type="text" id="" name="" autocomplete="off" class="AutoComplete Certification FormInput Text Long"/></td><td></td></tr>')
								$NewInput
									.find('td:last-child')
										.css('paddingTop','7px')
										.append('<span class="inputClarifier">(#' + newInputNumber + ')</span>')
										.end()
									.find('input')
										.attr({id: inputID,
											   name: inputID
											 })
										.val('')
										.uniform()
										.autocomplete_enhanced({
											source: Global.Server + "?FuseAction=AutoSuggest.Certifications&DisableGuardDog=1",
											addRecords: true,
											addRecordsURL: Global.Server + "?FuseAction=AutoSuggest.AddUserInput&InputType=certification&DisableGuardDog=1&Source=" + Global.Server,
											emptyText: "No license/certification found matching that term",
											hiddenInputID: hiddenInputID,
											minLength: 2,
											maxHeight: 200
										});
					        $('#CertificateInputsContainer').append($NewInput);
					}
					if(inputCnt == (maxCertifications-1)){
						// WE JUST ADDED THE MAX CERTIFICATION - HIDE LINK
							$this.hide();
					}
					return false;
				});
		
		
		// Update Confirmation
			function updateConfirmation(){
				var $JobIncumbentOnlyRows = $('#SEQuestionnaire table.confirmation tr.JobIncumbentOnly');
				if(JobIncumbent==true){
					// JobIncumbent	
						$JobIncumbentOnlyRows.show();
				}
				else{
					// NOT JobIncumbent
						$JobIncumbentOnlyRows.hide();
				}
				// JOB
					$('#Confirmed_JobTitle').text($('#Autocomplete_Job').val());
					if($('#JobStatus2').is(':checked')){
						// JOB SEEKER
							var JobStatus = "Job Seeker or Candidate";
					}
					else{
						// JOB INCUMBENT
							var JobStatus = "Presently employed in this job";
					}
					$('#Confirmed_JobStatus').text(JobStatus);
					$('#Confirmed_Location').text($('#Autocomplete_Location').val());
				// Certifications/Licenses
					var Certification = $('#Autocomplete_Certification_1').val();
					if(Certification.length > 0){
						$('#Confirmed_Certifications').text(Certification);
					}
					else{
						$('#Confirmed_Certifications').text('n/a');
					}
				// Employer
					$('#Confirmed_EmployerName').text($('#EmployerName').val());
					$('#Confirmed_Industry').text($('#Autocomplete_EmployerIndustry').val());
					$('#Confirmed_NumberOfEmployees').text($('#EmployerSize').val());
				// Education
					$('#Confirmed_EducationLevel').text($("#EducationLevel option:selected").text());
					$('#Confirmed_EducationDiscipline').text($('#Autocomplete_EducationDiscipline').val());
					$('#Confirmed_University').text($('#Autocomplete_University').val());
				// Compensation
					$('#Confirmed_PayType').text(getCheckedRadioLabel('PayType'));
					var PayType = parseInt($('#SEQuestionnaire input[name="PayType"]:checked').val());
					var $ConfirmIncomeRow = $('#SEQuestionnaire table.confirmation tr.IncomeRow');
					if(PayType == 0){
						// None
							$ConfirmIncomeRow.hide();
					}
					else{
						$('#Confirmed_IncomeLabel').text($('#IncomeLabel span.label').text());
						$('#Confirmed_Income').text($('#Income').val());
						$ConfirmIncomeRow.show();
					}
			}
			
			$('input[name="JobStatus"]').change(function(){
				onchangeJobStatus();
			});
			
			function onchangeJobStatus(){
				var JobStatus = parseInt($('#SEQuestionnaire table.confirmation input[name="JobStatus"]:checked').val());
				if(JobStatus == 1){
					// Presently employed in this job
						$('#SEQuestionnaire table.confirmation tr.EmployerInfo, #SEQuestionnaire table.confirmation tr.CompensationInfo')
							.show();
				}
				else{
					// Job Seeker or Candidate
						$('#SEQuestionnaire table.confirmation tr.EmployerInfo, #SEQuestionnaire table.confirmation tr.CompensationInfo')
							.hide(); 
				}
			}
			onchangeJobStatus();
		
		// Questionnaire
			
			// Scroll to Anchor
				function scrollToAnchor(id){
					// get the top offset of the target anchor
						var targetOffset = $("#" + id).offset();
						var targetTop = targetOffset.top;
					// Scroll to anchor by setting the body scroll top to anchor top
						$('html, body').animate({scrollTop:targetTop}, 500);
				}	
		
		
			// Educaton Level
				$('#SEQuestionnaire #EducationLevel').change(function(){
					onchangeEducationLevel();
				});
				
				function onchangeEducationLevel(){
					var $EducationLevelSelector = $('#SEQuestionnaire #EducationLevel');
					var EdcuationLevel = $EducationLevelSelector.val();
					var $PostHighschoolRows = $('tr.PostHighschool');
					if(EdcuationLevel > 1){
						// Post Highschool
							$PostHighschoolRows.show();
					}
					else{
						// Highschool or below
							// hide	field of study and school attended inputs
								$PostHighschoolRows.hide();
							// reset field of study and school attended inputs
								$('#Autocomplete_EducationDiscipline').val('');
								$('#CIP').val('');
								
								$('#Autocomplete_University').val('');
								$('#UniversityID').val('');
					}		
				}
				onchangeEducationLevel();
				
			// Pay Type
				$('#SEQuestionnaire input[name="PayType"]').change(function(){
					onchangePayType();
				});
				
				function onchangePayType(){
					var $IncomeRow = $('#SEQuestionnaire #IncomeRow');
					var $IncomeLabel = $('#SEQuestionnaire #IncomeLabel span.label');
					var CheckedRadioValue = parseInt($('#SEQuestionnaire input[name="PayType"]:checked').val());
					var CheckedRadioLabel = getCheckedRadioLabel('PayType');
					if(CheckedRadioValue == 0){
						// None
							$IncomeRow
								.css({
									visibility: "collapse"
								});
								
					}
					else{
						if(CheckedRadioValue == 1){
							// Hourly
								$IncomeLabel.text(CheckedRadioLabel + ' Rate:');
						}
						else{
							// Salary
								$IncomeLabel.text(CheckedRadioLabel + ' Salary:');
						}
						
						$IncomeRow
								.css({
									visibility: "visible"
								});
					}
				}
				onchangePayType();
	});
	
	
					
		
	// Updates a hidden form variable so when user hits back button, select form input will return to previously selected value
		/*
			EXAMPLE USAGE:
			 <script type="text/javascript">
				window.onload = function() {
					UpdateSelectValueBasedOnHiddenValue('Day','DayOriginal');
				}
			</script>
			 <input type="Hidden" name="DayOriginal" id="DayOriginal" value="#ATTRIBUTES.Day#">
			 <select name="Day" id="Day">
				<option value="1">1</option>   
				<option value="2">2</option>                      
			 </select>
		*/
		function UpdateSelectValueBasedOnHiddenValue(SelectObj,HiddenObj) {
			var HiddenObject = document.getElementById(HiddenObj);
			var HiddenValue = HiddenObject.value;
			var SelectObject = document.getElementById(SelectObj);
			var SelectIndex = document.getElementById(SelectObj).selectedIndex;
			var SelectValue = document.getElementById(SelectObj)[SelectIndex].value;
			
			SelectObject.value=HiddenValue;
		}	
				
// End hiding script from old browsers -->

//display the education level Disciplines 
	function displayQuestion() {

	if(document.SEQuestionnaire.EdLevel.options[document.SEQuestionnaire.EdLevel.selectedIndex].value == "3") {
			document.getElementById("questions5").style.display = 'none';
			document.getElementById("questions4").style.display = 'none';
			document.getElementById("questions3").style.display = '';
		}
		 
		if(document.SEQuestionnaire.EdLevel.options[document.SEQuestionnaire.EdLevel.selectedIndex].value == "4") {
			document.getElementById("questions5").style.display = 'none';
			document.getElementById("questions4").style.display = '';
			document.getElementById("questions3").style.display = 'none';
		}

		if(document.SEQuestionnaire.EdLevel.options[document.SEQuestionnaire.EdLevel.selectedIndex].value == "5") {
			document.getElementById("questions5").style.display = '';
			document.getElementById("questions4").style.display = 'none';
			document.getElementById("questions3").style.display = 'none';
		}
		
     if(document.SEQuestionnaire.EdLevel.options[document.SEQuestionnaire.EdLevel.selectedIndex].value == "2" || document.SEQuestionnaire.EdLevel.options[document.SEQuestionnaire.EdLevel.selectedIndex].value == "1" || document.SEQuestionnaire.EdLevel.options[document.SEQuestionnaire.EdLevel.selectedIndex].value == "0") {
			document.getElementById("questions5").style.display = 'none';
			document.getElementById("questions4").style.display = 'none';
			document.getElementById("questions3").style.display = 'none';
		}
		
	}
	
//end display the education level Disciplines 

//repopulate the BlackOpt and Rotating Questions form fields
	for (i=1; i<4;i++){
	// Rotating Questions
	function BOFields_i(){
		var BOFormName_c = getCookie("BLACKOPFN_"+i);
		var BOFormValue_c = getCookie("BLACKOP_"+i);
		//alert(BOFormName_c +" AND " + BOFormValue_c);
		$(function() {    
		var $radios = $('input:radio[name='+BOFormName_c+']');    
		if($radios.is(':checked') === false) {        
		$radios.filter('[value='+ BOFormValue_c +']').attr('checked', true);   
		 }});
	  }
	// Rotating Questions
	   function RQFields_i(){
		var RQFormName_c = getCookie("RQFN_"+i);
		var RQFormValue_c = getCookie("RQ_"+i);
		//alert(RQFormName_c +" AND " + RQFormValue_c);
		$(function() {    
		var $radios = $('input:radio[name='+RQFormName_c+']');    
		if($radios.is(':checked') === false) {        
		$radios.filter('[value='+RQFormValue_c+']').attr('checked', true);   
		 }});
	  }
	 }
//end repopulate the BlackOpt form fields

var today = new Date(); 
	var expiry = new Date(today.getTime() + 30 * 24 * 3600 * 1000);
	 // plus 30 days
	  function 	 setCookie(name, value) 
	 { 
	 	document.cookie=name + "=" + escape(value) + "; path=/; expires=" + expiry.toGMTString(); 
	}   
