function posAvalonDropMenu(selObj,id) {
	if(!isSafari && isNS || isIE_MacOSX || isIE_Mac ){//for Netscape and IE MACs
		document.getElementById(id).style.top =(this.getMarkerTop(selObj) + 22) + "px"; // used to adjust height offset of popup
		document.getElementById(id).style.left = (this.getMarkerLeft(selObj) + 0) + "px"; // used to adjust left offset of popup
	}
	else if(isSafari) { // for Safari MAX OSX
		document.getElementById(id).style.top = (this.getMarkerTop(selObj) + 22) + "px"; // used to adjust height offset of popup
		document.getElementById(id).style.left = (this.getMarkerLeft(selObj)  + 0) + "px"; // used to adjust left offset of popup
	}
	else { // all other EI versions on PC
		xPos = xPos;
		xPos = eval(document.getElementById(selObj)).offsetLeft;
		tempEl = eval(document.getElementById(selObj)).offsetParent;
		while (tempEl != null) {
			xPos += tempEl.offsetLeft;
			tempEl = tempEl.offsetParent;
		}
		yPos = yPos;
		yPos = eval(document.getElementById(selObj)).offsetTop;
		tempEl = eval(document.getElementById(selObj)).offsetParent;
		while (tempEl != null) {
			yPos += tempEl.offsetTop;
			tempEl = tempEl.offsetParent;
		}
		xPos = xPos - 0;
		document.getElementById(id).style.top = yPos + 22; // used to adjust height offset of popup
		document.getElementById(id).style.left = xPos  + 0; // used to adjust left offset of popup
	}
};
function posAvalonDropMenu_2(selObj,id) {
	if(!isSafari && isNS || isIE_MacOSX || isIE_Mac ){//for Netscape and IE MACs
		document.getElementById(id).style.top =(this.getMarkerTop(selObj) + 22) + "px"; // used to adjust height offset of popup
		document.getElementById(id).style.left = (this.getMarkerLeft(selObj) + 0) + "px"; // used to adjust left offset of popup
	}
	else if(isSafari) { // for Safari MAX OSX
		document.getElementById(id).style.top = (this.getMarkerTop(selObj) + 22) + "px"; // used to adjust height offset of popup
		document.getElementById(id).style.left = (this.getMarkerLeft(selObj)  + 0) + "px"; // used to adjust left offset of popup
	}
	else { // all other EI versions on PC
		xPos = xPos;
		xPos = eval(document.getElementById(selObj)).offsetLeft;
		tempEl = eval(document.getElementById(selObj)).offsetParent;
		while (tempEl != null) {
			xPos += tempEl.offsetLeft;
			tempEl = tempEl.offsetParent;
		}
		yPos = yPos;
		yPos = eval(document.getElementById(selObj)).offsetTop;
		tempEl = eval(document.getElementById(selObj)).offsetParent;
		while (tempEl != null) {
			yPos += tempEl.offsetTop;
			tempEl = tempEl.offsetParent;
		}
		xPos = xPos - 0;
		document.getElementById(id).style.top = yPos + 22; // used to adjust height offset of popup
		document.getElementById(id).style.left = xPos  + 0; // used to adjust left offset of popup
	}
};

	var this_pos="";
	var this_mod="";
	function previewModule(mod) {
		this_mod = mod;
		doAjax(mod, '', 'preview_Module', 'GET', '0')
	}
	function displayModule(this_mod) {
		//alert('this.mod' + this_mod + " this_pos - " + this_pos );
		var params = "modPos=" + this_pos;
		doAjax(this_mod, params, 'display_Module', 'GET', '0')
	}
	function preview_Module(xmldoc){
		document.getElementById('modulePreview').innerHTML = xmldoc;
	}
	function display_Module(xmldoc){
		document.getElementById(this_pos).innerHTML = xmldoc;
		window.scrollBy(0,10000);
		// After showing the module, need to reload so the JS for the widget kicks in.
		document.location.reload();
	}
	
	

function hideScrollBars(id){
var container = document.getElementById(id)
var elements = container.getElementsByTagName("div");
   	for (i=0;i< elements.length;i++){
      elements[i].style.overflow='hidden';
   	}
}

function showScrollBars(id){
var container = document.getElementById(id)
var elements = container.getElementsByTagName("div");
   	for (i=0;i< elements.length;i++){
      elements[i].style.overflow='auto';
   	}
}
function MoveOption(objSourceElement, objTargetElement)
    {
        var aryTempSourceOptions = new Array();
        var x = 0;
        
        //looping through source element to find selected options
        for (var i = 0; i < objSourceElement.length; i++) {
            if (objSourceElement.options[i].selected) {
                //need to move this option to target element
                var intTargetLen = objTargetElement.length++;
                objTargetElement.options[intTargetLen].text = objSourceElement.options[i].text;
                objTargetElement.options[intTargetLen].value = objSourceElement.options[i].value;
            }
            else {
                //storing options that stay to recreate select element
                var objTempValues = new Object();
                objTempValues.text = objSourceElement.options[i].text;
                objTempValues.value = objSourceElement.options[i].value;
                aryTempSourceOptions[x] = objTempValues;
                x++;
            }
        }
        
        //resetting length of source
        objSourceElement.length = aryTempSourceOptions.length;
        //looping through temp array to recreate source select element
        for (var i = 0; i < aryTempSourceOptions.length; i++) {
            objSourceElement.options[i].text = aryTempSourceOptions[i].text;
            objSourceElement.options[i].value = aryTempSourceOptions[i].value;
            objSourceElement.options[i].selected = false;
        }
		return false;
    }
    
    function selectAll(FormName, SelectBox){
  	temp = "document." + FormName + "." + SelectBox;
 	Source = eval(temp);

 	for(x=0; x<(Source.length); x++){
    Source.options[x].selected = "true";
    }
	}
