/************************************************************************************
*	function name:		openWin
*	function arguements:	The window url, the window name, the window features	
*	function details: 	a genaric window opener
*************************************************************************************/
function openWin( windowURL, windowName, windowFeatures ) { 
        return window.open( windowURL, windowName, windowFeatures ) ; 
}

/************************************************************************************
*	function name:		openCenterWin
*	function arguements:	The window url , the window name, the height, the width, window features	
*	function details: 	auto center window script
*************************************************************************************/
function openCenterWin(windowURL, windowName, h, w, otherFeatures ){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+', ' +  otherFeatures;
	win = window.open(windowURL,windowName,settings)
	return win
}

/************************************************************************************
*	function name:		destroyFrame
*	function arguements:	none	
*	function details: 	This function will destroy any framest and put the user on the same page without the frameset
*************************************************************************************/
function destroyFrame(){
if (window != window.top){
	top.location.href = location.href;
	}
}

function ClearValue(t){
	if (t.value == 'mm/dd/yyyy'){
	t.value = '';
	}
}

function popGrooveNetReminder(){
	var url;
	var win;
	var options;
	options = "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes"
	url = "/secure/popups/GrooveNetReminder.aspx";
	win = openCenterWin(url, 'GrooveNetReminderWindow', 198, 300, options);

}

function popGameConfirmation(result){
	var url;
	var win;
	var options;
	options = "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes"
	url = "/secure/popups/GameConfirmation.aspx?result=" + String(result);
	win = openCenterWin(url, 'GameConfirmationWindow', 173, 301, options);
}

function popTriviaQuestion(guid){
	var url;
	var win;
	var options;
	options = "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes"
	url = "/secure/popups/triviaquestion.aspx?trivia_guid=" + guid
	win = openCenterWin(url, 'TriviaQuestionWindow', 300, 400, options);
}

function popShowQuestion(){
	var url;
	var win;
	var options;
	options = "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes"
	url = "/secure/popups/showquestion.aspx"
	win = openCenterWin(url, 'ShowQuestionWindow', 300, 400, options);
}

function popSceneDilema(guid){
	var url;
	var win;
	var options;
	options = "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes"
	url = "/secure/popups/scenedilema.aspx?scene_dilema_guid=" + guid
	win = openCenterWin(url, 'SceneDilemaWindow', 199, 301, options);
}

function popEightTrack(guid){
	var url;
	var win;
	var options;
	options = "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=no,resizable=yes"
	url = "/secure/popups/eighttrack.aspx?eight_track_guid=" + guid
	win = openCenterWin(url, 'EightTrackWindow', 199, 301, options);
}

function popVideoPlayer(guid){
	var url;
	var win;
	var options;
	options = "toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=385,height=505"
	url = "/secure/popups/videoplayer.aspx?video_clip_guid=" + guid
	win = openWin (url, 'VideoWindow', options);
}

function popEightBall(){
	if ( document.frmMain.txtEmail.value =='' ){
		window.location.href="/register.aspx?ReturnUrl=%2fEightBall.aspx?popEightball=true"
	}
	else{
		openCenterWin('', 'EightBall', 550, 730, 'toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes');
		document.frmMain.submit();
	}
}


function advanceScene(scene){
	switch(scene){
		case 1:{
			document.location.href="/secure/scenes/scene1_2.aspx"
			break;
		}
		case 2:{
			document.location.href="/secure/scenes/scene2_2.aspx"
			break;
		}
		case 3:{
			document.location.href="/secure/scenes/scene3_2.aspx"
			break;
		}
		case 4:{
			document.location.href="/secure/scenes/scene4_2.aspx"
			break;
		}
		case 5:{
			document.location.href="/secure/scenes/scene5_2.aspx"
			break;
		}
		case 6:{
			document.location.href="/secure/scenes/scene6_2.aspx"
			break;
		}
	}//end switch
}