function GetHeaderImage()
{
images = new Array(3);
images[0] = "<img src='../../Images/BannerXifring00.jpg' alt='Xifring - Your Data Certification Easy' style='cursor:pointer;' onclick=window.open('../../index.asp','_self') />";
images[1] = "<img src='../../Images/BannerXifring01.jpg' alt='Xifring - Your Data Certification Easy' style='cursor:pointer;' onclick=window.open('../../index.asp','_self') />";
images[2] = "<img src='../../Images/BannerXifring02.jpg' alt='Xifring - Your Data Certification Easy' style='cursor:pointer;' onclick=window.open('../../index.asp','_self') />";
index = Math.floor(Math.random() * images.length);
document.write(images[index]);
}

function setHome()
{
   document.body.style.behavior='url(#default#homepage)';
   document.body.setHomePage(window.location.href);
}

function addFavorites()
{
if (document.all)
  {
  window.external.AddFavorite
  ("http://www.xifring.com","Xifring - Your Data Certification Easy")
  }
}

function TrimRight( str ) {
var resultStr = "";
var i = 0;
// Return immediately if an invalid value was passed in
if (str+"" == "undefined" || str == null) 
return null;
// Make sure the argument is a string
str += "";

if (str.length == 0) 
resultStr = "";
else {
// Loop through string starting at the end as long as there
// are spaces.
i = str.length - 1;
while ((i >= 0) && (str.charAt(i) == " "))
i--;

// When the loop is done, we're sitting at the last non-space char,
// so return that char plus all previous chars of the string.
resultStr = str.substring(0, i + 1);
}

return resultStr; 
}

function TrimLeft( str ) {
var resultStr = "";
var i = len = 0;
// Return immediately if an invalid value was passed in
if (str+"" == "undefined" || str == null) 
return null;
// Make sure the argument is a string
str += "";
if (str.length == 0) 
resultStr = "";
else { 
// Loop through string starting at the beginning as long as there
// are spaces.
// len = str.length - 1;
len = str.length;

while ((i <= len) && (str.charAt(i) == " "))
i++;
// When the loop is done, we're sitting at the first non-space char,
// so return that char plus the remaining chars of the string.
resultStr = str.substring(i, len);
}
return resultStr;
}

function Trim( str ) {
var resultStr = "";

resultStr = TrimLeft(str);
resultStr = TrimRight(resultStr);

return resultStr;
}

function Left(str, n){
	if (n <= 0)
	    return "";
	else if (n > String(str).length)
	    return str;
	else
	    return String(str).substring(0,n);
}
function Right(str, n){
    if (n <= 0)
       return "";
    else if (n > String(str).length)
       return str;
    else {
       var iLen = String(str).length;
       return String(str).substring(iLen, iLen - n);
    }
}
