// JavaScript Document
// Tooltip Start
var offsetfromcursorX=12 //Customize x offset of tooltip
var offsetfromcursorY=10 //Customize y offset of tooltip

var offsetdivfrompointerX=10 //Customize x offset of tooltip DIV relative to pointer image
var offsetdivfrompointerY=14 //Customize y offset of tooltip DIV relative to pointer image. Tip: Set it to (height_of_pointer_image-1).

document.write('<div id="menuhint"></div>') //write out tooltip DIV
document.write('<img id="menupointer" style="display:none" />') //write out pointer image

var ie=document.all
var ns6=document.getElementById && !document.all
var enabletip=false
if (ie||ns6)
var tipobj=document.all? document.all["menuhint"] : document.getElementById? document.getElementById("menuhint") : ""

var pointerobj=document.all? document.all["menupointer"] : document.getElementById? document.getElementById("menupointer") : ""

function ietruebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function ddrivetip(thetext, thewidth, thecolor){
if (ns6||ie){
//if (typeof thewidth!="undefined") tipobj.style.width=thewidth+"px"
if (typeof thecolor!="undefined" && thecolor!="") tipobj.style.backgroundColor=thecolor
tipobj.innerHTML=thetext
enabletip=true
return false
}
}

function positiontip(e){
if (enabletip){
var nondefaultpos=false
var curX=(ns6)?e.pageX : event.clientX+ietruebody().scrollLeft;
var curY=(ns6)?e.pageY : event.clientY+ietruebody().scrollTop;
//Find out how close the mouse is to the corner of the window
var winwidth=ie&&!window.opera? ietruebody().clientWidth : window.innerWidth-20
var winheight=ie&&!window.opera? ietruebody().clientHeight : window.innerHeight-20

var rightedge=ie&&!window.opera? winwidth-event.clientX-offsetfromcursorX : winwidth-e.clientX-offsetfromcursorX
var bottomedge=ie&&!window.opera? winheight-event.clientY-offsetfromcursorY : winheight-e.clientY-offsetfromcursorY

var leftedge=(offsetfromcursorX<0)? offsetfromcursorX*(-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=curX-tipobj.offsetWidth+"px"
nondefaultpos=true
}
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+offsetfromcursorX-offsetdivfrompointerX+"px"
pointerobj.style.left=curX+offsetfromcursorX+"px"
}

//same concept with the vertical position
if (bottomedge<tipobj.offsetHeight){
tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px"
nondefaultpos=true
}
else{
tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px"
pointerobj.style.top=curY+offsetfromcursorY+"px"
}
tipobj.style.visibility="visible"
if (!nondefaultpos)
pointerobj.style.visibility="visible"
else
pointerobj.style.visibility="hidden"
}
}

function hideddrivetip(){
if (ns6||ie){
enabletip=false
tipobj.style.visibility="hidden"
pointerobj.style.visibility="hidden"
tipobj.style.left="-1000px"
tipobj.style.backgroundColor=''
tipobj.style.width=''
}
}

document.onmousemove=positiontip
// Tooltip End


function showthis(x)
{

var ref=document.getElementById("toolTip");
ref.innerHTML=x;
ref=null;
}

function hidethis()
{

var ref=document.getElementById("toolTip");
ref.innerHTML="Mouse over the icons to know more about the features.";
}
var txtmyacc="Update your profile, view payment status or cancel your account.";
var txtcancel="Cancel your IBackup subscription.";
var txtupacc="Upgrade to a higher plan.";
var txteprof="Update your name, email address, password etc.";
var txtpref="Set the display preferences for your account.";
var txtbill="View payments made towards your account and generate invoice.";
var txtviewshare="View details of the share links.";
var txtunshare="Disable access to your shared file(s)/folder(s).";
var txtcalc="Click the Recalculate icon to get up-to-date information on the quota used by files and folders in your account."
var txtupcc="Modify credit card details and settle dues towards your subscription.";
var txtlogout="Sign out of your account.";
var txtupld="Upload files to your IBackup account.";
var txtshare="Share backed up files and folders with your associates.";
var txtshareopt="Withdraw access permission for the shared files/folders.";
var txtsacc="Provide access to files and folders within your account to your associates with all but administrative privileges.";
var txtwebfold="Features drag-n-drop transfers and Windows Explorer style display directly within Internet Explorer and Firefox.";
var txtsnap="Historical view of your data with provision to restore any older copy.";
var txtbackset="Edit your default Backup set, its schedule and view logs.";
var txtstreport="Shows Backup Status for the recent past. Display of this requires user to set email notification for the backups in IBackup for Windows client.";
var txtstreport1="Shows Backup Status for the recent past.";
var txtlogreport="View logs of the activities performed from the web.";
var txtcut="Cut a file or folder and paste at required destination.";
var txtcopy="Copy a file or folder and paste at required destination.";
var txtpaste="Paste a file or folder that you have cut or copied.";
var txtdelete="Remove files and folders from your account.";
var txtrefresh="Reflects updates made to files and folders in your account.";
var txtcreatefold="Create a new folder in your account.";
var txtrename="Modify the name of a file or folder.";
var txtmedgallery="View your images as thumbnails or a slideshow.";
var txtsave="The Save option lets you save file(s) to your IBackup account in the Sideload folder.";
var txtupload="The Upload option lets you upload a modified version of the file. The uploaded file will replace the current file in the Owner's account.";
var txtimgallery="The Image Gallery lets you view the thumbnails of images stored in the shared folder.";
var txtlogrep="The View Activity option shows an Activity Log of who modified the files recently and when was it modified.";
var txtrserve="Quick backup/restore of several gigabytes of data to/from your IBackup account via a temporary storage device.";
var txtbillad="Update your billing address.";
var txtpshare="Share folders with an other IBackup user.";
var txtviewpshare="View details of the private share folders.";




var timeout	= 200;
var closetimer	= 0;
var smenu	= 0;

function showmenu(id)
{	
submenu();
 if(smenu) smenu.style.visibility = 'hidden';
	smenu = document.getElementById(id);
	smenu.style.visibility = 'visible';
}
function mclose()
{
	if(smenu) smenu.style.visibility = 'hidden';
}
function hidemenu()
{
	closetimer = window.setTimeout(mclose, timeout);
}
function submenu()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}
function closethis()
{
		document.getElementById('newgrp').style.display ="none";
		document.getElementById('poparea').style.display ="none";
		document.getElementById('chagrp').style.display ="none";
		document.getElementById('addgrp').style.display ="none";
		document.getElementById('cgrp').style.display ="none";
		document.getElementById('chgrp').style.display ="none";
		document.getElementById('agrp').style.display ="none";
		document.getElementById('cnewact').style.display ="none";
		document.getElementById('cnact').style.display ="none";
		document.getElementById('cnactad').style.display="none";
		document.getElementById('cnewactbtn').style.display="none";
		document.getElementById('subadd').style.display="none";
		document.getElementById('accont').style.display="none";
		document.getElementById('addrembtn').style.display="none";
		document.getElementById('edacc').style.display="none";
		document.getElementById('edbtn').style.display="none";
}
