//disable the mouse clicks
//function rf() {
//    return false; 
//}
//document.oncontextmenu = rf;
//function keydown() {
//    if(event.ctrlKey ==true || event.keyCode ==93 || event.shiftKey ==true) {
//        return false;
//    } 
//}
//document.onkeydown = keydown;
//function drag() {
//    return false;
//}
//
//document.ondragstart=drag 
//function stopmouse(e) { 
//    if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2)) 
//    return false; 
//    else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3)) { 
//        //alert("hi there :)");
//        return false; 
//    }
//    return true; 
//} 
//document.onmousedown=stopmouse; 
//if (document.layers) window.captureEvents(Event.MOUSEDOWN); 
//window.onmousedown=stopmouse;
// end of disable.


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];}
}

ns4 = (document.layers)? true:false;
ie4 = (document.all)? true:false;

// Show/Hide functions for non-pointer layer/objects
function show(id) {
        if (ns4) document.layers[id].visibility = "show";
        else if (ie4) document.all[id].style.visibility = "visible";
}

function hide(id) {
        if (ns4) document.layers[id].visibility = "hide";
        else if (ie4) document.all[id].style.visibility = "hidden";
}

function moveTo(obj,x,y) {
    obj.xpos = x
    obj.left = obj.xpos
    obj.ypos = y
    obj.top = obj.ypos
}

function centerLayer(id,width,height) {
   winW = (ns4)? window.innerWidth-16 : document.body.offsetWidth-20;
   winH = (ns4)? window.innerHeight : document.body.offsetHeight;
   if (ns4) obj = document.layers[id];
   else if (ie4) obj = document.all[id].style;
   x = (winW-width)/2;
   y = (winH-height)/2;
   moveTo(obj,x,y);
}

function centerLayerHorizontal(id,width,top) {
   winW = (ns4)? window.innerWidth-16 : document.body.offsetWidth-20;
   winH = (ns4)? window.innerHeight : document.body.offsetHeight;
   if (ns4) obj = document.layers[id];
   else if (ie4) obj = document.all[id].style;
   x = (winW-width)/2;
   y = top;
   moveTo(obj,x,y);
}

function findSelectedIndex(formName, selectName, optionName) {
    for(var i=0;i<eval("document." + formName + "." + selectName + ".options.length");i++) {
        var optionArray = optionName.split(",");
        for(var j=0; j < optionArray.length; j++) {
            if(eval("document." + formName + "." + selectName + ".options[i].value == '" + optionArray[j] + "'")) {
                eval("document." + formName + "." + selectName + ".options[i].selected = '1';");
            }
        }
    }
}

function clearSelectedIndex(formName, selectName) {
    for(var i=0;i<eval("document." + formName + "." + selectName + ".options.length");i++) {
               eval("document." + formName + "." + selectName + ".options[i].selected = false;");
            }
    if (eval("document." + formName + "." + selectName).multiple == false) 
    	eval("document." + formName + "." + selectName + ".options[0].selected = true;");    

        
}

function startInto() {
  window.open('/elearning/intro/flash_detect.html', 'intro', 'toolbar=no,resizable=no,scrollbars=no,status=no,width=500,height=430,directories=no,hotkeys=no,location=no,menubar=no')
}

function toggleit(id, selfName, showValue, hideValue) {
        if (document.all[id].style.display=="none")  {
            document.all[id].style.display = "";
            document.all[selfName].value = hideValue;
        } else {
            document.all[id].style.display = "none";
            document.all[selfName].value= showValue;
        }
        
    }

function toggleitLink(id, selfName, showValue, hideValue) {
        if (document.all[id].style.display=="none")  {
            document.all[id].style.display = "";
            document.all[selfName].innerText = hideValue;
        } else {
            document.all[id].style.display = "none";
            document.all[selfName].innerText= showValue;
        }
        
    }

expandImg=new Image();
collapseImg=new Image();

function toggleImg(srcElement, targetId, img1, img2) {
        if (img1!=null) {
            expandImg = img1;
            collapseImg = img2;
        }   
        
        

        if (document.all[targetId].style.overflow=="auto") {
            document.all[targetId].style.overflow="visible";
            srcElement.src = collapseImg.src;                      
        } else {                                            
            document.all[targetId].style.overflow="auto";   
            srcElement.src = expandImg.src;                      
        }                                                   
    }

function expandLayer(tagId) {
    if(document.all[tagId] != null) 
    document.all[tagId].style.overflow = "visible";
}


function arrowUpDown(srcElement, targetId) {                  
        if (document.all[targetId].style.display=="none") {
            document.all[targetId].style.display="";
            srcElement.src = arrowDownImg.src;                      
        } else {                                            
            document.all[targetId].style.display="none";   
            srcElement.src = arrowUpImg.src;                      
        }                                                   
    }
    
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function open_new_window(theURL, winName, feature, selfChangeTo)  {
	var win_feature = feature;
	var newWin=window.open("", winName, win_feature);
	newWin.location.href = theURL;
	newWin.focus();
        if (selfChangeTo!=null && selfChangeTo!="") {
            document.location=selfChangeTo;
        }

}

function confirm_link(theURL, msg)  {
	if (confirm(msg)) {
	    document.location = theURL;
    }
}

function confirm_cancel(msg)  {
	if (confirm(msg)) {
            window.close();
        }
}    

var oldContent;
var newContent;

function print_body(tagid)  {	
        if (tagid==null) {
            tagid = "jspBody";
        }
        oldContent = document.body.innerHTML;
        if (document.all[tagid].style.overflow=="auto") document.all[tagid].style.overflow="visible";
        newContent = document.all[tagid].innerHTML;
        document.body.innerHTML = newContent;
        window.print();
        document.body.innerHTML = oldContent;

}


var hsSingle = new Object();
var hsArray = new Object();
function autoexpand() {
    var basewidth=800;
    if (document.body.offsetWidth>800) {
        basewidth = document.body.offsetWidth;
    }                	
               
    document.all.expander.width = basewidth-385-373-2-40;

        for(var property in hsSingle) {
			if (document.all[property] != undefined) {
				document.all[property].style.width = basewidth - hsSingle[property];
			}
        }

        for(var property in hsArray) {
            for(i=0;i<document.all[property].length;i++) {
                document.all[property][i].style.width = basewidth - hsArray[property];
            }
        }
		
}
	
function submitWithTodo(form, todo) {
    form.todo.value = todo;
    form.submit();
}