function pop_box(obj,text) {
  if(obj.previousSibling && obj.previousSibling.className == 'popbox') {
    obj.parentNode.removeChild(obj.previousSibling);
  }
  else {
    var newDiv = document.createElement('DIV');
    newDiv.className = 'popbox';
    newDiv.style.position = 'absolute';
    newDiv.style.top = (findPos(obj) + 30) + 'px';
    newDiv.style.left = '30%';
    newDiv.innerHTML = "<span class='jsbutton' onClick='this.parentNode.parentNode.removeChild(this.parentNode);'>close [x]</span>" + text;
    obj.parentNode.insertBefore(newDiv,obj);
  }
}

function getPageSize(){
        var xScroll, yScroll;
        if (window.innerHeight && window.scrollMaxY) {
                xScroll = document.body.scrollWidth;
                yScroll = window.innerHeight + window.scrollMaxY;
        } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
                xScroll = document.body.scrollWidth;
                yScroll = document.body.scrollHeight;
        } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
                xScroll = document.body.offsetWidth;
                yScroll = document.body.offsetHeight;
        }
        var windowWidth, windowHeight;
        if (self.innerHeight) { // all except Explorer
                windowWidth = self.innerWidth - 16;
                windowHeight = self.innerHeight;
        } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
                windowWidth = document.documentElement.clientWidth;
                windowHeight = document.documentElement.clientHeight;
                yScroll += 28;
        } else if (document.body) { // other Explorers
                windowWidth = document.body.clientWidth;
                windowHeight = document.body.clientHeight;
                yScroll += 28;
        }
        // for small pages with total height less then height of the viewport
        if(yScroll < windowHeight){
                pageHeight = windowHeight;
        } else {
                pageHeight = yScroll;
        }
        // for small pages with total width less then width of the viewport
        if(xScroll < windowWidth){
                pageWidth = windowWidth;
        } else {
                pageWidth = xScroll;
        }
        arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
        return arrayPageSize;
}
var page_backbox = false;
var page_frontbox = false;
function open_page_box() {
  if(page_backbox == false && page_frontbox == false) {
    var page_size = getPageSize();
    page_backbox = document.createElement('DIV');
    page_backbox.className = 'page_backbox';
    page_backbox.style.height = page_size[1] + 'px';
    //page_backbox.onclick = function () { close_page_box(); }
    page_frontbox = document.createElement('DIV');
    page_frontbox.className = 'page_frontbox';
    //page_frontbox.onclick = function () { close_page_box(); }
    document.body.appendChild(page_backbox);
    document.body.appendChild(page_frontbox);
    window.scrollTo(0,'50%');
  }
}
function close_page_box() {
  page_backbox.parentNode.removeChild(page_backbox);
  page_backbox = false;
  page_frontbox.parentNode.removeChild(page_frontbox);
  page_frontbox = false;
}

function pop_feedback_box() {
  open_page_box();
  page_frontbox.innerHTML = "<table cellspacing='0' cellpadding='0' style='margin-left:auto;margin-right:auto;border:1px solid black;background-color:#ffffff'><tr style='font-weight:bold;color:#ffffff;background-color:#808080'><td style='font-size: 14px;padding:2px 4px; border-bottom: 1px solid #000000'>Site Feedback</td><td align='right' style='padding:2px 4px; border-bottom: 1px solid #000000'><span class='jsbutton' onclick='close_page_box()'>Close [x]</span></td></tr><td colspan='2'><iframe src='/include/background_load/feedback.php' style='width: 320px; height: 300px; border: 0px'></iframe></td></tr></table>";
}
/*
function changeOpac(opacity, id)
{
    var object = document.getElementById(id).style; 
		object.opacity = (opacity / 100);
		object.MozOpacity = (opacity / 100);
		object.KhtmlOpacity = (opacity / 100);
		object.filter = "alpha(opacity=" + opacity + ")"; 
}
*/
function check_form(formObj) {
  formObj.window_location.value = parent.window.location.toString();
  if(formObj.comments.value.length > 0) return true;
  else return false;
}