var pathNdb='/Chemical/chemdivp.nsf'; var args = getArgs(); //******************** function getArgs() { var args = new Object (); var query = location.search.substring(1); var pairs = query.split("&"); for (var i = 0; i < pairs.length; i++) { var pos = pairs[i].indexOf('='); if (pos == -1) continue; var argname = pairs[i].substring(0, pos); var value = pairs[i].substring(pos+1); args[argname] = unescape(value); } return args; } //******************** function getDoc(docview, dockey, IncludeQS) { if (IncludeQS != null && IncludeQS == false){ var url = pathNdb + '/' + docview + '/' + escape(dockey) + '?OpenDocument'; } else{ var query = location.search.substring(1); if (query.indexOf('&')==-1) {var qs = ''} else {var qs = query.substring(query.indexOf('&'))} var url = pathNdb + '/' + docview + '/' + escape(dockey) + '?OpenDocument' + qs ; } window.location=url; } //******************** function PopWin(url,name,options){ var ContextWindow = window.open(url,name,options); ContextWindow.opener = this; ContextWindow.focus(); } //******************** function GetY( Height ) { //This function takes the passed window height and returns the position of the //top pixel that will cause the window to be centered from top to bottom. //Valid: JavaScript 1.2 var top = ( (screen.height - Height )/2); if ( top < 0 ) return 0; else return top; } //******************** function GetX( Width ) { //This function takes the passed window width and returns the position of the //left pixel that will cause the window to be centered from left to right. //Valid: JavaScript 1.2 var left = ( (screen.width - Width)/2); if ( left < 0 ) return 0; else return left; } //******************** function OpenCenteredWindow( NewURL, Name, WindowOptions, Width, Height ) { if ( OpenCenteredWindow.arguments.length < 5 ) { //Assume a default screen size of 640x480 ScreenX = GetX( 640 ); ScreenY = GetY( 480 ); if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 ) { //Microsoft if ( WindowOptions == "" ) WindowOptions += 'width=640,height=480,left = ' + ScreenX + ',top = ' + ScreenY; else WindowOptions += ',width=640,height=480,left = ' + ScreenX + ',top = ' + ScreenY; } else { //Assume Netscape if ( WindowOptions == "" ) WindowOptions += 'width=640,height=480,screenX=' + ScreenX + ',screenY=' + ScreenY; else WindowOptions += ',width=640,height=480,screenX=' + ScreenX + ',screenY=' + ScreenY; } } else { ScreenX = GetX( Width ); ScreenY = GetY( Height ); if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 ) { //Microsoft if ( WindowOptions == "" ) WindowOptions += 'width=' + Width + ',height=' + Height + ',left = ' + ScreenX + ',top = ' + ScreenY; else WindowOptions += ',width=' + Width + ',height=' + Height + ',left = ' + ScreenX + ',top = ' + ScreenY; } else { //Assume Netscape if ( WindowOptions == "" ) WindowOptions += 'width=' + Width + ',height=' + Height + ',screenX=' + ScreenX + ',screenY=' + ScreenY; else WindowOptions += ',width=' + Width + ',height=' + Height + ',screenX=' + ScreenX + ',screenY=' + ScreenY; } } Display = window.open( NewURL, Name, WindowOptions); Display.blur(); return Display; } //******************** function ExternalLinkPopUp( NewURL, Message, WindowOptions, Name, Width, Height, StyleSheetURL ) { ExternalLinkWindow = OpenCenteredWindow( "", Name, WindowOptions, Width, Height ); ExternalLinkWindow.focus(); var td = ExternalLinkWindow.document; td.open( "text/html" ); td.writeln( ""); td.writeln( "
" ); td.writeln( "