﻿// JScript File


function checkVal(imgName, newSrc) {
	document.images(imgName).src = newSrc;
}


function swapImage(imgName, newSrc) {
	document.images(imgName).src = newSrc;
}

function change_background(color) {
	document.getElementById('ctl00_panel_nav').style.backgroundColor = color;
}

function setVisible(obj) {
    windowHeight = document.body.offsetHeight
    windowWidth = document.body.offsetWidth
    
    brwserleft = (windowWidth/2) - 200
    brwsertop =  (windowHeight/4) + 200
	obj = document.getElementById(obj);
	if(obj.style.visibility == 'visible'){
	    obj.innerHTML = ''
	}
	obj.style.left = brwserleft;
	obj.style.top = brwsertop;
	obj.style.display = 'block';
	obj.style.visibility = 'visible';
}

function setImageVisible(obj, image_path) {

    document.getElementById('image_popup').src = image_path;

    windowHeight = document.body.offsetHeight
    windowWidth = document.body.offsetWidth
    
    brwserleft = (windowWidth/2) - 200
    brwsertop =  (windowHeight/4) + 100
	obj = document.getElementById(obj);
	if(obj.style.visibility == 'visible'){
	    obj.innerHTML = ''
	}
	obj.style.left = brwserleft;
	obj.style.top = brwsertop;
	obj.style.visibility = 'visible';
}

function setInVisible(obj) {
	obj = document.getElementById(obj);
	obj.style.visibility = 'hidden';
}

function ajaxRequest(url){
    var httpRequest; 
    
    if (window.XMLHttpRequest) { // Mozilla, Safari, ...
        http_request = new XMLHttpRequest();
    } else if (window.ActiveXObject) { // IE
        http_request = new ActiveXObject("Microsoft.XMLHTTP");
    }

    http_request.open("POST", url, true); 
    http_request.onreadystatechange = function(){
        processRequest()
    }
    
    http_request.send(null);
}

function processRequest() 
{             
    if (http_request.readyState == 4)
    { 
        if(http_request.status == 200) 
        { 
           document.getElementById('div_disclaimers').innerHTML = http_request.responseText
        } 
        else 
        { 
            alert("Error loading page\n"+ http_request.status +":"+ http_request.statusText); 
        } 
    }         
}