function JSONscriptRequest(fullUrl) {
    this.fullUrl = fullUrl; 
    this.noCacheIE = '&noCacheIE=' + (new Date()).getTime();
    this.headLoc = document.getElementsByTagName("head").item(0);
    this.scriptId = 'JscriptId' + JSONscriptRequest.scriptCounter++;
}

JSONscriptRequest.scriptCounter = 1;

JSONscriptRequest.prototype.buildScriptTag = function () {

    this.scriptObj = document.createElement("script");
    
    this.scriptObj.setAttribute("type", "text/javascript");
    this.scriptObj.setAttribute("charset", "utf-8");
    this.scriptObj.setAttribute("src", this.fullUrl + this.noCacheIE);
    this.scriptObj.setAttribute("id", this.scriptId);
}
 
JSONscriptRequest.prototype.removeScriptTag = function () {
    this.headLoc.removeChild(this.scriptObj);  
}

JSONscriptRequest.prototype.addScriptTag = function () {
    this.headLoc.appendChild(this.scriptObj);
}

var outtypetb = new Array() ;
outtypetb[500]="Joint ph. experts group (.jpg,.jfif,.jif,.jpe,.jpeg)";outtypetb[501]="Windows bitmap (.bmp)";outtypetb[502]="Graphics interchange format (.gif)";outtypetb[503]="Truevision TGA (.tga)";outtypetb[504]="Portable network graphics (.png)";outtypetb[505]="Tagged Image File Format (.tif,.tiff)";outtypetb[506]="portable pixmap file format (.pgm)";outtypetb[507]="AVS X image (.avs)";outtypetb[508]="Kodak Cineon Image Format (.cin)";outtypetb[509]="ZSoft IBM PC multi-page Paintbrush (.dcx)";outtypetb[510]="Windows device independent bitmap (.dib)";outtypetb[511]="SMPTE digital moving picture exchange (.dpx)";outtypetb[512]="Flexible Image Transport System (.fits)";outtypetb[513]="Microsoft icon (.ico)";outtypetb[514]="Magick image file format (.miff)";outtypetb[516]="On-the-air Bitmap (.otb)";outtypetb[517]="Portable anymap (.pnm)";outtypetb[518]="Common 2-dimensional bitmap (.pam)";outtypetb[519]="Palm pixmap (.palm)";outtypetb[520]="Portable bitmap format black/white (.pbm)";outtypetb[521]="Xv's Visual Schnauzer thumbnail (.p7)";outtypetb[522]="HP Page Control Language (.pcl)";outtypetb[523]="Photo CD (.pcd)";outtypetb[524]="ZSoft IBM PC Paintbrush file (.pcx)";outtypetb[525]="Apple Macintosh QuickDraw (.pict)";outtypetb[526]="Portable pixmap format - color (.ppm)";outtypetb[528]="Adobe Photoshop bitmap file (.psd)";outtypetb[529]="Photo CD - sRGB color (.pcds)";outtypetb[530]="Irix RGB image (.sgi)";outtypetb[531]="SUN Raster Image (.sun,.ras)";outtypetb[533]="X Windows system bitmap black/white (.xbm)";outtypetb[534]="X Windows system pixmap (.xpm)";outtypetb[535]="CCIR 601 4:1:1 (.yuv)";outtypetb[600]="Windows Metafile (.wmf)";outtypetb[601]="Scalable Vector Graphics (.svg)";outtypetb[602]="Magick Vector Graphics (.mvg)";outtypetb[631]="Enhanced Metafile (.emf)";outtypetb[632]="Encapsulated PostScript (.eps)";outtypetb[634]="OS/2 Metafile (.met)";outtypetb[650]="OpenOffice 2.0 Draw Document (.odg)";outtypetb[651]="OpenOffice 2.0 Draw Template (.otg)";outtypetb[652]="OpenOffice 1.0 Draw Document (.sxd)";outtypetb[653]="OpenOffice 1.0 Draw Template (.std)";outtypetb[1000]="Text files (.txt)";outtypetb[1001]="Text Encoded (.txt)";outtypetb[1002]="Morse code (.txt)";outtypetb[1013]="HyperText Markup Language (.htm,.html)";outtypetb[1014]="XHTML (.xhtml)";outtypetb[1015]="Rich Text Format/MS Word (.rtf)";outtypetb[1016]="Portable Document Format (.pdf)";outtypetb[1017]="Adobe PostScript (.ps)";outtypetb[1021]="OpenOffice 2.0 Text Document (.odt)";outtypetb[1022]="OpenOffice 2.0 Text Template (.ott)";outtypetb[1023]="OpenOffice 1.0 Text Document (.sxw)";outtypetb[1024]="OpenOffice 1.0 Text Template (.stw)";outtypetb[1025]="AportisDoc Palm DB (.pdb)";outtypetb[1029]="PocketWord (.psw)";outtypetb[1030]="Docbook (.xml)";outtypetb[1400]="Microsoft Word 6.0 (.doc)";outtypetb[1401]="Microsoft Word 95 (.doc)";outtypetb[1402]="Microsoft Word 97/2000/XP (.doc)";outtypetb[1403]="MS Word 2003 XML (.xml)";outtypetb[1410]="StarWriter 3.0 (.sdw)";outtypetb[1411]="StarWriter 3.0 Vorlage/Template (.vor)";outtypetb[1412]="StarWriter 4.0 (.sdw)";outtypetb[1413]="StarWriter 4.0 Vorlage/Template (.vor)";outtypetb[1414]="StarWriter 5.0 (.sdw)";outtypetb[1415]="StarWriter 5.0 Vorlage/Template (.vor)";outtypetb[2000]="Text CSV (.csv,.txt)";outtypetb[2001]="Data Interchange Format (.dif)";outtypetb[2002]="dBASE (.dbf)";outtypetb[2006]="SYLK (.slk)";outtypetb[2007]="Lotus 1-2-3 (.wk1)";outtypetb[2200]="Microsoft Excel 5.0 (.xls)";outtypetb[2201]="Microsoft Excel 5.0 Template (.xlt)";outtypetb[2202]="Microsoft Excel 95 (.xls)";outtypetb[2203]="Microsoft Excel 95 Template (.xlt)";outtypetb[2204]="Microsoft Excel 97/2000/XP (.xls)";outtypetb[2205]="Microsoft Excel 97/2000/XP Template (.xlt)";outtypetb[2206]="MS Excel 2003 XML (.xml)";outtypetb[2210]="StarCalc 3.0 (.sdc)";outtypetb[2211]="StarCalc 3.0 Template (.vor)";outtypetb[2212]="StarCalc 4.0 (.sdc)";outtypetb[2213]="StarCalc 4.0 Template (.vor)";outtypetb[2214]="StarCalc 5.0 (.sdc)";outtypetb[2215]="StarCalc 5.0 Template (.vor)";outtypetb[2216]="StarOffice 6.0 Spreadsheet (.sxc)";outtypetb[2217]="StarOffice 6.0 Spreadsheet Template (.stc)";outtypetb[2220]="OpenOffice 2.0 spreadsheet (.ods)";outtypetb[2221]="OpenOffice 2.0 calc template (.ots)";outtypetb[2222]="OpenOffice 1.0 spreadsheet (.sxc)";outtypetb[2223]="OpenOffice 1.0 calc template (.stc)";outtypetb[2900]="MathML (.mml)";outtypetb[2902]="StarMath 5.0 (.smf)";outtypetb[2990]="OpenOffice 2.0 Math (.odf)";outtypetb[2991]="OpenOffice 1.0 Math (.sxm)";outtypetb[3002]="Microsoft PowerPoint 97/2000/XP (.ppt)";outtypetb[3003]="MS PowerPoint 97/2000/XP Template (.pot)";outtypetb[3004]="StarImpress 5.0 (.sdd)";outtypetb[3005]="StarImpress 5.0 Template (.vor)";outtypetb[3006]="StarImpress 4.0 (.sdd)";outtypetb[3007]="StarImpress 4.0 Template (.vor)";outtypetb[3500]="OpenOffice 2.0 Impress (.odp)";outtypetb[3501]="OpenOffice 2.0 Impress Template (.otp)";outtypetb[3502]="OpenOffice 1.0 Impress (.sxi)";outtypetb[3503]="OpenOffice 1.0 Impress Template (.sti)";
var intypetb = new Array() ;
intypetb['123']=[1,2007];
intypetb['avs']=[1,507];
intypetb['bmp']=[1,501];
intypetb['cgm']=[1,633];
intypetb['cin']=[1,508];
intypetb['dbf']=[1,2002];
intypetb['dcx']=[1,509];
intypetb['dib']=[1,510];
intypetb['dif']=[1,2001];
intypetb['doc']=[1,1018];
intypetb['dot']=[1,1019];
intypetb['dpx']=[1,511];
intypetb['dxf']=[1,630];
intypetb['emf']=[1,631];
intypetb['eps']=[1,632];
intypetb['fits']=[1,512];
intypetb['gif']=[1,502];
intypetb['htm']=[1,1013];
intypetb['html']=[1,1013];
intypetb['ico']=[1,513];
intypetb['jfif']=[1,500];
intypetb['jif']=[1,500];
intypetb['jpe']=[1,500];
intypetb['jpeg']=[1,500];
intypetb['jpg']=[1,500];
intypetb['met']=[1,634];
intypetb['miff']=[1,514];
intypetb['mml']=[1,2900];
intypetb['mvg']=[1,602];
intypetb['odf']=[1,2990];
intypetb['odg']=[1,650];
intypetb['odp']=[1,3500];
intypetb['ods']=[1,2220];
intypetb['odt']=[1,1021];
intypetb['otb']=[1,516];
intypetb['otg']=[1,651];
intypetb['otp']=[1,3501];
intypetb['ots']=[1,2221];
intypetb['ott']=[1,1022];
intypetb['p7']=[1,521];
intypetb['palm']=[1,519];
intypetb['pbm']=[1,520];
intypetb['pcd']=[1,523];
intypetb['pcds']=[1,529];
intypetb['pcx']=[1,524];
intypetb['pdb']=[1,1025];
intypetb['pdf']=[1,1016];
intypetb['pgm']=[1,506];
intypetb['pict']=[1,525];
intypetb['png']=[1,504];
intypetb['pnm']=[1,517];
intypetb['pot']=[1,3001];
intypetb['ppm']=[1,526];
intypetb['ppt']=[1,3000];
intypetb['ps']=[1,1017];
intypetb['psd']=[1,528];
intypetb['psw']=[1,1029];
intypetb['pxl']=[1,2005];
intypetb['ras']=[1,531];
intypetb['rle']=[1,527];
intypetb['rtf']=[1,1015];
intypetb['sdc']=[1,2009];
intypetb['sdd']=[2,3004,3006];
intypetb['sdw']=[1,1026];
intypetb['sgi']=[1,530];
intypetb['slk']=[1,2006];
intypetb['smf']=[1,2901];
intypetb['stc']=[1,2223];
intypetb['std']=[1,653];
intypetb['sti']=[1,3503];
intypetb['stw']=[1,1024];
intypetb['sun']=[1,531];
intypetb['svg']=[1,601];
intypetb['sxc']=[1,2222];
intypetb['sxd']=[1,652];
intypetb['sxi']=[1,3502];
intypetb['sxm']=[1,2991];
intypetb['sxw']=[1,1023];
intypetb['tga']=[1,503];
intypetb['tif']=[1,505];
intypetb['tiff']=[1,505];
intypetb['txt']=[1,1000];
intypetb['url']=[1,1012];
intypetb['vor']=[4,1027,2010,3005,3007];
intypetb['wb2']=[1,2008];
intypetb['wk1']=[1,2007];
intypetb['wmf']=[1,600];
intypetb['wpd']=[1,1031];
intypetb['xbm']=[1,533];
intypetb['xhtml']=[1,1014];
intypetb['xls']=[1,2003];
intypetb['xlt']=[1,2004];
intypetb['xml']=[1,1403];
intypetb['xpm']=[1,534];
intypetb['yuv']=[1,535];

