function displayFlash(flashfile, flashid, flashwidth, flashheight, flashvars, align) {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,19,0" id="'+flashid+'" width="'+flashwidth+'" height="'+flashheight+'" align="'+align+'">\n');
	document.write('<param name="movie" value="'+flashfile+'" />');
	document.write('<param name="bgcolor" value="#FFFFFF" />');
	document.write('<param name="quality" value="best" />');
	document.write('<param name="devicefont" value="true" />');
	document.write('<param name="wmode" value="transparent" />');
	document.write('<param name="allowscriptaccess" value="samedomain" />');
	document.write('<param name="FlashVars" value="'+flashvars+'"/>');
	document.write('<param name="scale" value="noscale" />');
	document.write('<param name="salign" value="l" />');
	document.write('<embed src="'+flashfile+'" quality="best" salign="l" flashVars="'+flashvars+'" width="'+flashwidth+'" height="'+flashheight+'" name="'+flashid+'" align="'+align+'" wmode="transparent" allowScriptAccess="sameDomain" scale="noscale" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /><noembed></noembed></embed>');
	document.write('</object>');
}

function playVideo(videofile,videoid) {
	displayFlash('/net/external/index/VideoPlayer.swf',videoid,450,372,'&video='+videofile,'');
}

function displayFlashResizable(flashfile, flashid, flashwidth, flashheight, flashvars, align) {
	document.write('<div id="div'+flashid+'" style="position:relative; width:'+flashwidth+'px; height:'+flashheight+'px; z-index:1">\n');
	document.write('<table  height="100%" width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td>\n');
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,19,0" id="'+flashid+'" width="100%" height="100%"">\n');
	document.write('<param name="movie" value="'+flashfile+'" />\n');
	document.write('<param name="bgcolor" value="#FFFFFF" />\n');
	document.write('<param name="quality" value="best" />\n');
	document.write('<param name="devicefont" value="true" />\n');
	document.write('<param name="wmode" value="transparent" />\n');
	document.write('<param name="allowscriptaccess" value="samedomain" />\n');
	document.write('<param name="FlashVars" value="'+flashvars+'&id='+flashid+'"/>\n');
	document.write('<param name="scale" value="noscale" />\n');
	document.write('<param name="salign" value="LT" />\n');
	document.write('<embed src="'+flashfile+'" quality="best" salign="LT" flashVars="'+flashvars+'&id='+flashid+'" width="100%" height="100%" name="'+flashid+'" wmode="transparent" allowScriptAccess="sameDomain" scale="noscale" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('<noembed></noembed></embed>\n');
	document.write('</object>\n');
	document.write('</td></tr></table>\n</div>');	
}

function resizeFlash(flashid, newwidth, newheight) {
	if(document.all && !document.getElementById) {
 		document.all['div'+flashid].style.pixelWidth = newwidth;
 		document.all['div'+flashid].style.pixelHeight = newheight;
	} else {
		document.getElementById('div'+flashid).style.width = newwidth;
		document.getElementById('div'+flashid).style.height = newheight;
	}
}

function playMovie(moviefile, movieid, moviewidth, movieheight) {
	document.write('<object id="'+movieid+'" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" type="application/x-oleobject" width="'+moviewidth+'" height="'+movieheight+'">');
	document.write('<param name="FileName" value="'+moviefile+'">');
	document.write('<param name="AutoStart" value="-1">');
	document.write('<param name="ShowStatusBar" value="-1">');
	document.write('<param name="ShowControls" value="1">');
	document.write('<param name="ShowDisplay" value="0">');
	document.write('<param name="AudioStream" value="-1">');
	document.write('<param name="AutoSize" value="1">');
	document.write('<param name="WindowlessVideo" value="1">');
	document.write('<src="'+moviefile+'">');
	document.write('<embed width="'+moviewidth+'" height="'+movieheight+'" filename="'+moviefile+'" autostart="1" showstatusbar="0" showcontrols="1" showdisplay="0">');
	document.write('</embed></object>');
}

function uploadFiles(uploadDirectory, successURL, imagefilterenabled) {
	var _info = navigator.userAgent;
	var _ns = false;
	var _ns6 = false;
	var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0);
	var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0) || (_info.indexOf("AIX") > 0) || (_info.indexOf("OS/2") > 0) || (_info.indexOf("IRIX") > 0)));
	var _ns6 = ((_ns == true) && (_info.indexOf("Mozilla/5") >= 0));
	vusername = "PrT7JmiC4ao=";
	vpassword = "y6Ho613/9ig=";
	vhost = "NZTAs29oNYQKng5eSFPKdpIHDAwaRWW3";
	vkey = "sOwg//pmKGOfChzfIfYOMA==";

	if (_ie == true) {
		document.write('<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="100%" height="250" name="uploadApplet"  codebase="http://java.sun.com/update/1.5.0/jinstall-1_5-windows-i586.cab#Version=5,0,0,7">');
		document.write('<param name="code" value="com.javaatwork.myftpuploader.MyFTPUploader.class">');
		document.write('<param name="archive" value="/net/ZUpload/MyFTPUploader122/myftpuploader-standard-signed-v122.jar, /net/ZUpload/MyFTPUploader122/labels.jar">');
		document.write('<param name="name" value="uploadApplet">');
		document.write('<param name="type" value="application/x-java-applet;version=1.5">');
		document.write('<param name="scriptable" value="false">');

		document.write('<param name="asciiFileExtensions" value="txt, html, htm, xml">');
		document.write('<param name="automaticLogin" value="true">');
		document.write('<param name="userName" value="'+vusername+'">');
		document.write('<param name="password" value="'+vpassword+'">');
		document.write('<param name="host" value="'+vhost+'">');
		document.write('<param name="key" value="'+vkey+'">');
		document.write('<param name="uploadDirectories" value="false">');
		document.write('<param name="uploadDirectory" value="/'+uploadDirectory+'">');
		document.write('<param name="successURL" value="'+successURL+'">');
		document.write('<param name="backgroundColor" value="#ffffff">');
		document.write('<param name="deleteOnCancel" value="true">');
		document.write('<param name="nameConflict" value="overwrite">');
		if (imagefilterenabled == true) {
			document.write('<param name="fileFilter" value="Image files (*.jpg, *.jpeg, *.gif): jpg, jpeg, gif">');
		}
		document.write('<param name="iconAdd" value="http://www.javaatwork.com/images/add.gif">');
		document.write('<param name="iconRemove" value="http://www.javaatwork.com/images/remove.gif">');
		document.write('<param name="iconUpload" value="http://www.javaatwork.com/images/upload.gif">');
		document.write('<param name="maxByteSize" value="500">');
		document.write('<param name="maxFileSize" value="10000">');
		document.write('<param name="rejectFileFilter" value="exe, bat, com, lnk, pif, vbs, asp, aspx">');
		document.write('<param name="serverType" value="ftp">');
		document.write('<param name="showThumbNailsInApplet" value="true">');
		document.write('<param name="showThumbNailsInFileDialog" value="false">');
		document.write('<param name="transferType" value="automatic">');

		document.writeln('</object>');
	} else {
		document.write('<applet name="MyFTPUploader" code="com.javaatwork.myftpuploader.MyFTPUploader.class" archive="/net/ZUpload/MyFTPUploader122/myftpuploader-standard-signed-v122.jar, /net/ZUpload/MyFTPUploader122/labels.jar" width="100%"  height="250">');
		document.write('<param name="asciiFileExtensions" value="txt, html, htm, xml">');
		document.write('<param name="automaticLogin" value="true">');
		document.write('<param name="userName" value="'+vusername+'">');
		document.write('<param name="password" value="'+vpassword+'">');
		document.write('<param name="host" value="'+vhost+'">');
		document.write('<param name="key" value="'+vkey+'">');
		document.write('<param name="uploadDirectories" value="false">');
		document.write('<param name="uploadDirectory" value="/'+uploadDirectory+'">');
		document.write('<param name="successURL" value="'+successURL+'">');
		document.write('<param name="backgroundColor" value="#ffffff">');
		document.write('<param name="deleteOnCancel" value="true">');
		document.write('<param name="nameConflict" value="overwrite">');
		if (imagefilterenabled == true) {
			document.write('<param name="fileFilter" value="Image files (*.jpg, *.jpeg, *.gif): jpg, jpeg, gif">');
		}
		document.write('<param name="iconAdd" value="http://www.javaatwork.com/images/add.gif">');
		document.write('<param name="iconRemove" value="http://www.javaatwork.com/images/remove.gif">');
		document.write('<param name="iconUpload" value="http://www.javaatwork.com/images/upload.gif">');
		document.write('<param name="maxByteSize" value="500">');
		document.write('<param name="maxFileSize" value="10000">');
//		document.write('<param name="maxImageSize" value="500">');
		document.write('<param name="rejectFileFilter" value="exe, bat, com, lnk, pif, vbs, asp, aspx">');
		document.write('<param name="serverType" value="ftp">');
		document.write('<param name="showThumbNailsInApplet" value="true">');
		document.write('<param name="showThumbNailsInFileDialog" value="false">');
		document.write('<param name="transferType" value="automatic">');
		document.write('</applet>');
	}
}

