
window.onerror = null;
parent.name = '';

//===========================cockee

function setCookie(NameOfCookie, value, expirehours) {
var ExpireDate = new Date ();
ExpireDate.setTime(ExpireDate.getTime() + (expirehours * 3600 * 1000));
document.cookie = NameOfCookie + "=" + escape(value) +
((expirehours == null) ? "" : "; expires=" + ExpireDate.toGMTString()) +
"; path=/;" ;
}


//=====================onload code

document.write("<head><SCRIPT FOR=window EVENT=onload LANGUAGE=JavaScript>");
document.write("OnLoadPage();");
document.write("</script></head>");

function OnLoadPage() {

}

//==========================Browser Detect

var Browser = navigator.userAgent.toLowerCase()
var IE;
var NS;
var Mozilla;
var OtherBrowser;

NS = (document.layers);

if (Browser.indexOf("msie") > -1) IE = true;
else if (Browser.indexOf("mozilla") > -1) Mozilla = true
else OtherBrowser = true;


//===========================open a new window
function Open_WINDOW(URL,Name,H,W,SCROLL) {
try {
  var WIN;
  if (typeof(H) == "undefined" || H == "") H = screen.height - 60;
  if (typeof(W) == "undefined" || W == "") W = screen.width;
  H-=20;
  WS = screen.width / 2;
  WH = screen.height / 2;
  var LEFT, RIGHT;
  LEFT  = (WS - W/2) - 5;
  TOP = (WH - H/2) - 45;
  if (SCROLL != "No") WIN = window.open(URL,Name,"height="+H+",width="+W+",top="+TOP+",left="+LEFT+",scrollbars,resizable,status");
  else WIN = window.open(URL,Name,"height="+H+",width="+W+",top="+TOP+",left="+LEFT+",status");
  WIN.focus();
  return WIN;
}
catch(err) {
  alert("iExtensions->Please check whether POPUP windows are BLOCKED for this site.");
  return true;
}
}

//===========================open a new window with url from another server
function Open_WINDOW_Server2(URL,Name,H,W,SCROLL) {
try {
  var WIN;
  if (typeof(H) == "undefined" || H == "") H = screen.height - 60;
  if (typeof(W) == "undefined" || W == "") W = screen.width;
  H-=20;
  WS = screen.width / 2;
  WH = screen.height / 2;
  LEFT  = (WS - W/2) - 5;
  TOP = (WH - H/2) - 45;
  if (SCROLL != "No") WIN = window.open("",Name,"height="+H+",width="+W+",top="+TOP+",left="+LEFT+",scrollbars,resizable,status");
  else WIN = window.open("",Name,"height="+H+",width="+W+",top="+TOP+",left="+LEFT+",status");
  var LEFT, RIGHT;
  WIN.location.href = URL;
  WIN.focus();
  return WIN;
}
catch(err) {
  alert("iExtensions->Please check whether POPUP windows are BLOCKED for this site.");
  return true;
}
}

//===========================open a modal window
function Open_MODAL_WINDOW(URL,Name,H,W,SCROLL) {
try {
  if (typeof(H) == "undefined" || H == "") H = screen.height - 50;
  if (typeof(W) == "undefined" || W == "") W = screen.width;
  WS = screen.width / 2;
  WH = screen.height / 2;
  H-=20;
  var RET;
  var LEFT, RIGHT;
  LEFT  = (WS - W/2) - 5;
  TOP = (WH - H/2) - 38;
  if (SCROLL != "No")
  RET=showModalDialog(URL,"","dialogHeight:"+H+"px; dialogWidth:"+W+"px; dialogTop:"+TOP+"px; dialogLeft:"+LEFT+"px;help:No;resizable:Yes;scroll:Yes;status:Yes;");
  else
  RET=showModalDialog(URL,"","dialogHeight:"+H+"px; dialogWidth:"+W+"px; dialogTop:"+TOP+"px; dialogLeft:"+LEFT+"px;help:No;resizable:No;scroll:No;status:Yes;");
  return RET;
}
catch(err) {
  return "";
}
}


//##########========================================================DHTML WINDOW

var win_DHTML = "<div id=page_cover_div style=\"display:none;position:absolute;z-index:100;top:0;left:0;overflow:hidden;width:100%;\" class=PageCoverDiv>"+
"</div>"+
"<div id=dhtml_win_content style=\"display:none;position:absolute;z-index:101;top:0;left:0;overflow:hidden;\">"+
"</div>";
document.write(win_DHTML);
var CURRENT_WINDOW_DIV = "";

