function InitFocus10(controlName1,controlName2,controlName3,controlName4,controlName5,controlName6,controlName7,controlName8,controlName9,controlName10)
{
	// Now position the cursor
	// This version of the code will finally
	// position at the last found control
	PositionCursor(controlName1);
	if (PositionCursor(controlName2))return;
	if (PositionCursor(controlName3))return;
	if (PositionCursor(controlName4))return;
	if (PositionCursor(controlName5))return;
	if (PositionCursor(controlName6))return;
	if (PositionCursor(controlName7))return;
	if (PositionCursor(controlName8))return;
	if (PositionCursor(controlName9))return;
	if (PositionCursor(controlName10))return;
	
	// Setup the event handler for firefox browsers
	document.onkeypress = IsEnter;
}

function InitFocus(controlName1,controlName2,controlName3,controlName4,controlName5)
{
	
	// Setup the event handler for firefox browsers
	document.onkeypress = IsEnter;
	
	// Now position the cursor
	PositionCursor(controlName1);
	if (PositionCursor(controlName2))return;
	if (PositionCursor(controlName3))return;
	if (PositionCursor(controlName4))return;
	if (PositionCursor(controlName5))return;
}

function PositionCursor(controlName)
{
	//alert(controlName);
	
	if (controlName=='')return false;
	
	var control = document.getElementById(controlName); 
	if( control != null )
	{
		control.focus();
		return true;
	} 
	
	return false;
}	

function HandleClickEvent(controlName)
{
	if (controlName=='')return false;
	
	//Click button
	var control = document.getElementById(controlName);
	if( control != null )
	{
		control.click();
		return true;
	}
	
	return false;
}

 
function ShowVerifyingOrder(lblName,ConfirmMessage,lblMessageID)
{
    // The message which shows status of order verification needs to be cleared
  
  var browserName=navigator.appName; 

         if(document.getElementById(lblMessageID) != null)
        {
             if (browserName=="Microsoft Internet Explorer")
             {
                document.getElementById(lblMessageID).innerText = "Your order is being verified";
                document.getElementById('spnImgProcessing').style.display = 'block';
			 }			
             else
             {
                document.getElementById(lblMessageID).innerHTML = "Your order is being verified";
                document.getElementById('spnImgProcessing').style.display = 'block';
              }
        }  
              
         return true;
     
}

function ProcessEnterEvent(evt, controlName1,controlName2,controlName3,controlName4,controlName5)
{
	Process10EnterEvent(evt, controlName1,controlName2,controlName3,controlName4,controlName5,'','','','','');
}

function Process10EnterEvent(evt, controlName1,controlName2,controlName3,controlName4,controlName5,controlName6,controlName7,controlName8,controlName9,controlName10)
{
	var target;
    var keyCode;
    var is_ie;
    
    //ie or ns
    if (document.all || document.layers) 
    {
		//Is Enter
		if ((event.which ? event.which : event.keyCode) == 13)
		{
			// Stops the event activated by the enter
			event.returnValue = false;
			event.cancel = true;             
			
			//Click button, let the first control that is 
			// available handle the event.
			if (HandleClickEvent(controlName1))return;
			if (HandleClickEvent(controlName2))return;
			if (HandleClickEvent(controlName3))return;
			if (HandleClickEvent(controlName4))return;
			if (HandleClickEvent(controlName5))return;
			if (HandleClickEvent(controlName6))return;
			if (HandleClickEvent(controlName7))return;
			if (HandleClickEvent(controlName8))return;
			if (HandleClickEvent(controlName9))return;
			if (HandleClickEvent(controlName10))return;
			return;
		}
    }
    
    // Firefox
    if (document.addEventListener) 
	{		
		keyCode = evt.keyCode;
		
		//Is Enter
		if (keyCode==13)
		{
			// Stops the event activated by the enter
			evt.preventDefault();
			evt.stopPropagation();

			//Click button, let the first control that is 
			// available handle the event.
			if (HandleClickEvent(controlName1))return;
			if (HandleClickEvent(controlName2))return;
			if (HandleClickEvent(controlName3))return;
			if (HandleClickEvent(controlName4))return;
			if (HandleClickEvent(controlName5))return;
			if (HandleClickEvent(controlName6))return;
			if (HandleClickEvent(controlName7))return;
			if (HandleClickEvent(controlName8))return;
			if (HandleClickEvent(controlName9))return;
			if (HandleClickEvent(controlName10))return;
			return;
		}
	} 
} 

function ShowModal(URL, height, width)
{
	// Use window.open instead
	if (typeof height == 'undefined' || typeof width == 'undefined')
	{
		var sFeatures = 'scrollbars=yes,toolbar=no,menubar=no,height=600,width=800,resizable=yes,top=0,left=0'; 
		window.open(URL, '_blank', sFeatures);
	}
	else
	{
		var sFeatures = 'scrollbars=yes,toolbar=no,menubar=no,height=' + height + ',width=' + width + ',resizable=yes,top=0,left=0'; 
		window.open(URL, '_blank', sFeatures);
	}
	return false;
}