var exttypetb = new Array() ;
exttypetb[100]=[1,2,3,4,6,7,8,9,11,15,20,22,30,31,32,33,34,35,36,37,38,39,40,41];
exttypetb[199]=[198,199];
exttypetb[200]=[200,201,202,204,206,210,211,212,213,214,215,216,216,217,217,218];
exttypetb[500]=[500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,516,517,518,519,520,521,522,523,524,525,526,528,529,530,531,533,534,535];
exttypetb[600]=[600,601,602];
exttypetb[4000]=[4000,4002,4003,4005,4006,4009,4010,4013,4028];
exttypetb[5000]=[5000,5001,5002,5004,5005,5007,5008,5014,5015,5016,5018,5020,5021,5030,5031,5100];

exttypetb['offoutwriter']=[1013,1014,1015,1016,1025,1029,1030,1400,1401,1402,1403,1410,1411,1412,1413,1414,1415] ;
exttypetb['offoutcalc']=[1013,1014,1016,2000,2001,2002,2006,2007,2200,2201,2202,2203,2204,2205,2206,2210,2211,2212,2213,2214,2215,2216,2217,2222,2223] ;
exttypetb['offoutdraw']=[500,501,502,504,505,506,520,526,601,631,632,634,1013,1014,1016] ;
exttypetb['offoutimpress']=[1013,1014,1016,3002,3003,3004,3005,3006,3007] ;
exttypetb['offoutmath']=[1016,2900,2902,2990,2991] ;
exttypetb['offinwriter']=[1000,1013,1014,1015,1018,1019,1025,1026,1027,1029,1031,1403] ;
exttypetb['offincalc']=[1013,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010] ;
exttypetb['offindraw']=[500,501,502,503,504,505,506,520,523,524,526,528,531,600,630,631,632,634] ;
exttypetb['offinimpress']=[633,3000,3001,3004,3005,3006,3007] ;
exttypetb['offinmath']=[2900,2901] ;

