function goTo(pagename) {
	if (pagename.options[pagename.selectedIndex].value != 'null') {
		parent.top.document.location.href=pagename.options[pagename.selectedIndex].value;
	}
	return true;
}

var popupstatus = 0;
var popupmediaplayer;

/*
function launchmediaplayer()
{
	popupstatus = 1;
	//This launches a new window and then
	//focuses it if window.focus() is supported.
	popupmediaplayer = window.open('/sf-mediaplayer.html','sf_mediaplayer','height=370,width=560,scrollbars=no,resizable=no');
	popupmediaplayer.caller = self;
	//delay a bit here because IE4 encounters errors
	//when trying to focus a recently opened window
 	setTimeout('popupmediaplayer.focus();',250);
}
function launchmediaplayer(type, cat, id) {
	//return false;
	popupstatus = 1;
	if (type == undefined)
		type = 1;
	if (cat == undefined)
		cat = 10;
	if (id == undefined)
		id = 187;
	//This launches a new window and then
	//focuses it if window.focus() is supported.
	//stopMovieSounds();
	if (thisMovie(movieName)) {
		type = thisMovie(movieName).GetVariable("currentType");
		cat = thisMovie(movieName).GetVariable("currentCategory");
		id = thisMovie(movieName).GetVariable("currentTitle");
		if (type == undefined || type == '0')
			type = 1;
		if (cat == undefined || cat == '0')
			cat = 10;
		if (id == undefined || id == '0')
			id = 187;
	}
	popupmediaplayer = window.open('/mediaplayer_popup.aspx?type=' + type + '&cat=' + cat + '&id=' + id,'mediaplayer','width=800,height=445,scrollbar=no,menubar=no,resizable=no');
	popupmediaplayer.caller = self;
	//delay a bit here because IE4 encounters errors
	//when trying to focus a recently opened window
 	setTimeout('popupmediaplayer.focus();',250);
	if (thisMovie(movieName)) {
		location.href="/mediaplayer.aspx";
	}
}

*/

function launchmediaplayer(type, cat, id) {
	//return false;
	popupstatus = 1;
	if (type == undefined)
		type = 0;
	if (cat == undefined)
		cat = 0;
	if (id == undefined)
		id = 0;
	//This launches a new window and then
	//focuses it if window.focus() is supported.
	//stopMovieSounds();
	if (thisMovie(movieName)) {
		type = thisMovie(movieName).GetVariable("currentType");
		cat = thisMovie(movieName).GetVariable("currentCategory");
		id = thisMovie(movieName).GetVariable("currentTitle");
		if (type == undefined || type == '0')
			type = 0;
		if (cat == undefined || cat == '0')
			cat = 0;
		if (id == undefined || id == '0')
			id = 0;
	}
	popupmediaplayer = window.open('/mediaplayer_popup.aspx?type=' + type + '&cat=' + cat + '&id=' + id,'mediaplayer','width=800,height=445,scrollbar=no,menubar=no,resizable=no');
	popupmediaplayer.caller = self;
	//delay a bit here because IE4 encounters errors
	//when trying to focus a recently opened window
 	setTimeout('popupmediaplayer.focus();',250);
	if (thisMovie(movieName)) {
		location.href="/mediaplayer.aspx?autoPause=1";
	}
}

function launchpopupplayer(type, cat, id) {
	popupstatus = 1;
	if (type == undefined)
		type = 0;
	if (cat == undefined)
		cat = 0;
	if (id == undefined)
		id = 0;
	//This launches a new window and then
	//focuses it if window.focus() is supported.
	popupmediaplayer = window.open('/mediaplayer_popup.aspx?type=' + type + '&cat=' + cat + '&id=' + id,'mediaplayer','width=800,height=445,scrollbar=no,menubar=no,resizable=no');
	popupmediaplayer.caller = self;
	//delay a bit here because IE4 encounters errors
	//when trying to focus a recently opened window
 	setTimeout('popupmediaplayer.focus();',250);
}

function rollover(obj) {
  document.getElementById(obj).src = '/pics/' + obj + '_1.gif';  
}

function rollout(obj) {
  document.getElementById(obj).src = '/pics/' + obj + '_0.gif';  
}

function clearTxt(obj) {
  var f = document.getElementById(obj)
  var v = f.value;
  if (v.substring(0,1) == '<') {
    f.value = '';
  }
}

function launchmediaplayer_() {
  window.open('/sf-mediaplayer.html','sf_mediaplayer','width=556,height=370,scrollbars=no,menubar=no');
}

function tellFriend(str) {
	if (str == '1') {
		document.getElementById('div_tellFriend').className = 'showGrp';
		document.getElementById('div_tellFriend_txt').className = 'hideGrp';
	}
	else {
		document.getElementById('div_tellFriend').className = 'hideGrp';
		document.getElementById('div_tellFriend_txt').className = 'showGrp';
	}
	//return true;
}

function newThread(str) {
  //location.href = '/community/' + str + '/newthread.aspx';
  location.href = '/post.aspx?s=' + str;
}

function replyThread(str) {
  location.href = '/post.aspx?t=' + str;
}

function editPost(str) {
  location.href = '/post.aspx?p=' + str + '&e=1';
}

function replyPost(str) {
  location.href = '/post.aspx?p=' + str;
}

function quoteThread(str) {
  location.href = '/post.aspx?t=' + str + '&q=1';
}

function quotePost(str) {
  location.href = '/post.aspx?p=' + str + '&q=1';
}

function hideDiv(str) {
  document.getElementById(str).className = 'hideGrp';
}


var movieName = "mediaplayer"; 
function stopSubmit() { 
return false; 
} 
function thisMovie(movieName) { 
// IE and Netscape refer to the movie object differently. 
// This function returns the appropriate syntax depending on the browser. 
if (navigator.appName.indexOf ("Microsoft") !=-1) { 
return window[movieName] 
} else { 
return document[movieName] 
} 
} 

// Checks if movie is completely loaded. 
// Returns true if yes, false if no. 
function movieIsLoaded (theMovie) { 
if (typeof(theMovie) != "undefined") { 
return theMovie.PercentLoaded() == 100;
} else { 
return false; 
} 
} 


function playmovie() { 
if (movieIsLoaded(thisMovie(movieName))) { 
thisMovie(movieName).Play(); 


} 
} 

function stopmovie() { 
if (movieIsLoaded(thisMovie(movieName))) { 
thisMovie(movieName).StopPlay(); 
} 
} 




function go(theFrame) { 
if (movieIsLoaded(thisMovie(movieName))) { 
thisMovie(movieName).GotoFrame(theFrame); 
} 
} 

function golabel() { 
if (movieIsLoaded(thisMovie(movieName))) { 
thisMovie(movieName).TGotoLabel("_level0/","redframe"); 
} 
} 
//movieIsLoaded(movieName);
function stopMovieSounds() {
	if (thisMovie(movieName))
		//thisMovie(movieName).SetVariable("_root.MC_MediaPlayer.bagID","<%=bagID%>");
		location.href="/mediaplayer.aspx";
}
//setTimeout("initMovie()",50);
