/********************************************************************* JavaScript functions (c) 2001/2002 Open Framework Systems AB Date Sign Changes -------------------------------------------------------------------- 2003-10-16 MP openNewWindowResizable 2001-05-04 SVJ Created this file, added reload to openUrl() 2001-05-08 RN Edited openUrl(), replaced reload with assign 2001-06-06 GS Edited openUrl() & reloadFrame(), replaced top with parent 2002-05-26 CA Edited openUrl() & reloadFrame(), it now searches for the correct frame from the top and down, using the findFrame() function, it will also return true/false if it found the frame or not (if opened/reloaded the frame) 2002-05-26 CA Removed the confirmDelete() function. 2003-04-24 CA Changed the name of one of the openNewWindow to openNewWindow2 since there cannot be 2 functions with the same name but different parameters in javascript *********************************************************************/ function openFrame( url, frameName) { if( url != "" ) { var frame = document; if(frameName){ frame = findFrame( top, frameName ); } if( frame != null ){ frame.location.assign( url ); return true; } } return false; } function replaceFrame( url, frameName) { if( url != "" ) { var frame = findFrame( top, frameName ); if( frame != null ){ frame.location.replace( url ); return true; } } return false; } function reloadFrame( frameName ) { var frame=findFrame(top,frameName); if(frame!=null){ frame.location.reload(); return true; } else { return false; } } function findFrame(frame,frameName){ var i=0; while(frame.frames[i]!=null){ if(frame.frames[i].name==frameName){ return frame.frames[i]; } else { try{ if(frame.location.hostname==frame.frames[i].location.hostname){ var frame2=findFrame(frame.frames[i],frameName); if(frame2!=null){ return frame2; } } } catch (exception){ } } i++; } return null; } function openNewWindow2(win, mypage,myname,w,h,scroll){ var winl = (screen.width-w)/2; var wint = (screen.height-h)/2; var settings ='height='+h+','; settings +='width='+w+','; settings +='top='+wint+','; settings +='left='+winl+','; settings +='scrollbars='+scroll+','; settings +='dependant=yes,'; settings +='resizable=no'; if (win && win.open && !win.closed){ win.close(); win = window.open(mypage,myname,settings); } else { win = window.open(mypage,myname,settings); } return win; } function openNewWindowResizable(win, mypage,myname,w,h,scroll,resizable){ var winl = (screen.width-w)/2; var wint = (screen.height-h)/2; var settings ='height='+h+','; settings +='width='+w+','; settings +='top='+wint+','; settings +='left='+winl+','; settings +='scrollbars='+scroll+','; settings +='dependant=yes,'; settings +='resizable='+resizable; if (win && win.open && !win.closed){ win.close(); win = window.open(mypage,myname,settings); } else { win = window.open(mypage,myname,settings); } return win; } function openNewWindow(mypage,myname,w,h,scroll){ var winl = (screen.width-w)/2; var wint = (screen.height-h)/2; var settings ='height='+h+','; settings +='width='+w+','; settings +='top='+wint+','; settings +='left='+winl+','; settings +='scrollbars='+scroll+','; settings +='dependant=yes,'; settings +='resizable=yes'; win = window.open(mypage,myname,settings); //return win; } function openNewImageWindow(win,mypage,myname,w,h,scroll,pictureName){ var winl = (screen.width-w)/2; var wint = (screen.height-h)/2; var settings ='height='+h+','; settings +='width='+w+','; settings +='top='+wint+','; settings +='left='+winl+','; settings +='scrollbars='+scroll+','; settings +='resizable=yes'; if (pictureName!="") mypage+="?" + escape(pictureName); if (win && win.open && !win.closed){ win.close(); win = window.open(mypage,myname,settings); } else { win = window.open(mypage,myname,settings); } return win; } function closeWindow(win){ if (win && win.open && !win.closed){ win.close(); } }