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

function openWindow(name,location,width,height,myCmd){
	if (!myCmd) // <pk-07-11-16 />
	{
        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;

    if (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.scrollWidth) == 'number') {
        return window.scrollWidth;
    }
		
    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 ocsp_conf_winwidth;
}

function getWindowHeight() {
	
	if (typeof(window.scrollHeight) == 'number') {
		return window.scrollHeight;
	}
	
	
    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 ocsp_conf_winheight;
}

/**
  * sets the location of a documentElement
  *
  * @param document aDoc
  * @param string aLoc
  *
  * @since pk-06-02-23
  *
  **/
function setLocation(aDoc,aLoc) {
    aDoc.location.href=aLoc;
}

/**
  * returns a element by id
  *
  * @param string elemId
  *
  * @since pk-07-04-19
  *
  */
function ocsp_getElem(elemId)
{
    if(document.all) {
        return document.all(elemId);
    }
    if(document.getElementById) {
        return document.getElementById(elemId);
    }

    if (getRef(elemId))
    {
        return getRef(elemId);
    }

    if ( typeof jQuery != "undefined" )
    {
        if (jQuery('#'+elemId))
        {
            return jQuery('#'+elemId);
        }
    }
    return null;
}

/**
  * returns a current (calculated) style value
  *
  * @param string elemId
  * @param string styleName
  *
  * @return string
  * @since pk-07-04-27
  *
  */
function ocsp_get_ElemStyle(elemId,styleName)
{
    objElem = ocsp_getElem(elemId)
    if( objElem )
    {
        if( window.getComputedStyle )
        {
            return window.getComputedStyle(objElem, '' ).getPropertyValue( styleName );
        }
        else if( objElem.currentStyle )
        {
            return objElem.currentStyle.getAttribute( styleName.replace(/-/g, '') );
        }
    }
    return '';
}

/**
  * sets a style attribute of an element
  *
  * @param string elemId
  * @param string style
  * @param string styValue
  *
  * @since pk-07-09-16
  */
function ocsp_set_ElemStyle(elemId,style,styValue)
{
    objElem = ocsp_getElem(elemId);
    if( objElem )
    {
        objElem.style=styValue;
    }
}

/**
  * sets the css class of an element
  *
  * @param string elemId
  * @param string className
  *
  * @since pk-07-09-16
  */
function ocsp_set_ElemCSSClass(elemId,className)
{
    objElem = ocsp_getElem(elemId);
    if( objElem )
    {
        objElem.className=className;
    }
}

/**
  * class for a point on the screen
  *
  * @param int xpos
  * @param int ypos
  */
function ocsp_point(xpos,ypos)
{
    this.x=xpos;
    this.y=ypos;
}

/**
  * position class holding the postion information of an element
  *
  * @param string elemId
  *
  * @return ocsp_point
  */
function ocsp_getElemPosition(elemId)
{
    elem=ocsp_getElem(elemId);
    tagname='',x=0,y=0;
    while ((typeof(elem)=='object') && (typeof(elem.tagName)!='undefined'))
    {
        y+=elem.offsetTop; /* Offset des jeweiligen Elements addieren */
        x+=elem.offsetLeft; /* Offset des jeweiligen Elements addieren */
        tagname=elem.tagName.toUpperCase(); /* tag-Name ermitteln, Grossbuchstaben */
        /* wenn beim Body-tag angekommen elem fuer Abbruch auf 0 setzen */
        if (tagname=='BODY') elem=0; /* wenn elem ein Objekt ist und offsetParent enthaelt Offset-Elternelement ermitteln */
        if (typeof(elem)=='object')
            if (typeof(elem.offsetParent)=='object')
                elem=elem.offsetParent;
    }

    return new ocsp_point(x,y);

}

function ocsp_loadJScript(src,debug)
{
    if (debug) alert('ocsp_loadJScript: src');
    var html_doc = document.getElementsByTagName('head').item(0);
    var js = document.createElement('script');
    js.setAttribute('language', 'javascript');
    js.setAttribute('type', 'text/javascript');
    js.setAttribute('src', src);
    html_doc.appendChild(js);
}

