
function getElement(elId) {
    var dom = document.getElementById ? true : false;
    var ie = document.all ? true : false;
    
    var test = document.getElementById(elId);
    
    var el = ( dom ? document.getElementById(elId) : this.ie ? document.all[elId] : document.layers[elId] );
    return el;
}


//Open Browser Window
var activePopup = null;
function TRopenWindow(theURL,winName,features) { 
  TRcloseWindow();
  activePopup = window.open(theURL,winName,features);
  activePopup.focus();
}
function TRcloseWindow() {    // close pop-up window if it is open 
  if( activePopup != null ) {
    activePopup.close();
    activePopup = null;
  }
}
//Opens IMAGE Document
function TRopenImg(imgSrc,imgWidth,imgHeight){ 

winWidth = imgWidth+20; 
winHeight= imgHeight+47; 

var openWin = window.open(imgSrc,"ImgWin","width="+winWidth+",height="+winHeight+",scrollbars=0,status=0"); 

openWin.resizeTo(winWidth,winHeight); 
openWin.focus(); 
} 


//Image-Popup wie auf mmsgossip.ch!
var pic = null
var popImg = null  // use this when referring to pop-up image
var picTitle = null
var imgCount = 0
var imgWinName = "popImg"

function openPopImg(picName, windowTitle, windowWidth, windowHeight){
  closePopImg()
  picTitle = windowTitle
  imgWinName = "popImg" + imgCount++ //unique name for each pop-up window
  popImg = window.open(picName, imgWinName,
           "toolbar=no,scrollbars=no,resizable=no,width=" 
           + (parseInt(windowWidth)+20)  + ",height=" 
           + (parseInt(windowHeight)+25)) 
}
function closePopImg(){    // close pop-up window if it is open 
  if (navigator.appName != "Microsoft Internet Explorer" 
      || parseInt(navigator.appVersion) >=4) //do not close if early IE
    if(popImg != null) if(!popImg.closed) popImg.close() 
} 


//hilte form elements
function mark(face,field_color,text_color,border_color){
if (document.documentElement){//if browser is IE5+ or NS6+
face.style.backgroundColor=field_color;
face.style.color=text_color;
face.style.borderColor=border_color;
}
}	
function printPage() { 
  if (confirm("Achtung:\nDie Seite, welche Sie im Begriff sind zu drucken  \nwurde für die Druckerausgabe optimiert!\nEin paar Elemente werden im Ausdruck \nNicht dargestellt werden! ")) {
    window.print();
  }
} 

/*
//Hide status bar msg 
function hidestatus(){
//window.status='Autohelvetica.ch - Online Auto Handel Schweiz'
return true
}

if (document.layers) { document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT); }
document.onmouseover=hidestatus;
document.onmouseout=hidestatus;
*/

//bookmark
 function addBookmark(title,url) { 
 if (window.sidebar) { 
 window.sidebar.addPanel(title, url,""); 
 } else if( document.all ) { 
 window.external.AddFavorite( url, title); 
 } else if( window.opera && window.print ) { 
 return true; 
} 
} 

//Start image functions
<!--
function AH_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 AH_preloadImages() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=AH_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 AH_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=AH_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

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

//End image functions









