// JavaScript Document

function refreshDIV(url, pageElement, callMessage) {
  	document.getElementById(pageElement).innerHTML = callMessage;
	
	myRand = parseInt(Math.random()*99999999999);
	thisurl = url + "&rand=" + myRand;
	
     try {
     req = new XMLHttpRequest(); /* e.g. Firefox */
     } catch(e) {
       try {
       req = new ActiveXObject("Msxml2.XMLHTTP");  /* some versions IE */
       } catch (e) {
         try {
         req = new ActiveXObject("Microsoft.XMLHTTP");  /* some versions IE */
         } catch (E) {
          req = false;
         } 
       } 
     }
     req.onreadystatechange = function() {responseAHAH(pageElement);};
     req.open("GET",thisurl,true);
     req.send(null); 
  }
  
  function responseAHAH(pageElement) {
   var output = '';

   if(req.readyState == 4) {
      if(req.status == 200) {
         output = req.responseText;
		 	
         document.getElementById(pageElement).innerHTML = output;
         } else {
		 alert('Error in Refresh Update Script');
      }
   }
}


function showWindow(thiswindow,windowtitle,windowurl,windowwidth,windowheight) {
	var windowOptions = new Object();
	windowOptions.width = windowwidth;
	windowOptions.height = windowheight;
	windowOptions.modal = true;
	windowOptions.resizable = true;
	windowOptions.initshow = true;
	windowOptions.refreshonshow = true;
	windowOptions.source = windowurl;
	windowOptions.draggable = true;
	windowOptions.center = true;
	windowOptions.closable = true;
	windowOptions.headerstyle = 'text-align:left;font-family: tahoma; font-size:11px;border-color:#063A7C;background-color:#063A7C;';
	windowOptions.bodystyle = 'background-color:#ffffff;border-color:#063A7C;';
	ColdFusion.Window.create(thiswindow,windowtitle,windowurl,windowOptions);
}	
