
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 Replace(str, find, rep)
{
    var res = CStr(str);
    var i = 0;
    while(true)
    {
        i = res.indexOf(find, i);
        if (i == -1) break;
        res = res.substr(0, i) + rep + res.substr(i + find.length);
        i += rep.length;
    }
    return res;
}
function CStr(value)
{
    return (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)
}