//===========================open a new dhtml window with a url
function Open_DHTML_WINDOW(URL,Name,H,W,SCROLL,TOP_BAR,CLOSE_BTN) {
try {
  //alert(URL+"=="+Name+"=="+H+"=="+W+"=="+SCROLL)

  var winH;
  var winW;
  var urlH;
  var urlW;
  var wTop;

  var FIT_Height = get_div_fit_height ();

  if (typeof(H) == "undefined" || H == "") {
    winH = FIT_Height;
    urlH = winH - 38;
    if (TOP_BAR == "No") urlH = urlH + 25;
    wTop = 0;
  }
  else {
    H = parseInt(H);
    if (IE) winH = H+30;
    else winH = H+20;
    if (IE) urlH = winH - 38;
    else urlH = winH - 43;
    if (TOP_BAR == "No") winH = winH - 25;
    wTop = (document.body.clientHeight/2) + document.body.scrollTop - (winH/2);
    if (wTop > 100) wTop = wTop - 50;
  }

  if (typeof(W) == "undefined" || W == "") {
    winW = "100%";
    urlW = "99%";
  }
  else {
    W = parseInt(W);
    if (IE) winW = W+10;
    else winW = W+30;
    urlW = winW-16;
  }

  var win_HTML = "<table border=0 cellpadding=0 cellspacing=0 width=100% height=100%>"+
  "<tr><td>"+
  "<div align=center>"+
  "<table border=0 cellpadding=0 cellspacing=0 width="+winW+" height="+winH+" style=\"border-style:solid;border-color:gray;border-width:1 2 2 1;\">";

  if (TOP_BAR != "No") win_HTML = win_HTML + "<tr><td>"+ DHTML_WINDOW_TOP_BAR("",SCROLL,CLOSE_BTN) + "</td></tr>";

  var htmlSCROLL = "";
  if (SCROLL == "No") htmlSCROLL = "scrolling=no";

  win_HTML = win_HTML + "<td height=5 bgcolor=#FFFFFF></td>"+
  "</tr>"+
  "<tr>"+
  "<td align=left valign=top bgcolor=#FFFFFF>"+
  "<div align=center>"+
  "<iframe id=DHTML_WINDOW_IFRAME frameborder=No "+ htmlSCROLL +" width="+urlW+" height="+urlH+" src=\""+URL+"\" onload=\"SetiFrameWindow()\"></iframe>"+
  "</div>"+
  "</td>"+
  "</tr>"+
  "</table>"+
  "</div>"+
  "</td></tr>"+
  "</table>"

  CURRENT_WINDOW_DIV = 'dhtml_win_content';
  WriteDiv(CURRENT_WINDOW_DIV , win_HTML);
  setdiv('page_cover_div').height = FIT_Height;
  setdiv('page_cover_div').display="block";
  setdiv(CURRENT_WINDOW_DIV).top=wTop+"px";
  setdiv(CURRENT_WINDOW_DIV).display="block";
}
catch(err) {
  alert("iExtensions->ERROR.");
  return true;
}
}

//===========================dhtml window top bar title
function SetiFrameWindow() {
  try {
    setdivA('DHTML_WINDOW_TOP_BAR_TITLE').innerHTML = frames('DHTML_WINDOW_IFRAME').document.title;
  }
  catch (err) {}
}

//===========================open a new dhtml window with a div
function Open_DHTML_DIV_WINDOW(DivName) {
try {
  var FIT_Height = get_div_fit_height ();
  CURRENT_WINDOW_DIV = DivName;
  document.getElementById('page_cover_div').style.height = FIT_Height;
  document.getElementById('page_cover_div').style.left = 5;
  document.getElementById('page_cover_div').style.display="block";
  setdiv(CURRENT_WINDOW_DIV).top = document.body.scrollTop + 30;
  setdiv(CURRENT_WINDOW_DIV).display="block";
}
catch(err) {
  alert("iExtensions->ERROR2.");
  return true;
}
}

//===========================dhtml window top bar
function DHTML_WINDOW_TOP_BAR(Label,SCROLL,CLOSEBTN) {
  var win_HTML = "<table border=0 cellpadding=0 cellspacing=0 width=100%>"+
  "<tr><td height=25 valign=middle class=DHTMLWinTopBar>"+
  "<table border=0 cellpadding=0 cellspacing=0 width=100% height=25><tr>"+
  "<td valign=middle><div height=25 id=DHTML_WINDOW_TOP_BAR_TITLE class=DHTMLWinTopBarTitle style=\"height:25;\">"+Label+"</div></td>";
  if (CLOSEBTN != "No") win_HTML = win_HTML + "<td valign=middle><img onclick=\"Close_DHTML_WINDOW()\" src=\"_images/dhtml_win_close.gif\" align=right></td>";
  win_HTML = win_HTML + "</tr></table>"+
  "</td></tr>"+
  "</table>";
  return win_HTML;
}

//===========================
function get_div_fit_height (){
  var y;
  var test1 = document.body.scrollHeight;
  var test2 = document.body.offsetHeight
  if (test1 > test2) // all but Explorer Mac
  {
	y = document.body.scrollHeight;
  }
  else // Explorer Mac - would also work in Explorer 6 Strict, Mozilla and Safari
  {
	y = document.body.offsetHeight;
  }
  if (parent.frames.length <= 1) y = y - 5;
  return y;
}

