
function RTrim(value)
{
     var whitespace = new String(" \t\n\r");
     var s = new String(value);

     if (whitespace.indexOf(s.charAt(s.length-1)) != -1)
     {
          var i = s.length - 1;       // Get length of string
          while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
               i--;
               s = s.substring(0, i+1);
     }
     return s;
}

function LTrim(value)
{
     var whitespace = new String(" \t\n\r");
     var s = new String(value);

     if (whitespace.indexOf(s.charAt(0)) != -1)
     {
          var j=0, i = s.length;
          
          while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
               j++;
               s = s.substring(j, i);
     }
     return s;
}

function Trim(value)
{
     // return a boolean
     return RTrim(LTrim(value));
}

function closeMe()
{
     // close the current window
     self.close();
}

/********************************************************
* Button Functions                                               *
*********************************************************/
function HighlightButton(a){
     if (a.style)
     {
          if (a.className == 'pcButton')
          {
               // MouseOver
               a.className = 'pcButtonHighLight';
          }
          else
          {
               // MouseOut
               a.className = 'pcButton';
          }
     }
}

function HighlightButtonSubmenu(a){
     if (a.style)
     {
          if (a.className == 'pcButtonSubmenu')
          {
               // MouseOver
               a.className = 'pcButtonHighLightSubmenu';
          }
          else
          {
               // MouseOut
               a.className = 'pcButtonSubmenu';
          }
     }
}

function HighlightButtonSmall(a){
     if (a.style)
     {
          if (a.className == 'pcButtonSmall')
          {
               // MouseOver
               a.className = 'pcButtonSmallHighLight';
          }
          else
          {
               // MouseOut
               a.className = 'pcButtonSmall';
          }
     }
}

function HighlightButtonSmallWhite(a){
     if (a.style)
     {
          if (a.className == 'pcButtonSmallWhite')
          {
               // MouseOver
               a.className = 'pcButtonSmallHighLight';
          }
          else
          {
               // MouseOut
               a.className = 'pcButtonSmallWhite';
          }
     }
}

function HighlightButton2(obj,name){
   if (obj)  
	 obj.src = "/stratfordcareers/client/stratford/images/buttons/" + name; 
}

/********************************************************
* Popup Functions                                                *
*********************************************************/

function openCart()
{
     var h = 250;
     var w = 525;
     var t = ((screen.height / 2) - (h / 2)) - 100;
     var l = ((screen.width / 2) - (w / 2));
     var Config;
     var Page = '/stratfordcareers/popup/cart.asp';
     
     /* Set the configuration options */
     Config    =  ''
     Config += 'channelmode=no, ';
     Config += 'copyhistory=no, ';
     Config    += 'directories=no, ';
     Config += 'fullscreen=no, ';
     Config    += 'height=' + h + ', ';
     Config    += 'left=' + l + ', ';
     Config    += 'location=no, ';
     Config    += 'menubar=no, ';
     Config    += 'resizable=no, ';
     Config    += 'scrollbars=yes, ';
     Config    += 'status=no, ';
     Config    += 'titlebar=no, ';
     Config    += 'toolbar=no, ';
     Config    += 'top=' + t + ', ';
     Config    += 'width=' + w;
     
     /* Open the window */
     popup = window.open(Page, 'cart', Config);

     if(popup.opener == null) popup.opener = window;
     popup.opener.name = 'opener';
     
     /* Set the focus to the new window */
     if (popup)
     {
          popup.focus();
     }
}

function openSplash()
{
     var h = 150;
     var w = 325;
     var t = ((screen.height / 2) - (h / 2)) - 100;
     var l = ((screen.width / 2) - (w / 2));
     var Config;
     var Page = '/stratfordcareers/popup/splash.asp';
     
     /* Set the configuration options */
     Config    =  ''
     Config += 'channelmode=no, ';
     Config += 'copyhistory=no, ';
     Config    += 'directories=no, ';
     Config += 'fullscreen=no, ';
     Config    += 'height=' + h + ', ';
     Config    += 'left=' + l + ', ';
     Config    += 'location=no, ';
     Config    += 'menubar=no, ';
     Config    += 'resizable=no, ';
     Config    += 'scrollbars=no, ';
     Config    += 'status=no, ';
     Config    += 'titlebar=no, ';
     Config    += 'toolbar=no, ';
     Config    += 'top=' + t + ', ';
     Config    += 'width=' + w;
     
     /* Open the window */
     popup = window.open(Page, 'Uploading', Config);

     /*if(popup.opener == null) popup.opener = window;
     popup.opener.name = 'opener';
     
      Set the focus to the new window 
     if (popup)
     {
          popup.focus();
     }*/
}

function openEmail(jid)
{
     var h = 270;
     var w = 525;
     var t = ((screen.height / 2) - (h / 2)) - 100;
     var l = ((screen.width / 2) - (w / 2));
     var Config;
     var Page = 'popup/email.asp?jid=' + jid;

     // Set the configuration options
     Config    =  ''
     Config += 'channelmode=no, ';
     Config += 'copyhistory=no, ';
     Config    += 'directories=no, ';
     Config += 'fullscreen=no, ';
     Config    += 'height=' + h + ', ';
     Config    += 'left=' + l + ', ';
     Config    += 'location=no, ';
     Config    += 'menubar=no, ';
     Config    += 'resizable=no, ';
     Config    += 'scrollbars=yes, ';
     Config    += 'status=no, ';
     Config    += 'titlebar=no, ';
     Config    += 'toolbar=no, ';
     Config    += 'top=' + t + ', ';
     Config    += 'width=' + w;
     
     // Open the window
     popup = window.open(Page, 'email', Config);

     if(popup.opener == null) popup.opener = window;
     popup.opener.name = 'opener';
     
     // Set the focus to the new window
     if (popup)
     {
          popup.focus();
     }
}

function openResume(type)
{
     var h = 170;
     var w = 400;
     var t = ((screen.height / 2) - (h / 2)) - 100;
     var l = ((screen.width / 2) - (w / 2));
     var Config;
     var Page = 'popup/upload.asp?type='+type;
   
     /* Set the configuration options */
     Config    =  ''
     Config += 'channelmode=no, ';
     Config += 'copyhistory=no, ';
     Config    += 'directories=no, ';
     Config += 'fullscreen=no, ';
     Config    += 'height=' + h + ', ';
     Config    += 'left=' + l + ', ';
     Config    += 'location=no, ';
     Config    += 'menubar=no, ';
     Config    += 'resizable=no, ';
     Config    += 'scrollbars=no, ';
     Config    += 'status=no, ';
     Config    += 'titlebar=no, ';
     Config    += 'toolbar=no, ';
     Config    += 'top=' + t + ', ';
     Config    += 'width=' + w;

     /* Open the window */
     popup = window.open(Page, 'upload', Config);

     if(popup.opener == null) popup.opener = window;
     popup.opener.name = 'opener';
     
     /* Set the focus to the new window */
     if (popup)
     {
          popup.focus();
     }
}    