function setintype(sel) { var t = new Array(); 
sel.options[0] = new Option('---- Image ----','');
sel.options[1]= new Option('Adobe Photoshop bitmap file (psd)','528');
sel.options[2]= new Option('Apple Macintosh QuickDraw (pict)','525');
sel.options[3]= new Option('AVS X image (avs)','507');
sel.options[4]= new Option('CCIR 601 4:1:1 (yuv)','535');
sel.options[5]= new Option('Flexible Image Transport System (fits)','512');
sel.options[6]= new Option('Graphics interchange format (gif)','502');
sel.options[7]= new Option('Irix RGB image (sgi)','530');
sel.options[8] = new Option('Joint ph. experts group (.jfif,.jif,.jpe,.jpeg,.jpg)','500');
sel.options[9]= new Option('Kodak Cineon Image Format (cin)','508');
sel.options[10]= new Option('Magick image file format (miff)','514');
sel.options[11]= new Option('Microsoft icon (ico)','513');
sel.options[12]= new Option('On-the-air Bitmap (otb)','516');
sel.options[13]= new Option('Palm pixmap (palm)','519');
sel.options[14]= new Option('Photo CD (pcd)','523');
sel.options[15]= new Option('Photo CD - sRGB color (pcds)','529');
sel.options[16]= new Option('Portable anymap (pnm)','517');
sel.options[17]= new Option('Portable bitmap format black/white (pbm)','520');
sel.options[18]= new Option('Portable network graphics (png)','504');
sel.options[19]= new Option('portable pixmap file format (pgm)','506');
sel.options[20]= new Option('Portable pixmap format - color (ppm)','526');
sel.options[21]= new Option('SMPTE digital moving picture exchange (dpx)','511');
sel.options[22] = new Option('SUN Raster Image (.ras,.sun)','531');
sel.options[23] = new Option('Tagged Image File Format (.tif,.tiff)','505');
sel.options[24]= new Option('Truevision TGA (tga)','503');
sel.options[25]= new Option('Utah RLE encoded image (rle)','527');
sel.options[26]= new Option('Windows bitmap (bmp)','501');
sel.options[27]= new Option('Windows device independent bitmap (dib)','510');
sel.options[28]= new Option('X Windows system bitmap black/white (xbm)','533');
sel.options[29]= new Option('X Windows system pixmap (xpm)','534');
sel.options[30]= new Option('Xv\'s Visual Schnauzer thumbnail (p7)','521');
sel.options[31]= new Option('ZSoft IBM PC multi-page Paintbrush (dcx)','509');
sel.options[32]= new Option('ZSoft IBM PC Paintbrush file (pcx)','524');
sel.options[33] = new Option('---- Vector Document ----','');
sel.options[34]= new Option('Magick Vector Graphics (mvg)','602');
sel.options[35]= new Option('Scalable Vector Graphics (svg)','601');
sel.options[36]= new Option('Windows Metafile (wmf)','600');
sel.options[37] = new Option('---- Vector Document ----','');
sel.options[38]= new Option('AutoCAD Interchange Format (dxf)','630');
sel.options[39]= new Option('Computer Graphics Metafile (cgm)','633');
sel.options[40]= new Option('Encapsulated PostScript (eps)','632');
sel.options[41]= new Option('Enhanced Metafile (emf)','631');
sel.options[42]= new Option('OpenOffice 1.0 Draw Document (sxd)','652');
sel.options[43]= new Option('OpenOffice 1.0 Draw Template (std)','653');
sel.options[44]= new Option('OpenOffice 2.0 Draw Document (odg)','650');
sel.options[45]= new Option('OpenOffice 2.0 Draw Template (otg)','651');
sel.options[46]= new Option('OS/2 Metafile (met)','634');
sel.options[47] = new Option('---- Text Document ----','');
sel.options[48]= new Option('Adobe PostScript (ps)','1017');
sel.options[49]= new Option('AportisDoc Palm DB (pdb)','1025');
sel.options[50] = new Option('HyperText Markup Language (.htm,.html)','1013');
sel.options[51]= new Option('Microsoft Word (doc)','1018');
sel.options[52]= new Option('MS Word 2003 XML (xml)','1403');
sel.options[53]= new Option('MS Word template (dot)','1019');
sel.options[54]= new Option('OpenOffice 1.0 Text Document (sxw)','1023');
sel.options[55]= new Option('OpenOffice 1.0 Text Template (stw)','1024');
sel.options[56]= new Option('OpenOffice 2.0 Text Document (odt)','1021');
sel.options[57]= new Option('OpenOffice 2.0 Text Template (ott)','1022');
sel.options[58]= new Option('PocketWord (psw)','1029');
sel.options[59]= new Option('Portable Document Format (pdf)','1016');
sel.options[60]= new Option('Rich Text Format/MS Word (rtf)','1015');
sel.options[61]= new Option('StarWriter (sdw)','1026');
sel.options[62]= new Option('StarWriter Vorlage/Template (vor)','1027');
sel.options[63]= new Option('Text files (txt)','1000');
sel.options[64]= new Option('Website screenshot (url)','1012');
sel.options[65]= new Option('WordPerfect 6 (wpd)','1031');
sel.options[66]= new Option('XHTML (xhtml)','1014');
sel.options[67] = new Option('---- Data ----','');
sel.options[68]= new Option('Data Interchange Format (dif)','2001');
sel.options[69]= new Option('dBASE (dbf)','2002');
sel.options[70] = new Option('Lotus 1-2-3 (.123,.wk1)','2007');
sel.options[71]= new Option('Microsoft Excel (xls)','2003');
sel.options[72]= new Option('MS Excel Vorlage/Template (xlt)','2004');
sel.options[73]= new Option('OpenOffice 1.0 calc template (stc)','2223');
sel.options[74]= new Option('OpenOffice 1.0 spreadsheet (sxc)','2222');
sel.options[75]= new Option('OpenOffice 2.0 calc template (ots)','2221');
sel.options[76]= new Option('OpenOffice 2.0 spreadsheet (ods)','2220');
sel.options[77]= new Option('Pocket Excel (pxl)','2005');
sel.options[78]= new Option('Quattro Pro 6.0 (wb2)','2008');
sel.options[79]= new Option('StarCalc (sdc)','2009');
sel.options[80]= new Option('StarCalc Template (vor)','2010');
sel.options[81]= new Option('SYLK (slk)','2006');
sel.options[82] = new Option('---- Mathematics ----','');
sel.options[83]= new Option('MathML (mml)','2900');
sel.options[84]= new Option('OpenOffice 1.0 Math (sxm)','2991');
sel.options[85]= new Option('OpenOffice 2.0 Math (odf)','2990');
sel.options[86]= new Option('StarMath (smf)','2901');
sel.options[87] = new Option('---- Presentation ----','');
sel.options[88]= new Option('Microsoft PowerPoint (ppt)','3000');
sel.options[89]= new Option('Microsoft PowerPoint Template (pot)','3001');
sel.options[90]= new Option('OpenOffice 1.0 Impress (sxi)','3502');
sel.options[91]= new Option('OpenOffice 1.0 Impress Template (sti)','3503');
sel.options[92]= new Option('OpenOffice 2.0 Impress (odp)','3500');
sel.options[93]= new Option('OpenOffice 2.0 Impress Template (otp)','3501');
sel.options[94]= new Option('StarImpress 4.0 (sdd)','3006');
sel.options[95]= new Option('StarImpress 4.0 Template (vor)','3007');
sel.options[96]= new Option('StarImpress 5.0 (sdd)','3004');
sel.options[97]= new Option('StarImpress 5.0 Template (vor)','3005');

 }
