function openwindow(href) {

	var ref;

	ref = window.open (href, "mywindow", "location=no, menubar=no, status=no, scrollbars=no, resizable=no, width=400, height=380");

	ref.focus();

}

function openwindow2(href, w, h) {

	var ref;

	ref = window.open (href, "mywindow", "location=no, menubar=no, status=no, scrollbars=no, resizable=no, width="+w+", height="+h+"");

	ref.focus();

}

function showhelp(href, w, h) {

	var ref;

	ref = window.open (href, "mywindow", "location=no, menubar=no, status=no, scrollbars=yes, resizable=yes, width="+w+", height="+h+"");

	ref.focus();

}


/***************************************

* Check All / Uncheck All - Checkboxes

***************************************/



function CheckAll(form) {

	count = form.elements.length;

    for (i = 0; i < count; i++) {

		if (form.elements[i].checked == 0) {

			form.elements[i].checked = 1;

		}

	}

}

function UncheckAll(form) {

	count = form.elements.length;

	for (i=0; i < count; i++) {

		if (form.elements[i].checked == 1) {

			form.elements[i].checked = 0; 

		}

	}

}



/* DISABLE RIGHT CLICK */



var message = "Sorry, right-click has been disabled";



function clickIE() { 

	if (document.all) { 

		(message); 

		return false; 

	} 

}

	

function clickNS(e) { 

	if (document.layers || (document.getElementById && !document.all)) {

		if (e.which == 2 || e.which == 3) {

			(message);

			return false;

		}

	}

}

	

if (document.layers) {

	//document.captureEvents(Event.MOUSEDOWN);

	//document.onmousedown = clickNS;

} else {

	//document.onmouseup = clickNS; 

	//document.oncontextmenu = clickIE;

}

	

//document.oncontextmenu = new Function("return false")

function hidestatus() {

	window.status = "";
	
	return true;
}

function init() {

	var el = document.getElementsByTagName("a");
	
	for(var i = 0; i < el.length; i++) {
	
		el[i].onmouseover = hidestatus;
		
	}
	
}

// Count Meetup4Fun Selections
function countSelections(obj) {
	var total = 0;
	var el = document.getElementsByName('meetup[]');
	for (i = 0; i < el.length; i++) {
		if (el[i].checked) total += 1;	
	}
	if (total > 6) {
		obj.checked = false;
		alert('Maximum 6 Meetup4fun selections!');
	}
}

// Check Login Form
function checkForm() {
	var frm = document.frm1;
	if (frm.ename.value == 'enter username' || frm.epass.value == 'enter password') {
		alert('Both username and password field are required !');
		frm.ename.value = '';
		frm.epass.value = '';		
		frm.ename.focus();	
		return false;
	}
	if (frm.ename.value == '' || frm.epass.value == '') {
		alert('Both username and password field are required !');
		frm.ename.value = '';
		frm.epass.value = '';	
		frm.ename.focus();			
		return false;
	}
	return true;
}

window.onload = init;

