/* JAVASCRIPT TO OPEN THE PLAYER */

/* USAGE 
	- openPlayer() = opens the player to the first tab first video, plays first video from the list
	- openPlayer([videoID]) - opens the player to the first tab first video, and plays the video with corrosponding id
	- openPlayer([videoID], [tabName]) - opens the player to the tab, if no video id then plays the first video from the list
	- openPlayer([videoID], [tabName], [categoryName]) - opens the player to the tab and category, if no video id then plays the first video from the list

	** examples:
	openPlayer(); openPlayer(100); openPlayer('','hello'); openPlayer(100, 'hello', 'world'); openPlayer('', 'hello', 'world');
*/

function openPlayer(videoID, tabName, categoryName) {
	
	if(videoID == undefined) videoID = '';
	if(tabName == undefined) tabName = '';
	if(categoryName == undefined) categoryName = '';
	
	/* HEIGHT/WIDTH & TOP/LEFT OF THE POP-UP */
	var height = 660;
	var width = 880;
	var top = parseInt((screen.height - height) / 2, 10);
	var left = parseInt((screen.width - width) / 2, 10);	

	var url = 'http://videos.jetsuite.tv/video.aspx?playerID=7&videoID=' + videoID + '&tabName=' + escape(tabName) + '&categoryName=' + escape(categoryName);
	var windowFeatures = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=' + width + ',height=' + height + ',top=' + top + ',left=' + left;
	var windowName = 'JetSuiteTV';

	// Open the window.
	window.open(url, windowName, windowFeatures);
}