function setouttype(sel) { var t = new Array(); 
sel.options[0] = new Option('---- Image ----','');
sel.options[1]= new Option('Adobe Photoshop bitmap file (psd)','528');
sel.options[2]= new Option('Apple Macintosh QuickDraw (pict)','525');
sel.options[3]= new Option('AVS X image (avs)','507');
sel.options[4]= new Option('CCIR 601 4:1:1 (yuv)','535');
sel.options[5]= new Option('Common 2-dimensional bitmap (pam)','518');
sel.options[6]= new Option('Flexible Image Transport System (fits)','512');
sel.options[7]= new Option('Graphics interchange format (gif)','502');
sel.options[8]= new Option('HP Page Control Language (pcl)','522');
sel.options[9]= new Option('Irix RGB image (sgi)','530');
sel.options[10] = new Option('Joint ph. experts group (.jfif,.jif,.jpe,.jpeg,.jpg)','500');
sel.options[11]= new Option('Kodak Cineon Image Format (cin)','508');
sel.options[12]= new Option('Magick image file format (miff)','514');
sel.options[13]= new Option('Microsoft icon (ico)','513');
sel.options[14]= new Option('On-the-air Bitmap (otb)','516');
sel.options[15]= new Option('Palm pixmap (palm)','519');
sel.options[16]= new Option('Photo CD (pcd)','523');
sel.options[17]= new Option('Photo CD - sRGB color (pcds)','529');
sel.options[18]= new Option('Portable anymap (pnm)','517');
sel.options[19]= new Option('Portable bitmap format black/white (pbm)','520');
sel.options[20]= new Option('Portable network graphics (png)','504');
sel.options[21]= new Option('portable pixmap file format (pgm)','506');
sel.options[22]= new Option('Portable pixmap format - color (ppm)','526');
sel.options[23]= new Option('SMPTE digital moving picture exchange (dpx)','511');
sel.options[24] = new Option('SUN Raster Image (.ras,.sun)','531');
sel.options[25] = new Option('Tagged Image File Format (.tif,.tiff)','505');
sel.options[26]= new Option('Truevision TGA (tga)','503');
sel.options[27]= new Option('Windows bitmap (bmp)','501');
sel.options[28]= new Option('Windows device independent bitmap (dib)','510');
sel.options[29]= new Option('X Windows system bitmap black/white (xbm)','533');
sel.options[30]= new Option('X Windows system pixmap (xpm)','534');
sel.options[31]= new Option('Xv\'s Visual Schnauzer thumbnail (p7)','521');
sel.options[32]= new Option('ZSoft IBM PC multi-page Paintbrush (dcx)','509');
sel.options[33]= new Option('ZSoft IBM PC Paintbrush file (pcx)','524');
sel.options[34] = new Option('---- Vector Document ----','');
sel.options[35]= new Option('Magick Vector Graphics (mvg)','602');
sel.options[36]= new Option('Scalable Vector Graphics (svg)','601');
sel.options[37]= new Option('Windows Metafile (wmf)','600');
sel.options[38] = new Option('---- Vector Document ----','');
sel.options[39]= new Option('Encapsulated PostScript (eps)','632');
sel.options[40]= new Option('Enhanced Metafile (emf)','631');
sel.options[41]= new Option('OpenOffice 1.0 Draw Document (sxd)','652');
sel.options[42]= new Option('OpenOffice 1.0 Draw Template (std)','653');
sel.options[43]= new Option('OpenOffice 2.0 Draw Document (odg)','650');
sel.options[44]= new Option('OpenOffice 2.0 Draw Template (otg)','651');
sel.options[45]= new Option('OS/2 Metafile (met)','634');
sel.options[46] = new Option('---- Text Document ----','');
sel.options[47]= new Option('Adobe PostScript (ps)','1017');
sel.options[48]= new Option('AportisDoc Palm DB (pdb)','1025');
sel.options[49]= new Option('Docbook (xml)','1030');
sel.options[50] = new Option('HyperText Markup Language (.htm,.html)','1013');
sel.options[51]= new Option('Microsoft Word 6.0 (doc)','1400');
sel.options[52]= new Option('Microsoft Word 95 (doc)','1401');
sel.options[53]= new Option('Microsoft Word 97/2000/XP (doc)','1402');
sel.options[54]= new Option('Morse code (txt)','1002');
sel.options[55]= new Option('MS Word 2003 XML (xml)','1403');
sel.options[56]= new Option('OpenOffice 1.0 Text Document (sxw)','1023');
sel.options[57]= new Option('OpenOffice 1.0 Text Template (stw)','1024');
sel.options[58]= new Option('OpenOffice 2.0 Text Document (odt)','1021');
sel.options[59]= new Option('OpenOffice 2.0 Text Template (ott)','1022');
sel.options[60]= new Option('PocketWord (psw)','1029');
sel.options[61]= new Option('Portable Document Format (pdf)','1016');
sel.options[62]= new Option('Rich Text Format/MS Word (rtf)','1015');
sel.options[63]= new Option('StarWriter 3.0 (sdw)','1410');
sel.options[64]= new Option('StarWriter 3.0 Vorlage/Template (vor)','1411');
sel.options[65]= new Option('StarWriter 4.0 (sdw)','1412');
sel.options[66]= new Option('StarWriter 4.0 Vorlage/Template (vor)','1413');
sel.options[67]= new Option('StarWriter 5.0 (sdw)','1414');
sel.options[68]= new Option('StarWriter 5.0 Vorlage/Template (vor)','1415');
sel.options[69]= new Option('Text Encoded (txt)','1001');
sel.options[70]= new Option('Text files (txt)','1000');
sel.options[71]= new Option('XHTML (xhtml)','1014');
sel.options[72] = new Option('---- Data ----','');
sel.options[73]= new Option('Data Interchange Format (dif)','2001');
sel.options[74]= new Option('dBASE (dbf)','2002');
sel.options[75]= new Option('Lotus 1-2-3 (wk1)','2007');
sel.options[76]= new Option('Microsoft Excel 5.0 (xls)','2200');
sel.options[77]= new Option('Microsoft Excel 5.0 Template (xlt)','2201');
sel.options[78]= new Option('Microsoft Excel 95 (xls)','2202');
sel.options[79]= new Option('Microsoft Excel 95 Template (xlt)','2203');
sel.options[80]= new Option('Microsoft Excel 97/2000/XP (xls)','2204');
sel.options[81]= new Option('Microsoft Excel 97/2000/XP Template (xlt)','2205');
sel.options[82]= new Option('MS Excel 2003 XML (xml)','2206');
sel.options[83]= new Option('OpenOffice 1.0 calc template (stc)','2223');
sel.options[84]= new Option('OpenOffice 1.0 spreadsheet (sxc)','2222');
sel.options[85]= new Option('OpenOffice 2.0 calc template (ots)','2221');
sel.options[86]= new Option('OpenOffice 2.0 spreadsheet (ods)','2220');
sel.options[87]= new Option('StarCalc 3.0 (sdc)','2210');
sel.options[88]= new Option('StarCalc 3.0 Template (vor)','2211');
sel.options[89]= new Option('StarCalc 4.0 (sdc)','2212');
sel.options[90]= new Option('StarCalc 4.0 Template (vor)','2213');
sel.options[91]= new Option('StarCalc 5.0 (sdc)','2214');
sel.options[92]= new Option('StarCalc 5.0 Template (vor)','2215');
sel.options[93]= new Option('StarOffice 6.0 Spreadsheet (sxc)','2216');
sel.options[94]= new Option('StarOffice 6.0 Spreadsheet Template (stc)','2217');
sel.options[95]= new Option('SYLK (slk)','2006');
sel.options[96] = new Option('Text CSV (.csv,.txt)','2000');
sel.options[97] = new Option('---- Mathematics ----','');
sel.options[98]= new Option('MathML (mml)','2900');
sel.options[99]= new Option('OpenOffice 1.0 Math (sxm)','2991');
sel.options[100]= new Option('OpenOffice 2.0 Math (odf)','2990');
sel.options[101]= new Option('StarMath 5.0 (smf)','2902');
sel.options[102] = new Option('---- Presentation ----','');
sel.options[103]= new Option('Microsoft PowerPoint 97/2000/XP (ppt)','3002');
sel.options[104]= new Option('MS PowerPoint 97/2000/XP Template (pot)','3003');
sel.options[105]= new Option('OpenOffice 1.0 Impress (sxi)','3502');
sel.options[106]= new Option('OpenOffice 1.0 Impress Template (sti)','3503');
sel.options[107]= new Option('OpenOffice 2.0 Impress (odp)','3500');
sel.options[108]= new Option('OpenOffice 2.0 Impress Template (otp)','3501');
sel.options[109]= new Option('StarImpress 4.0 (sdd)','3006');
sel.options[110]= new Option('StarImpress 4.0 Template (vor)','3007');
sel.options[111]= new Option('StarImpress 5.0 (sdd)','3004');
sel.options[112]= new Option('StarImpress 5.0 Template (vor)','3005');

 }
