$(document).ready(function() {
	pageInit();
});

function pageInit(){
	initMoreLinkPg();
}
function reValue(){
	//dummy function, wait to override
}

function initMoreLinkPg(){    
    $(".lihide").hide();
    $("a.seemoreB").hide();	
    $(".seemore> a").click(function () {      
	   var toShow = true;	   
	   if($(this).attr('class').endsWith("B")){
		  toShow = false;
	   }
	   
	   var selectid = $(this).parent(".seemore").attr('id');	   
	   	   
	   if(toShow){
			$("#tbl"+selectid).find(".lihide").fadeIn("fast"); 
			$(this).siblings("a.seemoreB").show();
	   }
	   else{
			$("#tbl"+selectid).find(".lihide").fadeOut("fast"); 	   
			$(this).siblings("a.learnMoreBar").fadeIn("fast");
	   }
	   $(this).hide();	   
	   return false;
	});
    $(".learnMoreBar> a").click(function () {      
	   var toShow = true;	   
	   if($(this).attr('class').endsWith("B")){
		  toShow = false;
	   }
	   
	   var selectid = $(this).parent(".seemore").attr('id');	   
	   	   
	   if(toShow){
			$("#tbl"+selectid).find(".lihide").fadeIn("fast"); 
			$(this).siblings("a.seemoreB").show();
	   }
	   else{
			$("#tbl"+selectid).find(".lihide").fadeOut("fast"); 	   
			$(this).siblings("a.learnMoreBar").fadeIn("fast");
	   }
	   $(this).hide();	   
	   return false;
	});
}

function setAutoTab(){
	$('#PRIPHONE1').autotab({ format: 'numeric', target: 'PRIPHONE2' });
	$('#PRIPHONE2').autotab({ format: 'numeric', target: 'PRIPHONE3', previous: 'PRIPHONE1' });
	$('#PRIPHONE3').autotab({ format: 'numeric', target: 'SECPHONE1', previous: 'PRIPHONE2' });

	$('#SECPHONE1').autotab({ format: 'numeric', target: 'SECPHONE2', previous: 'PRIPHONE3' });
	$('#SECPHONE2').autotab({ format: 'numeric', target: 'SECPHONE3', previous: 'SECPHONE1' });
	$('#SECPHONE3').autotab({ format: 'numeric', previous: 'SECPHONE2' });

	$('#CELLPHONE1').autotab({ format: 'numeric', target: 'CELLPHONE2'});
	$('#CELLPHONE2').autotab({ format: 'numeric', target: 'CELLPHONE3', previous: 'CELLPHONE1' });
	$('#CELLPHONE3').autotab({ format: 'numeric', previous: 'CELLPHONE2' });	
	
	$('#FIRSTNAME').autotab({format: 'custom',  pattern: '[^a-zA-Z ]'});
	$('#LASTNAME').autotab({format: 'custom',  pattern: '[^a-zA-Z ]'});
	$('#ADDRESS').autotab({format: 'custom',  pattern: '[^0-9a-zA-Z\. ,#-]'});
}