// JavaScript Document
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function YY_checkform() { //v4.71
//copyright (c)1998,2002 Yaromat.com
  var a=YY_checkform.arguments,oo=true,v='',s='',err=false,r,o,at,o1,t,i,j,ma,rx,cd,cm,cy,dte,at;
  for (i=1; i<a.length;i=i+4){
    if (a[i+1].charAt(0)=='#'){r=true; a[i+1]=a[i+1].substring(1);}else{r=false}
    o=MM_findObj(a[i].replace(/\[\d+\]/ig,""));
    o1=MM_findObj(a[i+1].replace(/\[\d+\]/ig,""));
    v=o.value;t=a[i+2];
    if (o.type=='text'||o.type=='password'||o.type=='hidden'){
      if (r&&v.length==0){err=true}
      if (v.length>0)
      if (t==1){ //fromto
        ma=a[i+1].split('_');if(isNaN(v)||v<ma[0]/1||v > ma[1]/1){err=true}
      } else if (t==2){
        rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-zA-Z]{2,4}$");if(!rx.test(v))err=true;
      } else if (t==3){ // date
        ma=a[i+1].split("#");at=v.match(ma[0]);
        if(at){
          cd=(at[ma[1]])?at[ma[1]]:1;cm=at[ma[2]]-1;cy=at[ma[3]];
          dte=new Date(cy,cm,cd);
          if(dte.getFullYear()!=cy||dte.getDate()!=cd||dte.getMonth()!=cm){err=true};
        }else{err=true}
      } else if (t==4){ // time
        ma=a[i+1].split("#");at=v.match(ma[0]);if(!at){err=true}
      } else if (t==5){ // check this 2
            if(o1.length)o1=o1[a[i+1].replace(/(.*\[)|(\].*)/ig,"")];
            if(!o1.checked){err=true}
      } else if (t==6){ // the same
            if(v!=MM_findObj(a[i+1]).value){err=true}
      }
    } else
    if (!o.type&&o.length>0&&o[0].type=='radio'){
          at = a[i].match(/(.*)\[(\d+)\].*/i);
          o2=(o.length>1)?o[at[2]]:o;
      if (t==1&&o2&&o2.checked&&o1&&o1.value.length/1==0){err=true}
      if (t==2){
        oo=false;
        for(j=0;j<o.length;j++){oo=oo||o[j].checked}
        if(!oo){s+='* '+a[i+3]+'\n'}
      }
    } else if (o.type=='checkbox'){
      if((t==1&&o.checked==false)||(t==2&&o.checked&&o1&&o1.value.length/1==0)){err=true}
    } else if (o.type=='select-one'||o.type=='select-multiple'){
      if(t==1&&o.selectedIndex/1==0){err=true}
    }else if (o.type=='textarea'){
      if(v.length<a[i+1]){err=true}
    }
    if (err){s+='* '+a[i+3]+'\n'; err=false}
  }
  if (s!=''){alert('The required information is incomplete or contains errors:\t\t\t\t\t\n\n'+s)}
  document.MM_returnValue = (s=='');
}


/*

jQuery functions ----------------------------------------

*/
jQuery.fn.newsTicker = jQuery.fn.newsticker = function(delay)
{
	return this.each(
		function()
		{
			if(this.nodeName.toLowerCase()!= "ul") return;
			delay = delay || 4000;
			var self = this;
			self.items = jQuery("li", self);
			// hide all items (except first one)
			self.items.not(":eq(0)").hide().end();
			// current item
			self.currentitem = 0;
			var doTick = function()
			{
				jQuery.newsticker(self);
			}
			setInterval(doTick,delay);
		}
	)
	.addClass("newsticker")
	.hover(
		function()
		{
			// pause if hovered over
			this.pause = true;
		},
		function()
		{
			// unpause when not hovered over
			this.pause = false;
		}
	);
}
jQuery.newsticker = function(el)
{
	// return if hovered over
	if(el.pause) return;
	// hide current item
	jQuery(el.items[el.currentitem]).fadeOut("slow",
		function()
		{
			jQuery(this).hide();
			// move to next item and show
			el.currentitem = ++el.currentitem % (el.items.size());
			jQuery(el.items[el.currentitem]).fadeIn("slow");
		}
	);
}

