
var useragent = navigator.userAgent.toLowerCase();
var IE = useragent.indexOf('msie') > 0 ? true : false;
var MOZILLA = useragent.indexOf('firefox') > 0 ? true : false;
var NETSCAPE = useragent.indexOf('netscape') > 0 ? true : false;


function printWin(stylesheet) {
	var RTETitle = document.getElementById("RTETitle").innerHTML;
	var RTEContent = document.getElementById("RTEContent").innerHTML;
	pwin = open("","printWindow","width=795,height=530,left=10,top=10,scrollbars=yes,resizable=yes");
	pwin.document.open();
	pwin.document.write('<html><head><title>'+RTETitle+'</title>');
	pwin.document.write('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">');
	if (stylesheet)	pwin.document.write('<link href="'+stylesheet+'" rel="stylesheet" type="text/css">');
	pwin.document.write('<body bgcolor=\"#FFFFFF\" onLoad="window.print();window.close()">');
	pwin.document.write('<table width="100%" border="0" cellpadding="4" cellspacing="0">');
	pwin.document.write('	<tr>');
	pwin.document.write('		<td width="100%" height="20" class="RTETitle" nowrap>');
  	pwin.document.write(RTETitle);
	pwin.document.write('		<hr></td>');
	pwin.document.write('	</tr>');
	pwin.document.write('	<tr>');
	pwin.document.write('		<td valign="top">');
  	pwin.document.write(RTEContent);
	pwin.document.write('		</td>');
	pwin.document.write('	</tr>');
	pwin.document.write('</table>');
	pwin.document.write('</body></html>');
	pwin.document.close(); 
}


function openVideo(url,title,stylesheet,width,height) {
	var playerWidth = width;
	var playerHeight = height+70;
	var windowWidth = playerWidth+10;
	var windowHeight = playerHeight+40;
	
	pwin = open("","videoWindow","width="+windowWidth+",height="+windowHeight+",left=0,top=0,scrollbars=no,resizable=yes");
	pwin.document.open();
	pwin.document.write('<html><head><title>'+title+'</title>');
	pwin.document.write('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">');
	if (stylesheet)	pwin.document.write('<link href="'+stylesheet+'" rel="stylesheet" type="text/css">');
	pwin.document.write('<body bgcolor=\"#FFFFFF\">');
	pwin.document.write('<table width="100%" border="0" cellpadding="4" cellspacing="0" align="center">');
	pwin.document.write('	<tr>');
	pwin.document.write('		<td width="100%" height="20" class="RTETitle" nowrap>');
  pwin.document.write(title);
	pwin.document.write('		</td>');
	pwin.document.write('	</tr>');
	pwin.document.write('	<tr>');
	pwin.document.write('		<td valign="top" align="center">');
		
    pwin.document.write ('<OBJECT ID="MediaPlayer104503" width='+playerWidth+' height='+playerHeight);
    pwin.document.write ('  classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"');
    pwin.document.write ('  codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902"');
    pwin.document.write (' standby="Loading Microsoft Windows Media Player components..."');
    pwin.document.write (' TYPE="application/x-oleobject" >');
    pwin.document.write ('<PARAM NAME="filename" VALUE="' + url + '">');
    pwin.document.write ('<PARAM NAME="AnimationatStart" VALUE="0"/>');
    pwin.document.write ('<PARAM NAME="TransparentatStart" VALUE="1"/>');
    pwin.document.write ('<PARAM NAME="AutoStart" VALUE="1"/>');
    pwin.document.write ('<PARAM NAME="ShowControls" VALUE="1"/>');
    pwin.document.write ('<PARAM NAME="SendPlayStateChangeEvents" VALUE="1"/>');
    pwin.document.write ('<PARAM NAME="EnableContextMenu" VALUE="1"/>');
    pwin.document.write ('<PARAM NAME="EnablePositionControls" VALUE="0"/>');
    pwin.document.write ('<PARAM NAME="ShowStatusBar" VALUE="1"/>');
    pwin.document.write ('<PARAM NAME="AllowScan" VALUE="0"/>');
    pwin.document.write ('<PARAM NAME="volume" VALUE="0"/>');
    pwin.document.write ('<PARAM NAME="displaySize" VALUE="0"/>');
    pwin.document.write ('<EMBED type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" SRC="' + url + '" name="MediaPlayer" width="'+playerWidth+'" height="'+playerHeight+'" autostart="1"  EnableContextMenu="0"  ShowControls="1" AnimationAtStart="0" ShowStatusBar="1" volume="0" displaySize="0">');
    pwin.document.write ('</EMBED>');
    pwin.document.write ('</OBJECT>');
    
	pwin.document.write('		</td>');
	pwin.document.write('	</tr>');
	pwin.document.write('</table>');
	pwin.document.write('</body></html>');
	pwin.document.close(); 
	
}

function openChat(windowIndex,medewerkerName,medewekerId,klantId) {
	window.open('/chat/chat.php?medewerkerName='+medewerkerName+'&medewerkerId='+medewekerId+'&klantId='+klantId, 'Chatwindow'+windowIndex, 'height=300px,width=420px;');
}
