<!-- Beginning of JavaScript -

/************/
/* VARIABLE */
/************/
var activeMainBox='none';

var cont = 0;

var allActuatorsTypes = new Array();
allActuatorsTypes[0] = 'mpa02';
allActuatorsTypes[1] = 'mml';
//allActuatorsTypes[2] = 'MPA00';
//allActuatorsTypes[3] = 'HPA00';
//allActuatorsTypes[4] = 'HPA02';

var contador;
for(contador=0; contador<allActuatorsTypes.length; contador++){
	//var MPA00PageActiveBox='none';
	eval('var ' + allActuatorsTypes[contador]  + 'PageActiveBox=\'none\';');
}

if(document.images){
	MPA03 = new Image
	MPA03i = new Image
	MPA00 = new Image
	MPA02Serie = new Image
	initialImage = new Image
	MCLSerie = new Image
	MCMSerie = new Image
	MCHSerie = new Image
	MDMSerie = new Image
	MDHSerie = new Image
	HPA00Serie = new Image
	slideshow = new Image
	
	YOURVALVE_FR = new Image;
	YOURVALVE_ES = new Image;
	YOURVALVE_EN = new Image;
	
	ActuatorDimensions_en = new Image;
	SwagelokDimensions_en = new Image;
	ParkerDimensions_en = new Image;
	DropinSwag_en = new Image;
	
	ActuatorDimensions_fr = new Image;
	SwagelokDimensions_fr = new Image;
	ParkerDimensions_fr = new Image;
	DropinSwag_fr = new Image;
	
	ActuatorDimensions_es = new Image;
	SwagelokDimensions_es = new Image;
	ParkerDimensions_es = new Image;
	DropinSwag_es = new Image;
	
	Salesbanner_en = new Image;
	Salesbanner_fr = new Image;
	Salesbanner_es = new Image;
	
	HPAcustom1 = new Image;
	HPAcustom2 = new Image;
	HPAcustom3 = new Image;
	HPAcustom4 = new Image;
	
	Mseriecustom1 = new Image;
	Mseriecustom2 = new Image;
	Mseriecustom3 = new Image;
	Mseriecustom4 = new Image;
	Mseriecustom5 = new Image;
	
	Labcustom1 = new Image;
	Labcustom2 = new Image;
	Labcustom3 = new Image;
	
	HB3W4W = new Image;
	HBBFVD = new Image;
	HBBFVT = new Image;
	HBGVMT = new Image;
	HBM1NP = new Image;
	HBM1NS = new Image;
	HBM2SS = new Image;
	HBM3SS = new Image;
	HBPRBP = new Image;
	HBQX = new Image;
	HBSBSS = new Image;
	HBUUSS = new Image;
	HBVVAV = new Image;
	
	MPA03.src = "images/MPA03_BG_500x375.jpg"
	MPA03i.src = "images/MPA03i_BG_500x375.jpg"
	MPA00.src = "images/MPA00_BG_500x375.jpg"
	MPA02Serie.src = "images/MPA02Serie.jpg"
	initialImage.src = "images/MCLSerie.jpg"
	MCLSerie.src = "images/MCLSerie.jpg"
	MCMSerie.src = "images/MCMSerie.jpg"
	MCHSerie.src = "images/MCHSerie.jpg"
	MDMSerie.src = "images/MDMSerie.jpg"
	MDHSerie.src = "images/MDHSerie.jpg"
	HPA00Serie.src = "images/HPA00Serie.jpg"
	slideshow.src = "images/slideshow.gif"
	
	YOURVALVE_FR.src =  "images/YOURVALVE_FR.jpg"
	YOURVALVE_ES.src = "images/YOURVALVE_ES.jpg"
	YOURVALVE_EN.src = "images/YOURVALVE_EN.jpg"
	
	ActuatorDimensions_en.src = "images/ActuatorwoExtgear.jpg"
	SwagelokDimensions_en.src = "images/SwagelokSize.jpg"
	ParkerDimensions_en.src = "images/ParkerSize.jpg"
	DropinSwag_en.src = "images/mseriesswagdropin.jpg"
	
	ActuatorDimensions_fr.src = "images/ActuatorwoExtgear_fr.jpg"
	SwagelokDimensions_fr.src = "images/SwagelokSize_fr.jpg"
	ParkerDimensions_fr.src = "images/ParkerSize_fr.jpg"
	DropinSwag_fr.src = "images/mseriesswagdropin_fr.jpg"
	
	ActuatorDimensions_es.src = "images/ActuatorwoExtgear_es.jpg"
	SwagelokDimensions_es.src = "images/SwagelokSize_es.jpg"
	ParkerDimensions_es.src = "images/ParkerSize_es.jpg"
	DropinSwag_es.src = "images/mseriesswagdropin_es.jpg"
	
	Salesbanner_en.src = "images/salesbanner.jpg"
	Salesbanner_fr.src = "images/salesbanner_fr.jpg"
	Salesbanner_es.src = "images/salesbanner_es.jpg"
	
	HPAcustom1.src = "images/Newco 4inch with HPA.jpg"
	HPAcustom2.src = "images/HPA with Banksdale hydrolic valve 2.jpg"
	HPAcustom3.src = "images/HPA with Banksdale hydrolic valve 1.jpg"
	HPAcustom4.src = "images/HPA with Swagelok 4way ball valve.jpg"
	
	Mseriecustom1.src = "images/MPA with Custom High temp 3way Diverter Valve.jpg"
	Mseriecustom2.src = "images/MPA with Regulator valve 2.jpg"
	Mseriecustom3.src = "images/MPA in Plastic Enclosure.jpg"
	Mseriecustom4.src = "images/MPA with dual 3way valve.jpg"
	Mseriecustom5.src = "images/MPL02 with Badger valve.jpg "
	
	Labcustom1.src = "images/Cookie Machine.jpg"
	Labcustom2.src = "images/poditrist custom application.jpg"
	Labcustom3.src = "images/SSDS.jpg"
	
	HB3W4W.src = "images/HB3W-4W.jpg"
	HBBFVD.src = "images/HBBFV-D.jpg"
	HBBFVT.src = "images/HBBFV-T.jpg"
	HBGVMT.src = "images/HBGV-MT.jpg"
	HBM1NP.src = "images/HBM1-NP.jpg"
	HBM1NS.src = "images/HBM1-NS.jpg"
	HBM2SS.src = "images/HBM2-SS.jpg"
	HBM3SS.src = "images/HBM3-SS.jpg"
	HBPRBP.src = "images/HBPR-BP.jpg"
	HBQX.src = "images/HBQx.jpg"
	HBSBSS.src = "images/HBSB-SS.jpg"
	HBUUSS.src = "images/HBUU-SS.jpg"
	HBVVAV.src = "images/HBVV-AV.jpg"
	
}else{
	MPA03.src = ""
	MPA03i.src = ""
	MPA00.src = ""
	MPA02Serie.src = ""
	initialImage.src = ""
	MCLSerie.src = ""
	MCMSerie.src = ""
	MCHSerie.src = ""
	MDMSerie.src = ""
	MDHSerie.src = ""
	HPA00Serie.src = ""
	slideshow.src = ""
	
	YOURVALVE_FR.src = ""
	YOURVALVE_ES.src = ""
	YOURVALVE_EN.src = ""
	
	ActuatorDimensions_en.src = ""
	SwagelokDimensions_en.src = ""
	ParkerDimensions_en.src = ""
	DropinSwag_en.src = ""
	
	ActuatorDimensions_fr.src = ""
	SwagelokDimensions_fr.src = ""
	ParkerDimensions_fr.src = ""
	DropinSwag_fr.src = ""
	
	ActuatorDimensions_es.src = ""
	SwagelokDimensions_es.src = ""
	ParkerDimensions_es.src = ""
	DropinSwag_es.src = ""
	
	Salesbanner_en.src = ""
	Salesbanner_fr.src = ""
	Salesbanner_es.src = ""
	
	HPAcustom1.src = ""
	HPAcustom2.src = ""
	HPAcustom3.src = ""
	HPAcustom4.src = ""
	
	Mseriecustom1.src = ""
	Mseriecustom2.src = ""
	Mseriecustom3.src = ""
	Mseriecustom4.src = ""
	Mseriecustom5.src = ""
	
	Labcustom1.src = ""
	Labcustom2.src = ""
	Labcustom3.src = ""
	
	HB3W4W.src = ""
	HBBFVD.src = ""
	HBBFVT.src = ""
	HBGVMT.src = ""
	HBM1NP.src = ""
	HBM1NS.src = ""
	HBM2SS.src = ""
	HBM3SS.src = ""
	HBPRBP.src = ""
	HBQX.src = ""
	HBSBSS.src = ""
	HBUUSS.src = ""
	HBVVAV.src = ""
	
	document.framePpal = ""
}

