	function doProcessing() {
		if(document.getElementById('button')){
			document.getElementById('button').className = 'thide';		
		}else if (document.getElementById('button1')){
			document.getElementById('button1').className = 'thide';
		}else if (document.getElementById('submitBttn')){
			document.getElementById('submitBttn').className = 'thide';
		}
		document.getElementById('processing').className = 'tshow';
        if(navigator.userAgent.indexOf("Firefox")!=-1){
            window.location.reload( true );
        }
	}
	/* used for opening the window */
	function openWin(page, name, details) {
		newWin = window.open(page, name, details);
		if (window.focus) { newWin.focus() }
	}
	


	function popupPreview(urltxt, wid, high) 
	{     
	  wid+=0;
	  high+=0;
	  var flagvar=0;
	  try{
	  	  confirmWin.close();
		  confirmWin=window.open(urltxt, "kwu","height=" +high+ ",width="+wid+",directories=no,location=no,menubar=no," +
				 "resizable=yes,status=no,toolbar=no,scrollbars=yes");	
		}
	  catch(e)
	  {
			confirmWin=window.open(urltxt, "kwu", 
	  	   "height=" +high+ ",width="+wid+",directories=no,location=no,menubar=no," +
							 "resizable=yes,status=no,toolbar=no,scrollbars=yes");
	  }
	  if (window.confirmWin)
	  { 
			if (window.focus) 
			{ 
			  if ((navigator.appName.indexOf("Microsoft Internet Explorer")!=-1)&&(navigator.appVersion.indexOf("4.") != -1)
					  &&(parent.length>0))
			  { 
					window.confirmWin.close(); 
					flagvar=1;
					timevar = setTimeout("openit(urltxt)", 300);      
			  }
			  else
			  {
					confirmWin.focus();
			  }
			} 
		   else
		   {  
				if (navigator.appName.indexOf("Microsoft Internet Explorer") != -1)  // If this is a MSIE Browser
				{  
					if (navigator.appVersion.indexOf("3.") != -1)  // MSIE 3.x
					{
					  if (isLoaded == true)
					  {
						alert("If the large image does not pop up, press the 'Product Close-up' tab in your task bar, or locate the image browser behind your open window." );
						return;
					  }
					  else
					  {
						alert("If the Site Menu bar does not pop up, press the 'Product Close-up' tab in your task bar, or locate the image browser behind your open window." );
						return;
					  } 
					} 
				  }
			}
	  }          
	  else
	  {
			confirmWin = window.open(urltxt, "kwu", 
			"height=" +high+ ",width="+wid+",directories=no,location=no,menubar=no," +
			"resizeable=no,status=no,toolbar=no");
			var isLoaded = true;
	  }	
		  // This is important for Netscape 2.0 to enable the opener property	
	  if (flagvar!=1)
	  {
		if (confirmWin.opener == null)
		{
			  confirmWin.opener = self;
		}
	  }
	  wid=0;
	  high=0;
	}
function openFullSizeWindow( aURL, aWinName )
{
   var wOpen;
   var sOptions;

   sOptions = 'status=yes,menubar=yes,scrollbars=yes,resizable=yes,toolbar=yes';
   sOptions = sOptions + ',width=' + (screen.availWidth - 10).toString();
   sOptions = sOptions + ',height=' + (screen.availHeight - 122).toString();
   sOptions = sOptions + ',screenX=0,screenY=0,left=0,top=0';

   wOpen = window.open( '', aWinName, sOptions );
   wOpen.location = aURL;
   wOpen.focus();
   wOpen.moveTo( 0, 0 );
   wOpen.resizeTo( screen.availWidth, screen.availHeight );
}
function validateNumeric(objForm)
	{	blnValidChar = false;	
		var strWork = "0123456789";
		for(i=0; i < strWork.length; i++) {
			if(window.event.keyCode == strWork.charCodeAt(i)) {
				blnValidChar = true;
				break;
			}
		}
		if(!blnValidChar) {
			window.event.returnValue = false;
			objForm.focus();
		}
	}

	
	
function showLayer(layerToShow) {
	var layerValue = layerToShow;
	var idArray = layerArray();
	for (var i = 0; i < idArray.length; i++) {
		var idTmp = idArray[i];
		if (layerValue == idTmp) {
			document.getElementById(idTmp).style.display = "block";
		} else {
			document.getElementById(idTmp).style.display = "none";
		}
	}
}

$(document).ready(function() {
	 var formDiv = $('#preform2').css('height');
	 var contentDiv = $('#premid21').css('height');
	
	 if(formDiv !='undefined'){
     formDiv = toaNumber(formDiv);
     contentDiv = toaNumber(contentDiv);
	}
	 $('#preform2').css('height', function(index) {
	   if(formDiv > contentDiv && formDiv != "auto"){
			return formDiv;
		}else{
			return contentDiv;
		}
	});
	
	$('#premid21').css('height', function(index) {
	   if(formDiv > contentDiv && formDiv != "auto"){
			return formDiv;
		}else{
			return contentDiv;
		}
	});
	
	
	$('#innerpremid1').css('height', function(index) {
	   return $('#premid21').css('height');
	});
	
})

function toaNumber(number){
	if(isNaN(number) && number !=undefined){
		var number  =  number.substring(0,number.indexOf('px'));
		number = parseInt(number)+60 +"px"; 
		return number;
	}
}
