<!--// PopUp Window //-->
function PopupPic(sPicURL) { 
     window.open( "popup.htm?"+sPicURL, "",  
     "resizable=0,HEIGHT=200,WIDTH=200"); 
} 
<!--//Popup Window with Target //-->
function popupWindow(link, windowname, windowattr){
if (! window.focus)return true;
var href;
if (typeof(link) == 'string')
   href=link;
else
   href=link.href;
window.open(href, windowname, windowattr);
return false;
}

<!--//  //-->
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_jumpMenuGo(selName,targ,restore){ //v3.0
  var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}

function MM_jumpMenuNew(targ,selObj,restore){ //v3.0
var s = selObj.options[selObj.selectedIndex].value;
window.open(s);
if (restore) selObj.selectedIndex=0;
}

<!--//  //-->
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_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_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];}
}

<!--//  //-->
function MM_displayStatusMsg(msgStr) { //v1.0
  status=msgStr;
  document.MM_returnValue = true;
}

<!--//  //-->
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

<!--//  //-->
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

<!--// MM Form Validation //-->
function MM_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}


//Style Sheet Switcher version 1.0 Nov 9th, 2005
//Author: Dynamic Drive: http://www.dynamicdrive.com
//Usage terms: http://www.dynamicdrive.com/notice.htm

function getCookie(Name) { 
var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
if (document.cookie.match(re)) //if cookie found
return document.cookie.match(re)[0].split("=")[1] //return its value
return null
}

function setCookie(name, value, days) {
var expireDate = new Date()
//set "expstring" to either future or past date, to set or delete cookie, respectively
var expstring=(typeof days!="undefined")? expireDate.setDate(expireDate.getDate()+parseInt(days)) : expireDate.setDate(expireDate.getDate()-5)
document.cookie = name+"="+value+"; expires="+expireDate.toGMTString()+"; path=/";
}

function deleteCookie(name){
setCookie(name, "moot")
}

function setStylesheet(title) {
var i, cacheobj
for(i=0; (cacheobj=document.getElementsByTagName("link")[i]); i++) {
if(cacheobj.getAttribute("rel").indexOf("style") != -1 && cacheobj.getAttribute("title")) {
cacheobj.disabled = true
if(cacheobj.getAttribute("title") == title)
cacheobj.disabled = false //enable chosen style sheet
}
}
}

function chooseStyle(styletitle, days){
if (document.getElementById){
setStylesheet(styletitle)
setCookie("mysheet", styletitle, days)
}
}

function indicateSelected(element){ //Optional function that shows which style sheet is currently selected within group of radio buttons or select menu 
var i
if (selectedtitle!=null && (element.type==undefined || element.type=="select-one")){ //if element is a radio button or select menu
var element=(element.type=="select-one") ? element.options : element
for (i=0; i<element.length; i++){
if (element[i].value==selectedtitle){ //if match found between form element value and cookie value
if (element[i].tagName=="OPTION") //if this is a select menu
element[i].selected=true
else //else if it's a radio button
element[i].checked=true
break
}
}
}
}

//**************************************************************
// Function: printpage
// 03-27-07 Dave Walker - Print page for sodexho.com
// 06-25-07 Dave Walker - Move Print link to top of page.
// 09-04-07 Dave Walker - Remove media=print.
// 09-10-07 Dave Walker - Add space after print link.
//**************************************************************
function printPage(id1, id2, css, width, height)
{

/* id1 - first div id to process          */
/* id2 - second div id to process     */
/* css - css to embed                    */
/* height of new window                */
/* width of new window                 */

var m;
var ptr2;
var text="";
var elem;
var features;
text += "<html lang=\"en-GB\"><head>";
text += "<link rel=\"stylesheet\" type=\"text/css\" href=\"" + css +  "\" >";
text += "</head>";
text += "<body>";
text += "<div id=\"printable\">";
text += "<p><a href=\"javascript:print()\">Click here to print this page</a></p><p>";

if (id1 != "")
{
   elem = document.getElementById(id1);
   if (elem != null)
      text+= elem.innerHTML;
}
if (id2 != "")
{
   elem = document.getElementById(id2);
   if (elem != null)
      text+= elem.innerHTML;
}
text += "</div></body>";
text += "</html>"
features = "height="+height+",width="+width+",scrollbars=yes";
m = window.open("printDoc.html","printWindow",features);            
   m.document.write(text) ;
   m.moveTo(10,20);
   m.focus();
   m.document.close();  
}

//**************************************************************
// Function: printMLpage
//      Performs similar function as the printPage above, only this version uses
//      the appropriate language and translation for the print link in the 
//      printable page.
//
// 01/25/08 - Maricar Renion - Print page for CCIS
// 01/13/09 - Maricar Renion - Added div style for print message. 
// 02/18/09 - Maricar Renion - Added div style and div code for print_Logo
//**************************************************************
function printMLPage(ids, css, width, height, printMsg,lang)
{

/* ids - array of div ids to process                                       */
/* css - css to embed                                                      */
/* height of new window                                                    */
/* width of new window                                                     */
/* printMsg - translated message for actual print page link                */
/* lang - language of calling publication                                  */

var m;
var text="";
var elem;
var features;
var id;

text += "<html lang=\"" + lang + "\"><head>";
text += "<link rel=\"stylesheet\" type=\"text/css\" href=\"" + css +  "\" >";
text += "<style type=\"text\/css\">";
text += "#print_logo {display: block; text-align: right; border: 0px;}";
text += "#printAction {float: left; width: 200px;}";
text += "</style>";
text += "</head>";
text += "<body>";
text += "<div id=\"printable\">";
text += "<div id=\"printAction\"><p><a href=\"javascript:print()\">" + printMsg + "</a></p></div><p>";
text += "<div id=\"print_logo\"><img src=\"\/sden\/Images\/print-logo_tcm67-257294.jpg\" alt=\"Sodexo Print Logo\"></div>";

for (id = 0; id < ids.length; id++)
{
   if (ids[id] != "")
   {
      elem = document.getElementById(ids[id]);
      if (elem != null)
         text+= elem.innerHTML;
   }
}

text += "</p></div></body>";
text += "</html>"
features = "height="+height+",width="+width+",scrollbars=yes,top=10,left=10,resizeable=yes";
m = window.open("printDoc.html","printWindow",features);            
   m.document.write(text) ;
   m.focus();
   m.document.close();  
}

//**************************************************************
// Function: emailPage
// 05-02-07 Dave Walker - Email page for sodexho.com
//
//  Description: Add component link to Email Page URL.
//**************************************************************
function emailPage(link, emailPage)
{
   var href;
   href = emailPage + "?" + link;
   window.location = href;
}

//**************************************************************
// Function: showURL
// 03-27-07 Provided by Studio North
//Script Mr Ted
//**************************************************************
function showURL(url)
{
window.open(url,'Applyscreen','width=450,height=345,scrollbars=yes,resizable=no').focus();
} 

var selectedtitle=getCookie("mysheet")
if (document.getElementById && selectedtitle!=null) //load user chosen style sheet if there is one stored
setStylesheet(selectedtitle)