﻿// JScript File

//shows a hover over tool top
//e=html object
//text=text of tooltip
function showToolTip(e,text){ 
	
      document.all.ToolTip.innerHTML="<table><tr><td class=ToolTipTD>"+text+"</td></tr></table>"; 
      
      if (ToolTip.clientWidth + e.x > document.body.clientWidth)
		ToolTip.style.pixelLeft=(e.x+15+document.body.scrollLeft-ToolTip.clientWidth)      
      else
		ToolTip.style.pixelLeft=(e.x+15+document.body.scrollLeft); 
      
      if (ToolTip.clientHeight + e.y > document.body.clientHeight)
		ToolTip.style.pixelTop=(e.y+document.body.scrollTop-ToolTip.clientHeight) 
      else
		ToolTip.style.pixelTop=(e.y+document.body.scrollTop);     		
    
      ToolTip.style.visibility="visible"; 
} 
function hideToolTip(){ 
      ToolTip.style.visibility="hidden"; 
} 

function GetFromClipboard(controlId) {
if (window.clipboardData)

    var control = document.getElementById(controlId); 

    if (control == null)
    {
        alert('ERROR - control not found - ' + controlId); 
    }
    else
    { 
        //determine the value of the control
        control.value = window.clipboardData.getData('Text'); 
    }

	return false;
}

function PutInClipboard(controlId) 
{ 
    var control = document.getElementById(controlId); 

    if (control == null)
    {
        alert('ERROR - control not found - ' + controlId); 
    }
    else
    { 
        //determine the value of the control
        var controlValue = control.value; 

        //copy to clipboard 
        window.clipboardData.setData('Text', controlValue);
        
        alert('Metadata has been copyied to clipboard');
    }
    
    return false;
} 

function ToggleAll(iRow, iInput, iBoolean) {
	if (iBoolean == true) {
		iRow.bgColor = '#ffff99';
	}
	else {
		iRow.bgColor = '';
	}	
	iInput.checked = iBoolean;	
}

function checkAll(formId, cName, check ) {
    for (i=0,n=formId.elements.length;i<n;i++) {
        if (formId.elements[i].className.indexOf(cName) !=-1)
            formId.elements[i].checked = check;
    }
} 
 
function ToggleColor(iRow, iInput) {
	if (iInput.checked == true) {
		iRow.bgColor = '';
		iInput.checked = false;
	}
	else {
		iRow.bgColor = '#ffff99'
		iInput.checked = true;
	}	
}
 
function clickAll(formId, cName, button, check) {	
    for (i=0,n=formId.elements.length;i<n;i++) {
		var e = formId.elements[i];
		if (e.name == cName) 		
			if (button.value == 'Select All')
				ToggleAll(window.document.all('row_'+e.value),window.document.all('input_'+e.value),true)
			else
				ToggleAll(window.document.all('row_'+e.value),window.document.all('input_'+e.value),false)			
    }
    
    if (button.value == 'Select All')		
		button.value = 'Select None'
	else
		button.value = 'Select All';
} 

function FreezeScreen(msg) {    
    scroll(0, 0);
    var outerPane = document.getElementById('FreezePane');
    var innerPane = document.getElementById('InnerFreezePane');
    if (outerPane) outerPane.className = 'FreezePaneOn';
    if (innerPane) innerPane.innerHTML = msg;
    return true;
}

/*
08/12/2007 fmp
function to show/hide div tag based on a click on an image
*/
function TogglePlusMinus(divID, imgID, spanID, spanText) {
var div  = document.getElementById(divID)
var img  = document.getElementById(imgID)
var span = document.getElementById(spanID)

	if (div.style.display == "none") {
		div.style.display = "";
		img.src = "images/collapse.jpg";
		img.alt = spanText + "&nbsp;&nbsp;&nbsp;&nbsp;(Hide Details...)";
		span.innerHTML = spanText + "&nbsp;&nbsp;&nbsp;&nbsp;(Hide Details...)";
	}
	else {
		div.style.display = "none";
		img.src = "images/expand.jpg";
		img.alt = spanText + "&nbsp;&nbsp;&nbsp;&nbsp;(Show Details...)";
		span.innerHTML = spanText + "&nbsp;&nbsp;&nbsp;&nbsp;(Show Details...)";
	}
}
