// JavaScript Document
var idName = 0;

function createCSS(selector, declaration) {
        // test for IE
        var ua = navigator.userAgent.toLowerCase();
        var isIE = (/msie/.test(ua)) && !(/opera/.test(ua)) && (/win/.test(ua));

        // create the style node for all browsers
        var style_node = document.createElement("style");
        style_node.setAttribute("type", "text/css");
        style_node.setAttribute("media", "screen");

        // append a rule for good browsers
        if (!isIE) style_node.appendChild(document.createTextNode(selector + " {" + declaration + "}"));

        // append the style node
        document.getElementsByTagName("head")[0].appendChild(style_node);

        // use alternative methods for IE
        if (isIE && document.styleSheets && document.styleSheets.length > 0) {
                var last_style_node = document.styleSheets[document.styleSheets.length - 1];
                if (typeof(last_style_node.addRule) == "object") last_style_node.addRule(selector, declaration);
        }
};
function getElementsByClass(searchClass,node,tag) {
	var classElements = new Array();
	if ( node == null )
		node = document;
	if ( tag == null )
		tag = '*';
	var els = node.getElementsByTagName(tag);
	var elsLen = els.length;
	var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
	for (i = 0, j = 0; i < elsLen; i++) {
		if ( pattern.test(els[i].className) ) {
			classElements[j] = els[i];
			j++;
		}
	}
	return classElements;
}
function CJL_getCurrentStyle(elem, prop)
{
   if( elem.currentStyle )
   {  
      var ar = prop.match(/\w[^-]*/g);
      var s = ar[0];
      
      for(var i = 1; i < ar.length; ++i)		   
      {
         s += ar[i].replace(/\w/, ar[i].charAt(0).toUpperCase());
      }
           
      return elem.currentStyle[s]
   }
   else if( document.defaultView.getComputedStyle )
   {
      return document.defaultView.getComputedStyle(elem, null).getPropertyValue(prop);
   }
}


function flashImg (){
	var content=document.getElementById("content");
	var imgs=content.getElementsByTagName("img");
	//oP=document.getElementById("sMenuLevel");
	//oT=document.getElementById("sMenuTxt");
	//alert(h[0].innerHTML);

	for (i=0; i<imgs.length;i++){
	var w = imgs[i].offsetWidth;
	var h = imgs[i].offsetHeight;
	var s = imgs[i].src;
	var par = imgs[i].parentNode;
	var cls = imgs[i].className;
	if (cls=="")cls="flashedImg";
	var l=0;
	if ( par.tagName == "A") l=imgs[i].parentNode.href;
	
	var d = document.createElement("div");
	d.className = cls;
	d.style.width = w+"px";
	d.style.height = h+"px";
	
	var replacedNode = par.replaceChild(d,imgs[i]);
	fl="<object type='application/x-shockwave-flash' width='"+w+"' height='"+h+"' id='flashImg_"+idName+"' align='left' data='/flash/framedimage.swf?w="+w+"&h="+h+"&l="+l+"&pic="+s+"'><param name='movie' value='/flash/framedimage.swf?w="+w+"&h="+h+"&l="+l+"&pic="+s+"' /><param name='wmode' value='transparent' /><param name='scale' value='noscale' /><param name='salign' value='lt' /></object>";
	idName=idName+1;
	d.innerHTML = fl;
	
	if (imgs.length>0)i=i-1;
	
	}

}

createCSS ("#content img","visibility:hidden")



