

MM_preloadImages('/app_themes/images/shell/footer_link_agency_f2.jpg','/app_themes/images/shell/footer_link_group_f2.jpg');

// image swapping
function swapImage(id,onOff) {
      document.images[id].src=onOff;
     }

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function MM_changeProp(objName,x,theProp,theValue) { //v6.0
  var obj = MM_findObj(objName);
  if (obj && (theProp.indexOf("style.")==-1 || obj.style)){
    if (theValue == true || theValue == false)
      eval("obj."+theProp+"="+theValue);
    else eval("obj."+theProp+"='"+theValue+"'");
  }
}
function goToURL() { //v3.0
  var i, args=goToURL.arguments; document.returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function MM_jumpMenuGo(selName,targ,restore){ //v3.0
  var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}

function showhidetable(tblid) {
    if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
		document.getElementById(tblid).style.display = (document.getElementById(tblid).style.display == 'none') ? '' : 'none';
    }else{
		document.getElementById(tblid).style.display = (document.getElementById(tblid).style.display == 'none') ? '' : 'none';
    }
}

function popup_open(theURL,winName,features) { //v2.0
	//theURL = theURL + "?document=" + location.href + "&title=" + document.title
	//theURL = theURL + "?title=" + document.title + "&document=" + location.href 
	window.open(theURL,winName,features);
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->










// Setting Focus when a checkbox is in place
var focuson = ""
function btnfocus(focus){
	focuson = focus;
}
function CaptureEnter()
{
    if (window.event.keyCode == 13) 
    {
     window.event.cancelBubble = true;
     window.event.returnValue = false;
     //alert(focuson);
     document.getElementById(focuson).click();
     //document.Form1[focuson].click();
     return false;
    }
}

action = 0;
function expandtree()
{
var i;
    for (i=1;i<rtv.AllNodes.length;i++)
	{
			rtv.AllNodes[i].Toggle();
	   }
} 
function dropconfirm(source, dest)
{   
   if (source != null && dest != null){
      return confirm("You just dragged " + source.Text + " onto " + dest.Text + ". Proceed with postback ?");   
   }
   return false;
}
function navcontextclick(node, itemText)
{ 
   if (node != null && itemText != null){
		if (node.Category == "folder") {
				if (itemText == "Print") {
							popup_open('print.aspx?module=' + node.Value,'Preview','scrollbars=yes,resizable=yes,width=800,height=800')}
				else if (itemText == "Create New Page"){
							goToURL('parent','/webadmin/default.aspx?option=content&module=' + node.Value + '&tab=1');return document.returnValue;}
		}
		else if (node.Category == "page") {
			var nv = node.Value.split("|");
			if (itemText == "Create New Question"){
					goToURL('parent','/webadmin/default.aspx?option=content&module=' + nv[2] + '&page=' + nv[0] + '&tab=1');return document.returnValue;}
       		else if (itemText == "Delete"){
					return confirm("Are you sure that you wish to delete " + node.Text + " ?")}
		}
		else if (node.Category == "question") {
			var nv = node.Value.split("|");
			//if (itemText == "Print"){
					//goToURL('parent','/webadmin/default.aspx?option=content&module=' + nv[2] + '&page=' + nv[0] + '&tab=1');return document.returnValue;}
       		//else 
       		if (itemText == "Delete"){
					return confirm("Are you sure that you wish to delete " + node.Text + " ?")}
		}
   }
	return false;
}

function bolSubmit() 
{ 
document.Form1.action ='http://www.ge.com/jsp/search/newSearch.jsp'; 
document.Form1.method = "post"; 
document.Form1.submit(); 
}
function getconfirm(str) { 
	return confirm(str);
	}

function checkDeleteUser() { 
if (submitcount == 0) {
		alert("Are you sure that you want to delete this user");
		submitcount++; return true;  //You could add your alert here. 
	}}

function UpdateStatus(node)
{   
   window.status = node.Value;   
   
   if (node.Category == "File")
   {
      var ss = node.Value.split("||");
      document.getElementById("name").innerHTML = ss[0];
      document.getElementById("size").innerHTML = ss[1];
      document.getElementById("mod").innerHTML = ss[2];
      MM_swapImage('imgpreview','',ss[3],0);
   }
   else if (node.Value != null)
   {      
      document.getElementById("name").innerHTML = node.Value;
      document.getElementById("size").innerHTML = "Folder";
      document.getElementById("mod").innerHTML = "";   
   }   
}

function addtoList(objName,objHidden,src) { //Administrative
	var newtext;
	var obj = MM_findObj(objName)
	var obj2 = MM_findObj(objHidden)
	var srcobj = MM_findObj(src); if (srcobj) newtext = srcobj.value;
	var oOption = document.createElement("OPTION"); 
	obj.options.add(oOption);
	//Form1.ListBox1.options.add(oOption); 
	oOption.innerText = newtext; 
	oOption.value = newtext; 
	if (obj2.value == "") {obj2.value = newtext;}
	else {obj2.value = obj2.value + '||' + newtext;}
	
}
function removefromList(objName,objHidden) { //Administrative
	var obj = MM_findObj(objName)
	var obj2 = MM_findObj(objHidden)
	for (i = 0; i < obj.options.length; i++) { 
		if (obj.options[i].selected == true) {
			obj.options[i] = null ;}
	}
	obj2.value = "";
	for (i = 0; i < obj.options.length; i++) { 
		if (i == 0) {obj2.value = obj.options[i].value;}
		else{obj2.value = obj2.value + '||' + obj.options[i].value;}
	}
}