//===========================
var is_DHTML_WIN = false;
try {
   if (typeof(parent.setdivA('DHTML_WINDOW_IFRAME')) != "undefined") is_DHTML_WIN = true;
}
catch(err) {
   is_DHTML_WIN = false;
}

//===========================close dhtml window
function Close_DHTML_WINDOW() {
  document.getElementById('page_cover_div').style.display="none";
  document.getElementById(CURRENT_WINDOW_DIV).style.display="none";	
}

//===========================close window
function Close_WINDOW() {
  if (is_DHTML_WIN) GetParentWINDOW().Close_DHTML_WINDOW();
  else {window.opener = top;window.close();}
}

//===========================get parent window
function GetParentWINDOW() {
  if (is_DHTML_WIN) return window.parent;
  else return window.opener;
}

//##########========================================================END DHTML WINDOW



//=========================== DHTML layer functions
//Write to  Layer for IE and Netscape..
function WriteDiv(arg,T) {
  var D;
  if (document.all) {D = eval("document.all." + arg);}
  else if (document.layers) {D = eval("document.layers." + arg);}
  else {D = document.getElementById(arg);}
  D.innerHTML = T;
}

//Setting Layer for IE and Netscape..
function setdiv(arg) {
if (document.all) {return eval("document.all." + arg + ".style");}
else if (document.layers) {return eval("document.layers." + arg);}
else {return document.getElementById(arg).style;}
}

//Setting Layer for IE and Netscape..
function setdivA(arg) {
  if (document.all) {return eval("document.all." + arg);}
  else if (document.layers) {return eval("document.layers." + arg);}
  else {return document.getElementById(arg);}
}

//===========================TRIM / LTRIM / RTRIM strings

function LTRIM(STR) {
  STR = STR.toString();
  return STR.replace( /^\s*/, "" )
}

function RTRIM(STR) {
  STR = STR.toString();
  return STR.replace( /\s*$/, "" );
}

function TRIM(STR) {
  if (typeof(STR) == "undefined") return "";
  if (STR == null) return "";
  STR = STR.toString();
  return RTRIM(LTRIM(STR));
}

//=========================== get return value of a server URL
function GetURLReturnValue(URL,userName,userPassword) {
try {
  if (window.XMLHttpRequest) var objXMLHTTP = new XMLHttpRequest();
  else if (window.ActiveXObject) var objXMLHTTP = new ActiveXObject("Microsoft.XMLHTTP") ;
  else return "";
  if (typeof(userName) != "undefined" && typeof(userPassword) != "undefined" && userName != "" && userPassword != "") {
     objXMLHTTP.open ("GET", URL , false, userName, userPassword);
  }
  else {
     objXMLHTTP.open ("GET", URL , false);
  }
  objXMLHTTP.send(null)
  strXMLReturn = objXMLHTTP.responseText 
  objXMLHTTP = null
  return TRIM(strXMLReturn);
}
catch(err) {
  return "";
}
}

//=========================== get return value of a server URL
function GetIPInfo(IP) {
try {
  Open_DHTML_WINDOW("http://www.hostip.info/api/get.html?ip="+IP , "" , 200 , 350);
}
catch(err) {
  return "";
}
}

//=========================== update / get HIT count
function GetHITCount() {
document.write("<img border=0 src=\"_images/count.gif\" width=53 align=absMiddle height=15>")
document.write("<a href=\"\" onclick=\"Open_DHTML_WINDOW(\'http://shajis.hypermart.net/cgi-bin/client.cgi\',\'\',550,900);return false;\" ");
document.write("style=\"color: white; font-size: .8pt; font-family: MS Sans Serif; font-weight: bold; text-decoration: none; background: blue\">")
document.write("<font color=white style=\"font-size: 8pt\">")
try {
  var IP = GetURLReturnValue("http://shajis.hypermart.net/cgi-bin/getIP.cgi");
  if (IP != "69.249.47.63" && IP != "69.249.120.144") {
    var ret_HIT = GetURLReturnValue("http://shajis.hypermart.net/cgi-bin/hitcounter.cgi");
  }
  else {
    var ret_HIT = GetURLReturnValue("http://shajis.hypermart.net/cgi-bin/getcounter.cgi");
  }
  document.write(ret_HIT);
}
catch(err) {
  document.write("error");
}
document.write("</font></a>")
}


//===========================

var current = 0;var x = 0;var speed = 100;var speed2 = 2000;

function initArray(n) {
this.length = n;
for (var i =1; i <= n; i++) {this[i] = " ";}
}

typ = new initArray(4);
typ[0]="Shaji S";
typ[1]="Senior Software Architect...";
typ[2]="Working in Lotus Notes, XML Web Services, JavaScript, DHTML....";
typ[3]="EMail : sshaji@gmail.com";

function typewrite() {
var m = typ[current];
self.status = m.substring(0, x++) + '';
if (x == m.length + 1) {
x = 0;current++;
if (current > typ.length - 1) {
current = 0;
}
setTimeout('typewrite()', speed2);
}
else {
setTimeout('typewrite()', speed);
}
}