function gotoSelectedTab(tabName){
//alert("From JS: "+ tabName);
if(tabName == 'Part Number') {
submitToPage('mediaFlexSearch.do?method=showPartNumberSearch',document.manageSearchForm);
}else if(tabName == 'Keyword') {
submitToPage('mediaFlexSearch.do?method=showKeywordSearch',document.manageSearchForm);
}else if(tabName == 'Assay/Chemistry/Test') {
submitToPage('mediaFlexSearch.do?method=showAssayChemTestSearch',document.manageSearchForm);
}else if(tabName == 'Product') {
submitToPage('mediaFlexSearch.do?method=showProductSearch',document.manageSearchForm);
}else if(tabName == 'Discipline') {
submitToPage('mediaFlexSearch.do?method=showDisciplineSearch',document.manageSearchForm);
}
}
var isFirefox = false;
if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent)){
isFirefox = true;
}
var childwindow;
function openFileURL(url, uri, cxtPath, repPath, repFlag){
// closeChildWindow() // Close any child windows of this parent hanging around
//alert("cxtPath:"+cxtPath);
var baseURL = url.substring(0, url.indexOf(uri));
// alert(repPath);
if(!isFirefox){
childwindow = window.open('','','height=1,width=1,resizable=1,menubar=no,directories=no,location=no,toolbar=no,scrollbars=yes');
setTimeout("",3000);
childwindow.close();
}else{ // For FireFox to close child window
if(childwindow != null){
childwindow.close();
}
}
try{
if(repFlag == 'File System'){
var finalUrl = baseURL+cxtPath+'/search/mediaFlexSearch.do?method=getFileFromFileSystem&resourcePath='+repPath;
if(!isFirefox){
childwindow = window.open('www.google.com', 'null', 'height=700,width=700,resizable=1,menubar=no,directories=no,location=no,toolbar=no,scrollbars=yes');
}else{
childwindow = window.open('', 'null', 'height=700,width=700,resizable=1,menubar=no,directories=no,location=no,toolbar=no,scrollbars=yes');
}
childwindow.document.write('
');
childwindow.document.location = finalUrl;
}else if(repFlag == 'EDMS'){
var edmsUrl = baseURL+cxtPath+'/search/mediaFlexSearch.do?method=getFileFromEDMS&EDMSObjectName='+repPath;
if(!isFirefox){
childwindow = window.open('www.google.com', 'null', 'height=700,width=700,resizable=1,menubar=no,directories=no,location=no,toolbar=no,scrollbars=yes');
}else{
childwindow = window.open('', 'null', 'height=700,width=700,resizable=1,menubar=no,directories=no,location=no,toolbar=no,scrollbars=yes');
}
childwindow.document.write('');
childwindow.document.location = edmsUrl;
}
}catch (err){ // This was done to cheat the IE6 browser for its ridiculous behavior - replicate above code
if(repFlag == 'File System'){
var finalUrl = baseURL+cxtPath+'/search/mediaFlexSearch.do?method=getFileFromFileSystem&resourcePath='+repPath;
if(!isFirefox){
childwindow = window.open('www.google.com', 'null', 'height=700,width=700,resizable=1,menubar=no,directories=no,location=no,toolbar=no,scrollbars=yes');
}else{
childwindow = window.open('', 'null', 'height=700,width=700,resizable=1,menubar=no,directories=no,location=no,toolbar=no,scrollbars=yes');
}
childwindow.document.write('');
childwindow.document.location = finalUrl;
}else if(repFlag == 'EDMS'){
var edmsUrl = baseURL+cxtPath+'/search/mediaFlexSearch.do?method=getFileFromEDMS&EDMSObjectName='+repPath;
if(!isFirefox){
childwindow = window.open('www.google.com', 'null', 'height=700,width=700,resizable=1,menubar=no,directories=no,location=no,toolbar=no,scrollbars=yes');
}else{
childwindow = window.open('', 'null', 'height=700,width=700,resizable=1,menubar=no,directories=no,location=no,toolbar=no,scrollbars=yes');
}
childwindow.document.write('');
childwindow.document.location = edmsUrl;
}
}
}
function closeChildWindow(){
alert("Before closing");
if(childwindow != null){
alert("Inside If");
childwindow.close();
}
}