function homepage()
{
 if (document.all)
 {
   document.body.style.behavior='url(#default#homepage)';
   document.body.setHomePage('http://www.indobisnis.com');
 }
 else if (window.sidebar)
 {
   if(window.netscape)
   {
     try
     {
       netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
     }
     catch(e)
     {
       alert("Langkah ini tidak didukung oleh browser, jika Anda ingin mengaktifkan, isikan about:config pada alamat url, dan ubah nilai pada signed.applets.codebase_principal_support menjadi true");
     }
   }
   var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
   prefs.setCharPref('browser.startup.homepage','http://www.indobisnis.com');
 }
}

function favorit()
{
  var title = 'Indobisnis';
  var url = 'http://www.indobisnis.com';
  if (document.all)
    window.external.AddFavorite(url, title);
  else if (window.sidebar)
    window.sidebar.addPanel(title, url, "")
  else if (window.sidebar&&window.sidebar.addPanel)
    window.sidebar.addPanel(title,url,"");
}

function CountLeft(field, count, max)
{
  if (field.value.length > max)
  field.value = field.value.substring(0, max);
  else
  count.value = max - field.value.length;
}

/*
This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Steve | http://jsmadeeasy.com/
*/
function getObject(obj)
{
  if(document.all) {
    if(typeof obj=="string") {
      return document.all(obj);
    } else {
      return obj.style;
    }
  }
  if(document.getElementById) {
    if(typeof obj=="string") {
      return document.getElementById(obj);
    } else {
      return obj.style;
    }
  }
  return null;
}

function toCount(entrance,exit,text,characters)
{
  var entranceObj=getObject(entrance);
  var exitObj=getObject(exit);
  var length=characters - entranceObj.value.length;
  if(length <= 0) {
    length=0;
    text='<span> '+text+' </span>';
    entranceObj.value=entranceObj.value.substr(0,characters);
  }
  exitObj.innerHTML = text.replace("{CHAR}",length);
}
/*
End
*/

/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Cookie script - Scott Andrew
Popup script, Copyright 2005, Sandeep Gangadharan */

function newCookie(name,value,days)
{
  if (days)
  {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else var expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name)
{
  var nameSG = name + "=";
  var nuller = '';
  if (document.cookie.indexOf(nameSG) == -1)
    return nuller;
  var ca = document.cookie.split(';');
  for(var i=0; i<ca.length; i++)
  {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameSG) == 0)
      return c.substring(nameSG.length,c.length);
  }
  return null;
}

function saveCookie(a)
{
  newCookie('theName',document.form_masuk.username_anggota.value,7);
}

function retrieveCookie()
{
  document.form_masuk.username_anggota.value = readCookie("theName");
}

function validate(input)
{
  if (input.id_penerima.value=="")
  {
    alert("Pengirim harus diisi");
    return false;
  }
  if (input.subyek_pesan.value=="")
  {
    alert("Subyek pesan harus diisi");
    return false;
  }
  if (input.isi_pesan.value=="")
  {
    alert("Isi pesan harus diisi");
    return false;
  }
}

function correctPNG()
{
   var arVersion = navigator.appVersion.split("MSIE")
   var version = parseFloat(arVersion[1])
   if ((version >= 5.5) && (document.body.filters))
   {
      for(var i=0; i<document.images.length; i++)
      {
         var img = document.images[i]
         var imgName = img.src.toUpperCase()
         if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
         {
            var imgID = (img.id) ? "id='" + img.id + "' " : ""
            var imgClass = (img.className) ? "class='" + img.className + "' " : ""
            var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
            var imgStyle = "display:inline-block;" + img.style.cssText
            if (img.align == "left") imgStyle = "float:left;" + imgStyle
            if (img.align == "right") imgStyle = "float:right;" + imgStyle
            if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
            var strNewHTML = "<span " + imgID + imgClass + imgTitle
            + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
            + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
            + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>"
            img.outerHTML = strNewHTML
            i = i-1
         }
      }
   }
}

function initialize()
{
  if (GBrowserIsCompatible())
  {
    var map = new GMap2(document.getElementById("map_canvas"));
    map.setCenter(new GLatLng(-6.24585, 106.80539), 17);
    map.setUIToDefault();
    var point = new GLatLng(-6.24635, 106.80539);
    map.addOverlay(new GMarker(point));
    map.openInfoWindow(point,"Lokasi Kantor"+'<br>'+"PT. Raztel Solusindo Telematika");
  }
}

