/*
'	$Id: global.js 1736 2007-12-11 15:51:11Z bernd $
'	$Date: 2007-12-11 16:51:11 +0100 (Di, 11 Dez 2007) $
'	$HeadURL: svn://server01/01_Fiat_AAG/Lancia/02_DOMAINS/configurator.lancia.de/01_HTML/trunk/include/global.js $
'	$Revision: 1736 $
'
'	Name:
'	Funktion:
'
'	Aufruf:
'
'	Projekt:	Lancia: CC-Relaunch 2007
'	Copyright:	(C) 2004 Arc Worldwide Frankfurt
'
'	Autor:		Arc Interactive, Hamburg
'
'	Änderungen:	27.08.2007, CS
'
'
*/
/*############################################################################
'##
'##	global.js
'##
'##############################################################################
'##
'##	Projekt:	Fiat: CC-Relaunch 2004
'##
'##	Beschreibung:
'##
'##		versch. Routinen und Funktionen fuer allgemeinen Gebrauch
'##
'##	Autor:		Arc Interactive, Hamburg
'##
'##
'##############################################################################
'##
'##
'##
'##
'############################################################################*/

//
//	ErrorHandler
//
function ErrorHandler( msg, url, line ) {

	// @Live: alle Fehlermeldungen aus !
 	// alert ( 'Zeile:' + line + '\n' + msg + '\n' + url + '\n');

	return true;
}

// nur im INTRA: Fehlermeldung via Browser, KEIN eigener Fehler-Handler (!)
window.onerror = ErrorHandler;
// nur im INTRA: Fehlermeldung via Browser, KEIN eigener Fehler-Handler (!)

//
//	OpenWindow
//
function OpenWindow( theURL, theTitle, theParams, theHeight, theWidth, isCenter )
{

	//
	// alert( theURL+ '|' +theTitle+ '|' +theParams+ '|' +theHeight+ '|' +theWidth+ '|' +isCenter );
	// alert( theHeight+ '|' +theWidth );
		
	//
	var theNewWindow   = null;
	var theFinalParams = "";

	//
	if( theHeight && theHeight != "" ) theFinalParams  = 'height=' + theHeight + ',';
	if( theWidth  && theWidth  != "" ) theFinalParams += 'width='  + theWidth  + ',';
	theFinalParams += theParams;

	//
	theNewWindow = window.open( theURL, theTitle, theFinalParams );
	if( theNewWindow.focus() ) theNewWindow.focus();

	//
	if( isCenter && (theHeight && theHeight != "") && (theWidth && theWidth != "") )
	{
		theNewWindow.moveTo( (screen.width-theWidth)/2 , (screen.height-theHeight)/2 );
	}

}

//
//	CenterWindow
//
function CenterWindow( win, width, height )
{
	var winl = Math.floor((screen.width-width)/2);
	var wint = Math.floor((screen.height-height)/2);

	if (winl < 0) winl = 0;
	if (wint < 0) wint = 0;

	win.moveTo(winl, wint);
}

//
//	AntiZ	(JavaScript-Version)
//
//	ersetzt im String 'theCarCode' die zweite Stelle durch eine '0'
//
//	Hintergrund:
//	Nach Einbau der "MotorMatrix" können CarCodes auftreten, deren Markenschlüssel geändert wurde:
//	Fiat: 0Z (statt 00) / Lancia: 7Z (statt 70) / Alfa: 8Z (statt 80)
//	Um diese "Automatik-CarCodes" wieder in den Originalzustand zu versetzen, gibt es "AntiZ".
//
function AntiZ( theCarCode )
{
	return( theCarCode.substring( 0, 1 ) + '0' + theCarCode.substring( 2, theCarCode.length ) );
}

//
//
//
/*
function GetElementInDocument( theDocument, theID )
{
	if( theDocument.getElementById )
	{
		if( theDocument.getElementById( theID ) )	return( theDocument.getElementById( theID ) );
	}	
	else
	if( theDocument.all )
	{
		if( theDocument.all[ theID ] )				return( theDocument.all[ theID ] );
	}
	else
	if( theDocument.layers )
	{
		if( theDocument.layers[ theID ] )			return( theDocument.layers[ theID ] );
	}
	else
	{
												return( null );
	}
}
*/
/*      end $id: scroll_var_detailansicht.js 1088 2007-08-27 15:49:02z bernd $ end */