exttypetb[1000] = [1001,1002] ;
exttypetb[1001] = [1000] ;
exttypetb[1015] = [1016,1017] ;
exttypetb[1016] = [1000,1015,1017,5100] ;
exttypetb[1017] = [1016,505] ;
exttypetb[1018] = [1000,1016,1017] ;
exttypetb[2003] = [1016,1017] ;
exttypetb[6000] = [2200,2202,2204] ;
// exttypetb[3000] = [1016,1017] ;

exttypetb['writerlist'] = [1021,1022,1023,1024] ;
exttypetb['calclist'] = [2220,2221,2222,2223] ;
exttypetb['drawlist'] = [650,651,652,653] ;
exttypetb['impresslist'] = [3500,3501,3502,3503] ;
exttypetb['mathlist'] = [2990,2991] ;
exttypetb[500].push(632);
exttypetb[5000].push(1);
exttypetb[5000].push(4);
exttypetb[5000].push(7);
exttypetb[5000].push(500);
exttypetb[100].push(5000);
exttypetb['offoutimpress'].push('5100A1016');
outtypetb['5100A1016'] = 'SWF Flash Animation';
exttypetb['offoutimpress'].push('5000A1016');
outtypetb['5000A1016'] = 'WMV Windows Media Video';
exttypetb['offoutimpress'].push('5001A1016');
outtypetb['5001A1016'] = '3GP Video';
exttypetb['offoutimpress'].push('5004A1016');
outtypetb['5004A1016'] = 'MOV Quicktime Video';
exttypetb['offoutimpress'].push('5002A1016');
outtypetb['5002A1016'] = 'AVI Video';
outtypetb['5008A1016'] = 'FLV Video';
exttypetb['offoutimpress'].push('5008A1016');

var IE4 = document.all;
var NN7 = (!IE4 && document.getElementById);
var IE5 = (IE4 && navigator.userAgent.indexOf("Mac") == -1 && (navigator.userAgent.indexOf("MSIE 5") != -1 || navigator.userAgent.indexOf("MSIE 4") != -1));
if (IE4 && navigator.userAgent.indexOf("Opera") != -1) {
	NN7 = true;
	IE4 = false;
}
var safari = (navigator.userAgent.indexOf("Safari") != -1);

function getObject(obj) {
	return (IE4?document.all[obj]:document.getElementById(obj));
}

var progresscall = 0; var progressstart = 0; var progressset = 1; var pg_end = 0; var pg_status = 0; var pg_kb = 0; var pg_percent = 0; var sv_call = '';
function svinit() { progressset=0; progresscall=0; pg_status=0; }
function mcprogress(srv,sid,lg) {
 if (srv == sv_call) {} else { return; }
 progresscall=progresscall+1;
 var req  = 'http://'+srv+'/mcpjs.php?sessionid='+sid; 
 jreq = new JSONscriptRequest(req); 
 jreq.buildScriptTag(); 
 jreq.addScriptTag();
 var pbar = ''; 
 if (pg_kb>0) { progressstart = 1; }
 if (pg_status==1) { pbar = MSG['UPL_ERR']; svinit(); }
 if (pg_status==2) { pbar = MSG['UPL_OVL']; svinit(); }
 if (pg_status==3) { pbar = MSG['UPL_OVS']; svinit(); }
 if (pg_percent>0) { pg_percent=Math.round(pg_percent);
		 pbar = MSG['UPL_PG']+'<br/><table width=400px style="border: solid 1px #800808;text-align:center"><tr><td width=100% class=tdpgbar>'+pg_percent+' %</td></tr><tr><td width=100% align=left><table width='+pg_percent+'%><tr><td width=100% bgcolor="#FF0000" style="height:2px" ></td></tr></table></td></tr></table><br/>'+MSG['UPLOAD']+'<br>'; }
	if (pg_end==1) { progressset=0;	
		 pbar = '<table width=400px style="border: solid 1px #800808;text-align:center"><tr><td width=100% class=tdpgbar>100 %</td></tr><tr><td width=100% align=left><table width=100%><tr><td width=100% bgcolor="#FF0000" style="height:2px" ></td></tr></table></td></tr></table><a href="http://'+srv+'/'+lg+'/index.php?pg=envoi&sid='+sid+'">'+MSG['UPL_RDI']+'</a><br/>';	}
	if (progresscall>5 && progressstart==0) { pbar = MSG['UPL_SHS']; svinit(); }
	if (progressset==1) { setTimeout("mcprogress('"+srv+"','"+sid+"','"+lg+"')",5000); }
	if (pbar != '') {	 document.getElementById("pgbar").innerHTML = '<center>'+pbar+'</center>'; }
}
function rasid() { 
 var chars = "0123456789abcdefghiklmnopqrstuvwxyz";
 var ssid=''; 
 for (var i=0; i<26; i++) { var rnum = Math.floor(Math.random() * chars.length); ssid += chars.substring(rnum,rnum+1); }
 return ssid;
}
function p_startupload(formu,lang)
{
	var surl = '';
	var srv = getsv(formu);
	surl = rasid(); formu.sid.value = surl; 
	formu.action = 'http://'+srv+'/cgi-bin/mcupload_rd.cgi?sid=' + surl +'&lg=' + lang;
	formu.format1.disabled=false;	
	setTimeout("mcprogress('"+srv+"','"+surl+"','"+lang+"')",2000);
	document.getElementById('pgbar').innerHTML='<center><img src="http://media-convert.com/images/progress.gif" border=0 alt=""></center>';
	formu.submit();
}

function checkurl(chaine)
{
 var tomatch0= /\.(7z|3gp|aac|amr|amv|asf|avi|bmp|doc|dv|exe|js|flv|gif|ico|jpg|mid|midi|mkv|mmf|mov|mp4|mpc|mpg|pps|pdf|ps|psd|ra|ram|rm|qcp|tga|tar|tif|tgz|vob|wma|wmv|zip)[\s]*$/i
 if (tomatch0.test(chaine))
 {
 return false; 
 }
 var tomatch= /http:\/\/[A-Za-z0-9\.-]{3,}\.[A-Za-z]{2,5}/
 if (tomatch.test(chaine))
 {
 return true;
 }
 else
 {
 return false; 
}
}

