/*************************************************************************
  This code is from Dynamic Web Coding at http://www.dyn-web.com/
  See Terms of Use at http://www.dyn-web.com/bus/terms.html
  regarding conditions under which you may use this code.
  This notice must be retained in the code as is!
*************************************************************************/
function loadExternal(url) {
  if ( window.frames['buffer'] ) {
    window.frames['buffer'].location = url;
    var lyr = document.getElementById? document.getElementById('display'): document.all? document.all['display']: null;
    if ( lyr && typeof lyr.innerHTML != "undefined" ) {
      lyr.innerHTML = '<img src="/images/common/loading.gif" alt="">';
    }
    return false;
  } 
  return true; // other browsers follow link
}

// called when documents loaded into iframe (from their body's onload attribute)
function displayExternal() {
	//Always set overflow of the display DIV height to null and overflow to hidden so it won't show the scroll bars unless we want it to in portfolio slider
	parent.document.getElementById('display').style.height = null;
	parent.document.getElementById('display').style.overflow = "visible";
	//Load any javascript of the page being loaded.
	if (window.frames['buffer'].document.getElementById('myscript')) {
		var head = document.getElementsByTagName('head').item(0)
		script = document.createElement('script');
		//Safari does not support script.text, so we must detect when Safari to use script.innerHTML
		if (navigator.userAgent.indexOf( 'Safari' ) != -1) {
			script.innerHTML = window.frames['buffer'].document.getElementById('myscript').innerHTML;
		}
		else {	
			script.text = window.frames['buffer'].document.getElementById('myscript').innerHTML;
		}
		script.type = 'text/javascript';
		script.id = 'myscript';
		head.appendChild(script);
//		alert(head.innerText);
	}

	var lyr = document.getElementById? document.getElementById('display'): document.all? document.all['display']: null;
    if ( window.frames['buffer'] && lyr && typeof lyr.innerHTML != "undefined" ) 
		lyr.innerHTML = window.frames['buffer'].document.body.innerHTML;
}