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){
	var now = new Date();
	now.setTime(now.getTime() + 1000 * 60 * 60 * 24 * 365)
	if(document.all && !document.getElementById) {
		document.getElementById = function(id) {
			 return document.all[id];
		}
	}
	if (document.getElementById){
		oWhich = document.getElementById(which).style;
		oImage = document.getElementById(img );}
	else
		if (document.layers) {
			oWhich = document.layers[which];
			oImage = document.layers[img];}
	window.focus();
	
	if (oWhich.display == "none"){
		oWhich.display = "";
		oImage.src = imgsrc + "hide_min.gif"
		oImage.alt = "";
		setCookie(which,"show","/",now);
		}
	else{
		oWhich.display = "none";
		oImage.src = imgsrc + "hide_max.gif";
		oImage.alt = "";
		setCookie(which,"hide","/",now);
		}
}

function hideAll(which,img,imgsrc){
	var now = new Date();
	now.setTime(now.getTime() + 1000 * 60 * 60 * 24 * 365)
	if(document.all && !document.getElementById) {
		document.getElementById = function(id) {
			 return document.all[id];
		}
	}
	if (document.getElementById){
		oWhich = document.getElementById(which).style;
		oImage = document.getElementById(img );}
	else
		if (document.layers) {
			oWhich = document.layers[which];
			oImage = document.layers[img];}
	window.focus();
	oWhich.display = "none";
	oImage.src = imgsrc + "hide_max.gif";
	oImage.alt = "";
	setCookie(which,"hide","/",now);
}

function showAll(which,img,imgsrc){
	var now = new Date();
	now.setTime(now.getTime() + 1000 * 60 * 60 * 24 * 365)
	if(document.all && !document.getElementById) {
		document.getElementById = function(id) {
			 return document.all[id];
		}
	}
	if (document.getElementById){
		oWhich = document.getElementById(which).style;
		oImage = document.getElementById(img );}
	else
		if (document.layers) {
			oWhich = document.layers[which];
			oImage = document.layers[img];}
	window.focus();
	oWhich.display = "";
	oImage.src = imgsrc + "hide_min.gif";
	oImage.alt = "";
	setCookie(which,"show","/",now);
}


function setCookie(name, value, path, expires, domain, secure){
	 document.cookie = name + "=" +escape(value) +
        ((expires) ? ";expires=" + expires.toGMTString() : "") +
        ((path) ? ";path=" + path : "") + 
        ((domain) ? ";domain=" + domain : "") +
        ((secure) ? ";secure" : "");	
		
}
function getCookie1(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 getCookie(name) {
  var nameq = name + "=";
  var c_ar = document.cookie.split(';');
  for (var i=0; i<c_ar.length; i++) {
    var c = c_ar[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameq) == 0) return unescape( c.substring(nameq.length, c.length) );
  }
  return null;
}



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 MM_reloadPage(init) {  //Netscape 4 Resize Fix
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
