function application_actuator() {
	show_onLoad();
	img_preloader();
/*	rotation_control();*/
}
	
img_preloader();

function img_preloader() {
	imageBuffer = new Array();
	for(i=0;i<(document.images.length); i++) {
		tmp_img_src_holder = document.images[i].src + '';
		if(tmp_img_src_holder.indexOf('_out') != -1) {
			imageBuffer[imageBuffer.length] = new Image;
			imageBuffer[imageBuffer.length - 1].src = tmp_img_src_holder.replace('out', 'over');
		}
	}
}

isOPERA = (navigator.userAgent.indexOf('Opera') >= 0)? true : false;
isIE    = (document.all && !isOPERA)? true : false;
isDOM   = (document.getElementById && !isIE && !isOPERA)? true : false;


function imageSwap(f_Name) {
	i_switch = document.images[f_Name].src + '';
	if(i_switch.indexOf('out') != -1) {
		new_image = i_switch.replace('out', 'over');
	}
	else {
		new_image = i_switch.replace('over', 'out');	
	}
	document.images[f_Name].src = new_image;
}


function show_hide(f_arrow_name, f_id) {
	f_open_closed = document.images[f_arrow_name].src + '';
	if(f_open_closed.indexOf('open') != -1) {
		hide(f_id);
		f_new_arrow = f_open_closed.replace('open', 'closed');
		document.images[f_arrow_name].src=f_new_arrow;
	}
	else {
		show(f_id, 'table-row');
		f_new_arrow = f_open_closed.replace('closed', 'open');
		document.images[f_arrow_name].src=f_new_arrow;
	}
}

function underline_box(id, f_decoration) {
	if (isDOM) {
		document.getElementById(id).style.textDecoration = f_decoration;
	}
	else if (isIE) {
		document.all[id].style.textDecoration = f_decoration;
	}	
}

function hide (id) {
	if (isDOM)
		document.getElementById(id).style.display = "none";
	else if (isIE)
		document.all[id].style.display = "none";
}
if (isDOM || isIE)
{
	document.writeln('<style type="text/css">');
	document.writeln('.SubItemRow \{ display: none; \}');
	document.writeln('</style>');
}

function show (id, displayValue)
{
	if (isDOM)
		document.getElementById(id).style.display = (displayValue)? displayValue : "block";
	else if (isIE)
		document.all[id].style.display = "block";
}

function detect_ie_mac(f_toggle) {
	ok_val = 1;
	f_platform = navigator.appName + '';
	if(navigator.appVersion.indexOf("Mac") != -1) {
		if(f_platform.indexOf('Explorer') != -1) {
			f_open_closed = document.images[f_toggle].src + '';
			if(f_open_closed.indexOf('open') != -1) {
				ok_val = 0;
			}
		}
	}
	if(ok_val == 1) {
		return 1;
	}
	else {
		return 0;
	}
}
/*************************************************************************************/
var isNavigator;
isNavigator= (navigator.appName=="Netscape")?1:0;

/*This code is to accept the numbers from 0 to 3 numbers only*/
function fncnum_zero_to_three()
		{
			 if(!isNavigator)
			 { 
				if(event.keyCode < 48 || event.keyCode > 51)
				{ 
					alert("Please enter the numbers between 0 and 3");
					event.returnValue = false;
				}
		
			 }
			 else
			 {
				if(event.which < 48 || event.which > 51) 
				alert("Please enter the numbers between 0 and 3");
				return false;
			 }
		}

/*This code is to accept the numbers only*/ 
function fncnumbersonly()
{
		 if(!isNavigator)
			 { 
				if(event.keyCode < 45 || event.keyCode > 57)
				{ 
					alert("Please enter the numbers only");
					event.returnValue = false;
				}
		
			 }
			 else
			 {
				if(event.which < 45 || event.which > 57) 
				alert("Please enter the numbers only");
				return false;
			 }

}

/*This code is to accept the year between 2005 and 9999*/
function fncyear()
		{

			if(document.frmpersonal_data.Enroll_Year.value<2005 || document.frmpersonal_data.Enroll_Year.value>9999 || event.keyCode < 45 || event.keyCode > 57)
				{ 
				alert("Please check whether you have entered other than numbers \n\r or check whether you have entered the year which is not in the range 2005 and 9999");
				return false;
				}
			else
			{
				return true;
			}
		}
/****************************************************************************************/	

function show_onLoad() {
/*	if(detect_ie_mac('toggle2')) { 
		show_hide('toggle2', 'sub_0_2');
	}
	if(detect_ie_mac('toggle3')) { 
		show_hide('toggle3', 'sub_0_3');
	}
	if(detect_ie_mac('toggle7')) { 
		show_hide('toggle7', 'sub_0_7');
	}
	if(detect_ie_mac('toggle8')) { 
		show_hide('toggle8', 'sub_0_8');
	}
	if(detect_ie_mac('toggle17')) { 
		show_hide('toggle17', 'sub_0_17');
	}*/
/*	if(detect_ie_mac('toggle10')) { 
		show_hide('toggle10', 'sub_0_10')
	}
	if(detect_ie_mac('toggle11')) { ;
		show_hide('toggle11', 'sub_0_11');
	}*/
}
//*****************************************************************************************/

function emailCheck(emailStr) {

var emailPat=/^(.+)@(.+)$/;
var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]";
var validChars="\[^\\s" + specialChars + "\]";
var quotedUser="(\"[^\"]*\")";
var ipDomainPat="/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/";
var atom=validChars + '+';
var word="(" + atom + "|" + quotedUser + ")";
var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
var matchArray=emailStr.match(emailPat);
if (matchArray==null) {
	return false
}

var user=matchArray[1]
var domain=matchArray[2]

if (user.match(userPat)==null) {
   return false
}
var IPArray=domain.match(ipDomainPat)
if (IPArray!=null) {
 	  for (var i=1;i<=4;i++) {
	    if (IPArray[i]>255) {
			return false
	    }
    }
    return true
}
var domainArray=domain.match(domainPat)
if (domainArray==null) {
    return false
}

var atomPat=new RegExp(atom,"g");
var domArr=domain.match(atomPat);
var len=domArr.length;

if (domArr[domArr.length-1].length<2 || 
    domArr[domArr.length-1].length>3) {
	   return false
}

if (len<2) {
   var errStr="This address is missing a hostname!"
   return false
}

// If we've gotten this far, everything's valid!
return true;
} 





