	var pos;
	var msgpos;
	var mouse_cord;
	function popitup(url) {
		newwindow=window.open(url,'upload','height=700,width=800,top=0,left=150,scrollbars=1');
		if (window.focus) {newwindow.focus()}
		return false;
	}

function popitupupdateprofile(url) {
		newwindow=window.open(url,'upload','height=620,width=880,top=0,left=150,scrollbars=1');
		if (window.focus) {newwindow.focus()}
		return false;
	}

	function cp_popitup(url) {
		newwindow=window.open(url,'upload','height=240,width=380,top=250,left=300,scrollbars=1');
		if (window.focus) {newwindow.focus()}
		return false;
	}

	function showTooltip(id)
	{
		var obj = document.getElementById(id);
		var X = 0, Y = 0;

		showMediaDetails(id);

		if(!document.all)
		{
			document.onmouseover = getPosition;
			var xypos = new Array();
			xypos = pos.split('~');
		    X = parseInt(xypos[0]);
		    Y = parseInt(xypos[1]);

		}
		else if (document.all) 		// Gets IE browser position
		{
			X = window.event.clientX + document.body.scrollLeft;
		    Y = window.event.clientY + document.body.scrollTop;
		}

		obj.style.display = 'block';
		obj.style.left = X+'px';
		obj.style.top = Y+'px';
	}
	function getPosition(args)
	{
		pos = args.pageX+"~"+args.pageY;
		return pos;
	}
	function hideTooltip(id)
	{
		var obj = document.getElementById(id);
		obj.style.display = 'none';
	}
	function showMessageTooltip(id,flag)
	{
		if(flag == 1)
			showMessage(id,'to');
		else if(flag == 2)
			showMessage(id,'from');

		if(!document.all)
			document.onmouseover = getMessagePosition;

		var X, Y;
		// Gets IE browser position
		 if (document.all)
		 {
			X = window.event.clientX + document.body.scrollLeft;
		    Y = window.event.clientY + document.body.scrollTop;
		  }

		 // Gets position for other browsers
		 else
		 { 
			var xypos = new Array();
			xypos = msgpos.split('~');
		    X = parseInt(xypos[0]);
		    Y = parseInt(xypos[1]);
		  } 
		//alert(X+"***"+Y);

		var span_obj = document.getElementById('msgtooltip');
		span_obj.style.display = 'block';
		span_obj.style.top = Y;

	}
	function getMessagePosition(args)
	{
		msgpos = args.pageX+"~"+args.pageY;
		return msgpos;
	}
	function hideMessageTooltip()
	{
		var span_obj = document.getElementById('msgtooltip');
		span_obj.style.display = 'none';
	}

	function showLabelHelp(id)
	{
		/*if(!document.all)
			document.onmousemove=getMouseCoordinates;*/
		var span_obj = document.getElementById(id);
		span_obj.style.display = 'block';
		var x_var, y_var;
		// For IE browser
		if (document.all)
		{
			x_var = window.event.clientX + document.body.scrollLeft+"px";
		    y_var = window.event.clientY + document.body.scrollTop+"px";
		}
		else if(!document.all) // For other browsers
		{
			document.onmousemove=getMouseCoordinates;

			var cord = new Array();
			cord = mouse_cord.split('~');
		    x_var = parseInt(cord[0])+5+"px";
		    y_var = parseInt(cord[1])+"px";
		  }

		span_obj.style.left = x_var;		  
		span_obj.style.top = y_var;
	}
	function getMouseCoordinates(event)
	{
		mouse_cord = args.pageX+"~"+args.pageY;
		return mouse_cord;
	}
	function hideLabelHelp(id)
	{
		var span_obj = document.getElementById(id);
		span_obj.style.display = 'none';
	}

	// Function to show pop up window to view mylist
	function mailpopup(url) 
	{
		newwindow=window.open(url,'upload','height=450,width=700,top=10,left=170,scrollbars=1');
		if (window.focus) {newwindow.focus()}
		return false;
	}

	function redirectto()
	{
		location.href = "usermessages.php";
	}