// Browser-specific support // SAFARI ------------ var g_gdSafari = navigator.appVersion.indexOf( "Safari") > 0; // Include the safari-specific style sheet. if( g_gdSafari) { // Include a stylesheet with custom safari stuff. document.write( ''); // DO ANY BEFORE LOAD PROCESSING HERE... // DO ANY POST POST PROCESSING IN THIS EVENT HANDLER gdAddEvent(window, "load", gdSafariAfterLoad); } // DO ANY POST POST PROCESSING IN THIS EVENT HANDLER function gdSafariAfterLoad() { //alert( "safari specific init"); } function gdAddEvent(elm, evType, fn, useCapture) // addEvent and removeEvent // cross-browser event handling for IE5+, NS6 and Mozilla // By Scott Andrew { if (elm.addEventListener){ elm.addEventListener(evType, fn, useCapture); return true; } else if (elm.attachEvent){ var r = elm.attachEvent("on"+evType, fn); return r; } else { alert("Handler could not be removed"); } return false; } /* // Cross-browser access to stylesheet rules // For sample, just pick the first style sheet. var theRules = new Array(); if (document.styleSheets[0].cssRules) theRules = document.styleSheets[0].cssRules else if (document.styleSheets[0].rules) theRules = document.styleSheets[0].rules // Now make an array, indexedRules, that stores var indexedRules = new Array(); for( var ii = 0; ii< theRules.length ; ii++) { var selectors = theRules[ii].selectorText; var multipleSelectors = selectors.split(","); for( var jj=0; jj< multipleSelectors.length; jj++) { // Pain. IE decides to UPPERCASE the TAG part of any rule. indexedRules[ multipleSelectors[jj].toLowerCase() ] = theRules[ii]; } } // The rule (cssRule) object is pretty limited in IE. alert( indexedRules[ "body"].selectorText); alert( indexedRules[ ".gdcls_smalltable"].style); alert( indexedRules[ ".gdcls_table thead th"].selectorText); } */