/* ------------------------------------------------------------ */
/* MODULE:                                                      */
/*	    window.js                                               */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
/* RELEASE:							                            */
/* 		                        			                    */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
/* DESCRIPTION:							                        */
/*								                                */
/* window javascript functions                                  */
/*                                                              */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
/* HISTORY:							                            */
/*								                                */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
/* TESTS:							                            */
/*								                                */
/* ************************************************************	*/

function winLaunch(theURL,winName,targetName,features) {
    eval(winName+"=window.open('"+theURL+"','"+targetName+"','"+features+"')")
}

function openWindow(name,location,width,height){
    var myCmd = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes"

    if (width != "")
        myCmd = myCmd + ",width="+width;
    if (height != "")
        myCmd = myCmd + ",height="+height;

    var myWnd = window.open(location,name,myCmd);
    myWnd.focus();
    return myWnd;
}


function popup_window(datei,sx,sy) {
    openWindow("POPUP",datei,sx,sy)
}

function openLinkWnd(url) {
    openWindow("Link",url,700,500);
}

function getWindowWidth(){
   if( typeof( window.innerWidth ) == 'number' ) {
        //Non-IE
        return window.innerWidth;
   }
   if( document.documentElement && ( document.documentElement.clientWidth) ) {
        //IE 6+ in 'standards compliant mode'
        return document.documentElement.clientWidth;
   }
   if( document.body && ( document.body.clientWidth) ) {
        //IE 4 compatible
        return document.body.clientWidth;
   }

   return 750;
}

function getWindowHeight() {
    if( typeof( window.innerHeight ) == 'number' ) {
        return window.innerHeight;
    }

    if( document.documentElement && ( document.documentElement.clientHeight) ) {
        //IE 6+ in 'standards compliant mode'
        return document.documentElement.clientHeight;
    }

    if( document.body && ( document.body.clientHeight ) ) {
        //IE 4 compatible
        return document.body.clientHeight;
    }

	if (screen.availHeight) {
		return screen.availHeight-120;
	}

    return 450;
}

