// JavaScript Document


document.write('<div class="ppFrame" id="ppFrame"><div class="ppHeader"></div><div id="hframe"></div></div><div class="ppWindow" id="ppWin" ><!--[if lte IE 6.5]><iframe id="menuFrame" frameborder="0"></iframe><![endif]--></div>');

function initWin(page,title, pWidth, pHeight){
	var wBow = whichBrs();
	var ppWin = document.getElementById("ppWin");
	var ppFrame = document.getElementById("ppFrame");
	var iFrame = document.getElementById("hframe");
	var mBody = document.getElementsByTagName("html");	
	var htext = document.getElementById("pp_Heading");
	 scrollOff();
	mBody[0].scrollTop=0;
	setHTML('hframe',page);
	iFrame.style.width=((pWidth)-(22))+"px";
	if(wBow=="Internet Explorer"){
		iFrame.style.height=((pHeight)-(14))+"px";	
		ppFrame.style.height=pHeight+31+"px";
	}else{
		iFrame.style.height=((pHeight)-(27))+"px";	
		ppFrame.style.height=pHeight+18+"px";		
	}
	ppWin.style.height=window.screen.height+"px";
	ppWin.style.display="block";
	ppFrame.style.display="block";
	ppFrame.style.marginTop=(-((pHeight+33)/2))+"px"

	if (typeof document.body.style.maxHeight == "undefined") {
		ppFrame.style.width=pWidth+0+"px";		
	}else{
		ppFrame.style.width=pWidth+"px";	
	}
	ppFrame.style.marginLeft=(-(pWidth)/2)+"px"
	mBody[0].className="ppWin";
	//htext.innerHTML= title;
}

function whichBrs() {
	var agt=navigator.userAgent.toLowerCase();
	if (agt.indexOf("opera") != -1) return 'Opera';
	if (agt.indexOf("staroffice") != -1) return 'Star Office';
	if (agt.indexOf("webtv") != -1) return 'WebTV';
	if (agt.indexOf("beonex") != -1) return 'Beonex';
	if (agt.indexOf("chimera") != -1) return 'Chimera';
	if (agt.indexOf("netpositive") != -1) return 'NetPositive';
	if (agt.indexOf("phoenix") != -1) return 'Phoenix';
	if (agt.indexOf("firefox") != -1) return 'Firefox';
	if (agt.indexOf("safari") != -1) return 'Safari';
	if (agt.indexOf("skipstone") != -1) return 'SkipStone';
	if (agt.indexOf("msie") != -1) return 'Internet Explorer';
	if (agt.indexOf("netscape") != -1) return 'Netscape';
	if (agt.indexOf("mozilla/5.0") != -1) return 'Mozilla';
	if (agt.indexOf('\/') != -1) {
	if (agt.substr(0,agt.indexOf('\/')) != 'mozilla') {
	return navigator.userAgent.substr(0,agt.indexOf('\/'));}
	else return 'Netscape';} else if (agt.indexOf(' ') != -1)
	return navigator.userAgent.substr(0,agt.indexOf(' '));
	else return navigator.userAgent;
}


function closePp(){
	var ppWin = document.getElementById("ppWin");
	var ppFrame = document.getElementById("ppFrame");
	var mBody = document.getElementsByTagName("html");
	
	ppWin.style.display="none";
	ppFrame.style.display="none";
	mBody[0].className="";
	scrollOn();
}
function setParentDiv(){
	var _div =  document.getElementById("hDiv");
	
	_div.style.display="block";
}
function doNotScroll ()
{
        window.scrollTo(0,0);
}

function scrollOff()
{ 
        if (document.all)
        {               
                document.body.scroll = "no";
        }
        else
        {
                var oTop = document.body.scrollTop;
                document.body.style.overflow = "hidden";
                document.body.scrollTop = oTop;
        }
        window.onscroll = doNotScroll;
}

function scrollOn()
{
        document.body.scroll = "";
        document.body.style.overflow = "";
        window.onscroll = "";
}





function setHTML(id, url) {
  var req = false;
  // For Safari, Firefox, and other non-MS browsers
  if (window.XMLHttpRequest) {
    try {
      req = new XMLHttpRequest();
    } catch (e) {
      req = false;
    }
  } else if (window.ActiveXObject) {
    // For Internet Explorer on Windows
    try {
      req = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (e) {
      try {
        req = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {
        req = false;
      }
    }
  }
 var element = document.getElementById(id);
 if (!element) {
  alert("Bad id " + id +
   "passed to clientSideInclude." +
   "You need a div or span element " +
   "with this id in your page.");
  return;
 }
  if (req) {
    // Synchronous request, wait till we have it all
    req.open('GET', url, false);
		//req.onreadystatechange =function() {if (req.readyState == 4) {preloadSlideshow(req,id);}
    req.send(null);
    element.innerHTML = req.responseText;
		
  } else {
    element.innerHTML ="Sorry, your browser does not support XMLHTTPRequest objects. This page requires Internet Explorer 5 or better for Windows, or Firefox for any system, or Safari. Other compatible browsers may also exist.";
  }

}
