﻿// JScript File
function exec_request(url,id) {
	if(window.XMLHttpRequest) {
    	try {
			xmlhttp = new XMLHttpRequest();
        } catch(e) {
			xmlhttp = false;
        }
    // branch for IE/Windows ActiveX version
    } else if(window.ActiveXObject) {
       	try {
        	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
      	} catch(e) {
        	try {
          		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        	} catch(e) {
          		xmlhttp = false;
        	}
		}
    }
	if(xmlhttp) {
	xmlhttp.open("GET",url,true);
	xmlhttp.onreadystatechange=function() {
	
	if (xmlhttp.readyState==4) {
		var response=xmlhttp.responseText;
		writeintolayer(id,response); //write the layer		
		
	//	}
	}	
	}
	
	xmlhttp.setRequestHeader('Accept','message/x-formresult')
	xmlhttp.send(null)
	return false
	}
}
function writeintolayer(objid,content) {
  if (typeof objid != 'object') {

    objid = document.getElementById(objid);
  }
  if (objid){

    objid.innerHTML = content;
  }
}

//ENTER PRESS FUNCTION
function clickButton(e, buttonid){ 
      var bt = document.getElementById(buttonid); 
      if (typeof bt == 'object'){ 
            if(navigator.appName.indexOf("Netscape")>(-1)){ 
                  if (e.keyCode == 13){ 
                        bt.click(); 
                        return false; 
                  } 
            } 
            if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1)){ 
                  if (event.keyCode == 13){ 
                        bt.click(); 
                        return false; 
                  } 
            } 
      } 
} 