function checkurl2(chaine)
{

 var tomatch= /http:\/\/[A-Za-z0-9\.-]{3,}\.[A-Za-z]{2,5}/
 if (tomatch.test(chaine))
 {
 return true;
 }
 else
 {
 return false; 
}
}

function indexByName(obj,valeur) {
	for (var i = 0 ; i < obj.options.length ; i++ ) {	
		if ( obj.options[i].value == valeur ) {
			return i;
		}
	}
	return 0;
}

function testchamps2(formulaire) {
  var fname ;
  var sel = 0 ;
  var extname ;
	var selbox = formulaire.format1 ;

  fname = formulaire.fichier.value ;
  extname = fname.substring( fname.lastIndexOf('.') + 1 , fname.length ).toLowerCase() ;
	if (typeof(intypetb[extname]) != 'undefined') {
  if ( intypetb[extname][0] > 0 ) {
  	formulaire.format1.selectedIndex = indexByName(formulaire.format1 ,intypetb[extname][1]) ;
  	if ( intypetb[extname][0] > 1 ) alert( MSG['MULTI-FORMAT'] ) ;
  	sel = 1 ;	
  }	
	}
  if (sel==1)	setoutput(formulaire.format1.value,formulaire.format2) ;
return true ;
}

function checkurlext(formulaire,doc) {
  var fname ;
  var sel = 0 ;
  var extname = '' ;
	var selbox = formulaire.format1 ;
  fname = formulaire.urlin.value ;
	if (extname!='') {} else {
  extname = fname.substring( fname.lastIndexOf('.') + 1 , fname.length ).toLowerCase() ;
	}
	if (typeof(intypetb[extname]) != 'undefined') {
  if ( intypetb[extname][0] > 0 ) {
  	formulaire.format1.selectedIndex = indexByName(formulaire.format1 ,intypetb[extname][1]) ;
  	if ( intypetb[extname][0] > 1 ) alert( MSG['MULTI-FORMAT'] ) ;
  	sel = 1 ;	
  }	
	}
  if (sel==1)	{
		setoutput(formulaire.format1.value,formulaire.format2) ;
	  setoptions(formulaire.format2,formulaire.option1,formulaire.format1,formulaire,doc);
	}
return true ;
}

