var LAST_IDLE_TIME;
//Function to jump to another forum
function ForumJump(URL) {
	
	if (URL.options[URL.selectedIndex].value != "") self.location.href = URL.options[URL.selectedIndex].value;	
	return true;
}

//Function to open pop up window
function openWin(theURL,winName,features) {
  	window.open(theURL,winName,features);
}


var activeHelpWin = null;
function open_help_window(url) {
	var agent = navigator.userAgent.toLowerCase();
	if (agent.indexOf('webtv') != -1) {
		window.location.href = url;
	} else {
		if (!activeHelpWin || activeHelpWin.closed) {
			activeHelpWin = window.open(url,'help','height=350,width=500,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=yes');
		} else {
			activeHelpWin.focus();
			activeHelpWin.location.href = url;
		}
	}
}

function open_custom_help_window(url , width , height) {
	var agent = navigator.userAgent.toLowerCase();
	if (agent.indexOf('webtv') != -1) {
		window.location.href = url;
	} else {
		if (!activeHelpWin || activeHelpWin.closed) {
			activeHelpWin = window.open(url,'help','height='+height+',width='+width+',toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=yes');
		} else {
			activeHelpWin.focus();
			activeHelpWin.location.href = url;
		}
	}
}


function open_pop_window(url , width , height, options, winName) {
	var agent = navigator.userAgent.toLowerCase();
	var popupWin;
	if (agent.indexOf('webtv') != -1) {
		window.location.href = url;
	} else {
	    options = options || "toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=0,resizable=no";
	    winName = winName || "help";
		popupWin = window.open(url,winName,'height='+height+',width='+width+','+options);
		if(window.focus)
		    popupWin.focus();
	}
}


function open_window(name , url , width , height) {
	var agent = navigator.userAgent.toLowerCase();
	if (agent.indexOf('webtv') != -1) {
		window.location.href = url;
	} else {
		window.open(url,name,'height='+height+',width='+width+',toolbar=1,location=1,directories=1,status=1,menuBar=1,scrollBars=1,resizable=yes');
	}
}

// <a href="javascript:open_bare_window('http://www.google.com','help',350,500)">Click here to open window</a>


//Function to open preview post window
function OpenPreviewWindow(targetPage, formName){
	
	now = new Date  
	
	//Open the window first 	
   	openWin('','preview','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=680,height=400')
   		
   	//Now submit form to the new window
   	formName.action = targetPage + "&ID=" + now.getTime();	
	formName.target = "preview";
	formName.submit();
}


function ConfirmAndRedirect( msg , yesLink , noLink ) {
	if( confirm(msg) ) {
		if( yesLink != '' )
			window.location = yesLink;
	} else {
		if( noLink != '' )
			window.location = noLink;
	}
}
