var idleTime = 3590000; // number of miliseconds until the user is considered idle var initialSessionTimeoutMessage = 'Your session will expire in seconds.

Click on OK to continue your session.'; var sessionTimeoutCountdownId = 'sessionTimeoutCountdown'; var redirectAfter = 10; // number of seconds to wait before redirecting the user var redirectTo = '../__clrsession.php'; // URL to relocate the user to once they have timed out var expiredMessage = 'Your session has expired. You are being logged out for security reasons.'; // message to show user when the countdown reaches 0 var running = false; // var to check if the countdown is running var timer; // reference to the setInterval timer so it can be stopped function limitText(limitField, limitNum) { if (limitField.value.length > limitNum) { limitField.value = limitField.value.substring(0, limitNum); } } function strpos( haystack, needle, offset){ // http://kevin.vanzonneveld.net // + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + improved by: Onno Marsman // + bugfixed by: Daniel Esteban // * example 1: strpos('Kevin van Zonneveld', 'e', 5); // * returns 1: 14 var i = (haystack+'').indexOf(needle, (offset ? offset : 0)); return i === -1 ? false : i; } if (strpos(window.location,'/about') || strpos(window.location,'/volunteers') || strpos(window.location,'/researchers') || strpos(window.location,'/partners') || strpos(window.location,'/contact') || strpos(window.location,'/cordinators') || strpos(window.location,'/login')){ var link_url = '../'; } else { var link_url = '../'; } $j(document).ready(function(){ if($j('#sessionTimeoutWarning').length){ // create the warning window and set autoOpen to false var sessionTimeoutWarningDialog = $j("#sessionTimeoutWarning"); $j(sessionTimeoutWarningDialog).html(initialSessionTimeoutMessage); $j(sessionTimeoutWarningDialog).dialog({ title: 'Session Expiration Warning', autoOpen: false, // set this to false so we can manually open it closeOnEscape: false, draggable: false, width: 460, minHeight: 50, modal: true, beforeclose: function() { // bind to beforeclose so if the user clicks on the "X" or escape to close the dialog, it will work too // stop the timer clearInterval(timer); // stop countdown running = false; }, buttons: { OK: function() { // close dialog $j(this).dialog('close'); } }, resizable: false, open: function() { // scrollbar fix for IE $j('body').css('overflow','hidden'); }, close: function() { clearInterval(timer); // stop countdown running = false; // reset overflow $j('body').css('overflow','auto'); } }); // end of dialog $j.getScript( "/scripts/jquery.idletimer.js" ) .done(function( script, textStatus ) { }); // start the idle timer $j.idleTimer(idleTime); // bind to idleTimer's idle.idleTimer event $j(document).bind("idle.idleTimer", function(){ // if the user is idle and a countdown isn't already running if($j.data(document,'idleTimer') === 'idle' && !running){ var counter = redirectAfter; running = true; // intialisze timer $j('#'+sessionTimeoutCountdownId).html(redirectAfter); // open dialog $j(sessionTimeoutWarningDialog).dialog('open'); // create a timer that runs every second timer = setInterval(function(){ counter -= 1; // if the counter is 0, redirect the user if(counter === 0) { $j(sessionTimeoutWarningDialog).html(expiredMessage); $j(sessionTimeoutWarningDialog).dialog('disable'); window.location = redirectTo; } else { $j('#'+sessionTimeoutCountdownId).html(counter); } }, 1000); } }); } docufon('.title','rw');dosubnav(); $j("#about").click(function(){window.location=link_url+'about/';}).mouseover(function(){$j(this).css("cursor","pointer").css("background-image","url(/images/_pnav_on_05.jpg)");}).mouseout(function(){$j(this).css("cursor","default").css("background-image","url(/images/_pnav_off_05.jpg)");}); $j("#volunteers").click(function(){window.location=link_url+'volunteers/';}).mouseover(function(){$j(this).css("cursor","pointer").css("background-image","url(/images/_pnav_on_06.jpg)");}).mouseout(function(){$j(this).css("cursor","default").css("background-image","url(/images/_pnav_off_06.jpg)");}); $j("#researchers").click(function(){window.location=link_url+'researchers/';}).mouseover(function(){$j(this).css("cursor","pointer").css("background-image","url(/images/_pnav_researchers_on_03.gif)");}).mouseout(function(){$j(this).css("cursor","default").css("background-image","url(/images/_pnav_researchers_off_03.gif)");}); $j("#network").click(function(){window.location=link_url+'partners/';}).mouseover(function(){$j(this).css("cursor","pointer").css("background-image","url(/images/_pnav_on_07.jpg)");}).mouseout(function(){$j(this).css("cursor","default").css("background-image","url(/images/_pnav_off_07.jpg)");}); $j("#contact").click(function(){window.location=link_url+'contact/';}).mouseover(function(){$j(this).css("cursor","pointer").css("background-image","url(/images/_pnav_on_08.jpg)");}).mouseout(function(){$j(this).css("cursor","default").css("background-image","url(/images/_pnav_off_08.jpg)");}); //dobuggers(); //$j('a[href$=".xls"]').addClass("xls"); //$j('a[href$="xls"]').addClass("xls"); // }); donewtitle=function(path){ $j("#contentarea>h1").remove(); $j("#contentarea").prepend("

