<!--

//check-Browser()->This is the main class where different browsers are identified and they are set to true or false value

function check_Browser()
{

	d=document;
	this.agt=navigator.userAgent.toLowerCase();
	this.major = parseInt(navigator.appVersion);
	this.dom=(d.getElementById)?1:0;
	this.ns=(d.layers);
	this.ns4up=(this.ns && this.major >=4);
	this.ns6=(this.dom&&navigator.appName=="Netscape");
	this.op=(window.opera? 1:0);
	this.ie=(d.all);
	this.ie4=(d.all&&!this.dom)?1:0;
	this.ie4up=(this.ie && this.major >= 4);
	this.ie5=(d.all&&this.dom);
	this.win=((this.agt.indexOf("win")!=-1) || (this.agt.indexOf("16bit")!=-1));
	this.mac=(this.agt.indexOf("mac")!=-1);
};


var cBw = new check_Browser(); // createing an object for check_Browser (cBw)

//This function sets the dimensions of the page (horizontally)

function dim_getPageX(o) { var x=0; if(cBw.ns) x=o.pageX; else { while(eval(o)) { x+=o.offsetLeft; o=o.offsetParent; } } return x; };

//This function sets the dimensions of the page (vertically)
function dim_getPageY(o) { var y=0; if(cBw.ns) y=o.pageY; else { while(eval(o)) { y+=o.offsetTop; o=o.offsetParent; } } return y; };


//this is called when you press the options link
/*
function MessageViewMenu_Click()
{
   	var oSender = this.Sender;
	var sHref = false;

	if(!oSender.tagName) sHref = oSender.parentNode.href;
		else if(oSender.tagName == "A") sHref = oSender.href;
			else sHref = oSender.getElementsByTagName('a')[0].href;
			if(sHref) window.location.href = sHref;
};
*/
/* Buttons */

// This function is invoked as soon as 'options' button is clicked.
/*
function Menu_Click(p_oEvent)
{


	var oEvent = p_oEvent ? p_oEvent : window.event;
	var oSender = p_oEvent ? oEvent.target : oEvent.srcElement;

	if(p_oEvent) oEvent.stopPropagation();
	else oEvent.cancelBubble = true;

	this.Sender = oSender;
	this.Event = oEvent;

	if(typeof this.ClickHandler != 'undefined') this.ClickHandler();
};
*/


//especially for IE
function Menu_MouseOver(p_oEvent)
{
	var oEvent = p_oEvent ? p_oEvent : window.event;
	var oSender = p_oEvent ? oEvent.target : oEvent.srcElement;

	if(oSender.tagName == 'LI') oSender.className = 'hover';
	else if(oSender.tagName == 'A') oSender.parentNode.className = 'hover';
	else return false;
};

//especially for IE
function Menu_MouseOut(p_oEvent)
{
	var oEvent = p_oEvent ? p_oEvent : window.event;
	var oSender = p_oEvent ? oEvent.target : oEvent.srcElement;

	if(oSender.tagName == 'LI') oSender.className = '';
	else if(oSender.tagName == 'A') oSender.parentNode.className = '';
	else return false;
};
// This function is invoked whenever you click on an event.

function Button_Click(p_oEvent)
{

	var oEvent = p_oEvent ? p_oEvent : window.event;
	var oSender = p_oEvent ? oEvent.target : oEvent.srcElement;


	if(p_oEvent) oEvent.stopPropagation();
	else oEvent.cancelBubble = true;

	this.Event = oEvent;
	this.Sender = oSender;

	HideMenu();
	this.Menu.Button = this;
	g_oMenu = this.Menu;

	if(typeof this.ClickHandler != 'undefined') this.ClickHandler();
	else g_oMenu.Show();

	document.onclick = Document_Click;
};


// This function takes two arguments i.e  name of the menu and the click handler.
// It checks for the different types of browsers and sets the dimensions of the page respectively.

function ButtonMenu(p_sMenuId, p_oClickHandler)
{

	var oMenu = document.getElementById(p_sMenuId);

	if(oMenu)
	{
		if(typeof p_oClickHandler != 'undefined') oMenu.ClickHandler = p_oClickHandler;

		oMenu.Show = function () {

			if(document.all) this.style.width = this.offsetWidth+'px';

			var nTop = dim_getPageY(this.Button) + this.Button.offsetHeight;
			var nLeft = dim_getPageX(this.Button);

			if(cBw.ie && cBw.mac)
			{
				nTop -= 4;
				nLeft -= 6;
			}

			this.style.top = nTop+'px';
			this.style.left = nLeft+'px';
			this.style.visibility = 'visible';

		};

		oMenu.onclick = Menu_Click;

		if(document.all)
		{
			oMenu.onmouseover = Menu_MouseOver;
			oMenu.onmouseout = Menu_MouseOut;
		}

		return oMenu;
	}
	else return false;
};

