function openFmsGlobal()
{
    var w, h, posx, posy;

    if( screen.width <= 800 )
    {
        w = screen.width;
        h = screen.height;
        posx = 0;
        posy = 0;
    }
    else if( screen.width <= 1024 )
    {
        w = 800;
        h = 600;
        posx = 50;
        posy = 50;
    }
    else
    {
        w = 800;
        h = 600;
        posx = 100;
        posy = 100;
    }
    window.open
    	( "about:blank", "fmswindow", "toolbar=no, location=no, directories=no, status=yes, menubar=no," +
        "resizable=yes, scrollbars=yes, copyhistory=no, top=0, left=0, width=" +
        ( screen.width - 10 ) + ", height=" + ( screen.height - 50 ) );
}

function openAuftragsboerse()
{
	win = window.open( "firmenkunden/auftragsboerse.html", "newWin",
    	"toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no," +
    	"width=580, height=430, top=50, left=50" );
}

function MM_reloadPage( init )	//reloads the window if Nav4 resized
{
  	if( init == true ) with ( navigator )
  	{
    	if( ( appName == "Netscape" ) && ( parseInt( appVersion ) == 4 ) )
    	{
      		document.MM_pgW = innerWidth;
      		document.MM_pgH = innerHeight;
      		onresize = MM_reloadPage;
    	}
  	}
  	else if( innerWidth != document.MM_pgW || innerHeight != document.MM_pgH )
  	{
    	location.reload();
  	}
}
MM_reloadPage( true );

function rechtsklick()
{
  	if( event.button == 2 )
  	{
    	alert( 'GeT Gesellschaft für europaweite Transferfahrten mbH' );
  	}
}
document.onmousedown=rechtsklick

function MM_openBrWindow( theURL, winName, features )	//v2.0
{
  	window.open( theURL, winName, features );
}

function is_msie()
{
  	return( navigator.appName == "Microsoft Internet Explorer" );
}

function Framing( path, language )
{
    var framing = false;

    //if( this.document == top.document || top.location.host != this.location.host )
    if( this.document == top.document )
    {
    	var doctitle = document.title;

    	document.clear();
    	document.open( "text/html" );
    	document.writeln( '<html>\n<head><title>' + doctitle + '</title></head>' );

        document.writeln(
        	'<frameset rows="60,*,55" frameborder="no" border="0" framespacing="0">' +
	  		'<frame name="topFrame" scrolling="no" src="' + path + 'topFrame.html" frameborder="no" marginwidth="0" marginheight="0">' +
	  		'<frame name="startframe" src="' + path );

        // choose the start page dependent on the selected language
        if( language == 'de' )
        {
        	document.write( 'start.html">' );
        }
        else if( language == 'en' )
        {
            document.write( 'start_en.html">' );
        }

        document.writeln(
	  		'<frame name="bottomFrame" scrolling="no" src="' + path + 'untenFrame.html" frameborder="no" marginwidth="0" marginheight="0">' +
      		'</frameset></html>');
    	document.close();

    	framing = true;
  	}
  	return framing;
}

function isStart()
{
    var isStart = false;

    if( top.location.pathname.indexOf( 'start.html' ) != -1 ||
    	top.location.pathname.indexOf( 'start_en.html' ) != -1 )
    {
        isStart = true;
    }
    return isStart;
}

function msieFraming( path )
{
    msieFraming( path, 'de' );
}

function msieFraming( path, language )
{
  	if( is_msie() )
  	{
    	if( Framing( path, language ) )
		{
            if( isStart() )
            {
                if( language == 'de' )
                {
                    window.setTimeout
                    	( 'top.frames["startframe"].location.href = "start.html";', 1000 );
                }
                else if( language == 'en' )
                {
                    window.setTimeout
                    	( 'top.frames["startframe"].location.href = "start_en.html";', 1000 );
                }
            }
            else
            {
                window.setTimeout( 'top.frames["startframe"].mitte.location.href = ' + '"' +
                    top.location.href + '";', 1000 );
            }
    	}
  	}
}

function netscFraming()
{
  	if( !is_msie() )
    {
    	Framing();
    }
}

var Text = "GeT Gesellschaft für europaweite Transferfahrten";
var Geschwindigkeit = 1;
var Breite = 100;
var TextLaenge = Text.length;
var Position = 1 - Breite;

function StatusLauftext()
{
  	Position++;
 	var Textzustand = "";

  	if( Position == TextLaenge )
  	{
    	Position = 1 - Breite;
  	}

  	if( Position < 0 )
  	{
    	for( var Zaehler = 1; Zaehler <= Math.abs( Position ); Zaehler++ )
    	{
      		Textzustand = Textzustand + " ";
    	}
    	Textzustand = Textzustand + Text.substring( 0, Breite - Zaehler + 1 );
  	}
  	else
  	{
    	Textzustand = Textzustand + Text.substring( Position, Breite + Position );
  	}
  	window.status = Textzustand;
  	setTimeout( "StatusLauftext()", Geschwindigkeit );
}

var speed1 = 1;
/*var speed2 = 1;
var speed3 = 1;
var speed4 = 1;*/

