﻿function modalDialog(url, name, height, width)
{
    var dHeight = height; var dWidth = width; 
    if (( document.all )&&(navigator.appName != 'Opera')) 
        { 
            if ( parseInt(navigator.appVersion.substr(22, 1)) < 7 ) { dWidth += 4; dHeight += 58; }; 
            dialog = window.showModalDialog(url, this, 'dialogWidth:' + dWidth + 'px;dialogHeight:' + dHeight + 'px;resizable:yes;scroll:no;center:yes'); 
        } 
    else 
        { 
            oWindow = window.open(url, name, 'height=' + dHeight + ',width=' + dWidth + ',toolbar=no,directories=no,menubar=no,modal=yes,dependent=yes,resizable=yes'); oWindow.opener = this; oWindow.focus(); 
        } 
}

var PlayerWindow;
var p_win;
var p_win2;
function launchPOP(url,w,h,reg){
	if(reg == '' || reg == null){ reg = false; }
	if(p_win&& !p_win.closed){
		p_win.close();
		p_win= null;
	}

	if(navigator.appName.indexOf('Netscape') != -1){
		w += 0;
		h += 0;
	}
		w += 260;
		h += 24;

	l = 200;
	t = 200;
	properties  = 'width=' + w;
	properties += ',height=' + h;
	properties += ',scrollbars=0,toolbar=0,location=0';
	properties += ',directories=0,status=1,menubar=0';
	properties += ',resizable=1';
	properties += ',top=' + t;
	properties += ',left=' + l;

	p_win= window.open(url,"pop",properties);

	if(navigator.appName.indexOf('Netscape') != -1){
		p_win.resizeTo(w,h);
	} else {
		p_win.resizeTo(w+12,h+30);
	}
	
}

function launchPOPnp(url,w,h,reg){
	if(reg == '' || reg == null){ reg = false; }
	if(p_win&& !p_win.closed){
		p_win.close();
		p_win= null;
	}

	if(navigator.appName.indexOf('Netscape') != -1){
		w += 0;
		h += 0;
	}
		w += 260;
		h += 24;

	l = 200;
	t = 200;
	properties  = 'width=' + w;
	properties += ',height=' + h;
	properties += ',scrollbars=0,toolbar=0,location=0';
	properties += ',directories=0,status=1,menubar=0';
	properties += ',resizable=1';
	properties += ',top=' + t;
	properties += ',left=' + l;

	p_win= window.open(url,"popnp",properties);

	if(navigator.appName.indexOf('Netscape') != -1){
		p_win.resizeTo(w,h);
	} else {
		p_win.resizeTo(w+12,h+30);
	}
	
}

function launchPOP2(url,w,h,reg){
	if(reg == '' || reg == null){ reg = false; }
	if(p_win&& !p_win.closed){
		p_win.close();
		p_win= null;
	}

	if(navigator.appName.indexOf('Netscape') != -1){
		w += 0;
		h += 0;
	}
		w += 260;
		h += 24;

	l = 200;
	t = 200;
	properties  = 'width=' + w;
	properties += ',height=' + h;
	properties += ',scrollbars=1,toolbar=0,location=0';
	properties += ',directories=0,status=1,menubar=0';
	properties += ',resizable=1';
	properties += ',top=' + t;
	properties += ',left=' + l;

	p_win= window.open(url,"pop2",properties);

	if(navigator.appName.indexOf('Netscape') != -1){
		p_win.resizeTo(w,h);
	} else {
		p_win.resizeTo(w+12,h+30);
	}
	
}

// wird nur zum öffnen des hauptfensters verwendet
function launchwindow(url,w,h,reg){
    if(reg == '' || reg == null){ reg = false; }
    if(p_win&& !p_win.closed){
        p_win.close();
        p_win= null;
    }

    if(navigator.appName.indexOf('Netscape') != -1){
        w += 0;
        h += 0;
    }

    l = 0;
    t = 0;
    properties  = 'width=1012';
    properties += ',height=717';
    properties += ',scrollbars=0,toolbar=0,location=0';
    properties += ',directories=0,status=1,menubar=0,fullscreen=0';
    properties += ',resizable=1,center=1';

    p_win2= window.open(url,"hauptfenster",properties);
	
	if (window.name != "MSCRM_MAIN")
    {
    var oMe = window.self;
    oMe.opener = window.self;
    oMe.close();
    }
	
    if(navigator.appName.indexOf('Netscape') != -1){
        p_win.resizeTo(w,h);
    } else {
        p_win.resizeTo(w,h);
    }
}


