// form field onfocus:

function setInputColor(objElement){
    objElement.style.backgroundColor='#F9F6A3';
    objElement.style.border='1px solid #0084FF';
    
}
function hideColor(objElement){
    objElement.style.backgroundColor='#ffffff';
    objElement.style.border='1px solid #cccccc';        
}

// positioning divs:
// - footer for form pages that are shorter than the users browser height
// - flash content div to maximize the flash height but keep the entire page viewable

function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}
/**/
function setFlashHeight() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		//var headerHeight = document.getElementById('header').offsetHeight;
	    var footerHeight = document.getElementById('footer').offsetHeight;
		if (windowHeight > 0) {
		    var flashheight = (windowHeight - (90 + footerHeight));
		    var divflashcontent = document.getElementById('flashcontent');
		    if (divflashcontent != null) {
		        divflashcontent.style.height = flashheight + 'px';
		    }
		}
	}
}

function setFlashHeightMain(minusHeight){
    var winH = getFlashHeightMain(minusHeight);
    var flashheight = (winH);
    var flashcontent = document.getElementById('flashcontent');
    if (flashcontent != null) {
        flashcontent.style.height = flashheight + 'px';
    }
    var flashcontentdiv = document.getElementById('flashcontentdiv');
    if (flashcontentdiv != null) {
        flashcontentdiv.style.height = flashheight + 'px';
    }
}

function getFlashHeightMain(minusHeight){
    var winH = window.innerHeight-minusHeight;
    if (parseInt(navigator.appVersion)>3) {
     if (navigator.appName=="Netscape") {
      winH = window.innerHeight-minusHeight;
     }
     if (navigator.appName.indexOf("Microsoft")!=-1) {
      winH = getWindowHeight()-minusHeight;
     }
    }
    return winH;
}

function setFlashWidthMain(minusWidth){
    var winW = getFlashWidthMain(minusWidth);
    var flashwidth = (winW);
    var flashcontent = document.getElementById('flashcontent');
    if (flashcontent != null) {
        flashcontent.style.width = flashwidth + 'px';
    }	
    var flashcontentdiv = document.getElementById('flashcontentdiv');
    if (flashcontentdiv != null) {
        flashcontentdiv.style.width = flashwidth + 'px';
    }
}

function getFlashWidthMain(minusWidth){
    var winW = window.innerWidth-minusWidth;
    if (parseInt(navigator.appVersion)>3) {
     if (navigator.appName=="Netscape") {
      winW = window.innerWidth-minusWidth;
     }
     if (navigator.appName.indexOf("Microsoft")!=-1) {
      winW = document.body.offsetWidth-minusWidth;
     }
     //safari
     if (navigator.vendor != null && navigator.vendor.indexOf("apple")!=-1) {
      winW =  document.body.clientWidth-minusWidth;
     }
    }
    return winW;
}

function setFlashHeightFileViewer(minusHeight){
    var winH = window.innerHeight;
    if (parseInt(navigator.appVersion)>3) {
     if (navigator.appName=="Netscape") {
      winH = window.innerHeight-minusHeight;
     }
     if (navigator.appName.indexOf("Microsoft")!=-1) {
      winH = getWindowHeight()-minusHeight;
     }
    }
    var flashheight = (winH);
    var divflashcontent = document.getElementById('flashcontent');
    if (divflashcontent != null) {
        divflashcontent.style.height = flashheight + 'px';
    }	
}


function setFlashWidthFileViewer(minusWidth,noads){
var winW = window.innerWidth;
    if (parseInt(navigator.appVersion)>3) {
     if (navigator.appName=="Netscape") {
      winW = window.innerWidth-minusWidth;

     }
     if (navigator.appName.indexOf("Microsoft")!=-1) {
      winW = document.body.offsetWidth-minusWidth+20;
     }
     //safari     
     if (navigator.vendor.toLowerCase().indexOf("apple") != -1) {
      winW =  document.body.clientWidth-minusWidth;
     }     
    }
    var flashwidth = (winW);
    var divflashcontent = document.getElementById('flashcontent');
    if (divflashcontent != null) {
        divflashcontent.style.width = flashwidth + 'px';
    }	
}

function setFooter() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		if (windowHeight > 0) {
			var contentHeight = document.getElementById('container').offsetHeight;
			var footerElement = document.getElementById('footer');
			var footerHeight  = footerElement.offsetHeight;
			if (windowHeight - (contentHeight + footerHeight) >= 0) {
				footerElement.style.position = 'relative';
				footerElement.style.top = (windowHeight - (contentHeight + footerHeight - 28)) + 'px';
			}
			else {
				footerElement.style.position = 'static';
			}
		}
	}
}