			var IE = document.all?true:false
			var ie4 = navigator.userAgent.indexOf("MSIE") != -1		
			
			function DisplayLayer(LayerChoice) {
				if (ie4) {
					if (document.all[LayerChoice].style.display == "none") {
						document.all[LayerChoice].style.display = "block";
					}
					else {
						document.all[LayerChoice].style.display = "none";
					}
				}
			}
			function SubmitSearchMessage() {
				DisplayLayer('SummaryWaitMessage') ;
				return true ;
			}							
			
			function hideTable(which, bManipulateDropDown)
			{
				if(bManipulateDropDown == null)
				{
					bManipulateDropDown = true;
				}
				
				
				if (document.all(which).style.display == "")
				{
					var SelectList = document.getElementsByTagName("SELECT");
					if(bManipulateDropDown)
					{
					
						for(i = 0 ; i < SelectList.length ; i++)
						{
							//alert(SelectList[i].style.visibility + "1");
							if(SelectList[i].style.visibility == "hidden")
							{
							
								SelectList[i].style.visibility = "visible";
							}
						}
					}
					document.all(which).style.display = "none";
				}
				else
				{
					
					var SelectList = document.getElementsByTagName("SELECT");
					
					if(bManipulateDropDown)
					{
						for(i = 0 ; i < SelectList.length; i++)
						{
							//alert(SelectList[i].style.visibility);
							if(SelectList[i].style.visibility == "" || SelectList[i].style.visibility == "visible")
							{
								
								SelectList[i].style.visibility = "hidden";
							}
						}
					}
					
					document.all(which).style.display = "";
					
					var mousex=getMouseX(null)
				
					document.all(which).style.left = (mousex + document.all(which).offsetWidth   < 1000  )? mousex : (1000 - document.all(which).offsetWidth); 
					document.all(which).style.top = getMouseY(null) + 10;
		
					
				}
				
			}
			function CloseBlock(which, bManipulateDropDown)
			{
				if(bManipulateDropDown == null)
				{
					bManipulateDropDown = true;
				}
				
				if(bManipulateDropDown)
				{
					var SelectList = document.getElementsByTagName("SELECT");
					for(i = 0 ; i < SelectList.length ; i++)
					{
						//alert(SelectList[i].style.visibility + "1");
						if(SelectList[i].style.visibility == "hidden")
						{
						
							SelectList[i].style.visibility = "visible";
						}
					}
				}
				document.all(which).style.display = "none";
			}
			
			function ClearOptions()
			{
				document.all.LocationColumnCheckBox.checked = false;
				document.all.LineDescriptionColumnCheckBox.checked = false;
				document.all.ItemDescriptionColumnCheckBox.checked = false;
				document.all.PriceColumnCheckBox.checked = false;
				document.all.InvoiceDateColumnCheckBox.checked = false;
				
				
			}
			function getMouseX(e) 
			{
				var tempX;
				if (IE) {
			
					 // grab the x-y pos.s if browser is IE
					tempX = event.clientX + document.body.scrollLeft;
					
				} else {  
					
					// grab the x-y pos.s if browser is NS
					tempX = e.pageX
				}  
				// catch possible negative values in NS4
				if (tempX < 0){tempX = 0}
				// show the position values in the form named Show
				// in the text fields named MouseX and MouseY
				return tempX;
				
			}
			
			function getMouseY(e) 
			{
				var tempY;
				if (IE) { // grab the x-y pos.s if browser is IE
					tempY = event.clientY + document.body.scrollTop
				} else {  // grab the x-y pos.s if browser is NS
					tempY = e.pageY
				}  
				// catch possible negative values in NS4
				if (tempY < 0){tempY = 0}  
				// show the position values in the form named Show
				// in the text fields named MouseX and MouseY
				return tempY;
			}
			
			function trimString (str) {
				str = this != window? this : str;
				return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
			}

function openNewWindow(windowPath,windowWidth,windowHeight,windowResizable,windowScrollbars,windowStatus,windowMenuBar,windowToolbar,windowLocation,windowDirectories){
	var d = new Date();
	windowName = String('win' + d.getHours() + d.getMinutes() +  d.getSeconds() + d.getMilliseconds());
	windowOpen = window.open(windowPath,windowName,'top='+(screen.height-windowHeight)/2+',left='+(screen.width-windowWidth)/2+',width='+windowWidth+',height='+windowHeight+',resizable='+windowResizable+',scrollbars='+windowScrollbars+',status='+windowStatus+',menubar='+windowMenuBar+',toolbar='+windowToolbar+',location='+windowLocation+',directories='+windowDirectories);
	}
	