function setoptions(selformat,seloption,selformat1,formu,doc) {
  var affoptions = 0;
	objopt = document.getElementById("homeoptions");
	objopt.innerHTML='';
	var htmlopt = '';
	if (selformat1.value >= 5000 && selformat1.value < 6000) {
	 		htmlopt += '<tr><td>&nbsp;<input type=checkbox onclick=\'checkcmjoin(this)\' name=cmjoin>&nbsp;<b>'+MSG['JS_MJ']+'</b></td><td><div id="divcmjbt"></div></td></tr><tr><td colspan=2><div id="divcmjoin"></div></td></tr>'; }	
	if (selformat.value == 5031 ) {
	  htmlopt +='<tr><td>'+MSG['FORMAT']+'</td><td><select name=option1><option value=0 default>320x240 4/3</option><option value=1>320x180 16/9</option></select></td></tr>';	} 		
	if (selformat.value == 5030) {
	  htmlopt +='<tr><td>'+MSG['FORMAT']+'</td><td><select name=option1><option value=0 default>H264 320x240 4/3 - 768kbit</option><option value=1 >H264 320x180 16/9 - 768kbit</option><option value=2 >MPEG4 480x480 - 2500kbit</option><option value=3 >H264 640x480 - (TV out)</option></select></td></tr>';			} 		
	if (selformat.value == 5016 ) {
	  htmlopt +='<tr><td>'+MSG['JS_RESIZE_TO']+' [16x16 > 640x480]</td><td><input size=3 type=text name=taillex>x<input size=3 type=text name=tailley></td></tr>';			 		
	  htmlopt +='<tr><td>Frames/second [1 > 15]</td><td><input type=text size=3 name=v_fps></td></tr>';	} 	
	if (selformat.value >= 5000 && selformat.value < 6000  && selformat.value != 5016 && selformat.value != 5031 && selformat.value != 5005 && selformat1.value != 1016) {
	  htmlopt +='<tr><td>'+MSG['FPS']+' [4 > 30]</td><td><input type=text size=3 name=v_fps></td></tr>' ; } 	
	if (selformat.value >= 5000 && selformat.value < 6000  && selformat1.value >=5000 && selformat1.value < 6000) {
		htmlopt +='<tr><td>'+MSG['JS_AMR_ALL']+' <input type=radio name=v_split value=0 checked> '+MSG['JS_AMR_SPLIT']+' <input type=radio name=v_split value=1></td><td><input type=text length=8 name=v_start value="00:00:00"> ==> <input type=text length=8 name=v_end value="00:00:00"> [HH:MM:SS]</td></tr>';	
		} 	
	if (selformat.value >= 5000 && selformat.value < 6000  && selformat1.value >=5000 && selformat1.value < 6000 && (selformat.value != 5016 && selformat.value != 5018)) {
		htmlopt +='<tr><td>Audio Sync. [-5000 > +5000ms]</td><td><input type=text value="0" name=v_shift></td></tr>';
		} 				
	if (((selformat.value >= 5000 && selformat.value < 6000) || selformat.value<500)  && selformat1.value >=5000 && selformat1.value < 6000 && (selformat.value != 5016 && selformat.value != 5018)) {
		htmlopt +='<tr><td>'+MSG['VOL']+'</td><td><select name=v_vol><option selected value=1>+0</option><option value=2>+1</option><option value=3>+2</option><option value=-2>-1</option><option value=-3>-2</option></select></td></tr>';
		} 				
	if (selformat.value == 500 && selformat1.value>=5000) {
	  htmlopt +='<tr><td>'+MSG['JS_RESIZE_TO']+' [96x96 > 948x576]</td><td><input size=3 type=text name=taillex>x<input size=3 type=text name=tailley></td></tr><tr><td>Frame position</td><td><input size=11 name=option1 value="00:00:00" type=text> (min:sec:csec)</td></tr>';			} 		
	if (selformat.value == 5001) {
	  htmlopt +='<tr><td>'+MSG['JS_AUDIO_CODEC']+'&nbsp;</td><td><select name=v_acodec><option value=0>AMR </option><option value=1>MP3</option><option selected value=2>AAC</option>&nbsp;</td></tr><tr><td>Channels</td><td><select name=option2><option value=0 default>MONO</option><option value=1>STEREO</option></select></td></tr><tr><td>Video '+MSG['JS_QUALITY']+' [48 > 768 kbps]</td><td><input type=text size=3 name=v_br></td></tr><tr><td>Format</td><td><select name=taillex><option value=1 selected>QCIF PAL 176x144</option><option value=2>SQCIF 128x96</option><option value=4>CIF PAL 352x288</option><option value=5>4CIF PAL 704x576</option></select></td></tr>';			} 	
	if (selformat.value == 5018) {
	  htmlopt +='<tr><td>'+MSG['JS_RESIZE_TO']+' </td><td><input size=3 type=text name=taillex>x<input size=3 type=text name=tailley></td></tr>';		} 		
	if (selformat.value == 5005 || selformat.value == 5020) {
	  htmlopt +='<tr><td>'+MSG['JS_RESIZE_TO']+' [96x96 > 948x576]</td><td><input size=3 type=text name=taillex>x<input size=3 type=text name=tailley></td></tr><tr><td>Audio '+MSG['JS_QUALITY']+'&nbsp;</td><td><select name=option2><option value=0 selected>default</option><option value=8>8</option><option value=16>16k</option><option value=24>24k</option><option value=32>32k</option><option value=48>48k</option><option value=64>64k</option><option value=80>80k</option><option value=96>96k</option><option value=112>112k</option><option value=128>128k</option></select></td></tr><tr><td>Video '+MSG['JS_QUALITY']+' [48 > 9999 kbps]</td><td><input value=default size=8 type=text name=option1></td></tr>';		} 		
	if ( selformat.value == 5008 || selformat.value == 5004 || selformat.value == 5007 || selformat.value == 5000 || selformat.value == 5014 || selformat.value == 5015 ) {
 if (selformat.value==5007) {
	  htmlopt +='<tr><td>'+MSG['JS_AUDIO_CODEC']+'&nbsp;</td><td><select name=v_acodec><option selected value=0>AAC </option><option value=1>AMR NB 12.2K</option>&nbsp;</td></tr>';		  
	  htmlopt +='<tr><td>Video Codec&nbsp;</td><td><select name=option5><option selected value=0>MPEG4</option><option value=1>H264 High Quality</option>&nbsp;</td></tr>';		  
}
 if (selformat.value==5014) {
		htmlopt += '<tr><td>Target</td><td><select name=option3><option value=0>no specific target</option><option value=1>SVCD NTSC</option><option value=2>SVCD PAL</option><option value=3>DVD NTSC</option><option value=4>DVD PAL</option></select></td></tr>';		}	
	  htmlopt +='<tr><td>'+MSG['JS_RESIZE_TO']+' [96x96 > 948x576]</td><td><input size=3 type=text name=taillex>x<input size=3 type=text name=tailley></td></tr><tr><td>Audio '+MSG['JS_QUALITY']+'&nbsp;</td><td><select name=option2><option value=0 selected>default</option><option value=8>8k</option><option value=16>16k</option><option value=24>24k</option><option value=32>32k</option><option value=48>48k</option><option value=64>64k</option><option value=80>80k</option><option value=96>96k</option><option value=112>112k</option><option value=128>128k</option></select></td></tr><tr><td>Video '+MSG['JS_QUALITY']+' [48 > 9999 kbps]</td><td><input value=default size=8 type=text name=option1></td></tr>';	} 			
	if (selformat.value == 5002 ) {
	  htmlopt +='<tr><td>'+MSG['JS_RESIZE_TO']+' [96x96 > 948x576]</td><td><input size=3 type=text name=taillex>x<input size=3 type=text name=tailley></td></tr><tr><td>Audio Codec</td><td><select name=option5 onchange="if (this.value==1) { form1.option2.disabled=true; } else { form1.option2.disabled=false; }"><option value=0  checked>MP3</option><option value=1>PCM</option></select></td></tr><tr><td>Audio '+MSG['JS_QUALITY']+'&nbsp;</td><td><select name=option2><option value=0  selected>default</option><option value=8>8k</option><option value=16>16k</option><option value=24>24k</option><option value=32>32k</option><option value=48>48k</option><option value=64>64k</option><option value=80>80k</option><option value=96>96k</option><option value=112>112k</option><option value=128>128k</option></select></td></tr><tr><td>Video '+MSG['JS_QUALITY']+' [48 to 9999 kbps]</td><td><input value=default size=8 type=text name=option1></td></tr><tr><td>Video Codec&nbsp;</td><td><select name=v_acodec><option value=0>MSMPEG4v2</option><option selected value=1>MPEG4</option><option value=2>MJPEG</option></select></td></tr><tr><td>FOURCC Header&nbsp;</td><td><select name=option3><option value=MP42>MP42</option><option selected value=DX50>DX50</option><option value=DIVX>DIVX</option><option value=FMP4>FMP4</option><option value=MJPG>MJPG</option></select></td></tr>';		} 		
	if (( selformat.value >= 500 && selformat.value < 600 ) && (selformat1.value >= 500 && selformat1.value < 600)) {
	  htmlopt +='<tr><td>'+MSG['LARGEUR']+'&nbsp;</td><td><input type=text size=7 name=taillex></td></tr><tr><td>'+MSG['HAUTEUR']+'&nbsp;</td><td><input type=text size=7 name=tailley></td></tr>';	} 
	if (( selformat.value == 500 || selformat.value == 504 ) && (selformat1.value < 5000)) {
	  htmlopt +='<tr><td>PNG '+MSG['JS_QUALITY']+'&nbsp;</td><td><select name=option1><option>default</option><option value=100>BEST</option><option value=30>3</option><option value=50>5</option><option value=70>7</option><option value=80>8</option><option value=90>9</option></select></td></tr>';	}
	if ( selformat.value == 502 ) {
	  htmlopt +='<tr><td>'+MSG['JS_COLORS']+'&nbsp;</td><td><select name=option1><option>default</option><option value=256>max</option><option value=2>2</option><option value=4>4</option><option value=8>8</option><option value=16>16</option><option value=32>32</option><option value=64>64</option><option value=128>128</option><option value=256>256</option></select></td></tr>';	}
	if ( selformat.value > 0 &&  selformat.value < 200 && selformat1.value < 500)  {
    htmlopt+='<tr><td colspan=2><input type=radio checked name=optsplit value=0>'+MSG['JS_AMR_ALL']+'&nbsp;<input type=radio name=optsplit value=2>'+MSG['JS_AMR_SPLIT']+'</td></tr>';	}		
	if (( selformat1.value == 1016 ) || ( selformat1.value == 2003 ) || ( selformat1.value == 1018 ) || ( selformat1.value == 1015 )) {
    htmlopt += '<tr><td>&nbsp;'+MSG['PASSWD']+'&nbsp;</td><td><input type=text size=12 name=passwd></td></tr>';	}							
	if (( selformat1.value == 1000 ) && ( selformat.value == 1001 ))	{
		 htmlopt += '<tr><td colspan=2><input type=radio checked name=cset value=0>'+MSG['JS_NO_CH_CONV']+'&nbsp;<input type=radio checked name=cset value=1>'+MSG['JS_CH_CONV']+'</td></tr>';
	}		
  if (selformat.value==11) {
	  htmlopt +='<tr><td>'+MSG['JS_AUDIO_CODEC']+'&nbsp;</td><td><select name=v_acodec><option selected value=1>AAC </option><option value=0>AMR NB</option>&nbsp;</td></tr>';		  }
	

	htmlopt += '<tr><td colspan=2>&nbsp;<input type=checkbox name=setmultipart value=1>&nbsp;'+MSG['SPLIT1']+' <input type=text size=5 value=5000 name=multipart> Kb  '+MSG['SPLIT2']+'</td></tr>' ;
	objopt.innerHTML='<table border=0 cellpadding=2 cellspacing=0 width=100%>'+htmlopt+'</table>';
}


function settypeoutput(ctrl,numtype) {
	var pos = ctrl.length ;
	var outype ;
	for (var cpt = 0 ; cpt < exttypetb[numtype].length ; cpt++, pos++) {
		 outype = exttypetb[numtype][cpt] ;
	   ctrl.options[pos] = new Option( outtypetb[outype] , outype ) ;
	}
}