Welcome / "+path+"

"); docufon('.title','rw'); } dotipm=function(what,colorm,idnum,postip,pospt,posvalign,twidth,info,text){ if(info == ""){ url = text; $j("#"+what).qtip({ show: 'mouseover', hide: 'mouseout', content: { text: text}, position: { corner: { target: postip, tooltip: pospt } }, style: { 'font-size': 14 , width: twidth, padding: 5, background: colorm, color: 'white', textAlign: 'center', border: { width: 7, radius: 5, color: colorm }, tip: posvalign, name: 'dark' } }); } else { url = "/"+info+".php"; $j("#"+what).qtip({ show: 'mouseover', hide: 'mouseout', content: { url: url, data: { id: idnum } }, position: { corner: { target: postip, tooltip: pospt } }, style: { 'font-size': 14, width: twidth, padding: 5, background: colorm, color: 'white', textAlign: 'center', border: { width: 7, radius: 5, color: colorm }, tip: posvalign, name: 'dark' // Inherit the rest of the attributes from the preset dark style } }); } } dotip=function(what,colorm,idnum,postip,pospt,posvalign,twidth,info,text,instid){ if(info == ""){ url = text; $j("#"+what).qtip({ show: 'click', hide: 'click', content: { text: text}, position: { corner: { target: postip, tooltip: pospt } }, style: { 'font-size': 14 , width: twidth, padding: 5, background: colorm, color: 'white', textAlign: 'center', border: { width: 7, radius: 5, color: colorm }, tip: posvalign, name: 'dark' // Inherit the rest of the attributes from the preset dark style } }); } else { url = "/"+info+".php?inst="+text; $j("#"+what).qtip({ show: 'click', hide: 'click', content: { url: url, data: { id: idnum } }, position: { corner: { target: postip, tooltip: pospt } }, style: { 'font-size': 14, width: twidth, padding: 5, background: colorm, color: 'white', textAlign: 'center', border: { width: 7, radius: 5, color: colorm }, tip: posvalign, name: 'dark' // Inherit the rest of the attributes from the preset dark style } }); } } dotipparam=function(what,colorm,idnum,postip,pospt,posvalign,twidth,info,text,param){ url = "/"+info+".php?study_id="+text+"&user_id="+param; $j("#"+what).qtip({ show: 'click', hide: 'click', content: { url: url, data: { id: idnum } }, position: { corner: { target: postip, tooltip: pospt } }, style: { 'font-size': 14, width: twidth, padding: 5, background: colorm, color: 'white', textAlign: 'center', border: { width: 7, radius: 5, color: colorm }, tip: posvalign, name: 'dark' // Inherit the rest of the attributes from the preset dark style } }); } jQuery.fn.setEqualHeight=function(o) { var maxHeight=0; var maxElement=null; jQuery(this).each(function(i) { if((jQuery(this).height()+parseInt(jQuery(this).css("padding-bottom"))+parseInt(jQuery(this).css("padding-top")))>maxHeight) { maxHeight=jQuery(this).height()+parseInt(jQuery(this).css("padding-top"))+parseInt(jQuery(this).css("padding-bottom")); maxElement=this; } }); jQuery(this).not(jQuery(maxElement)).each(function() {jQuery(this).height(maxHeight-parseInt(jQuery(this).css("padding-top"))-parseInt(jQuery(this).css("padding-bottom")))}) } sortthis=function(parent,column,sortorder,sorttype){ //sortorder (asc or desc) //sorttype (string or number or date) var sortParams = { sortOn: column, direction: sortorder, sortType: sorttype } $j(parent).sort(sortParams); } dosortthis=function(parent,sortbyname,type){ if(sortbyname == ".irbsort"){ $j("#tnotifications").attr("id","temptnotification"); } var nameEQ = sortbyname.replace(".","") + "="; var ca = document.cookie.split(';'); var checkcookie = ""; var sortby = ""; for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0){checkcookie = c.substring(nameEQ.length,c.length);} else document.cookie = sortbyname.replace(".","")+"=desc"; } if(checkcookie == "asc"){ sortby = "desc"; document.cookie = sortbyname.replace(".","")+"=desc"; } else { sortby = "asc"; document.cookie = sortbyname.replace(".","")+"=asc"; } sortthis(parent,sortbyname,sortby,type); }