/*
	Version 1.00
	(c) 2002 insign gmbh
	written by mk
	last change 30.07.2002 [mk]
	
	history:
	1.00	30.07.2002	initial Version
*/
scriptPath='../jscripts/';
usedScripts = [
	{'file':'forms.js','active':true},
	{'file':'validationFunctions.js','active':true},
	{'file':'formsLayer.js','active':false},
	{'file':'slideLayer.js','active':false},
	{'file':'formImages.js','active':false},
	{'file':'fixLayer.js','active':false},
	{'file':'fadeElements.js','active':false},
	{'file':'fadeLayer.js','active':false},
	{'file':'shopFunctions.js','active':false},
	{'file':'formFunctions.js','active':false}
];

doNotInit=new Array();
doNotInit['Search']=true; //enter the names of the forms without formcheck
doNotInit['territory']=true; //enter the names of the forms without formcheck

//-----------------forms layer-----------------
layerSource="<table border=0 cellpadding=borderSize cellspacing=0 width=layerWidth><tr><td class=borderStyle><table border=0 cellpadding=tableCellpadding cellspacing=0 width=100%><tr><td width=100% class=bgStyle><span class=fontStyle>textToReplace</span></td></tr></table></td></tr></table>";
eTypes=new Array('help','complete','text','optional');//handled events of the script (can be deleted)
showLyrFor=new Array('text','textarea','password','select-one');//element-types, for which the help-layer should be shown

//don't change
showIt=new Array();
for(i=0;i<showLyrFor.length;i++)
	showIt[showLyrFor[i]]=true;
lArr=new Array();
for(i=0;i<eTypes.length;i++)
	lArr[eTypes[i]]=new Array();

lArgs=new Array('layerWidth','borderSize','tableCellpadding','borderStyle','bgStyle','fontStyle','xDist','yDist','onTop','alignRight');
//end don't change

lArr['help']['layerWidth']=200;							// width of layer 
lArr['help']['borderSize']=1;							// border size of layer
lArr['help']['tableCellpadding']=3;						// cellpadding in the layer
lArr['help']['borderStyle']='tdhelpborder';				// name of the border style
lArr['help']['bgStyle']='tdhelp';						// name of the background style
lArr['help']['fontStyle']='freq';						// name of the font style
lArr['help']['xDist']=document.layers?0:0;				// distance (x-direction) between image and layer (Netscape) respectively the form element and the layer
lArr['help']['yDist']=document.layers?-12:0;			// distance (y-direction) between image and layer (Netscape) respectively the form element and the layer
lArr['help']['onTop']=false;							// if true the layer is placed on top of the form element
lArr['help']['alignRight']=document.layers?500:500;		// for values != 0 the help layer will be fixed in x-direction at the given position

lArr['complete']['fontStyle']='fcomplete';				// propertys may be overwritten
lArr['complete']['bgStyle']='tdcomplete';
lArr['complete']['borderStyle']='bordercomplete';
lArr['optional']['fontStyle']='ftext';
lArr['text']['fontStyle']='ftext';


//-----------------slide layers-----------------
maxStep=30;						//maximal step size
slideTo=20;						//timeout between steps
relSpeed=3;					//the bigger it is the shorter the slow down distance is
xOut=document.layers?500:500;	//for values != 0 the x position of the layre is fixed to the value xOut (pixel) 
yOut=-100;						//y position, where the layer is sliding to

//-----------------fade elements-----------------
elFadeDuration=.5;		//"fading time" (seconds)
elFadeIn=100;			//"opacity" (%)
elFadeOut=80;			//"opacity" (%)
elFadeStyle=1;			//style (1 to 5)

//-----------------fade layer-----------------
fLayerDuration=1;	//"fading time" (seconds)
fLayerStyle=3;		//style (1 to 5)
fLayerOpacity=90;	//"opacity" (%)

//-----------------fix layer-----------------
//fixes the layer relativ to the position of an image (name='layerPos')
xDist=1;		//distance between layer and image (horizontal)
yDist=1;		//distance between layer and image (vertical)

//-----------------form images-----------------
//needs 3 images ('form.gif','form_ok.gif' and 'form_not_ok.gif')
imgPath='../images/icons/'; //path to the images
imgSrcs=new Array(imgPath+'form.gif',imgPath+'form_ok.gif',imgPath+'form_not_ok.gif'); //srcs of the images
imgEvents=new Array('neutral','ok','not_ok'); 

//-----------------including scripts-----------------
scriptCode='<script language="JavaScript1.2" src="'+scriptPath+'scriptSRC"></script>';

for(var i=0; i<usedScripts.length; i++)
{
	if(usedScripts[i].active)
	{
		document.write(scriptCode.replace(/scriptSRC/,usedScripts[i].file));
	}
}

function doResize(isOnload){
	//newXPos=document.layers?598:598;
	//for(i=0;i<eTypes.length;i++)
	//	lArr[eTypes[i]]['alignRight']=newXPos;
	//xOut=newXPos;
	//getLyrObject('helpLayer').left=newXPos;
	if(!isOnload && window.doOnresize)
		doOnresize();
}

if(window.onresize)
	doOnresize=window.onresize;
window.onresize=doResize;