
var ie = document.all;
var nn6 = document.getElementById &&! document.all;

var isdrag = false;
var x, y;
var dobj;

var fadeOutStat = 0;

var win=null;

onerror = stopError;
function stopError(){
	return true;
}


function popfenster(urlx){

	var urls = urlx;
	myleft=(screen.width)?(screen.width-800)/2:100;mytop=(screen.height)?(screen.height-600)/2:100;
	settings="width=800,height=600,top=" + mytop + ",left=" + myleft + ",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no,dependent=no";
	win=window.open(urls,"bild",settings);
	win.focus();

}

function getWidth(){
	return document.width ? document.width : document.documentElement.offsetWidth;    // get Document- Width
}

function getHeight(){
	return document.height ? document.height : document.documentElement.offsetHeight; // get Document- Height
}

function setOpacity( value ) {
 document.getElementById("styled_popup").style.opacity = value / 10;
 document.getElementById("styled_popup").style.filter = 'alpha(opacity=' + value * 10 + ')';
}

function fadeInMyPopup() {
 for( var i = 0 ; i <= 100 ; i=i+10 )
   setTimeout( 'setOpacity(' + (i / 10) + ')' , 8 * i );
}

function fadeOutMyPopup() {
if(fadeOutStat == 0){
fadeOutStat =1;
 for( var i = 0 ; i <= 100 ; i=i+10) {
   setTimeout( 'setOpacity(' + (10 - i / 10) + ')' , 8 * i );
 }
fadeOutStat = 0;
 setTimeout('styledPopupClose()', 800 );
 
 }else{
    // Do Nothing...
 }
}


function movemouse( e ) {
  if( isdrag ) {
    dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x;
    dobj.style.top  = nn6 ? ty + e.clientY - y : ty + event.clientY - y;
    return false;
  }
}


function mausposition()
{

document.captureEvents(Event.MOUSEDOWN)
document.onmousedown = setzestatus

}

var maus_y;

function setzestatus(e)
{
         maus_y = e.pageY
}

function selectmouse( e ) {
  var fobj       = nn6 ? e.target : event.srcElement;
  var topelement = nn6 ? "HTML" : "BODY";

  while (fobj.tagName != topelement && fobj.className != "dragme") {
    fobj = nn6 ? fobj.parentNode : fobj.parentElement;
  }

  if (fobj.className=="dragme") {
    isdrag = true;
    dobj = document.getElementById("styled_popup");
    tx = parseInt(dobj.style.left+0);
    ty = parseInt(dobj.style.top+0);
    x = nn6 ? e.clientX : event.clientX;
    y = nn6 ? e.clientY : event.clientY;
    document.onmousemove=movemouse;
    return false;
  }
}

function fireMyPopup() {

document.getElementById('styled_popup').style.top = (60)+'px';
document.getElementById('styled_popup').style.left = (80)+'px';

 setOpacity( 0 );
 document.getElementById("styled_popup").style.display = "block";
 fadeInMyPopup();
}

function styledPopupClose() {
    document.getElementById("styled_popup").style.display = "none";
    
}