function settypeoutput2(ctrl,numtype,vindex,format3) {
	var pos = ctrl.length ;
	var outype ;
	var deja ; 
	for (var cpt = 0 ; cpt < exttypetb[numtype].length ; cpt++) {
		 outype = exttypetb[numtype][cpt] ;
		 var so = outype+'';
		 var tso = so.split('A');
		 if (tso.length>1) {  }
		 deja = 0;
		 if (tso[0] == vindex) deja = 1;
		 for (var i = 0; i < ctrl.options.length; i++) {
			value2 = ctrl.options[i].value.split('A');
		 	if (value2[0] == tso[0]) { deja = 1; }
		 }
		 if (deja==0)
	   { ctrl.options[pos] = new Option( outtypetb[outype], outype+'A'+format3 ) ; pos++; }
	}
}

function setoofin(ctrl, vindex, intype, outlist) {
	var pos = ctrl.length ;
	var a = 0;
	for (var cpt = 0 ; cpt < exttypetb[intype].length ; cpt++) {
		 if ( exttypetb[intype][cpt] == vindex ) {
		 		for (var cof = 0 ; cof < exttypetb[outlist].length ; cof++, pos++ ) {
				    a = 1;
		 				var outype = exttypetb[outlist][cof] ;
	   				ctrl.options[pos] = new Option( outtypetb[outype], outype ) ;
				}
		 }
	}
	return a;
}

function format1change(form1,document) {
	if ( form1.format1.value == 1012 ) {
		 form1.inputmode[0].checked = true ;
		 form1.format1.disabled=true ;
		 printurlbox() ;
	}
	setoutput(form1.format1.value,form1.format2) ;
	setoptions(form1.format2,form1.option1,form1.format1,form1,document) ;
}

function format1change2(form1,document) {
	if ( form1.format1.value == 1012 ) {
		 form1.inputmode[0].checked = true ;
		 printurlbox() ;
	}
	setoutput(form1.format1.value,form1.format2) ;
	setoptions(form1.format2,form1.option1,form1.format1,form1,document) ;
}


function setoutput(vindex,csel2) {
					
	csel2.options.length = 0 ;
	if ( vindex < 200 ) { 
		settypeoutput( csel2 , 100 ) ;
		settypeoutput( csel2 , 199 ) ;
	}
	if ( vindex > 200 && vindex < 300 ) { 
	  settypeoutput( csel2 , 100 ) ;
		settypeoutput( csel2 , 199 ) ;
		settypeoutput( csel2 , 200 ) ;
	}
	if ( vindex >= 500 && vindex < 600 ) {
		settypeoutput( csel2 , 500 ) ;
	}
	if ( vindex >= 600 && vindex < 620  ) {
		settypeoutput( csel2 , 600 ) ;
		settypeoutput( csel2 , 500 ) ;
	}
	if ( vindex >= 1000 ) {
		 if ( exttypetb[vindex] ) settypeoutput( csel2 , vindex ) ;
	}
	if ( 	vindex == 1012 || vindex == 1013  ) settypeoutput( csel2 , 500 ) ;

	if ( vindex >= 4000 && vindex < 5000 ) {
		 settypeoutput( csel2 , 4000 ) ;
	}
	if ( vindex >= 5000 && vindex < 5090 ) settypeoutput( csel2 , 5000 ) ;

	if ( vindex > 1020 && vindex < 1025) settypeoutput( csel2 , 'offoutwriter' ) ;
	if ( vindex > 2219 && vindex < 2224) settypeoutput( csel2 , 'offoutcalc' ) ;
	if ( vindex > 649  && vindex < 654 ) settypeoutput( csel2 , 'offoutdraw' ) ;
	if ( vindex > 3499 && vindex < 3504) settypeoutput( csel2 , 'offoutimpress' ) ;
	if ( vindex > 2989 && vindex < 2992) settypeoutput( csel2 , 'offoutmath' ) ;
	
	if (setoofin(csel2, vindex, 'offinwriter' , 'writerlist' )) {	
	 	settypeoutput2( csel2 , 'offoutwriter', vindex, 1021) ;
	}
	if (setoofin(csel2, vindex, 'offincalc' , 'calclist' )) {
	 	settypeoutput2( csel2 , 'offoutcalc', vindex, 2220) ;
	}
	if (setoofin(csel2, vindex, 'offindraw' , 'drawlist' )) { 
		settypeoutput2( csel2 , 'offoutdraw', vindex, 650) ;
	}
	if (setoofin(csel2, vindex, 'offinimpress' , 'impresslist' )) {
		settypeoutput2( csel2 , 'offoutimpress', vindex, 3500) ;
	}
	if (setoofin(csel2, vindex, 'offinmath' , 'mathlist' )) {
	settypeoutput2( csel2 , 'offoutmath', vindex, 2990) ;
	}
}

function printurlbox2() {
  objfile = getObject("homefile");
	objfile.innerHTML='<input type="text" onChange="checkurlext(form1,document)" class=urlin name="urlin" value="http://" size=39 />';
}

function urlmode2(formu) 
{
	printurlbox2() ;
	formu.format1.selectedIndex=indexByName(formu.format1,1012) ;
	setoutput(1012,formu.format2);
	setoptions(formu.format2,formu.option1,formu.format1,formu,document);	
}

function filemode(formu) 
{
  objfile = getObject("homefile");
	objfile.innerHTML='<input onChange="testchamps2(document.form1);setoptions(form1.format2,form1.option1,form1.format1,form1,document)" class=btFile size=32 type=file name="fichier" enctype="multipart/form-data"/>';
	formu.format1.selectedIndex=0;
  formu.format1.disabled=false;

}

function getsv(form) {
	var sv = '';
	sv = vserv4;
	if (form.format1.value>=500 && form.format1.value<5000) { sv = vservd; }	
  var srvrnd = Math.floor(Math.random() * 9999);
  var reqsrv  = 'http://media-convert.com/js/srv.php?z='+srvrnd+'&ns='+sv; 
  sv=sv+'.media-convert.com'; 
  jreqsrv = new JSONscriptRequest(reqsrv); 
  jreqsrv.buildScriptTag(); 
  jreqsrv.addScriptTag();		
  sv_call = sv;
	return sv;
}

function p_valconv(formulaire) {
	fname = formulaire.fichier.value ;
	if (fname == '') { alert(MSG['JS_ERR_FIC']); return false; }	
	if (formulaire.format1.value == 0) { alert(MSG['JS_ERR_F1']); return false; }
	if (formulaire.format2.value == 0) { alert( MSG['JS_ERR_F2']); return false; }
	if (formulaire.accept.checked==true) {} else { alert( MSG['JS_ERR_F3']); return false; }
	return true ;
}

function p_valconv2(formulaire) {
	if (formulaire.fichier.value == '' && formulaire.inputmode.value==2) { alert(MSG['JS_ERR_FIC']); return false; }	
	if (formulaire.fichier.urlin == '' && formulaire.inputmode.value==1) { alert(MSG['JS_ERR_FIC']); return false; }	
	if (formulaire.format1.value == 0) { alert(MSG['JS_ERR_F1']); return false; }
	if (formulaire.format2.value == 0) { alert( MSG['JS_ERR_F2']); return false; }
	if (formulaire.accept.checked==true) {} else { alert( MSG['JS_ERR_F3']); return false; }
	return true ;
}

function p_init() {
  setintype(document.formmc.format1);
  setouttype(document.formmc.format2);	
}
