function ForumJump(URL) {
	
	if (URL.options[URL.selectedIndex].value != "") self.location.href = URL.options[URL.selectedIndex].value;	
	return true;
}
function openWin(theURL,winName,features) {
  	window.open(theURL,winName,features);
}
function hideshow(which,img,imgsrc){
	if (!document.getElementById|document.all|document.layers)
		return;
	else {
		if (document.getElementById){
			oWhich = document.getElementById(which).style;
			oImage = document.getElementById(img );}
		else
			if (document.layers) {
			oWhich = document.layers[which].style;
			oImage = document.layers[img];}
		else {
			oWhich = document.all.which.style;
			oImage = document.all.img;}
		}
	window.focus();
	if (oWhich.display == "none"){
		oWhich.display = "";
		oImage.src = imgsrc + "hide_min.gif"
		oImage.alt = "";
		setCookie(which,"show","/");
		}
	else{
		oWhich.display = "none";
		oImage.src = imgsrc + "hide_max.gif";
		oImage.alt = "";
		setCookie(which,"hide","/");
		}
}
function setCookie(name, value, path, domain, expires, secure){
	//expire = " expires=Wed, 1 Jan 2020 00:00:00 GMT;";
	 document.cookie = name + "=" +escape(value) +
        ((expires) ? ";expires=" + expires.toGMTString() : "") +
        ((path) ? ";path=" + path : "") + 
        ((domain) ? ";domain=" + domain : "") +
        ((secure) ? ";secure" : "");	
}
function getCookie(name){
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1){
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;}
    else{
        begin += 2;}
    var end = document.cookie.indexOf(";", begin);
    if (end == -1){
        end = dc.length;}
    return unescape(dc.substring(begin + prefix.length, end));
}
function deleteCookie(name, path, domain){
    if (getCookie(name)){
        document.cookie = name + "=" + 
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            "; expires=Thu, 01-Jan-70 00:00:01 GMT";}
}
function fixDate(date) {
  var base = new Date(0);
  var skew = base.getTime();
  if (skew > 0)
    date.setTime(date.getTime() - skew);
}
function trimAll( strValue ) {
	var objRegExp = /^(\s*)$/;
	if(objRegExp.test(strValue)) {
		strValue = strValue.replace(objRegExp, '');
		if( strValue.length == 0)
			return strValue;
		}
	objRegExp = /^(\s*)([\W\w]*)(\b\s*$)/;
	if(objRegExp.test(strValue)) {
		strValue = strValue.replace(objRegExp, '$2');
	}
	return strValue;
}
function OpenPreviewWindow(targetPage, formName){
	now = new Date  
   	openWin('','preview','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=680,height=400')
   	formName.action = targetPage + "?ID=" + now.getTime();	
	formName.target = "preview";
	formName.submit();
}
function CheckFormAddEventSys () {
	var errorMsg = "";
	if (document.frmAddEvent.selectMonth.value==""){
		errorMsg += "\n\t<% = strTxtNoMonthSelected %>";
	}
	if (document.frmAddEvent.selectYear.value==""){
		errorMsg += "\n\t<% = strTxtNoYearToView %>";
	}
	if (errorMsg != ""){
		msg = "<% = strTxtErrorDisplayLine %>\n\n";
		msg += "<% = strTxtErrorDisplayLine1 %>\n";
		msg += "<% = strTxtErrorDisplayLine2 %>\n";
		msg += "<% = strTxtErrorDisplayLine %>\n\n";
		msg += "<% = strTxtErrorDisplayLine3 %>\n";
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	return true;
}
