if (!(!document.getElementsByTagName || !document.getElementById)) {
  document.write(panoStyles());
}

function panoStyles() {
  var cssText = "";
  cssText += "<style type=\"text/css\">\n";
  cssText += ".panoramaInStyle .nojs { display:none }\n";
  cssText += "</style>\n";
  return cssText;
}

function panoInsert() {
	var divs = document.getElementsByTagName('div');
	for (i = 0; div = divs[i]; i++) {
		if (div && hasClass(div, 'panoramaInStyle')) {
			var QTclass = div.className.match(/quicktime\(([^\)]*)\)/);
			var qtURL = (QTclass!=null)?QTclass[1]:'';
			var PTclass = div.className.match(/ptviewer\(([^\)]*)\)/);
			var ptURL = (PTclass!=null)?PTclass[1]:'';
			var FLclass = div.className.match(/pano2qtvr\(([^\)]*)\)/);
			var flURL = (FLclass!=null)?FLclass[1]:'';
			var FLVRclass = div.className.match(/flashvr\(([^\)]*)\)/);
			var flvrURL = (FLVRclass!=null)?FLVRclass[1]:'';
			if (document.all && navigator.userAgent.indexOf("Macintosh")>=0)
//				var qtURL,ptURL,flURL,flvrURL='';
				var ptURL,flURL,flvrURL='';
			var content='', tw=document.writeln; 
			document.writeln=function(txt){content+=txt+"\n"};
			writevrcode(qtURL,ptURL,flURL,flvrURL,"100%","100%");
			document.writeln=tw;
//			alert(content);
			div.innerHTML=content;
			return;
		}
	}
}

function hasClass(node, className) {
  if (node.className == className) return true;
  var reg = new RegExp('(^| )'+ className +'($| )')
  if (reg.test(node.className)) return true;
  return false;
}

