$(document).ready(function() { $('.browser ul.child').each(function(i) { $(this).hide(); }); $('.browser a.folder').each(function(i) { $(this).click(function(e) { $('#' + $(this).attr('rel')).slideToggle('fast',function() {}); return false; }); }); }); // ############################################################################# // ### open_function: // ############################################################################# function open_function(url,width,height,options) { if ( height > screen.availHeight || width > screen.availWidth) { if ( options.indexOf( "scrollbars=") < 0) { if ( height > screen.availHeight) height = screen.availHeight; if ( width > screen.availWidth) width = screen.availWidth; options += ",scrollbars=yes,resizable=yes"; } } var name = url; var i = name.lastIndexOf( "/"); if ( i > 0) { name = name.substring(i+1); } else { name = url; } i = name.indexOf("?"); if ( i > 0) { name = name.substring(0,i); } i = name.indexOf("-"); if ( i > 0) { name = name.substring(0,i); } i = name.indexOf("."); if ( i > 0) { name = name.substring(0,i); } var left = ( screen.width - width ) / 2; var top = ( screen.height - height ) / 2; var msgWindow = open(url, name, "width=" + width + ",height=" + height + ",screenX=" + left + ",screenY=" + top + ",dependent=yes" + ",left=" + left + ",top=" + top + options ); if ( msgWindow) { msgWindow.focus(); if ( msgWindow.opener == null) { msgWindow.opener = self; } } }