if (document.location.href.indexOf("tp://sites")>0)
	pathVar = "/insign.ch/"; 
else 
{
	if(document.location.href.indexOf("tp://www.insign.ch/kunden/")>0)
		pathVar = "/kunden/insign.ch/";
	else
		pathVar = "/";
}

function openPicWin(pFileName,pWinName,pWidth,pHeight)
{
	var isNS = (document.layers) ? true : false;	
	if (isNS) pHeight = pHeight + 19;
	eval("allSettings = 'width="+pWidth+",height="+pHeight+",menubar=yes,scrollbars=yes,status=yes,resizable=yes'");
	w=window.open(pFileName,pWinName,allSettings);
	w.window.focus();
}



var pic_off_ar = new Array();
var pic_on_ar = new Array();
/*
pic_on_ar["pos4"] = "de/images/nav_1_ms.jpg";
pic_off_ar["pos4"] = "de/images/nav_1_off.jpg";

pic_on_ar["pos5"] = "de/images/nav_2_ms.jpg";
pic_off_ar["pos5"] = "de/images/nav_2_off.jpg";

pic_on_ar["pos9"] = "de/images/nav_3_ms.jpg";
pic_off_ar["pos9"] = "de/images/nav_3_off.jpg";

pic_on_ar["pos10"] = "de/images/nav_4_ms.jpg";
pic_off_ar["pos10"] = "de/images/nav_4_off.jpg";
*/
var pic_off = new Array();
var pic_on = new Array();

for (var i in pic_off_ar)
{
	pic_off[i] = new Image();
	pic_off[i].src = pathVar+pic_off_ar[i];
	pic_on[i] = new Image();
	pic_on[i].src = pathVar+pic_on_ar[i];
}

function mouseEnter(name,text)
{	
	if(!text)
		text="";	

	if (document.images)
		document.images[name].src = pic_on[name].src;
	window.status=text;
	return true;
}

function mouseExit(name,actnav)
{
	
	if (document.images)
		document.images[name].src = pic_off[name].src;
	window.status="";
	return true;
}


// TICKER START
var tickers = new Array();
function addTickerToStart(ticker)
{
	tickers[tickers.length] = ticker;
}
function startTickers()
{
	for(i=0;i<tickers.length;i++)
	{
		tickers[i].start();
	}
}
// TICKER END

function getIFrameDoc( name ) {
  var IFrameDoc;
  var Height;
  var IFrameObj = document.getElementsByName(''+name)[0];

  if (typeof(document.frames) != 'undefined' && typeof(IFrameDoc) == 'undefined') {
    IFrameObj = document.frames[name];
    //alert(name);
  }
  
  if (typeof(IFrameObj.contentDocument) != 'undefined' && IFrameObj.contentDocument) {
    // For NS6
    IFrameDoc = IFrameObj.contentDocument; 
  } else if (IFrameObj.contentWindow) {
    // For IE5.5 and IE6
    IFrameDoc = IFrameObj.contentWindow.document;
  } else if (IFrameObj.document) {
    // For IE5
    IFrameDoc = IFrameObj.document;
  } else {
    return false;
  }
  
  if(typeof(IFrameDoc.body) != 'undefined')
  {
    return IFrameDoc.body;
  }
  else
  {
    return IFrameDoc.documentElement;
  }
}

/*
* gets the height of an iframe document
*/
function getIFrameDocHeight( name )
{
var IFrameDoc = getIFrameDoc( name );
  if(typeof(IFrameDoc) == 'undefined' || typeof(IFrameDoc.scrollHeight) == 'undefined') {
    return false;
  }
  return IFrameDoc.scrollHeight;
}

/*
* gets the width of an iframe document
*/
function getIFrameDocWidth( name )
{
var IFrameDoc = getIFrameDoc( name );
  if(typeof(IFrameDoc) == 'undefined' || typeof(IFrameDoc.scrollWidth) == 'undefined') {
    return false;
  }
  return IFrameDoc.scrollWidth;
}

/*
* sets the correct height for an iframe
* 
* @var	string	iframe		the name and id of the iframe tag
* @var	string	div			the name and id of the enclosing div container
*/
function iframeExpander(iframe, div)
{
	setTimeout('iframeExpander("'+iframe+'","'+div+'")', 500);
	var iH = getIFrameDocHeight( iframe );
	document.getElementsByName( iframe )[0].height = '' + iH;
	document.getElementsByName( div )[0].style.height = getIFrameDocHeight( iframe );
	if(iH > 0)
	{
		superLoader = 'true';
	}
}

/*
* start function for iframeExpander()-thread. see howto for implementation!
* 
* @var	string	iframe		the name and id of the iframe tag
* @var	string	div			the name and id of the enclosing div container
*/
function startIframeExpander(iframe, div)
{
	// 24.10.2003, mt, sh, correction for opera, ie5 (win & mac) and safari (mac)
	// 15.03.2004, mt, correction also for mozilla browsers (the behavior of mozilla browsers isnt always the same...)
	var agt = navigator.userAgent.toLowerCase();
	if((agt.indexOf("msie 5.0") != -1)		// IE5
		|| (agt.indexOf("opera") != -1) 	// Opera (opera hasnt to be "opera"!)
		|| (agt.indexOf("safari") != -1) 	// Safari
		|| (agt.indexOf("mozilla") != -1)	// Mozilla / Netscape / Firebird / -fox
	)
	{
		iframeExpander(iframe, div);
	}
}

