<!--
var thisUrl = location.href;
servername = thisUrl.substr(thisUrl.indexOf('//')+2,thisUrl.indexOf('/',thisUrl.indexOf('//')+2)-(thisUrl.indexOf('//')+2));

if (servername == '') servername = "localhost";


var App_VirtualRoot = "/myschoolportal2_0"
var App_ServerPath = thisUrl.substr(0,thisUrl.indexOf('/',thisUrl.indexOf('//')+2));
var App_WebRoot = App_ServerPath+App_VirtualRoot
//derive webroot from the url
var App_FullWebRoot = thisUrl.substr(0, thisUrl.indexOf('?'));
var App_ImageRoot = App_WebRoot+"/images006/";
var israelo;


function App_NewWindow(pUrl,pWidth,pHeight,pTop,pLeft,pEtc) {
	win_New = window.open(pUrl,"win_New","width="+pWidth+",height="+pHeight+",top="+pTop+",left="+pLeft+pEtc);
	win_New.focus();
}

function fullScreen(pUrl) {
	App_NewWindow(pUrl,window.screen.width,window.screen.height,0,0,", toolbar=yes, menubar=yes");
}

function openWindow(pUrl) {
	App_NewWindow(pUrl,window.screen.width-100,window.screen.height-100,10,10,", toolbar=yes, menubar=yes, scrollbars=yes, status=yes, resizable=yes");
		
}

function App_MinMax(part,alt) {
	var thisPart = document.all['part'+part];
	var thisImg = document.all['min'+part];
	if (thisPart.style.display == '') {
		thisPart.style.display = "none";
		thisImg.src = App_ImageRoot+"plus"+alt+".gif";
	} else {
		thisPart.style.display = "";
		thisImg.src = App_ImageRoot+"minus"+alt+".gif";
	}
}

function disableEnterKey(){
      if(event.keyCode == 13) event.returnValue = false;
      event.cancelBubble = true
}

//still leave for now, study more with time
function App_FindMatch(param) {
	var sURL =  App_VirtualRoot+"/services/peopleFinder.aspx?"+param;
	App_NewWindow(sURL,700,400,100,50,'",scrollbars=1"');
}

function Footer_Link(pagename) {
  var sURL = App_VirtualRoot + "/services/footerLinks.aspx?id=" + pagename;
  App_NewWindow(sURL,400,300,100,50,'",scrollbars=1"');
}


function doOnload(redirect, newUrl) {
   if (redirect) {
        //move to specified page
        window.location.href = newUrl;
   } else {
        document.getElementById('splashScreen').style.visibility='hidden';
        document.getElementById('contentScreen').style.display='';
   }
}
 
function loadHelp() {
	window.location.href = App_FullWebRoot + "?Event=default&TabName=Help";
}

function openpopup(url, windowtarget) 
{
    window.open(
        url, 
        windowtarget,
        
'width=240,height=180,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0');
}
function fadein(){
mytransition.innerHTML=''
if (cur!='x'){
mytransition.filters.revealTrans.Transition=cur
mytransition.filters.revealTrans.apply()
mytransition.innerHTML='<p align="center"><big><big><font face="Verdana">This is a sample document. Welcome!</font></big></big></p><p align="center"><img src="BS00825A.gif" width="97" height="100"></p><p align="center"><img src="BS00825A.gif" width="97" height="100"></p><p align="center"><big><big><font face="Verdana">This is a sample document. Welcome!</font></big></big></p>'
mytransition.filters.revealTrans.play()
}
else{
mytransition.filters.blendTrans.apply()
mytransition.innerHTML='<p align="center"><big><big><font face="Verdana">This is a sample document. Welcome!</font></big></big></p><p align="center"><img src="BS00825A.gif" width="97" height="100"></p><p align="center"><img src="BS00825A.gif" width="97" height="100"></p><p align="center"><big><big><font face="Verdana">This is a sample document. Welcome!</font></big></big></p>'
mytransition.filters.blendTrans.play()
}
}
//-->
var capslock = {
  init: function() {
    if (!document.getElementsByTagName) {
      return;
    }
    // Find all password fields in the page, and set a keypress event on them
    var inps = document.getElementsByTagName("input");
    for (var i=0, l=inps.length; i<l; i++) {
      if (inps[i].type == "password") {
        capslock.addEvent(inps[i], "keypress", capslock.keypress);
      }
    }
  },
  addEvent: function(obj,evt,fn) {
    if (document.addEventListener) {
      capslock.addEvent = function (obj,evt,fn) {
        obj.addEventListener(evt,fn,false);
      };
      capslock.addEvent(obj,evt,fn);
    } else if (document.attachEvent) {
      capslock.addEvent = function (obj,evt,fn) {
        obj.attachEvent('on'+evt,fn);
      };
      capslock.addEvent(obj,evt,fn);
    } else {
      // no support for addEventListener *or* attachEvent, so quietly exit
    }
  },
  keypress: function(e) {
    var ev = e ? e : window.event;
    if (!ev) {
      return;
    }
    var targ = ev.target ? ev.target : ev.srcElement;
    // get key pressed
    var which = -1;
    if (ev.which) {
      which = ev.which;
    } else if (ev.keyCode) {
      which = ev.keyCode;
    }
    // get shift status
    var shift_status = false;
    if (ev.shiftKey) {
      shift_status = ev.shiftKey;
    } else if (ev.modifiers) {
      shift_status = !!(ev.modifiers & 4);
    }
    if (((which >= 65 && which <=  90) && !shift_status) ||
        ((which >= 97 && which <= 122) && shift_status)) {
      // uppercase, no shift key
      capslock.show_warning(targ);
    } else {
      capslock.hide_warning(targ);
    }
  },
  
  show_warning: function(targ) {
    if (!targ.warning) {
      targ.warning = document.createElement('img');
      targ.warning.src = "images006/cpwarn.png";
      targ.warning.style.position = "absolute";
      targ.warning.style.top = (targ.offsetTop - 73) + "px";
      targ.warning.style.left = (targ.offsetLeft + targ.offsetWidth - 5) + "px";
      targ.warning.style.zIndex = "999";
      targ.warning.setAttribute("alt", "Warning: Caps Lock is on");
      if (targ.warning.runtimeStyle) {
        // PNG transparency for IE
        targ.warning.runtimeStyle.filter += 
"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images006/cpwarn.png',sizingMethod='scale')";
      }
      document.body.appendChild(targ.warning);
    }
  },
  hide_warning: function(targ) {
    if (targ.warning) {
      targ.warning.parentNode.removeChild(targ.warning);
      targ.warning = null;
    }
  }
};

(function(i) {var u =navigator.userAgent;var e=/*@cc_on!@*/false; var st =
setTimeout;if(/webkit/i.test(u)){st(function(){var dr=document.readyState;
if(dr=="loaded"||dr=="complete"){i()}else{st(arguments.callee,10);}},10);}
else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
document.addEventListener("DOMContentLoaded",i,false); } else if(e){     (
function(){var t=document.createElement('doc:rdy');try{t.doScroll('left');
i();t=null;}catch(e){st(arguments.callee,0);}})();}else{window.onload=i;}})(capslock.init);


