//This method trims the white spaces of the strings

function trim(str)
{
  var i,j;
  i = 0;
  j=str.length-1;
  str = str.split("");
  while(i < str.length)
  {
    if(str[i]==" ")
    {
      str[i] = ""
    }
    else
    {
      break;
    }
    i++;
  }
  while(j > 0)
  {
    if(str[j]== " ")
    {
      str[j]=""
    }
    else
    {
      break;
    }
    j--;
  }
  return str.join("")
}

function isInteger(s)
{   var i;
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}


function modelesswin(url, mwidth, mheight) {
    if (document.all && window.print) {  //if ie5
      eval('window.showModelessDialog(url,"","help:0;resizable:1;dialogWidth:'+(mwidth)+'px;dialogHeight:'+(mheight+80)+'px;status:no;scroll:no;")');
    } else  {
      eval('window.open(url,"","width='+(mwidth+50)+'px,height='+(mheight+80)+'px,resizable=1,scrollbars=0")');
    }
  }

  function win2col(url2col) {
    window.open(url2col,'BP','width=433,height=500,status=no,resizable=1,top=110,left=200,toolbar=no,menubar=no,scrollbars=yes');
  }

  function win3col(url3col) {
    window.open(url3col,'Bp_com','width=627, height=500,resizable=1,top=110,left=200,toolbar=0,titlebar=0,menubar=0,scrollbars=yes');
  }

  function openWin(sURL, homeCategoryId) {
    var iLeft, iTop;
    var iwidth, iheight;
    if (homeCategoryId == 4060) {
      iwidth = 780; iheight = 600;
    } else if(homeCategoryId == 4040) {
      iwidth = 780; iheight = 600;
    } else {
      iwidth = 600; iheight = 600;
    }
    iLeft = (window.screen.availWidth / 2) - (586/2);
    iTop = (window.screen.availHeight / 2) - (600/2);
    var sFeatures = "scrollbars=yes,resizable=no,width=" + iwidth + ",height=" + iheight + ",menubar=no,top=" + iTop + ",left=" + iLeft;
    window.open(sURL, "", sFeatures);
  }

  if (navigator.platform.indexOf("MacPPC") != -1) {
    document.write('<link rel="stylesheet" type="text/css" href="english/css/modules/pageNav_Mac.css" />');
    document.write('<link rel="stylesheet" type="text/css" href="english/css/text/en/text_Mac.css" />');
    document.write('<link rel="stylesheet" type="text/css" href="english/modules/cda/css/relatedLinks_Mac.css" />');
  }