function uploadFilesB(uploadDirectory, successURL, imagefilterenabled, vhost, vusername, vpassword, vkey) {
	var _info = navigator.userAgent;
	var _ns = false;
	var _ns6 = false;
	var _ie = (_info.indexOf("MSIE") > 0 && _info.indexOf("Win") > 0 && _info.indexOf("Windows 3.1") < 0);
	var _ns = (navigator.appName.indexOf("Netscape") >= 0 && ((_info.indexOf("Win") > 0 && _info.indexOf("Win16") < 0 && java.lang.System.getProperty("os.version").indexOf("3.5") < 0) || (_info.indexOf("Sun") > 0) || (_info.indexOf("Linux") > 0) || (_info.indexOf("AIX") > 0) || (_info.indexOf("OS/2") > 0) || (_info.indexOf("IRIX") > 0)));
	var _ns6 = ((_ns == true) && (_info.indexOf("Mozilla/5") >= 0));
	
//	document.writeln(navigator.appName);	

	if (_ie == true) {
		document.write('<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="100%" height="250" name="uploadApplet"  codebase="http://java.sun.com/update/1.5.0/jinstall-1_5-windows-i586.cab#Version=5,0,0,7">');
		document.write('<param name="code" value="com.javaatwork.myftpuploader.MyFTPUploader.class">');
		document.write('<param name="archive" value="/net/ZUpload/MyFTPUploader122/myftpuploader-standard-signed-v122.jar, /net/ZUpload/MyFTPUploader122/labels.jar">');
		document.write('<param name="name" value="uploadApplet">');
		document.write('<param name="type" value="application/x-java-applet;version=1.5">');
		document.write('<param name="scriptable" value="false">');

		document.write('<param name="asciiFileExtensions" value="txt, html, htm, xml">');
		document.write('<param name="automaticLogin" value="true">');
		document.write('<param name="userName" value="'+vusername+'">');
		document.write('<param name="password" value="'+vpassword+'">');
		document.write('<param name="host" value="'+vhost+'">');
		document.write('<param name="key" value="'+vkey+'">');
		document.write('<param name="uploadDirectories" value="false">');
		document.write('<param name="uploadDirectory" value="/'+uploadDirectory+'">');
		document.write('<param name="successURL" value="'+successURL+'">');
		document.write('<param name="backgroundColor" value="#ffffff">');
		document.write('<param name="deleteOnCancel" value="true">');
		document.write('<param name="nameConflict" value="overwrite">');
		if (imagefilterenabled == true) {
			document.write('<param name="fileFilter" value="Image files (*.jpg, *.jpeg, *.gif): jpg, jpeg, gif">');
		}
		document.write('<param name="iconAdd" value="http://www.javaatwork.com/images/add.gif">');
		document.write('<param name="iconRemove" value="http://www.javaatwork.com/images/remove.gif">');
		document.write('<param name="iconUpload" value="http://www.javaatwork.com/images/upload.gif">');
		document.write('<param name="maxByteSize" value="500">');
		document.write('<param name="maxFileSize" value="10000">');
		document.write('<param name="rejectFileFilter" value="exe, bat, com, lnk, pif, vbs, asp, aspx">');
		document.write('<param name="serverType" value="ftp">');
		document.write('<param name="showThumbNailsInApplet" value="true">');
		document.write('<param name="showThumbNailsInFileDialog" value="false">');
		document.write('<param name="transferType" value="automatic">');

		document.writeln('</object>');
	} else {
		document.write('<applet name="MyFTPUploader" code="com.javaatwork.myftpuploader.MyFTPUploader.class" archive="/net/ZUpload/MyFTPUploader122/myftpuploader-standard-signed-v122.jar, /net/ZUpload/MyFTPUploader122/labels.jar" width="100%"  height="250">');
		document.write('<param name="asciiFileExtensions" value="txt, html, htm, xml">');
		document.write('<param name="automaticLogin" value="true">');
		document.write('<param name="userName" value="'+vusername+'">');
		document.write('<param name="password" value="'+vpassword+'">');
		document.write('<param name="host" value="'+vhost+'">');
		document.write('<param name="key" value="'+vkey+'">');
		document.write('<param name="uploadDirectories" value="false">');
		document.write('<param name="uploadDirectory" value="/'+uploadDirectory+'">');
		document.write('<param name="successURL" value="'+successURL+'">');
		document.write('<param name="backgroundColor" value="#ffffff">');
		document.write('<param name="deleteOnCancel" value="true">');
		document.write('<param name="nameConflict" value="overwrite">');
		if (imagefilterenabled == true) {
			document.write('<param name="fileFilter" value="Image files (*.jpg, *.jpeg, *.gif): jpg, jpeg, gif">');
		}
		document.write('<param name="iconAdd" value="http://www.javaatwork.com/images/add.gif">');
		document.write('<param name="iconRemove" value="http://www.javaatwork.com/images/remove.gif">');
		document.write('<param name="iconUpload" value="http://www.javaatwork.com/images/upload.gif">');
		document.write('<param name="maxByteSize" value="500">');
		document.write('<param name="maxFileSize" value="10000">');
//		document.write('<param name="maxImageSize" value="500">');
		document.write('<param name="rejectFileFilter" value="exe, bat, com, lnk, pif, vbs, asp, aspx">');
		document.write('<param name="serverType" value="ftp">');
		document.write('<param name="showThumbNailsInApplet" value="true">');
		document.write('<param name="showThumbNailsInFileDialog" value="false">');
		document.write('<param name="transferType" value="automatic">');
		document.write('</applet>');
	}
}

