//
// Browser Detection
//
var ns = navigator.appName == "Netscape";
var ns5 = (ns && parseInt(navigator.appVersion) > 4);
var ie  = 0;
var ns4 = 0;
var dom = 1;
var ie4 = 0;
var ie5 = 0;
var ope = 0;
var moz = 0;
var bok = 1;
var initdone = false;
var xcenter = 0;

ie  = (document.all)?true:false;
ns4 = (document.layers)?true:false;
dom = (document.getElementById)?true:false;
ie4 = (document.all && !dom)?true:false;
ie5 = (dom && navigator.userAgent.indexOf('MSIE 5')>0);
ope = (dom && navigator.userAgent.indexOf('Opera')>0);
moz = (dom && navigator.userAgent.indexOf('Gecko')>0);
bok = ns4 || ie4 || dom;

// Get object by ID
function getobj(hname) {
  if (ns4) return eval("document."+hname);
  else if (ie4) return document.all[hname]
  else if (dom) return document.getElementById(hname);
};



// Make an object visible
function showObj(obj) {
  if (ns4) obj.visibility = "show"
  else obj.style.visibility = "visible";
};

// Hide an object
function hideObj(obj) {
  if (ns4) obj.visibility = "hide"

  else obj.style.visibility = "hidden";
};

// Move an object X
function moveObjX(obj,x) {
  if (ns4)
  {
    obj.left = x;
  } else
  {
    obj.style.left = x;
  };
};

function moveObjY(obj,y) {
  if (ns4)
  {
    obj.top = y;
  } else
  {
    obj.style.top = y;
  };
};


function show_window(name,id,x,y)
{
 le=(screen.width-x) / 2;
 tp=(screen.height-y) / 2;

 par ='width='+x+',height='+y+', menubar=no,resizable=yes,scrollbars=no,left='+le+',top='+tp;
 h=window.open('','',par);
 h.document.writeln('<html>');
 h.document.writeln('<head>');
 h.document.writeln('<title>'+id+'</title>');
 h.document.writeln('</head>');
 h.document.writeln('<body style="margin:0px 0px 0px 0px" MARGINWIDTH="0" MARGINHEIGHT="0" LEFTMARGIN="0" TOPMARGIN="0">');
 s ='<a href="#" onClick="self.close();"><img src = "'+name+'" border="0" alt = "Anklicken zum Schließen"></a>';
 h.document.writeln(s);
 h.document.writeln('</body>');
 h.document.writeln('</html>');
 h.document.close();

}


function callback(string)
{
  var breite  = 400;
  var hoehe = 400;
  var h=window.open(string,"Callback","toolbar=no,width="+breite+",height="+hoehe+",directories=no,status=no,scrollbars=no,resize=no,menubar=no");
  h.focus();
}

function zoom(nr, titel, x,y)
{

  var breite  = x+30;
  var hoehe = y+78+15;
  if (x ==0) { breite = 600};
  if (y ==0) { hoehe = 400};

  le=(screen.width-breite) / 2;
  tp=(screen.height-hoehe) / 2;

  var h=window.open("","fefco","toolbar=no,width="+breite+",height="+hoehe+",left="+le+",top="+tp+",directories=no,status=no,scrollbars=no,resize=no,menubar=no");
//  h.focus();
  h.document.writeln('<html>');

  h.document.writeln('<head>');
  h.document.writeln('<title>Wiederstein Verpackungen</title>');

  h.document.writeln('<style type = "text/css">');
  h.document.writeln('body, td {font-size:10pt; color:000000; font-family:verdana}');
  h.document.writeln('font.sm {font-size:7pt; color:000000; font-family:verdana}');

  h.document.writeln('</style>');
  h.document.writeln('</head>');
  h.document.writeln('<body bgcolor = "#ffffff" style="margin:0px 0px 0px 0px" MARGINWIDTH="0" MARGINHEIGHT="0" LEFTMARGIN="0" TOPMARGIN="0">');
  h.document.writeln('<table border="0" cellpadding="0" cellspacing="0" bgcolor = "#ffffff" width="100%">');
  h.document.writeln('<tr bgcolor = "#f0f0f0">');
  h.document.writeln('<td bgcolor = "#f0f0f0">');
//  h.document.writeln('&nbsp;&nbsp;&nbsp;&nbsp;<b>Fefco-System<b><br><br>');
  h.document.writeln('<table border="0" cellpadding="10" cellspacing="4"><tr><td><b>'+nr+' '+titel+'</b></td></tr></table>');
  h.document.writeln('</td>');
  h.document.writeln('<td bgcolor = "#f0f0f0"><center> <img src = "../common/logo_cb.gif" align="right"></td>');
  h.document.writeln('</tr>');
  h.document.writeln('<tr height="1"><td colspan="2" height="1" bgcolor = "#888888"><img src = "common/space.gif" height="1" width="1"></td></tr>');
  h.document.writeln('<tr bgcolor = "#ffffff">');
  h.document.writeln('<td colspan="2">');
  h.document.writeln('<a href = "javascript:self.close()"><img src = "fefco/big/fefco'+nr+'_gr.gif" alt="Anklicken zum Schließen" border="0"></a>');
  h.document.writeln('</td>');
  h.document.writeln('</tr>');
  h.document.writeln('</table>');

  h.document.writeln('</body>');

  h.document.writeln('</html>');
  h.document.close();


  h.focus();
}

function istleer(s)
{
  for (var i = 0; i < s.length; i++)
  {
    var c = s.charAt(i);
    if ((c != ' ') && (c != '\\n') && ( c!= '\t')) return false;
  }
  return true;
}

function getxpos()
{
  x1=0;
  var ppic=getobj("portal");

  if (ns4) {
    x1 = document.portal.pageX;

  } else {
    for (obj = ppic, x1=0;  obj.tagName != 'BODY'; obj = obj.offsetParent){
      x1 += obj.offsetLeft;
    };
  };

  return x1
}

function getypos()
{
  y1=0;
  var ppic=getobj("portal");

  if (ns4) {
    y1 = document.portal.pageY;
  } else {
    for (obj = ppic, y1=0;  obj.tagName != 'BODY'; obj = obj.offsetParent){
      y1 += obj.offsetTop;
    };
  };

  return y1
}

function open_window()
{
  var path="http://www.qpartner-online.de/folienrechner/index.htm";
  var param = "width=476,height=400,status=no,menubar=no";
  var h = window.open(path,"Stretchfolienkalkulator",param);
  h.focus();
}


function reloadPage(init) {
  if (init==true) onresize=reloadPage;
  else location.reload();
}
reloadPage(true);