// This function takes an argument and checks if the particular element exists or not , if yes then Button_Click event
// is associated with it.

function Button(p_sButtonId)
{

	var oButton = document.getElementById(p_sButtonId);

	if(oButton)
	{
		oButton.onclick = Button_Click;
		return oButton;
	}
	else return false;
};

// This is the first function which is invoked when the body gets loaded .It takes 3 arguments : 1.id of the outer div
// 2.id of the inner div(dropdown list) 3. Click Handler

function MenuButton()
{

	var nArguments = arguments.length;

	function __MenuButton_ThreeArguments(p_sButtonId, p_sMenuId, p_oMenuClickHandler)
	{
			var oButton = new Button(p_sButtonId);

			if(oButton)
			{
				oButton.Menu = new ButtonMenu(p_sMenuId, p_oMenuClickHandler);
				return oButton;
			}
			else return false;
	};

	if (nArguments == 3) return __MenuButton_ThreeArguments(arguments[0],arguments[1],arguments[2]);
	//else if(nArguments == 4) return __MenuButton_FourArguments(arguments[0],arguments[1],arguments[2],arguments[3]);
	else return false;
};

//This function is used to hide the dropdown list whenever an item in the list is clicked.
function HideMenu()
{
 try { hideCLMenu(); } catch(e) {}
 
	if(typeof g_oMenu != 'undefined' && g_oMenu)
	{
		if(g_oMenu.Hide) g_oMenu.Hide();
		else g_oMenu.style.visibility = 'hidden';

		g_oMenu = null;
		document.onclick = null;
		window.onresize = null;
	}
	else return;
};

 function Document_Click()
 {

	if(document.Selects)
	{
		var nSelects = document.Selects.length-1;
		for(var i=nSelects;i>=0;i--) document.Selects[i].style.visibility = 'visible';
	}

	HideMenu();
 };



//This function is used for displaying tooltip for Call logs page

var offsetxpoint=-60 //Customize x offset of tooltip
var offsetypoint=20 //Customize y offset of tooltip
var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["dhtmltooltip"] : document.getElementById? document.getElementById("dhtmltooltip") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function showInfo(name,id,email,phone){
name=unescape(name);
id=unescape(id);
email=unescape(email);
phone=unescape(phone);

if (name.length < 28)
	var trimedName = name;
else
	var trimedName = trimValue(name,'nameval');

if (id.length < 22)
	var trimedId = id;
else
	var trimedId = trimValue(id);

if (email.length < 22)
	var trimedEmail = email;
else
	var trimedEmail = trimValue(email);

if (phone.length < 30)
	var trimedPhone = phone;
else
	var trimedPhone = trimValue(phone);




var thetext="";

thetext+="<div id='container'><div id='top'>"+trimedName+"</div>";

if(id != ""){
 	 thetext+="<div id='leftnav'>ID:</div> <div id='content'>"+trimedId+"</div>";
}

if(email != ""){
  	thetext+="<div id='leftnav'>Email:</div><div id='contentnew'>"+trimedEmail+"</div>";
}

if(phone != ""){
  thetext+="<div id='leftnav'>Phone:</div><div id='content'>"+trimedPhone+"</div>";
}
thetext+="</div>";

if (ns6||ie){
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var curX=(ns6)?e.pageX : event.x+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.y+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var rightedge=ie&&!window.opera? ietruebody().clientWidth-event.clientX-offsetxpoint : window.innerWidth-e.clientX-offsetxpoint-20
var bottomedge=ie&&!window.opera? ietruebody().clientHeight-event.clientY-offsetypoint : window.innerHeight-e.clientY-offsetypoint-20

var leftedge=(offsetxpoint<0)? offsetxpoint*(-1) : -1000

//if the horizontal distance isn't enough to accomodate the width of the context menu
if (rightedge<tipobj.offsetWidth)
//move the horizontal position of the menu to the left by it's width
tipobj.style.left=ie? ietruebody().scrollLeft+event.clientX-tipobj.offsetWidth+"px" : window.pageXOffset+e.clientX-tipobj.offsetWidth+"px"
else if (curX<leftedge)
tipobj.style.left="5px"
else
//position the horizontal position of the menu where the mouse is positioned
tipobj.style.left=curX+offsetxpoint+"px"

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight)
tipobj.style.top=ie? ietruebody().scrollTop+event.clientY-tipobj.offsetHeight-offsetypoint+"px" : window.pageYOffset+e.clientY-tipobj.offsetHeight-offsetypoint+"px"
else
tipobj.style.top=curY+offsetypoint+"px"
tipobj.style.visibility="visible"
}
}

