<!--
/* 	filename: test_01_common.js		*/
/* 	author: saw@onpoi.net 			*/
/*	synopsys: common javascript functions 	*/

function ClrLogin(emlfld)
{
/* empty login textbox on click */
if (emlfld.value == 'Your email')
	{
	emlfld.value = '';	
	}	
}

function profile_popup(Uid)
{
/* Open User Profile Popup */
var Url = "/ah/profile_popup.php?UserId=" + Uid;
window.open(Url,"popup","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width=420,height=340,top=25,left=50")
}
function  CopyTopPrev(Vv)
{
/* Copy picture links to textfields */
document.forms.collectn_form.preview_line.value=Vv;	
}

function  CopyPrev(Vv, Tgt)
{
/* Copy picture links to textfields */
document.forms.collectn_form.preview_line.value=Vv;	
Tt = document.forms.collection_f[Tgt];
Tt.value=Vv;
}

function  MyCollCopyPrev(Vv, Tgt)
{
/* Copy picture links to textfields */
document.forms.collectn_form.preview_line.value=Vv;	
Tgt.value=Vv;
Tgt.select();
Tgt.focus();


}

function alert_browser()
{
/* display browser info */
var browser = "Your Browser Information:\n";
for (var propname in navigator)
	{
	browser += propname + ": " + navigator[propname] +"\n";
	}
alert(browser);
}

function display_time_in_status_line()
{
document.body.background='./images/spacer.gif';

// This function displays the time in the status line.
// Invoke it once to activate the clock; it will call itself from then on.
    var d = new Date();                // Get current time.
    var h = d.getHours();              // Extract hours: 0 to 23.
    var m = d.getMinutes();            // Extract minutes: 0 to 59.
    var ampm = (h >= 12)?"PM":"AM";    // Is it am or pm?
    if (h > 12) h -= 12;               // Convert 24-hour format to 12-hour.
    if (h == 0) h = 12;                // Convert 0 o'clock to midnight.
    if (m < 10) m = "0" + m;           // Convert 0 minutes to 00 minutes, etc.
    var t = h + ':' + m + ' ' + ampm;  // Put it all together.

    defaultStatus = "Local time for "+ UserHandle + " is " +t;                 // Display it in the status line.

    // Arrange to do it all again in 1 minute. 
    setTimeout("display_time_in_status_line()", 60000); // 60000 ms is 1 minute.


}

function AlertPrivMessage(PmId)
{
	if (confirm('You have private messages, click YES to read them.'))
		{
		if (PmId != "all")
			{
			window.location = 'http://www.onpoi.net/ah/read_pm.php?pmid=' +PmId;	
			}
		else
			{
			window.location = 'http://www.onpoi.net/ah/list_pm.php'	
			}			
		}

}
-->