function loadPageInSameWindow(url, typeActuator) {
	window.location.href = url + '?language=' + eval(typeActuator+'Language');
}

newPages = new Array();
function loadNewWindow(url) {
	var i;
	
	var longitud=newPages.length;
	
	newPages[newPages.length] = window.open(url,'','scrollbars=no,menubar=no,height=600,width=800,resizable=yes,toolbar=no,location=no,status=no');
	
	/*for(i in newPages){
		newPages[i].focus();
	}*/
}

var pageContactUs='';
function openPageContactUs() {
	if(pageContactUs.closed || pageContactUs==''){
		pageContactUs = window.open('contactUs.htm?language=' + eval(moduleId+'Language'), 'pageContactUs', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,height=567,width=713');
	}else{
		pageContactUs.focus();
	}
}

detailsOptionsLinkInformation = new Array();
detailsOptionsPages = new Array();
detailsOptionsUrls = new Array();
function openPageDetailsOptions(origen, language) {
	var i;
	var pageDetailsOptionsUrl;
	var alreadyOpened = false;
	
	pageDetailsOptionsUrl = 'detailsOptions.htm?';
	pageDetailsOptionsUrl += 'language' + '=' + language + '&';
	pageDetailsOptionsUrl += 'partNumber' + '=' + detailsOptionsLinkInformation[origen].partNumber + '&';
	pageDetailsOptionsUrl += 'title' + '=' + detailsOptionsLinkInformation[origen].title + '&';
	pageDetailsOptionsUrl += 'type' + '=' + detailsOptionsLinkInformation[origen].type + '&';
	pageDetailsOptionsUrl += 'material' + '=' + detailsOptionsLinkInformation[origen].material + '&';
	pageDetailsOptionsUrl += 'connection' + '=' + detailsOptionsLinkInformation[origen].connected + '&';
	pageDetailsOptionsUrl += 'cv' + '=' + detailsOptionsLinkInformation[origen].cv + '&';
	pageDetailsOptionsUrl += 'price' + '=' + detailsOptionsLinkInformation[origen].price + '&';
	pageDetailsOptionsUrl += 'valvepdf' + '=' + detailsOptionsLinkInformation[origen].valvepdf + '&';
	pageDetailsOptionsUrl += 'mountingprice' + '=' + detailsOptionsLinkInformation[origen].mountingkit;

	for(i in detailsOptionsPages){
		if(!detailsOptionsPages[i].closed){
			if(detailsOptionsUrls[i] == pageDetailsOptionsUrl){
				alreadyOpened = true;
				break;
			}
		}
	}
	
	if(!alreadyOpened){
		var screenXText= 'screenX=' + (5+50*detailsOptionsPages.length) + ',';
		var screenYText= 'screenY=' + (5+50*(detailsOptionsPages.length%4)) + ',';
		var leftText= 'left=' + (5+50*detailsOptionsPages.length) + ',';
		var topText= 'top=' + (5+50*(detailsOptionsPages.length%4)) + ',';
		detailsOptionsUrls[detailsOptionsPages.length] = pageDetailsOptionsUrl;
		detailsOptionsPages[detailsOptionsPages.length] = window.open(pageDetailsOptionsUrl, detailsOptionsPages.length, screenXText + screenYText + leftText + topText + 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,height=700,width=713');
	}
	
	for(i in detailsOptionsPages){
		if(!detailsOptionsPages[i].closed){
			detailsOptionsPages[i].focus();
		}
	}
}

function formatName (name){
	var i;
	
	for(i=0; i<name.length; i++){
		name=name.replace("-","_");
	}	
	return name;
}

var oldImage;
function changeImage(where, newImage){
	if(oldImage != newImage){
		javascript:changeOpac(0, where);
		document.getElementById(where).src=newImage;
		javascript:opacity(where, 0, 100, APPEAR_TIME);
		oldImage = newImage;
	}	
}

var linkActuator= new Array();
var linkValve= new Array();
var price= new Array();


////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////
function AllInformationForMaterialAndDataSheetTable(linkActuator, linkValve, price, altBoxText) {
	this.linkActuator=linkActuator;
	this.linkValve=linkValve;
	this.price=price;
	this.altBoxText=altBoxText;
}
allInformationForMaterialAndDataSheetTable= new Object();

////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////

//code initial for your own application function doYourOwnValveBoxAction(boxId, typeActuator, language){
//code initial for your own application 
//code initial for your own application 	document.getElementById(typeActuator+'CvCell').innerHTML = 'Price for the actuator with your own valve';
//code initial for your own application 	changeImage('images'+typeActuator, eval(boxId+'.src'));
//code initial for your own application 	if(eval(typeActuator+'PageActiveBox') != boxId){
//code initial for your own application 		if(eval(typeActuator+'PageActiveBox') != 'none'){	//if it's the first time I don't have to desactivate any box
//code initial for your own application 			document.getElementById(eval(typeActuator+'PageActiveBox')).style.backgroundColor=columnBackColor;
//code initial for your own application 		}
//code initial for your own application 	
//code initial for your own application 		eval(typeActuator+'PageActiveBox'+"=boxId");
//code initial for your own application 		document.getElementById(boxId).style.backgroundColor=imagesMPA02BackColor;
//code initial for your own application 	}
//code initial for your own application 	//Hide all rows for MaterialAndDataSheetTable
//code initial for your own application 	for(j=0; j<eval(typeActuator+'MaxQtyMaterials'); j++){
//code initial for your own application 		document.getElementById(typeActuator+'MaterialAndDataSheetTable'+j).style.display = 'none';
//code initial for your own application 	}
//code initial for your own application }

function buildCascadeMenu(typeActuator){
	var i, j;
	var workString;
	
	workString='<td width="200" valign="top"><table width="200" border="0" cellspacing="0" cellpadding="0">';
			
	for(i=0; i<eval(typeActuator +'ListedByGroups.length'); i++){
		workString=insertString(workString, '<tr><td');
		workString=insertAttribute(workString, 'id', typeActuator+'Supplier'+i);
		workString=insertAttribute(workString, 'width', 194);
		workString=insertAttribute(workString, 'height', 44);
		workString=insertAttribute(workString, 'bgcolor', titleColumnBackColor);
		workString=insertAttribute(workString, 'class', 'H16VerdanaBold');
		workString=insertAttribute(workString, 'style', 'line-height:150%');
		workString=insertAttribute(workString, 'align', 'center');
		workString=insertAttribute(workString, 'onMouseOver', 'this.style.color=\'' + redCompany + '\'; this.style.cursor=\'default\'; doTitleBoxAction(this,\'' + typeActuator + '\')');
		workString=insertAttribute(workString, 'onMouseOut', 'this.style.color=\'#000000\'');
		workString=insertString(workString, '>');
		workString=insertString(workString, eval(typeActuator +'ListedByGroups['+i+'][0]'));
		//workString=insertString(workString, S0P1material[i].price + '  ' + S0P1material[i].cellText + '  ' + S0P1material[i].altCellText + '  ' + S0P1material[i].altCellPosition);
		workString=insertString(workString, '</td></tr><tr><td');
		workString=insertAttribute(workString, 'height', titleCellSeparations);
		workString=insertString(workString, '></td></tr>');
	}
	
	workString=insertString(workString, '</table></td><td width="195" valign="top"><table border="0" cellspacing="0" cellpadding="2" height="0"><tr><td id="offsetCell" width="191" height="0"></td></tr>');
	
	for(i=0; i<eval(typeActuator +'ListedByGroups.length'); i++){
		//code initial for your own application workString=insertString(workString, '<tr><td');
		//code initial for your own application workString=insertAttribute(workString, 'id', typeActuator + 'YourOwnValveGroup' + i);
		//code initial for your own application workString=insertAttribute(workString, 'height', 0);
		//code initial for your own application workString=insertAttribute(workString, 'bgcolor', columnBackColor);
		//code initial for your own application workString=insertAttribute(workString, 'class', 'H12VerdanaBold');
		//code initial for your own application workString=insertAttribute(workString, 'width', 0);
		//code initial for your own application workString=insertAttribute(workString, 'align', 'left');
		//code initial for your own application workString=insertAttribute(workString, 'onMouseOver', 'this.style.cursor=\'default\'; doYourOwnValveBoxAction(\'' + typeActuator + 'YourOwnValveGroup' + i + '\'' + ',\'' + typeActuator + '\',mpa02Language)');
		//code initial for your own application workString=insertString(workString, '>');
		//code initial for your own application workString=insertString(workString, 'MPA02-3-Your-Own-Valve');
		//code initial for your own application workString=insertString(workString, '</td></tr>');
		for(j=1; j<eval(typeActuator +'ListedByGroups['+i+'].length'); j++){
			workString=insertString(workString, '<tr><td');
			workString=insertAttribute(workString, 'id', formatName(eval(typeActuator +'ListedByGroups['+i+']['+j+']')));
			workString=insertAttribute(workString, 'height', 0);
			workString=insertAttribute(workString, 'bgcolor', columnBackColor);
			workString=insertAttribute(workString, 'class', 'H12VerdanaBold');
			workString=insertAttribute(workString, 'width', 0);
			workString=insertAttribute(workString, 'align', 'left');
			workString=insertAttribute(workString, 'onMouseOver', 'this.style.cursor=\'default\'; doBoxAction(\'' + formatName(eval(typeActuator +'ListedByGroups['+i+']['+j+']')) + '\'' + ',\'' + typeActuator + '\','+typeActuator+'Language)');
			//workString=insertString(workString, '>&nbsp;');
			workString=insertString(workString, '>');
			workString=insertString(workString, eval(typeActuator +'ListedByGroups['+i+']['+j+']'));
			workString=insertString(workString, '</td></tr>');
		}
	}
	workString=insertString(workString, '</table></td>');
	
	document.write(workString);
	
	for(i=0; i<eval(typeActuator +'ListedByGroups.length'); i++){
		//code initial for your own application document.getElementById( typeActuator + 'YourOwnValveGroup' + i ).style.display = 'none';
		for(j=1; j<eval(typeActuator +'ListedByGroups['+i+'].length'); j++){
			document.getElementById( formatName( eval(typeActuator +'ListedByGroups['+i+']['+j+']') )).style.display = 'none';
		}
	}
}

function buildMaterialAndDataSheetTable(typeActuator){
	var i;
	var workString='';
/*	
<tr id="MPA02MaterialAndDataSheetTable0">
	<td id="MPA02MaterialAndDataSheetTable00" width="327" align="left">MPA02-3-SS-ORS2</td>
	<td id="MPA02MaterialAndDataSheetTable01" width="55" align="center"><a href="index.html"><img src="images/pdfImage_64x64.gif" width="25" height="25" border="0"></a></td>
	<td id="MPA02MaterialAndDataSheetTable02" width="55" align="center"><a href="index.html"><img src="images/pdfImage_64x64.gif" width="25" height="25" border="0"></a></td>
</tr>
<tr id="MPA02MaterialAndDataSheetTable1">
	<td id="MPA02MaterialAndDataSheetTable10" width="327" align="left">MPA02-3-B-ORS2</td>
	<td id="MPA02MaterialAndDataSheetTable11" width="55" align="center"><a id="MPA02MaterialAndDataSheetTable11Link" href="index.html"><img src="images/pdfImage_64x64.gif" width="25" height="25" border="0"></a></td>
	<td id="MPA02MaterialAndDataSheetTable12" width="55" align="center"><a id="MPA02MaterialAndDataSheetTable11Link" href="index.html"><img src="images/pdfImage_64x64.gif" width="25" height="25" border="0"></a></td>
</tr>
*/
	for(i=0; i<eval(typeActuator+'MaxQtyMaterials'); i++){
		workString=insertString(workString, '<tr');
		workString=insertAttribute(workString, 'id', typeActuator + 'MaterialAndDataSheetTable'+i);
		workString=insertAttribute(workString, 'style', 'display:none');
		workString=insertString(workString, '>');
		
		workString=insertString(workString, '<td');
		workString=insertAttribute(workString, 'id', typeActuator + 'MaterialAndDataSheetTable'+i+'0');
		//workString=insertAttribute(workString, 'width', 307);
		workString=insertAttribute(workString, 'width', 437);
		workString=insertAttribute(workString, 'align', 'center');
		workString=insertAttribute(workString, 'onMouseOver', 'doMaterialAndDataSheetTableBoxAction(this, \'on\',\''+typeActuator+'\')');
		workString=insertAttribute(workString, 'onMouseOut', 'doMaterialAndDataSheetTableBoxAction(this, \'off\',\''+typeActuator+'\')');
		workString=insertAttribute(workString, 'onClick', 'openPageDetailsOptions(' + i + ','+typeActuator+'Language)');
		workString=insertAttribute(workString, 'style', 'text-decoration: underline');
		workString=insertString(workString, '></td>');
		
		//when I removed the actuator datasheet link workString=insertString(workString, '<td');
		//when I removed the actuator datasheet link workString=insertAttribute(workString, 'id', typeActuator + 'MaterialAndDataSheetTable'+i+'1');
		//when I removed the actuator datasheet link workString=insertAttribute(workString, 'width', 65);
		//when I removed the actuator datasheet link workString=insertAttribute(workString, 'align', 'center');
		//when I removed the actuator datasheet link workString=insertAttribute(workString, 'onMouseOver', 'doMaterialAndDataSheetTableBoxAction(this, \'on\',\''+typeActuator+'\')');
		//when I removed the actuator datasheet link workString=insertAttribute(workString, 'onMouseOut', 'doMaterialAndDataSheetTableBoxAction(this, \'off\',\''+typeActuator+'\')');
		//when I removed the actuator datasheet link workString=insertString(workString, '><a');
		//when I removed the actuator datasheet link workString=insertAttribute(workString, 'id', typeActuator + 'MaterialAndDataSheetTable' + i + '1' + 'Link');
		//when I removed the actuator datasheet link workString=insertAttribute(workString, 'onClick', 'loadNewWindow(allInformationForMaterialAndDataSheetTable[' + i + '].linkActuator)');
		//when I removed the actuator datasheet link workString=insertString(workString, '><img src="images/pdfImage_64x64.gif"');
		//when I removed the actuator datasheet link workString=insertAttribute(workString, 'width', 25);
		//when I removed the actuator datasheet link workString=insertAttribute(workString, 'height', 25);
		//when I removed the actuator datasheet link workString=insertAttribute(workString, 'border', 0);
		//when I removed the actuator datasheet link workString=insertString(workString, '></a></td>');
		
		//lps
		
		//workString=insertString(workString, '<td');
		//workString=insertAttribute(workString, 'id', typeActuator + 'MaterialAndDataSheetTable'+i+'2');
		//workString=insertAttribute(workString, 'width', 65+65);
		//workString=insertAttribute(workString, 'align', 'center');
		//workString=insertAttribute(workString, 'onMouseOver', 'doMaterialAndDataSheetTableBoxAction(this, \'on\',\''+typeActuator+'\')');
		//workString=insertAttribute(workString, 'onMouseOut', 'doMaterialAndDataSheetTableBoxAction(this, \'off\',\''+typeActuator+'\')');
		//workString=insertString(workString, '><a');
		//workString=insertAttribute(workString, 'id', typeActuator + 'MaterialAndDataSheetTable' + i + '2' + 'Link');
		//workString=insertAttribute(workString, 'onClick', 'loadNewWindow(allInformationForMaterialAndDataSheetTable[' + i + '].linkValve)');
		//workString=insertString(workString, '><img src="images/pdfImage_64x64.gif"');
		//workString=insertAttribute(workString, 'width', 25);
		//workString=insertAttribute(workString, 'height', 25);
		//workString=insertAttribute(workString, 'border', 0);
		//workString=insertString(workString, '></a></td>');
		
		//lps
		
		workString=insertString(workString, '</tr>');
	}
		
	document.write(workString);	
}

function doTitleBoxAction(title, typeActuator){
	var i;
	var a=title.getAttribute("id").split('Supplier')[1];
	var newOffsetCellHeight=0;
	
	if(activeTitleBox != a){
		eval(typeActuator+'PageActiveBox'+'=\'none\'');
		if(activeTitleBox != 'none'){
			//Hide actual menu
			for(i=1; i<eval(typeActuator +'ListedByGroups['+activeTitleBox+'].length'); i++){
				document.getElementById( formatName(eval(typeActuator +'ListedByGroups['+activeTitleBox+']['+i+']')) ).style.display = 'none';
				document.getElementById( formatName(eval(typeActuator +'ListedByGroups['+activeTitleBox+']['+i+']')) ).style.backgroundColor = columnBackColor;
			}
			
			document.getElementById(typeActuator+'Supplier'+activeTitleBox).style.backgroundColor = titleColumnBackColor;
		}

		activeTitleBox = a;
		document.getElementById(typeActuator+'Supplier'+activeTitleBox).style.backgroundColor = columnBackColor;
		
		newOffsetCellHeight=eval(document.getElementById(typeActuator+'Supplier'+activeTitleBox).getAttribute("height"))/4;
	
		for(i=0; i<a; i++){
			newOffsetCellHeight = newOffsetCellHeight + eval(document.getElementById(typeActuator+'Supplier'+i).getAttribute("height")) + titleCellSeparations;
		}
			
		document.getElementById('offsetCell').height = newOffsetCellHeight;
		
//code initial for your own application 		document.getElementById( typeActuator + 'YourOwnValveGroup' + 0 ).style.display = '';
		for(i=1; i<eval(typeActuator +'ListedByGroups['+activeTitleBox+'].length'); i++){
			document.getElementById( formatName( eval(typeActuator +'ListedByGroups['+a+']['+i+']') ) ).style.display = '';
		}
		doBoxAction(formatName( eval(typeActuator +'ListedByGroups['+a+'][1]')),typeActuator,eval(typeActuator+'Language'))
	}
}

function doMaterialAndDataSheetTableBoxAction(title, onOff, typeActuator){
	var activeCell, referenceCell, datasheetActuatorCell, datasheetValveCell;
	var boxId=title.getAttribute("id");
	
	
	activeCell = boxId.charAt(boxId.length-2);
	referenceCell=typeActuator + 'MaterialAndDataSheetTable' + activeCell + '0';
	datasheetActuatorCell=typeActuator + 'MaterialAndDataSheetTable' + activeCell + '1';
	datasheetValveCell=typeActuator + 'MaterialAndDataSheetTable' + activeCell + '2';
	
	if(onOff == 'on'){
		title.style.cursor='pointer';
		title.style.backgroundColor=altTextBoxBackColor;
		document.getElementById(referenceCell).style.backgroundColor=altTextBoxBackColor;
		//when I removed the actuator datasheet link document.getElementById(datasheetActuatorCell).style.backgroundColor=altTextBoxBackColor;
		//lps document.getElementById(datasheetValveCell).style.backgroundColor=altTextBoxBackColor;
		showAltText (title, 'show');
	}else{
		title.style.backgroundColor=generalBackColor;
		document.getElementById(referenceCell).style.backgroundColor=generalBackColor;
		//when I removed the actuator datasheet link document.getElementById(datasheetActuatorCell).style.backgroundColor=generalBackColor;
		//lps document.getElementById(datasheetValveCell).style.backgroundColor=generalBackColor;
		showAltText (title, 'hide');
	     }	
	
}

function doBoxAction(boxId, typeActuator, language){
	var i, j;
	var linkActuatorLocal, linkValveLocal, priceLocal, altBoxTextLocal,priceMountingkit;
	var a=boxId.split('YOUR')[1];
	
	if(typeActuator != 'null'){
		
		if (a == 'VALVE')
		{
			if (language == 'es')
				{
					changeImage('images'+typeActuator, YOURVALVE_ES.src);
					
				}
			else if (language == 'fr')
				{
					changeImage('images'+typeActuator, YOURVALVE_FR.src);
				}
			else
			{
					changeImage('images'+typeActuator, YOURVALVE_EN.src);
			}
				for(j=0; j<eval(typeActuator+'MaxQtyMaterials'); j++){
				document.getElementById(typeActuator+'MaterialAndDataSheetTable'+j).style.display = 'none';
				}
			
		}
		else
		{
		changeImage('images'+typeActuator, eval(boxId+'.src'));
		
		
		if(eval(typeActuator+'PageActiveBox') != boxId){
			if(eval(typeActuator+'PageActiveBox') != 'none'){	//if it's the first time I don't have to desactivate any box
				document.getElementById(eval(typeActuator+'PageActiveBox')).style.backgroundColor=columnBackColor;
			}
		
			eval(typeActuator+'PageActiveBox'+'=boxId');
			document.getElementById(boxId).style.backgroundColor=imagesMPA02BackColor;
		}
		
		//javascript:changeOpac(0, typeActuator+'MaterialAndDataSheetTable');
		
		//Hide all rows for MaterialAndDataSheetTable
		for(j=0; j<eval(typeActuator+'MaxQtyMaterials'); j++){
			document.getElementById(typeActuator+'MaterialAndDataSheetTable'+j).style.display = 'none';
		}
		
		for(j=0; j<eval(boxId+'_MATERIAL.length'); j++){
			document.getElementById(typeActuator+'MaterialAndDataSheetTable'+j+'0').innerHTML = eval( boxId + '_MATERIAL[' + j + '][0]' ); //writes each material
			document.getElementById(typeActuator+'MaterialAndDataSheetTable'+j).style.display = '';	//Shows each row
			
			linkActuatorLocal = 'dataSheets/' + eval(boxId + '_MATERIAL[' + j + '][2]' );
			linkValveLocal = 'dataSheets/' + eval(boxId + '_MATERIAL[' + j + '][3]' );
			priceLocal = document.getElementById( formatName( eval(boxId + '_MATERIAL[' + j + '][0]')+'Price') ).innerHTML;
			priceMountingkit=document.getElementById(eval(boxId + '_MATERIAL[' + j + '][4]' )).innerHTML;
			//priceLocal = 10;
			fillAltTextfields(eval(boxId + '_MATERIAL[' + j + '][1]'), priceLocal);
			//altBoxTextLocal = buildAltBoxText(eval(boxId + '_MATERIAL[' + j + '][1]'), priceLocal, eval( boxId + '_MATERIAL[' + j + '][0]' ), language);
			altBoxTextLocal = buildAltBoxText(language);
			detailsOptionsLinkInformation[j] = buildDetailsOptionsLinkInformation(eval(boxId + '_MATERIAL[' + j + '][1]'), priceLocal, eval( boxId + '_MATERIAL[' + j + '][0]' ),eval( boxId + '_MATERIAL[' + j + '][3]' ),priceMountingkit);
			allInformationForMaterialAndDataSheetTable[j]=new AllInformationForMaterialAndDataSheetTable(linkActuatorLocal, linkValveLocal, priceLocal, altBoxTextLocal);
		}
		
		//lpsdocument.getElementById(typeActuator+'CvCell').innerHTML = 'C<sub>v</sub> =  ' + getCv(eval(boxId + '_MATERIAL[0][1]'));
		
		//javascript:opacity(typeActuator+'MaterialAndDataSheetTable', 0, 100, APPEAR_TIME);
		//document.getElementById(typeActuator+'MaterialAndDataSheetTable').style.display = '';
		
		}//end else of a=='VALVE'
	}
}

function buildDetailsOptionsLinkInformation (string, price, partNumber,valvepdf,priceMountingkit){
	linkInformation = new Object();
	var stringSplited = string.split(' | ');
	
	linkInformation.title = stringSplited[0];
	linkInformation.type = stringSplited[1];
	linkInformation.material = stringSplited[2];
	linkInformation.connected = stringSplited[3];
	linkInformation.cv = stringSplited[4];
	linkInformation.partNumber = partNumber;
	linkInformation.price = price;
	linkInformation.valvepdf = valvepdf;
	linkInformation.mountingkit = priceMountingkit;
	
	return (linkInformation);
}

altTextfields = new Object();

function fillAltTextfields(string, price){
	//string='VALVULA DE CONTROL | Needle valve | Stainless Steel 316 | &frac14;" Compresion | 0.08'
	var stringSplited = string.split(' | ');
	
	altTextfields.title = stringSplited[0];
	altTextfields.type = stringSplited[1];
	altTextfields.material = stringSplited[2];
	altTextfields.connection = stringSplited[3];
	altTextfields.cv = stringSplited[4];
	altTextfields.price = price;
}

function buildAltBoxText (language){
	allAltTexts= new Array();
	var i;
	var finalStringPartNumber, finalStringActuator, finalStringValve;
	
	finalStringPartNumber = altTextfields.title + '|';
	finalStringPartNumber += altTextfields.type + '|';
	finalStringPartNumber += altTextfields.material + '|';
	finalStringPartNumber += altTextfields.connection + '|';
	finalStringPartNumber += altTextfields.cv + '|';
	
	if(language == 'es'){
		finalStringActuator = finalStringPartNumber + 'CLICK PARA VER EL MANUAL DEL ACTUADOR';
		finalStringValve = finalStringPartNumber + 'CLICK PARA VER EL MANUAL DE LA VALVULA';
		finalStringPartNumber += 'Click para detalles, opciones y precios';
	}else if(language == 'fr'){
		finalStringActuator = finalStringPartNumber + 'CLIQUEZ POUR VOIR LE BROCHURE DE L\'ACTUATEUR';
		finalStringValve = finalStringPartNumber + 'CLIQUEZ POUR VOIR LE BROCHURE DE LA VALVE';
		finalStringPartNumber += 'Cliquez pour détails, options et prix';
	}else{
		finalStringActuator = finalStringPartNumber + 'CLICK FOR ACTUATOR USER MANUAL';
		finalStringValve = finalStringPartNumber + 'CLICK FOR VALVE DATASHEET';
		finalStringPartNumber += 'Click for details, options and pricing';
	}
	
	allAltTexts[0]=finalStringPartNumber;
	allAltTexts[1]=finalStringActuator;
	allAltTexts[2]=finalStringValve;
	
	return (allAltTexts);	
}

function getCv (where){
	//where='VALVULA DE CONTROL | Needle valve | Stainless Steel 316 | &frac14;" Compresion | 0.08'
	var i;
	var stringSplited = where.split(' | ');
	
	return (stringSplited[4]);	
}

function changeBoxBackgroundColor(mainBox, color){
	var title, additional;
	
	//document.getElementById("debug").innerHTML = 'activeMainBox = ' +  activeMainBox + '  mainBox = ' +  mainBox;
	
	if(activeMainBox != mainBox){
		if(activeMainBox != 'none'){	//if it's the first time I don't have to desactivate any box
			title = activeMainBox + 'Title';
			additional = activeMainBox + 'Additional';
			document.getElementById(title).style.backgroundColor=columnBackColor;
			document.getElementById(additional).style.backgroundColor=generalBackColor;
		}
	
		activeMainBox=mainBox;
		
		cont++;
		//document.getElementById("debug").innerHTML = mainBox + ' ' + cont;
		
		title = mainBox + 'Title';
		additional = mainBox + 'Additional';
		
		changeBackgroundColor(title, color);
		changeBackgroundColor(additional, color);
	}
}

function changeBackgroundColor(where, color){
	document.getElementById(where).style.backgroundColor=color;
}

function changeBgImage (image, id) {
	var element = document.getElementById(id);
	element.style.backgroundImage = "url('images/flag_es.jpg')";
	//si.style.backgroundImage = "url('images/flag_es.jpg')";	
}

/////////////////////////////////////////////////////////////////////////
var TimeToFade = 1000.0;

function animateFade(lastTick, eid)
{  
  var curTick = new Date().getTime();
  var elapsedTicks = curTick - lastTick;
  
  var element = document.getElementById(eid);
 
  if(element.FadeTimeLeft <= elapsedTicks)
  {
    element.style.opacity = element.FadeState == 1 ? '1' : '0';
    element.style.filter = 'alpha(opacity = ' 
        + (element.FadeState == 1 ? '100' : '0') + ')';
    element.FadeState = element.FadeState == 1 ? 2 : -2;
    return;
  }
 
  element.FadeTimeLeft -= elapsedTicks;
  var newOpVal = element.FadeTimeLeft/TimeToFade;
  if(element.FadeState == 1)
    newOpVal = 1 - newOpVal;

  element.style.opacity = newOpVal;
  element.style.filter = 
      'alpha(opacity = ' + (newOpVal*100) + ')';
  
  setTimeout("animateFade(" + curTick 
      + ",'" + eid + "')", 33);
}
//////////////////////////////////////////////////////////////////////////		
		
function opacity(id, opacStart, opacEnd, millisec) { 
	//speed for each frame 
	var speed = Math.round(millisec / 100); 
	var timer = 0; 

	//determine the direction for the blending, if start and end are the same nothing happens 
	if(opacStart > opacEnd) { 
		for(i = opacStart; i >= opacEnd; i--) { 
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
			timer++; 
		} 
	} else if(opacStart < opacEnd) { 
		for(i = opacStart; i <= opacEnd; i++) { 
			setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed)); 
			timer++; 
		} 
	} 
} 

//change the opacity for different browsers 
function changeOpac(opacity, id) { 
	var object = document.getElementById(id).style; 
	object.opacity = (opacity / 100); 
	object.MozOpacity = (opacity / 100); 
	object.KhtmlOpacity = (opacity / 100); 
	object.filter = "alpha(opacity=" + opacity + ")"; 
}
		
function PictureClick(now) { 
	
	if (now == 'none')
	{
	}
	else
	{
	javascript:loadPageInSameWindow(now, moduleId)
	
	}
}		
		
		

// - End of JavaScript - -->