
//Specify affected tags. Add or remove from list:
var tgs = new Array( 'td','select','input','a');//'div',

//Specify spectrum of different font sizes:
var szs = new Array( '10','11','12','13','14','15','16','17','18' );
var startSz = 2;

function ts( trgt,inc ) {
if (!document.getElementById) return
var d = document,cEl = null,sz = startSz,i,j,cTags;

sz += inc;
if ( sz < 0 ) sz = 0;
if ( sz > 6 ) sz = 6;
startSz = sz;

if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];

cEl.style.fontSize = szs[ sz ];

for ( i = 0 ; i < tgs.length ; i++ ) {
cTags = cEl.getElementsByTagName( tgs[ i ] );
for ( j = 0 ; j < cTags.length ; j++ ) cTags[ j ].style.fontSize = szs[ sz ];
}
} 

function MM_findObj(n, d) { //v4.0
  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 show_hide(obj,action)
{
  obj=MM_findObj(obj);
  action=(action=='show')?"visible":"hidden";
  if(obj){obj.style.visibility=action};
}
function show_hide_filial(action)
{
  obj=MM_findObj("layer_filialwahl");
  if(obj)
  {
    action=(action=='show')?"visible":"hidden";
    if(obj.style){obj.style.visibility=action};
  }
}
function hide_all()
{
  for(var i=0;i<=7;i++)
  {
    show_hide("layer"+i,"hide");
  }
  show_hide_filial('show');
}
function change_image(obj,newsrc)
{
  obj=MM_findObj(obj);
  if(obj){obj.src=newsrc};
}



var l = (screen.width - w) / 2;
var t = (screen.height - h) / 2;
var w = 700;
var h = 331;

function openConfiguredWin(url, params, w, h)
{

	var thisTemp = params.split(":");
	var thisYesNo = thisTemp[0];
	var thisZeroOne = thisTemp[1];

	//windows conf variables
	var winStatus = thisZeroOne;
	var winToolbar = thisYesNo;
	var winLocation = thisYesNo;
	var winScrollbars = thisZeroOne;
	var winResizable = thisYesNo;

	//to center window on screen
	var l = (screen.width - this.w) / 2;
	var t = (screen.height - this.h) / 2;
	l = 0;
	t = 0;
	var scrW = screen.width;
	var scrH = screen.height;

	var maxWidth = screen.width - 50;
	var maxHeight = screen.height - 50;
	var desirableWidth = w;
	var desirableHeight = h;
	var newWidth = (desirableWidth > maxWidth) ? maxWidth : desirableWidth;
	var newHeight = (desirableHeight > maxHeight) ? maxHeight : desirableHeight;
	if (desirableHeight > maxHeight) var winScrollbars = "1";
	if (desirableWidth > maxWidth) var winScrollbars = "1";
	if (desirableHeight > maxHeight) var winResizable = "yes";
	if (desirableWidth > maxWidth) var winResizable = "yes";
	
	//permanent... temporarily
	var winScrollbars = "1";
	var winResizable = "yes";

	var debugStr = 'thisTemp = ' + thisTemp[0] + ' : ' + thisTemp[1] + '\nscrW = ' + scrW + '\nscrH = ' + scrH  + '\nl = ' + l + '\nt = ' + t;
	//alert(debugStr);
	var debugStr2 = 'maxWidth ' + maxWidth +  '\nmaxHeight  ' + maxHeight +  '\ndesirableWidth  ' + desirableWidth +  '\ndesirableHeight  ' + desirableHeight +  '\nnewWidth  ' + newWidth +  '\nnewHeight  ' + newHeight +  '\nwinScrollbars  ' + winScrollbars +  '\nwinResizable  ' + winResizable +  '\nthisTemp  ' + thisTemp +  '\nthisYesNo  ' + thisYesNo +  '\nthisZeroOne  ' + thisZeroOne;
	//alert(debugStr2);


	var a = window.open( url, '', 'status=' + winStatus + ', toolbar=' + winToolbar + ', location=' + winLocation + ', scrollbars=' + winScrollbars + ', resizable=' + winResizable + ', top=' + t + ',left=' + l + ', height=' + newHeight + ', width=' + newWidth );



}//end function openConfiguredWin(url, params, w, h)


function pu(s, n, w, h)
{
	a=window.open("", "zzz", "height=" + h + ", width=" + w + ", resizable=no, scrollbars=no, left='0', top='0'");//, fullscreen
	a.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><title>' + n + '</title></head><body topmargin=0 leftmargin=0 marginheight=0 marginwidth=0><div id="mainDiv" style="position:absolute; top:0; left:0; z-index:2000;"><table border=0 cellpadding=0 cellspacing=0 width="100%" height="100%"><tr><td align=center valign=center height="100%"><img src="' + s + '" border=0 alt="click to close window" onmouseup="window.close();"></td></tr></table></div></body><script language="javascript" type="text/javascript">self.focus();</script></html>');
	a.document.close();
}