function openWindow(windowPath,windowName, windowWidth,windowHeight,windowResizable,windowScrollbars,windowStatus,windowMenuBar,windowToolbar,windowLocation,windowDirectories)
{
	windowOpen = window.open(windowPath,windowName,'top='+(screen.height-windowHeight)/2+',left='+(screen.width-windowWidth)/2+',width='+windowWidth+',height='+windowHeight+',resizable='+windowResizable+',scrollbars='+windowScrollbars+',status='+windowStatus+',menubar='+windowMenuBar+',toolbar='+windowToolbar+',location='+windowLocation+',directories='+windowDirectories);
}

function openNewWindowAt(windowPath,windowWidth,windowHeight,windowResizable,windowScrollbars,windowStatus,windowMenuBar,windowToolbar,windowLocation,windowDirectories, windowLeft, windowTop)
{
	var d = new Date();
	windowName = String('win' + d.getHours() + d.getMinutes() +  d.getSeconds() + d.getMilliseconds());
	windowOpen = window.open(windowPath,windowName,'top='+windowTop+',left='+windowLeft+',width='+windowWidth+',height='+windowHeight+',resizable='+windowResizable+',scrollbars='+windowScrollbars+',status='+windowStatus+',menubar='+windowMenuBar+',toolbar='+windowToolbar+',location='+windowLocation+',directories='+windowDirectories);
}
	
function openPopupWindow(windowPath)
{
	openWindow(windowPath,"popup",426, 474, 'no', 'yes','yes','no','no','no','no'); 
}	
function rollOn(selectedImage){
	var imgOn 					= selectedImage+'On.src';
	var selectedImage1			= 'img_'+selectedImage;
	document[selectedImage1].src = eval(imgOn);
}
	
function rollOff(selectedImage){
	var imgOff 					= selectedImage+'Off.src';
	var selectedImage1			= 'img_'+selectedImage;
	document[selectedImage1].src = eval(imgOff);
}

function rollFolderOn(selectedImage){
	var imgOn 					= 'folderOn.src';
	var selectedImage1			= selectedImage;
	document[selectedImage1].src = eval(imgOn);
}
	
function rollFolderOff(selectedImage){
	var imgOff 					= 'folderOff.src';
	var selectedImage1			= selectedImage;
	document[selectedImage1].src = eval(imgOff);
}

function redirectOpenerPage(sUrl, bCloseCurrentWindow)
{
	window.opener.location.href = sUrl;
	//alert(sUrl);
	if(bCloseCurrentWindow)
	{
		self.close();
	}

}
 
//ADD BY PROXIMI-T
//Do the Cancel Action of a form.
function CancelAction()
	{
		//NumberOfBack
		eval('history.go(-' + NumberOfBack + ');');
	}
function printWindow()
{
   bV = parseInt(navigator.appVersion)
   if (bV >= 4) window.print()
}
function OpenTechnicalProblemWindow()
	{
		openNewWindow("/redirect/technicalproblem.htm",  530, 430, 'no', 'no','no','no','no','no','no');
	}

///VICTOR 2.0
///FNT : FNT-006, FNT-008
function ControlAccessToField(ControlToValidateId, ControlToAccessId, RegExpPattern)
	{
		
		var ControlToValidate		= document.getElementById(ControlToValidateId);
		var ControlToAccessField	= document.getElementById(ControlToAccessId);
		
		myRegExp					= new RegExp(RegExpPattern);
		
		if(myRegExp.test(ControlToValidate.value))
		{
			ControlToAccessField.disabled	= false;
			
			ControlToAccessField.focus();
			ControlToAccessField.select();
		}
		else
		{
			ControlToAccessField.disabled	= true; 
			ControlToAccessField.value		= '';
			
		}
	}
function OpenMSDS(ProductCode, Frameless)
{	
	var sUrl = Frameless ? "/msds/msdsredirection.aspx?p=" + ProductCode : "/msds/?p=" + ProductCode;
	openNewWindowAt(sUrl, 993, 540,'yes','no','no','no','no','no','no', 1, 185)
}

