var timerID = null;
var posX;
var posY;

document.onmousemove = function(evt) 
{
    if (typeof evt == 'undefined') 
    { 
        myEvent = window.event; 
    } 
    else 
    {
        myEvent = evt;
    } 
    posX = myEvent.clientX;
    posY = myEvent.clientY;
}

function mailto(name, domain)
{
    document.location = 'mailto:' + name + '@' + domain;
}

function contactus()
{
    var address = 'info';
    var host = '247meeting.com';
    
    document.location = 'mailto:' + address + '@' + host;
}

function popme(fileName, top, left, width, height) {
    width = width + 15;
    window.open(fileName, "scorepop", "top=" + top + ",left=" + left + ",toolbars=no,maximize=no,resize=no,width=" + width + ",height=" + height + ",location=no,directories=no");
}

function popmeresizable(fileName, top, left, width, height) {
    width = width + 15;
    var thiswin = window.open(fileName, 'lmpop', "top=" + top + ",left=" + left + ",width=" + width + ",height=" + height);
    // + ",toolbars=0,maximize=1,resize=1,location=0,directories=0,status=1"
}

function popinvoice(url)
{
	window.open(url,"invoicepop","top=10,left=10,toolbars=no,maximize=0,resize=1,width=780,height=580,location=0,directories=0,scrollbars=1,status=0");
}

function popCalendar(fileName, width, height, sender)
{
	window.open(fileName+'?s='+sender,"scorepop","top="+posY+",left="+posX+",toolbars=no,maximize=no,resize=no,width="+width+",height="+height+",location=no,directories=no,scrollbars=no,status=no");
}

function validate()
{
	var msg = "";
	if(document.form1.txt_un.value=="") msg += "Email required!\n";
	if(document.form1.txt_pw.value=="") msg += "Password required!\n";
	if(msg=="")
	{
		return true;
	}else{
		alert(msg);
		return false;
	}
	return false;
}

function help(URL) {
    window.open(URL,'window'); //,'width=750,height=400,toolbars=no,scrollbars=yes,resizable=no,menubar=no,left=300,top=200');
}

function inviteguests(meeting, pin, top, left, width, height)
{
	window.open('InviteGuests.aspx?m=' + meeting +'&p=' + pin, "invites", "top="+top+",left="+left+",toolbars=no,maximize=no,status=no,resize=no,width="+width+",height="+height+",location=no,directories=no,scrollbars=no");
}

function gotoMeeting(url)
{
    timerID = setInterval(OpenMeetingWindow(url), 15000);
}

function OpenMeetingWindow(url)
{
    window.open(url, 'meeting', 'toolbars=0,maximize=1,resize=1,location=0,directories=0,scrollbars=0,status=0')
}

function OpenInvoiceWindow(url)
{
    window.open(url, 'invoice', 'toolbars=0,maximize=1,resize=1,location=0,directories=0,scrollbars=1,status=0')
}

function showInvoice(billingContactId, invNo)
{
    window.open('invoices/display_invoice.aspx?bcid=' + billingContactId + '&ino=' + invNo, 'invoice', 'toolbars=0,maximize=1,resize=1,location=0,directories=0,scrollbars=1,status=0');
}

