﻿// JScript File
var $j = jQuery.noConflict();
    
// initialise plugins
$j(function(){

function goToValidationSummary()
{
	$j("div.formContentContainer").focus();
	//return true;
}
	$j('ul#AdminMenu').superfish({ autoArrows: false, pathLevels: 1 });
		
    $j("input.TextBoxItemCharacter").keyup(function(e) {
		
		if (e.keyCode != 13)
		{
		  if($j(this).val().length > 0)
		  {
			var $next;
			if($j(this).next().attr("type") == "text")
			{
			   $next = $j(this).next()
			}
			else
			{
				$next = $j(this).next().next();
			}
			$next.focus();
		  }
		}
		
    }).keydown(function(e)
	{
	  if($j(this).val().length > 0)
	  {
		$j(this).val("")
	  }
	  if(e.keyCode == 13)
	  {
		var $next;
		if($j(this).next().attr("type") == "text")
		{
		   $next = $j(this).next()
		}
		else
		{
			$next = $j(this).next().next();
		}
		$next.focus();
		return false;
	  }
	  
	  if (e.keyCode == 8 && $j(this).val().length == 0){
         	if($j(this).prev().attr("type") == "text")
			{
         	   $j(this).prev().focus();
			}
			else
			{
				$j(this).prev().prev().focus();
			}
      	}
	  
	});
});