/* THIS SET OF FUNCTIONS IS NECESSARY FOR CMS */



/* Browser Compatibility code */
/* =============================================== */
var gFFHeight;
function iFrameHeight(myframe,ffoxheight)
{
var fr = myframe.id;
gFFHeight = ffoxheight;
//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
//var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

if(parseFloat(getFFVersion)>=0.1)
   {
     var FFextraHeight = gFFHeight;	
   }
else
   {
     var FFextraHeight = 0;
   }
   
function resizeCaller(myframe) 
{
if (document.getElementById)
resizeIframe(myframe)
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no")
{
var tempobj=document.all? document.all[myframe] : document.getElementById(myframe)
tempobj.style.display="block"
}

}

function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
  { 
  	currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight; 
  }	
else if (currentfr.document && currentfr.document.body.scrollHeight) //ie5+ syntax
      {
      	  currentfr.height = currentfr.Document.body.scrollHeight;
      }
     else
       {
       	currentfr.height = gFFHeight;   // it is global variable for handling height of some frames.
       } 
if (currentfr.addEventListener)
{
try
{
	currentfr.addEventListener("load", readjustIframe, false)
}
catch(e) { }

}
else if (currentfr.attachEvent)
{
try
{
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
catch(e) { }
}

}
}

function readjustIframe(loadevt) 
{
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement

try
{
if (iframeroot)
  {
  //	alert(gFFHeight);
  	resizeIframe(iframeroot.id,gFFHeight);
  }	
}
catch(e) { }
}

try
{
	if (window.addEventListener)
		Window.addEventListener("load", resizeCaller(fr), false)
	else if (window.attachEvent)
		window.attachEvent("onload", resizeCaller(fr))
	else
		window.onload=resizeCaller(fr)
}
catch(e) { }
}



function CTM_GetStyle(className, styleProperty)
{
   if(IE6) 
        theRules = document.styleSheets[0].rules;
    else if (bName=="Netscape")
	theRules = document.styleSheets[0].cssRules;
	
   for (var i = 0; (i < theRules.length); i++)  {	
       if (theRules[i].selectorText.toLowerCase() == className.toLowerCase()) {
           if(IE6)
              return theRules[i].style.getAttribute(styleProperty);
           else if(bName=="Netscape")
                return theRules[i].style.getPropertyValue(styleProperty);
              
        }	
   }     
}
//******************************************************
