﻿//******************************** Search Form Hijacking *****************************************
//
//

function redirectSearchForm() {
	var formObj = document.forms[0];
	formObj.name = formObj.id = "quicksearch";
	document.getElementById("__VIEWSTATE").value = "";
	formObj.action = "http://migration.kentucky.gov/Portal/Search.aspx";
	formObj.submit();
}

function checkKeystroke(evt) {
	evt = (evt) ? evt : (window.event) ? event : null;
	if (evt) {
		var charCode = (evt.charCode) ? evt.charCode :
			((evt.keyCode) ? evt.keyCode :
			((evt.which) ? evt.which : 0));
	}
	if (charCode == 13) { //return "Enter" key
		__CMS_PostbackFormBeenReset = true;
		redirectSearchForm();
	}
}




//******************************** jQuery INITIALIZATIONS BLOCK *****************************************
//
//

$(document).ready( function() {
//******************************** jQuery Fontsizer Initialization *****************************************
//
//
//initialize jQuery Fontsizer plugin. 
	$jquery.FontSizer.Init( {min: -2, max : 3} );

//******************************** jQuery Superfish Initialization *****************************************
//
//
// initialise plugins
		jQuery(function(){
			jQuery('ul.KI-Menu').superfish();
		});



//******************************** jQuery Show/Hide Initialization *****************************************
//
//
//Show Hide     
// hide all blocks that have class hide
  		$('.toggle').hide();
  		// toggle link1 with container1
  		// using chaining for performance and ease
  		// changing html of link
  		$('.toggleLink').toggle(function(){
  		  $(this).next().slideDown('fast').removeClass('hide').preventDefault;
  		    $(this).html('Hide').addClass('toggleLinkHide');
  		  },function(){
  		    $(this).next().slideUp('fast').addClass('hide').preventDefault;
  		    $(this).html('More info...').removeClass('toggleLinkHide');
  		})


});
