/**
 * version 2: 2010-10-26
 * Technal International
 * copyright Copyright (C) 2010 Blograft. All rights reserved.
 */

// Redirection page accueil
if (top.location.href == "http://www.technal-int.com/default.aspx?epslanguage=EN"){
	top.location.href = "http://www.technal-int.com/en/Aluminium-Systems/";
}
// Redirection page accueil
if (top.location.href == "http://www.technal-int.com/default.aspx?epslanguage=ES"){
	top.location.href = "http://www.technal-int.com/es/Sistema-de-aluminio/";
}
// Redirection page accueil
if (top.location.href == "http://www.technal-int.com/default.aspx?epslanguage=FR"){
	top.location.href = "http://www.technal-int.com/fr/mensuiseries-aluminium/";
}
     
// Fonction de recherche par Class	 
function getElementsByClassName(_className, _startElem, _filterTag)
{
   if (typeof _className === 'string')
      { _className = new RegExp('(^| )' + _className + '( |$)'); }

   // default to the document element if no _startElem is specified
   _startElem = _startElem || document;

   // default to all elements if no _filterTag is specified
   _filterTag = _filterTag || '*';

   var arr = [];    // the array of matched elements that will be returned
   var tags;        // array of all tags to check for class name matches

   /* If the browser supports [DOMElement].all, we'll use that.  Otherwise
       we'll use .getElementsByTagName(..), which is really the preferred method. */
   if (typeof _startElem.all != 'undefined' && _filterTag == '*')
   {
      tags = _startElem.all;
   }
   else
   {
      // the W3C way (but won't work for IE less than 6)
      tags = _startElem.getElementsByTagName(_filterTag);
   }

   // loop through the tags array checking for .className matches
   var i, len = tags.length;
   for (i = 0; i < len; i++)
   {
      var elem = tags[i];
      if (_className.test(elem.className))
         { arr.push(elem); }
   }

   return arr;
}


   
// Fonction de changement de texte	 
function change_text(){
	var url_site = top.location.href;
	var test_en = "www.technal-int.com/en/";
	var test_es = "www.technal-int.com/es/";
	var test_fr = "www.technal-int.com/fr/";
	var test_en2 = "epslanguage=EN";
	var test_es2 = "epslanguage=ES";
	var test_fr2 = "epslanguage=FR";
	
	
	
		   if(document.getElementById('ctl00_MainArea_ctl00_breadCrumbTrail')){
				var tab = document.getElementById('ctl00_MainArea_ctl00_breadCrumbTrail').getElementsByTagName('a');
				
			  	if (url_site.match(test_en) || url_site.match(test_en2)){
					tab[0].innerHTML='Technal products and services';
			   }
			  	if (url_site.match(test_es) || url_site.match(test_es2)){
					tab[0].innerHTML='Los productos y servicios Technal';
			   }
			  	if (url_site.match(test_fr) || url_site.match(test_fr2)){
					tab[0].innerHTML='Les produits et services Technal';
			   }
			   
			}
			
	  		if(document.getElementById('ctl00_MainArea_ContentArea_PageLoginPrompt_loginContainer')){
				
				
				var tab1 = document.getElementById('ctl00_MainArea_ContentArea_PageLoginPrompt_loginContainer').getElementsByTagName('H2');
				
			  	if (url_site.match(test_en) || url_site.match(test_en2)){
					tab1[0].innerHTML='<img src="/images/h2-square-blue.gif">&nbsp;This content is dedicated to registered users.';
			   }
			  	if (url_site.match(test_es) || url_site.match(test_es2)){
					tab1[0].innerHTML='<img src="/images/h2-square-blue.gif">&nbsp;Este contenido est&#225; dedicado a los usuarios registrados';
					tab1[1].innerHTML='<img src="/images/h2-square-blue.gif">&nbsp;SUSCRIPCION';
			   }
			   
			   
				var tab11 = document.getElementById('ctl00_MainArea_ContentArea_PageLoginPrompt_loginContainer').getElementsByTagName('p');
			  	if (url_site.match(test_en) || url_site.match(test_en2)){
					tab11[0].innerHTML='The content you are trying to view is protected. In order to view or download it, please enter your access codes in fields below.';
					tab11[3].innerHTML='You are not registered? To benefit from Technal services, please subscribe';
			   }
			  	if (url_site.match(test_es) || url_site.match(test_es2)){
					tab11[0].innerHTML='El contenido est&#225; protegido. Para descargar la documentaci&#243;n, por favor, introduzca sus claves de acceso en los campos de abajo.';
					tab11[3].innerHTML='No est&#225; registrado? Para obtener los beneficios Technal, click aqu&#237; para suscribir al site.';
			   }
			   
			   
				var tab111 = document.getElementById('ctl00_MainArea_ContentArea_PageLoginPrompt_loginContainer').getElementsByTagName('label');
			  	if (url_site.match(test_es) || url_site.match(test_es2)){
					tab111[0].innerHTML='Usuario';
			   }
				var tab1111 = document.getElementById('ctl00_MainArea_ContentArea_PageLoginPrompt_loginContainer').getElementsByTagName('span');
			  	if (url_site.match(test_es) || url_site.match(test_es2)){
					tab1111[1].innerHTML='SUSCRIBASE';
			   }
			   
			}
	
				
		   if(document.getElementById('ctl00_MainArea_ContentArea_ctl00_updatePanel')){
				var tab4 = document.getElementById('ctl00_MainArea_ContentArea_ctl00_updatePanel').getElementsByTagName('div');
				var tab41 = tab4[0].getElementsByTagName('p');
				
			  	if (url_site.match(test_en) || url_site.match(test_en2)){
					var textt = 'According to the Computer and Freedom law dating of January 6th, 1978, you have the right to access, modify, rectify or delete any personal data by simply contacting the Website’s publisher to following address: contact@technal-international.com or Hydro Building Systems International 270 rue Léon Joulin - B.P.63709 - 31037 Toulouse cedex 1.';
					tab41[2].innerHTML= textt;
			   }
			  	if (url_site.match(test_es) || url_site.match(test_es2)){
					var textt = 'De acuerdo con la ley Inform&#225;tica y Libertad que data del 6 de enero de 1978, tiene el derecho a acceder, modificar, rectificar o borrar cualquier dato personal, simplemente ponerse en contacto con el editor del sitio Web a la siguiente direcci&#243;n: contact@technal-international.com o Hydro Building Systems Internacional 270 rue L&#233;on Joulin - BP63709 - 31037 Toulouse cedex 1.';
					tab41[2].innerHTML= textt;
			   }
			  	if (url_site.match(test_fr) || url_site.match(test_fr2)){
					var textt = 'Conform&#233;ment &#224; la loi Informatique et Libert&#233;s du 6 Janvier 1978 modifi&#233;e, vous disposez du droit d\'acc&#232;s, de modification, de rectification et de suppression des donn&#233;es vous concernant aupr&#232;s de l\'&#233;diteur du Site. Si vous souhaitez exercer ce droit et obtenir communication des informations vous concernant, veuillez vous adresser &#224;: contact@technal-international.com ou par courrier &#224;: Hydro Building Systems International, 270 rue L&#233;on Joulin - BP 63709 - 31037 Toulouse cedex 1.';
					tab41[2].innerHTML= textt;
			   }
			}	
			if (url_site.match(test_es) || url_site.match(test_es2)){
				var doc = getElementsByClassName('SearchBoxLink',null,'a');
				doc[0].innerHTML="Mi selecci&#243;n";
			}
			
		   if(document.getElementById('ctl00_MainArea_addToMySelection_panel')){
			   
			   
			  	if (url_site.match(test_es) || url_site.match(test_es2)){
					
					var text_case = getElementsByClassName('LeftColumn',null,'div');
					var img_case = getElementsByClassName('RightColumn',null,'div');
				
					var tab22 = document.getElementById('ctl00_MainArea_addToMySelection_panel').getElementsByTagName('a');
					tab22[0].innerHTML='<span>A&#241;adir a mi selecci&#243;n</span>';
					tab22[0].href="javascript:__doPostBack('ctl00$MainArea$addToMySelection$AddToMyselection','');time_change()";
					tab22[1].innerHTML='<span>Ir a Mi selecci&#243;n</span>';
					
					var tab222 = document.getElementById('MySelectionPopupWinodw').getElementsByTagName('p');
					tab222[0].innerHTML='Descripci&#243;n de mi selecci&#243;n';
					
					//var tab2222 = text_case.getElementsByTagName('p');
					//tab2222[1].innerHTML='Descripci&#243;n de mi selecci&#243;n';
					
			   }
			   
			}	
}
		function time_change(){
			var t=setTimeout("change_text()",300)
			}
window.onload = change_text;
