//
var stageOpen = false;

// app specific functions



function openGTC(file) {

  var location = file;
  var height = 553;
  var width = 521;  

  ref = window.open(location, 'gtc', "toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,width="+width+",height="+height);
  ref.focus();
  return false;
  


}

function openPDF(file) {

  var location = file;
  var height = 553;
  var width = 521;  

  ref = window.open(location, 'gtc', "toolbar=1,location=0,directories=0,status=0,menubar=1,scrollbars=1,width="+width+",height="+height);
  ref.focus();
  return false;
  

  
  
  

}

// background functions
function getBrowserType() {
   // returns browserType: 
   // N4 = Nescape Navigator >4 
   // N6 = Nescape Navigator >6    
   // M4 = Mircosoft IExplorer >4
   // NN = browser unknown
 
   var browserVer=parseInt(navigator.appVersion);
   var browserType=navigator.appName;
   var browser = "NN";

   if (browserType == "Netscape" && browserVer >= 4) browser = "N4";
   if (browserType == "Netscape" && browserVer >= 6) browser = "N6";   
   if ((browserType.indexOf("Microsoft") != -1) && browserVer >= 4 ) browser = "M4";
   return browser;

}



// common 
var popupnum = 0;

function popup(location) {
  ref = window.open(location, 'stefanmaycom', "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,width=330,height=250");
  ref.focus();
  popupnum++;
  return false;
}



function popupSizedCentered(location, width, height) {
  
  LeftPosition = (screen.width) ? (screen.width-width)/2 : 0;
  TopPosition = (screen.height) ? (screen.height-height)/2 : 0;
  
  ref = window.open(location, 'stefanmaycom', "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,width="+width+",height="+height+",top="+TopPosition+",left="+LeftPosition);
  
  ref.focus();  
  return ref;
  
}



function popupSized(location, width, height) {
  ref = window.open(location, 'stefanmaycom', "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,width="+width+",height="+height);
  ref.focus();
  popupnum++;
  return false;
}



function popupSizedNamed(location, name, width, height) {
  ref = window.open(location, name, "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,width="+width+",height="+height);
  ref.focus();
  popupnum++;
  return false;
}



function getURLParamValue(paramName) {
   // gibt Werte von URL Parameter paramName zurueck
   // URL Parameter Symtax  seite.html?paramName1=paramWert1&paramName2=paramWert2 

   var searchString = document.location.search;
   var paramValue = null;

   var findex = searchString.indexOf(paramName);
   
   if (findex != -1) {
      indexStart = searchString.indexOf(paramName) + paramName.length + 1;
      var indexEnd = searchString.indexOf("&", indexStart);   
      if(indexEnd != -1) {
         var paramValue = searchString.substring(indexStart, indexEnd);
      } else {
         var paramValue = searchString.substring(indexStart);
      }
  }
      
  return paramValue;
   
}

