// Scripts for IE<=7, compensating for it's lack of support for some things.  
 
// Style abbreviations for IE properly, by sovavsiti. NB: not needed for IE7.
// Couldn't actually see an improvement on this with jQuery - IE doesn't recognise abbr to act on it.
// Called by DOM ready.
function styleAbbr() {
	var oldBodyText, newBodyText, reg;
	oldBodyText = document.body.innerHTML;
	reg = /<ABBR([^>]*)>([^<]*)<\/ABBR>/g;
	newBodyText = oldBodyText.replace(reg, '<ABBR $1><SPAN class=\"abbr\" $1>$2</SPAN></ABBR>');
	document.body.innerHTML = newBodyText;
} // end styleAbbr

// Add quotes to q elements, originally from Juicystudio, but jQueryfied
// Relies on jQuery, called by DOM ready
function fixIEQuotes(){
	
  var objQuotes = $("#content q");

  $(objQuotes).each(function(i){
	objQuote = objQuotes[i];
	
	if( $(objQuote).parent().is("q") ) {
      // single-quotes for nested quotes
      $(objQuote).prepend("\u2018");
      $(objQuote).append("\u2019");
    }
    else {
      // double-quotes
      $(objQuote).prepend("\u201c");
      $(objQuote).append("\u201d");
    }
  });// end each
} // end fixIEQuotes

// Functions to call on DOM ready.
$(document).ready(function() {
	/*@cc_on @*/
	/*@if (@_jscript_version < 5.7)
		styleAbbr();
	/*@end @*/
	fixIEQuotes();
});

