function redirectURL(url) {
	if (navigator.appName == 'Microsoft Internet Explorer') {
        window.location.href(url);
    } else if (navigator.appName == 'Netscape') {
        window.open(url, '_parent', 1);
        window.close();
    }
}

function CheckSession(msg, URL, session) {
	if(session != "") {
		redirectURL(URL);
	} else {
		alert(msg);
		redirectURL("userregistration.php");
	}
}
function ShowOnlyAlert(msg) {
	alert(msg);
}


function showImage(obj, path) {
	document.getElementById(obj).src = path;
}

function checkEmailValidation(txtobj)
{
	var tempEmail= document.getElementById(txtobj).value;
	var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
	var check=/@[\w\-]+\./;
	var checkend=/\.[a-zA-Z]{2,3}$/;
	if (document.getElementById(txtobj).value != "") {
		if (tempEmail.search(exclude) != -1 || tempEmail.search(check) == -1 || tempEmail.search(checkend) == -1 ) {
			return false;
		}
		else {
			return true;
		}
	}
}

function IsNumeric(strString) {
    var strValidChars = "0123456789";
    var strChar;
    var blnResult = true;

    if (strString.length == 0) return false;

    for (i = 0; i < strString.length && blnResult == true; i++) {
        strChar = strString.charAt(i);
        if (strValidChars.indexOf(strChar) == -1) {
            blnResult = false;
        }
    }
    return blnResult;
}
