//*****************************************************************************
// Filename: utils.js
// Global variables
var URL;				// URL object
var parentframe = '/fr_index.html';

function strpos(str, ch) {
  for (var i = 0; i < str.length; i++)
  if (str.substring(i, i+1) == ch) return i;
  return -1;
}

function getFocus()
{
  self.focus();
}

function doPopUp( url ){
  doPopUpWindow = window.open(url,"Rene","width=500,height=500");
}

function framecheck()
{
  if (parent.location.href == self.location.href)
  {
    var current = window.self.location.pathname;
    var param = window.self.location.search;
    window.location.replace (parentframe + '?' + current + param);
  }
};

function get_cookie(Name) {
  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    // if cookie exists
    if (offset != -1) { 
      offset += search.length
      // set index of beginning of value
      end = document.cookie.indexOf(";", offset);
      // set index of end of cookie value
      if (end == -1)
        end = document.cookie.length;
      returnvalue=unescape(document.cookie.substring(offset, end))
    }
  }
  return returnvalue;
} 

function SetCookie(name, value) {
  document.cookie = name + "=" + escape (value)
}