function CacheLeMenu() {
	setTimeout("$('#nav ul li ul').fadeOut('fast');",2000);
}


	var obj = null;

function checkHover() {
	if (obj) {
		obj.find('ul').fadeOut('fast');
	}
}


$(document).ready(function(){

/*
	$("#nav ul li").each(function(){
		$(this).mouseover(function(){
			$(this).children("ul").slideDown("fast");
			$(this).prev().children("ul").fadeOut("fast");
			$(this).siblings().children("ul").fadeOut("fast");
		});
	});
	*/
	/*
	$("body").click(function(){
		$("#nav ul li ul").fadeOut("fast");
	});
*/
	
	

/*
	$('#nav ul li').hover(function() {
		if (obj) {
		
			obj.find('ul').fadeOut('fast');
			obj = null;
		}
		
	
		$(this).children("ul").slideDown("fast");
		$(this).prev().children("ul").fadeOut("fast");
		$(this).siblings().children("ul").fadeOut("fast");
		
	}, function() {
		obj = $(this);
		setTimeout(
			"checkHover()",
			5000);
	});
*/


jQuery("#dropdown ul").css({display: "none"}); // Opera Fix 
	jQuery("#dropdown li").hover(function(){ 
	        jQuery(this).find('ul:first').css({visibility: "visible",display: "none"}).show(268); 
	        },function(){ 
	        jQuery(this).find('ul:first').css({visibility: "hidden"}); 
	        }); 


	
//var newnews = $("<ul>").attr("id", "bande-logos");
var newnews = $("<ul>").attr("id", "bande-logos");


monArray = new Array("<li><a title=\"Aceralia / Arcelor Mittal\" href=\"http://www.arcelormittal.com/\" target=\"_blank\"><img src=\"IMAGES/logos/1.png\" alt=\"\" /></a><a title=\"Alcan Extruded Products\" href=\"http://www.alcan.com/\" target=\"_blank\"><img src=\"IMAGES/logos/2.png\" alt=\"\" /></a><a title=\"Alstom Transport\" href=\"http://www.transport.alstom.com/home\"><img src=\"IMAGES/logos/3.png\" alt=\"\" /></a><a title=\"Altpro\" href=\"http://www.altpro.biz/en/index.htm\"><img src=\"IMAGES/logos/4.png\" alt=\"\" /></a><a title=\"Amurrio Ferrocarril y Equipos\" href=\"http://www.amufer.es/\" target=\"_blank\"><img src=\"IMAGES/logos/5.png\" alt=\"\" /></a><a title=\"AnsaldoBreda\" href=\"http://www.ansaldobreda.it/\" target=\"_blank\"><img src=\"IMAGES/logos/6.png\" alt=\"\" /></a><a title=\"Ansaldo STS \" href=\"http://www.ansaldo-sts.com/\" target=\"_blank\"><img src=\"IMAGES/logos/7.png\" alt=\"\" /></a></li>","<li><a title=\"Astra\" href=\"#\"><img src=\"IMAGES/logos/8.png\" alt=\"\" /></a><a title=\"AZD Praha\" href=\"http://www.azd.cz/\" target=\"_blank\"><img src=\"IMAGES/logos/9.png\" alt=\"\" /></a><a title=\"Balfour Beatty Rail\" href=\"http://www.bbrail.com/Home\"><img src=\"IMAGES/logos/10.png\" alt=\"\" /></a><a title=\"Bochumer Verein Verkehrstechnik\" href=\"http://www.bochumer-verein.de\"><img src=\"IMAGES/logos/11.png\" alt=\"\" /></a><a title=\"Bombardier\" href=\"http://www.transport.bombardier.com\"><img src=\"IMAGES/logos/12.png\" alt=\"\" /></a><a title=\"Bonatrans Group\" href=\"http://www.bonatrans.cz\"><img src=\"IMAGES/logos/13.png\" alt=\"\" /></a><a title=\"CAF\" href=\"http://www.caf.net/ingles/home/index.php\"><img src=\"IMAGES/logos/14.png\" alt=\"\" /></a></li>","<li><a title=\"Colas Rail\" href=\"http://www.colasrail.com/\" target=\"_blank\"><img src=\"IMAGES/logos/15.png\" alt=\"\" /></a><a title=\"Corus Rail Products\" href=\"http://www.corusrail.com\" target=\"_blank\"><img src=\"IMAGES/logos/16.png\" alt=\"\" /></a><a title=\"Deuta Werke\" href=\"http://www.deuta.com/index_en.htm\"><img src=\"IMAGES/logos/17.png\" alt=\"\" /></a><a title=\"DuPont Safety Resources\" href=\"http://www2.dupont.com/Consulting_Services/en_US/\" target=\"_blank\"><img src=\"IMAGES/logos/18.png\" alt=\"\" /></a><a title=\"EKE-Electronics\" href=\"http://www.eke.com\" target=\"_blank\"><img src=\"IMAGES/logos/19.png\" alt=\"\" /></a><a title=\"Electro-Motive Diesels\" href=\"http://www.emdiesels.com/lms/emdweb/emd_index.jsp\"><img src=\"IMAGES/logos/20.png\" alt=\"\" /></a><a title=\"Eliop\" href=\"http://www.eliop.es/\" target=\"_blank\"><img src=\"IMAGES/logos/21.png\" alt=\"\" /></a><a title=\"ELTA\" href=\"http://www.elta.fr\" target=\"_blank\"><img src=\"IMAGES/logos/22.png\" alt=\"\" /></a></li>","<li><a title=\"Faiveley Transport\" href=\"http://www.faiveley.com/fr/home.php\"><img src=\"IMAGES/logos/23.png\" alt=\"\" /></a><a title=\"FAR Systems\" href=\"http://www.farsystems.it/\" target=\"_blank\"><img src=\"IMAGES/logos/24.png\" alt=\"\" /></a><a title=\"Firema Transporti\" href=\"http://www.firema.it/\" target=\"_blank\"><img src=\"IMAGES/logos/25.png\" alt=\"\" /></a><a title=\"Frenoplast\" href=\"http://www.frenoplast.com/\" target=\"_blank\"><img src=\"IMAGES/logos/26.png\" alt=\"\" /></a><a title=\"Funkwerk Information Technologies\" href=\"http://www.funkwerk-it.com\"><img src=\"IMAGES/logos/27.png\" alt=\"\" /></a><a title=\"GE Inspection Technologies\" href=\"http://www.geinspectiontechnologies.com/\" target=\"_blank\"><img src=\"IMAGES/logos/28.png\" alt=\"\" /></a><a title=\"GE Transportation Systems\" href=\"http://www.getransportation.com/\" target=\"_blank\"><img src=\"IMAGES/logos/29.png\" alt=\"\" /></a></li>","<li><a title=\"Greenbrier Europe\" href=\"http://www.gbrx.com/page.php?view=GREENBRIER_EUROPE/\" target=\"_blank\"><img src=\"IMAGES/logos/30.png\" alt=\"\" /></a><a title=\"Gutehoffnungsh&uuml;tte Radsatz\" href=\"http://www.ghh-radsatz.com/\" target=\"_blank\"><img src=\"IMAGES/logos/31.png\" alt=\"\" /></a><a title=\"Harting\" href=\"http://www.harting.de/\" target=\"_blank\"><img src=\"IMAGES/logos/32.png\" alt=\"\" /></a><a title=\"Hasler Rail\" href=\"http://www.haslerrail.com/\" target=\"_blank\"><img src=\"IMAGES/logos/33.png\" alt=\"\" /></a><a title=\"Invensys Rail Group\" href=\"http://www.invensysrail.com/\" target=\"_blank\"><img src=\"IMAGES/logos/34.png\" alt=\"\" /></a><a title=\"Knorr-Bremse\" href=\"http://www.knorr-bremse.com/html/com/index_com_en.php\"><img src=\"IMAGES/logos/35.png\" alt=\"\" /></a></li>","<li><a title=\"Kontron\" href=\"http://www.kontron.com/\" target=\"_blank\"><img src=\"IMAGES/logos/36.png\" alt=\"\" /></a><a title=\"Lucchini\" href=\"http://www.lucchini.it/\" target=\"_blank\"><img src=\"IMAGES/logos/37.png\" alt=\"\" /></a><a title=\"Magliola Antonio & Figli\" href=\"http://www.magliola.it/index.html\"><img src=\"IMAGES/logos/38.png\" alt=\"\" /></a><a title=\"Matisa\" href=\"http://www.matisa.ch/\" target=\"_blank\"><img src=\"IMAGES/logos/39.png\" alt=\"\" /></a><a title=\"Mer Mec\" href=\"http://www.mermec.it/\" target=\"_blank\"><img src=\"IMAGES/logos/40.png\" alt=\"\" /></a><a title=\"Moravia Steels\" href=\"http://www.moravia-steel.cz/\" target=\"_blank\"><img src=\"IMAGES/logos/41.png\" alt=\"\" /></a><a title=\"Radsatzfabrik\" href=\"http://www.rafil-gmbh.de\"><img src=\"IMAGES/logos/42.png\" alt=\"\" /></a></li>","<li><a title=\"Rail.One\" href=\"http://www.railone.com/\" target=\"_blank\"><img src=\"IMAGES/logos/43.png\" alt=\"\" /></a><a title=\"Saft\" href=\"http://www.saft.fr/\" target=\"_blank\"><img src=\"IMAGES/logos/44.png\" alt=\"\" /></a><a title=\"Schaltbau\" href=\"http://www.schaltbau-gmbh.com/\" target=\"_blank\"><img src=\"IMAGES/logos/45.png\" alt=\"\" /></a><a title=\"Scheidt & Bachmann\" href=\"http://www.scheidt-bachmann.de/\" target=\"_blank\"><img src=\"IMAGES/logos/46.png\" alt=\"\" /></a><a title=\"S&eacute;cheron\" href=\"http://www.secheron.com/\" target=\"_blank\"><img src=\"IMAGES/logos/47.png\" alt=\"\" /></a><a title=\"Selectron\" href=\"http://www.selectron.ch/wDeutsch/index.php\"><img src=\"IMAGES/logos/48.png\" alt=\"\" /></a></li>","<li><a title=\"Siemens Mobility\" href=\"http://www.mobility.siemens.com/mobility/de/pub/home.htm\"><img src=\"IMAGES/logos/49.png\" alt=\"\" /></a><a title=\"Sigma Coachair\" href=\"http://www.sigmacoachair.com/\" target=\"_blank\"><img src=\"IMAGES/logos/50.png\" alt=\"\" /></a><a title=\"SKF\" href=\"http://www.skf.com/\" target=\"_blank\"><img src=\"IMAGES/logos/51.png\" alt=\"\" /></a><a title=\"Skoda Transportation\" href=\"http://www.skoda.cz/skoda-transportation/\" target=\"_blank\"><img src=\"IMAGES/logos/52.png\" alt=\"\" /></a><a title=\"SouthCo\" href=\"http://www.southco.com/\" target=\"_blank\"><img src=\"IMAGES/logos/53.png\" alt=\"\" /></a><a title=\"Stadler-Fahrzeuge\" href=\"http://www.stadlerrail.com/\" target=\"_blank\"><img src=\"IMAGES/logos/54.png\" alt=\"\" /></a><a title=\"Patentes Talgo\" href=\"http://www.talgo.com/\" target=\"_blank\"><img src=\"IMAGES/logos/55.png\" alt=\"\" /></a></li>","<li><a title=\"Thales Rail Signaling Solutions\" href=\"http://www.thalesonline.com/markets/Activities/Ground-Transportation.html\"><img src=\"IMAGES/logos/56.png\" alt=\"\" /></a><a title=\"Unicontrols\" href=\"http://www.unicontrols.cz/\" target=\"_blank\"><img src=\"IMAGES/logos/57.png\" alt=\"\" /></a><a title=\"Verint\" href=\"http://verint.com/corporate/index.cfm\"><img src=\"IMAGES/logos/58.png\" alt=\"\" /></a><a title=\"Voestalpine\" href=\"http://www.voestalpine.com/ag/en.html\"><img src=\"IMAGES/logos/59.png\" alt=\"\" /></a><a title=\"Voith Turbo\" href=\"http://www.voithturbo.com/index_e.php\"><img src=\"IMAGES/logos/60.png\" alt=\"\" /></a><a title=\"Vossloh\" href=\"http://www.vossloh.com/cms/de/home/home.jsp\"><img src=\"IMAGES/logos/61.png\" alt=\"\" /></a><a title=\"VUKV\" href=\"http://www.vukv.cz/\" target=\"_blank\"><img src=\"IMAGES/logos/62.png\" alt=\"\" /></a></li>","<li><a title=\"ACRI, Czech Republic\" href=\"http://www.acri.cz/cz/index.php\"><img src=\"IMAGES/logos/63.png\" alt=\"\" /></a><a title=\"AGORIA, Belgium\" href=\"http://www.agoria.be/\" target=\"_blank\"><img src=\"IMAGES/logos/64.png\" alt=\"\" /></a><a title=\"AIF, Romania\" href=\"http://www.club-feroviar.ro/\" target=\"_blank\"><img src=\"IMAGES/logos/65.png\" alt=\"\" /></a><a title=\"ANIE/ASSIFER, Italy\" href=\"http://www.anie.it/browse.asp?goto=217&livello=2\" target=\"_blank\"><img src=\"IMAGES/logos/66.png\" alt=\"\" /></a><a title=\"Austrian Association of the Railway Industry\" href=\"http://www.bahnindustrie.at/start.php\"><img src=\"IMAGES/logos/67.png\" alt=\"\" /></a><a title=\"Freight Cars Producers Union, Community of Independent States\" href=\"http://www.vkmvagon.ru/\" target=\"_blank\"><img src=\"IMAGES/logos/68.png\" alt=\"\" /></a><a title=\"CEMAFE, Spain\" href=\"http://www.cemafe.com/\" target=\"_blank\"><img src=\"IMAGES/logos/69.png\" alt=\"\" /></a><a title=\"Danish Railway Group, Denmark\" href=\"http://www.dega.dk/home-15\" target=\"_blank\"><img src=\"IMAGES/logos/70.png\" alt=\"\" /></a></li>","<li><a title=\"EFRTC (European Federation of Railways Trackworks Contractors)\" href=\"http://www.efrtc.org/\" target=\"_blank\"><img src=\"IMAGES/logos/71.png\" alt=\"\" /></a><a title=\"FIF, France\" href=\"http://www.fif.asso.fr/_fif_/sommaire.php?lang=fr\"><img src=\"IMAGES/logos/72.png\" alt=\"\" /></a><a title=\"Holland Rail Industry, the Netherlands\" href=\"http://www.hollandrailindustry.nl/\" target=\"_blank\"><img src=\"IMAGES/logos/73.png\" alt=\"\" /></a><a title=\"Mafex, Spain\" href=\"http://www.mafex.es/\" target=\"_blank\"><img src=\"IMAGES/logos/74.png\" alt=\"\" /></a><a title=\"RIA, United Kingdom\" href=\"http://www.riagb.org.uk/\" target=\"_blank\"><img src=\"IMAGES/logos/75.png\" alt=\"\" /></a><a title=\"SIRTS, Poland\" href=\"http://www.sirts.pl/\"><img src=\"IMAGES/logos/76.png\" alt=\"\" /></a><a title=\"Swedtrain\" href=\"http://www.swedtrain.org\"><img src=\"IMAGES/logos/77.png\" alt=\"\" /></a></li>","<li><a title=\"Swissrail Industry Association, Switzerland\" href=\"http://www.swissrail.com/en/index.php\"><img src=\"IMAGES/logos/78.png\" alt=\"\" /></a><a title=\"UCRIFER, Italy\" href=\"http://www.ucrifer.it/\"><img src=\"IMAGES/logos/79.png\" alt=\"\" /></a><a title=\"VDB, Germany\" href=\"http://www.bahnindustrie.info/\" target=\"_blank\"><img src=\"IMAGES/logos/80.png\" alt=\"\" /></a><a title=\"ZVEI, Germany\" href=\"http://www.zvei.org/\" target=\"_blank\"><img src=\"IMAGES/logos/81.png\" alt=\"\" /></a></li>");
	
	var numberrr = Math.floor(Math.random() * 11);

	for (i = numberrr; i<=numberrr+11; i++) {
		if (i>11) {	
			newnews.append(monArray[i-12]);	
		}else{
			newnews.append(monArray[i]);
		}
	}

newnews.appendTo("#logoband").newsTicker();

	
	
	
	$('#bande-logos a').tooltip({ 
		track: true, 
		delay: 0, 
		showURL: false, 
		//showBody: " - ", 
		opacity: 0.85 
	});
});