function layerA()
{
	if( document.layers )
	{
		var page1 = eval( document.contentLayer1 );
	}
	if( document.getElementById )
	{
    	var page1 = eval( "document.getElementById('contentLayer1').style" );
	}
	if( document.all )
	{
    	var page1 = eval( document.all.contentLayer1.style );
	}
  	slideA( page1 )
}

function slideA( whichlayer )
{
	layer1 = whichlayer;
	var y_pos1 = parseInt( layer1.top );
	layer1.top = ( y_pos1 - ( speed1 ) );
	if( y_pos1 == -700 )
	{
    	layer1.top = 125;
	}
	setTimeout( "slideA(layer1)", 45 );
}

/*
function layerB()
{
  if( document.layers )
  {
    var page2 = eval( document.contentLayer2 );
  }
  if( document.getElementById )
  {
    var page2 = eval( "document.getElementById('contentLayer2').style" );
  }
  if( document.all )
  {
    var page2 = eval( document.all.contentLayer2.style );
  }
  slideB( page2 );
}

function slideB( whichlayer )
{
  layer2 = whichlayer;
  var y_pos2 = parseInt( layer2.top );
  layer2.top = ( y_pos2 - ( speed2 ) );
  if( y_pos2 == -125 )
  {
    layer2.top = 60;
  }
  setTimeout( "slideB(layer2)", 45 );
}*/

function start()
{
  	layerA();
  	//layerB();
}

function MM_swapImgRestore()
{
  	var i, x, a = document.MM_sr;
  	for( i = 0; a && i < a.length && ( x = a[i] ) && x.oSrc; i++ )
  	{
    	x.src=x.oSrc;
  	}
}

function MM_preloadImages()
{
  	var d = document;
  	if( d.images )
  	{
    	if( !d.MM_p )
		{
	  		d.MM_p = new Array();
    	}
    	var i, j = d.MM_p.length, a = MM_preloadImages.arguments;
		for( i = 0; i < a.length; i++ )
		{
      		if( a[i].indexOf( "#" ) != 0 )
	  		{
	    		d.MM_p[j] = new Image;
                d.MM_p[j++].src = a[i];
      		}
		}
  	}
}

function MM_findObj( n, d )
{
  	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 && document.getElementById )
	  		{
	    		x = document.getElementById( n );
      		}
		}
  	}
  	return x;
}

function MM_swapImage()
{
  	var i, j = 0, x, a = MM_swapImage.arguments;
  	document.MM_sr = new Array;
  	for( i = 0; i < ( a.length - 2 ); i += 3 )
  	{
    	if( ( x = MM_findObj( a[i] ) ) != null )
		{
	  		document.MM_sr[j++] = x;
	  		if( !x.oSrc )
	  		{
	    		x.oSrc = x.src;
	  		}
	  		x.src = a[i + 2];
    	}
  	}
}

function MM_validateForm()
{
  	var i, p, q, nm, test, num, min, max, errors = '', args = MM_validateForm.arguments;
  	for( i = 0; i < ( args.length - 2 ); i += 3 )
  	{
    	test = args[i + 2];
		val = MM_findObj( args[i] );
    	if( val )
		{
	  		nm = val.name;
	  		if( ( val = val.value ) != "" )
	  		{
        		if( test.indexOf( 'isEmail' ) != -1 )
	    		{
	      			p = val.indexOf( '@' );
          			if( p < 1 || p == ( val.length - 1 ) )
		  			errors += '- ' + nm + ' must contain an e-mail address.\n';
        		}
	    		else if( test != 'R' )
	    		{
	      			num = parseFloat( val );
          			if( val != '' + num )
		  			errors += '- ' + nm + ' must contain a number.\n';
          			if( test.indexOf( 'inRange' ) != -1 )
		  			{
		    			p = test.indexOf( ':' );
           				min = test.substring( 8, p );
						max = test.substring( p + 1 );
            			if( num < min || max < num )
						{
		     				errors += '- ' + nm + ' must contain a number between ' + min + ' and ' + max + '.\n';
						}
		  			}
	    		}
	  		}
	  		else if( test.charAt( 0 ) == 'R' )
	  		{
	    		errors += '- ' + nm + ' is required.\n';
	  		}
		}
  	}
  	if( errors )
  	{
    	alert( 'The following error(s) occurred:\n' + errors );
  	}
  	document.MM_returnValue = ( errors == '' );
}

function showPic( url )
{
  	var width = 854;
  	var height = 641;
  	var newWin = window.open
    	( "", "_blank", "toolbar=no, location=no, status=no, menubar=no, scrollbars=no, width=" +
        width + ", height=" + height );
  	var doc = newWin.document;

  	doc.writeln("<html>");
  	doc.writeln("<head>");
  	doc.writeln("<title>59. IAA Nutzfahrzeuge 2002</title>");
  	doc.writeln("</head>");
  	doc.writeln("<body>");
  	doc.write("<div style=\"position: absolute; top: 0; left: 0;\"><layer><img src=\"");
  	doc.write(url);
  	doc.writeln("\"></layer></div>");
 	doc.writeln("</body>");
  	doc.writeln("</html>");
}