function openWindow(url,id,w,h) {
	window.open(url,id,'height='+h+',width='+w+',toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,modal=no');
}

function openWindowModal(url,id,w,h) {
	if (window.showModalDialog) {
		window.showModalDialog(url,id,"dialogWidth:"+w+"px;dialogHeight:"+h+"px");
	} else {
		window.open(url,id,'height='+h+',width='+w+',toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no ,modal=yes');
	}
}

function borderize(divid, w) {
	cur = document.getElementById(divid).innerHTML;
	tablewidth = w + 32;
	xwidth = w - 200;
	
	x = '<table cellpadding="0" cellspacing="0" width="'+tablewidth+'">';
	x = x + '<tr><td width="14" height="14"><img src="/net/external/borderize/top-l.png" width="14" height="14"></td><td background="/net/external/borderize/top.png"><img src="/net/images/spacer.gif" width="1" height="1"></td></td><td width="18" height="14"><img src="/net/external/borderize/top-r.png" width="18" height="14"></td></tr>';
	x = x + '<tr><td width="14" background="/net/external/borderize/l.png"><img src="/net/images/spacer.gif" width="1" height="1"></td>';
	x = x + '<td>'+cur+'</td>';
	x = x + '<td width="19" background="/net/external/borderize/r.png"><img src="/net/images/spacer.gif" width="1" height="1"></td></tr>';
	x = x + '<tr><td width="14" height="20"><img src="/net/external/borderize/bottom-l.png" width="14" height="20"></td><td background="/net/external/borderize/bottom.png"><img src="/net/images/spacer.gif" width="1" height="1"></td><td width="18" height="20"><img src="/net/external/borderize/bottom-r.png" width="18" height="20"></td></tr>';
	x = x + '</table>';
	
	
	
	document.getElementById(divid).innerHTML = x;
}

function getPosition(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft;
		curtop = obj.offsetTop;
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		}
	}
	xy = curleft + ',' + curtop;
	xyarr = xy.split(',');
	xyarr[0] = parseInt(xyarr[0]);
	xyarr[1] = parseInt(xyarr[1]);
	
	return xyarr;
}