function hideInfo(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

document.onmousemove=positiontip


function trimValue(paramVal, infotype){

var totLength = paramVal.length;
var newParamVal = '';
var j=0;
var i;
if (infotype == "nameval"){
  var trimAt = 18;
}
else{
	if(totLength == 90){
  		var trimAt = 17;
    }
  	else{
  		var trimAt = 19;
     }
}
for (i=trimAt; i<=totLength ; i=i+trimAt){
   newParamVal += paramVal.substring(j,i)
   newParamVal += "<br>&nbsp;";
   j+=trimAt;
}
newParamVal += paramVal.substring(j,totLength);
return newParamVal;
}


var newwindow = '';

function popitup(url)
{ 

	if (!newwindow.closed && newwindow.location)
	{
	  newwindow.location.href = url;
	}
	else
	{
		newwindow=window.open(url,'name','height=500,width=650');
		if(!newwindow) { 
		  alert("You have a popup blocker installed. Please allow popups from this site to proceed.");
		  return false; 
		}
		if (!newwindow.opener) {
		  newwindow.opener = self;
		}
	}
	if (window.focus) {newwindow.focus()}
	return false;
}

var Abstract = new Object();

/**
 * Amends an object with the properties of a second object, effectively combining them.
 */
Object.extend = function(destination, source) {
  for (var property in source) {
    destination[property] = source[property];
  }
  return destination;
};

/**
 * @class popupUtil
 * @author Maninder Singh
 */
var popupUtil = {
  /**
   * open
   * @param {Hash} options
   * @usage <a href=# Onclick="return popupUtil.open({url:'http://www.juno.com/', width: 1000});">Click To Launch</a>
   */
  open: function(options) {
    this.options = {
      url        :  '#',
      width      :  600,
      height     :  500,
      name       :  "_blank",
      location   :  "no",
      menubar    :  "no",
      toolbar    :  "no",
      status     :  "yes",
      scrollbars :  "yes",
      resizable  :  "yes",
      left       :  "",
      top        :  "",
      normal     :  false
    }
    Object.extend(this.options, options || {});
     var newwindow = '';
    /* opens up a new browser window vs a popup window */
    if (this.options.normal){
        this.options.menubar  =  "yes";
        this.options.status   =  "yes";
        this.options.toolbar  =  "yes";
        this.options.location =  "yes";
    }
    
    /* make sure the width and height are realistic for a users screen size */
    this.options.width        =  this.options.width < screen.availWidth  ?  this.options.width   :  screen.availWidth;
    this.options.height       =  this.options.height < screen.availHeight?  this.options.height  :  screen.availHeight;
    var openoptions           =  'width='+this.options.width+',height='+this.options.height+',location='+this.options.location+',menubar='+this.options.menubar+',toolbar='+this.options.toolbar+',scrollbars='+this.options.scrollbars+',resizable='+this.options.resizable+',status='+this.options.status
    
    if (this.options.top!="") {
        openoptions+=",top="+this.options.top;
    }
    if (this.options.left!="") {
        openoptions+=",left="+this.options.left;
    }
    
    if (!newwindow.closed && newwindow.location){
		  newwindow.location.href = url;
		}
		else{
		  newwindow=window.open(this.options.url, this.options.name,openoptions );
			if(!newwindow) { 
		    alert("You have a popup blocker installed. Please allow popups from this site to proceed.");
			  return false; 
			}
		  if (!newwindow.opener) {
		    newwindow.opener = self;
			}
		}
		if (window.focus) {newwindow.focus()}
	    return false;
  }
};

function openPopuptshoot(turl) {
    popupUtil.open({url:turl, width: 750, location: 'yes', menubar: 'yes', toolbar: 'yes'});
}

function detectFlashVersion() {
  var version = deconcept.SWFObjectUtil.getPlayerVersion();
	 if ( document.getElementById && version["major"] <= 0) {
	    document.getElementById('flasherr').style.display = "block";
	    document.getElementById('errText').innerHTML="This application requires Adobe Flash. Please click on the button below to go to the Adobe site and install Flash for free."; 
	    document.getElementById('mainContent').style.display = "none"; 	
	 } else if (document.getElementById && version["major"] <= 6) {
	     document.getElementById('flasherr').style.display = "block";
	     document.getElementById('errText').innerHTML="This application requires Adobe Flash 8 or above. Please click on the button below to go to the Adobe site and install for free."; 
         document.getElementById('mainContent').style.display = "none"; 	  
	 } else {
	      document.getElementById('mainContent').style.display = "block";
	      document.getElementById('flasherr').style.display="none";   
	 }	
}

//function to get the position of any element
function getElementPosition(elemID) {
  var offsetTrail = document.getElementById(elemID);
  var offsetLeft = 0;
  var offsetTop = 0;
  while (offsetTrail) {
    offsetLeft += offsetTrail.offsetLeft;
    offsetTop += offsetTrail.offsetTop;
    offsetTrail = offsetTrail.offsetParent;
  }
  if (navigator.userAgent.indexOf("Mac") != -1 &&
    typeof document.body.leftMargin != "undefined") {
    offsetLeft += parseInt(document.body.leftMargin);
    offsetTop += parseInt(document.body.topMargin);
  }
  return {left:offsetLeft, top:offsetTop};
}

// functions added for the flash tooltip
var href = document.location.href;

// These functions were added with the General release of Video Mail
// All the functions below are accessed in VideoMailCompose page and Read Message page.

function getFlashCookie(cookiename) { 
  getCookiejarVal = new cookiejar('cjar_eow');
  cookieVal = getCookiejarVal.getCookie(cookiename);
  return cookieVal;
}

function setFlashCookie(cookiename,val) {
	setCookiejarVal = new cookiejar('cjar_eow');
	setCookiejarVal.setPath("/");
	setCookiejarVal.setCookie(cookiename,val);
	setCookiejarVal.write();
}

function showVideoSettings() { 
  //alert(getElementPosition('flashplay').left+13);
  document.getElementById('oId').style.left = getElementPosition('flashplay').left+13; 
  document.getElementById('oId').style.top = getElementPosition('flashplay').top+148;
  document.getElementById('oId').style.display='block';
  var settings = getFlashCookie('PlayType');
  if ( settings != null && settings == _playSettings) { 
	document.overlay.settings.checked = true;
  } else {
	  document.overlay.settings.checked = false;
  }
  if (_playSettings == '1') { 
    document.overlay.quality[0].checked = true;
    onchkBoxClick();
  } else {
      document.overlay.quality[1].checked = true;
      onchkBoxClick();
  }
}	

function okBtnAction(cookiename) { 
   loc = location.href; 	 
   if (document.overlay.quality[0].checked == true) { conType="1"; }  else { conType="0"; }
   var setCookie = false;
   if (document.overlay.settings.checked == true && getFlashCookie(cookiename) != conType) { 
    setCookie = true;   
   }
   if (setCookie) setFlashCookie(cookiename,conType);
   handlePlaySettings(conType);
} 

function onchkBoxClick() { 
  if (document.overlay.settings.checked == false) {
    if (document.overlay.quality[0].checked == true) {
    document.getElementById('flashMesg').innerHTML="Video Quality set to <b>Broadband</b>";  
    } else {
        document.getElementById('flashMesg').innerHTML="Video Quality set to <b>Dial-Up</b>";  
    }
  } else {
      if (document.overlay.quality[0].checked == true) {
        document.getElementById('flashMesg').innerHTML="Video Quality default set to <b>Broadband</b>";  
      } else {
          document.getElementById('flashMesg').innerHTML="Video Quality default set to <b>Dial-Up</b>";  
      }  
  }
}

function handlePlaySettings(conType) {
  if(_playSettings == conType)  {
    hideVideoSettings();
    return;
  }
  loc = location.href;
  loc = loc.split("&count=")[0].split("&tempSettings=")[0]; //splitting the url first based on count and then based on tempSettings
  if (document.overlay.settings.checked == false) {
    loc = loc+'&tempSettings='+conType+'&count='+ (new Date()).getTime()+"#VideoMail";
  }
  else {
    loc = loc+'&count='+ (new Date()).getTime()+"#VideoMail";
  }
  location.href = loc;
}

function hideVideoSettings() {
  document.getElementById('oId').style.display='none';
}	

function onradioClick() {
  if (document.overlay.quality[0].checked == true) {
     radioVal = document.overlay.quality[0].value;
   } else  {
     radioVal =  document.overlay.quality[1].value;
   }  
  
  if ( (document.overlay.settings.checked == true) && (_playSettings != radioVal )) {
    document.overlay.settings.checked=false;   
  }  
   onchkBoxClick();
}
