function back()
{
	window.history.back();
}

function iframe(src, w, h)
{
	document.write('<iframe src="' + src + '" scrolling="no" frameborder="0" style="width: '+ w +'px; height: '+ h +'px; border: none;"></iframe>');
}

function displayFlash(url)
{
    document.write('<object data="' + url + '" style="width: 425px; height: 344px;">');
    document.write('<param name="movie" value="' + url + '"></param>');
    document.write('<param name="allowFullScreen" value="true"></param>');
    document.write('<param name="allowscriptaccess" value="always"></param>');
    document.write('<embed src="http://www.youtube.com/v/gfeEGX1Bc3g?fs=1&amp;hl=en_US&amp;rel=0&amp;autoplay=1" allowfullscreen="true" style="width: 425px; height: 344px;"></embed>');
    document.write('</object>');
}

function verify( text, url )
{
	if ( confirm( text ) )
	{
		window.location.replace( url );
	}
}

function captcha_reload()
{
	document.getElementById( 'captcha' ).src = '/securimage/securimage_show.php?' + Math.random();
}

function Search(web_root)
{
	var keyword = document.getElementById('keyword').value;
	
	if (keyword != '')
	{
		window.location = web_root+'forum/search:'+keyword;
	}
	else
	{
		cancelSearch(web_root);
	}
}

function cancelSearch(web_root)
{
	window.location = web_root+'forum/';
}

var newWindow;
function openNewWin( url )
{
	var width = 920;
    var height = 450;
    var left = parseInt( ( screen.availWidth / 2 ) - ( width / 2 ) );
    var top = parseInt( (screen.availHeight / 2 ) - ( height / 2 ) );
    var windowFeatures = "width="+width+", height="+height; 
    windowFeatures += ",left="+(left)+", top="+(top);
	windowFeatures += ",status=0, scrollbars=1 ,resizable=1";
    windowFeatures += ",screenX="+left+", screenY="+top;
    newWindow = window.open( url, "newWin", windowFeatures );
	newWindow.focus();
}
