tagName = "course";

function CourseOW(){
	this.innerWidth = 0;
	this.innerHeight = 0;
}

CourseOW.prototype.showVideo = function(website, language){
	this.innerWidth = oNavigator.getInnerWidth();
	this.innerHeight = oNavigator.getInnerHeight();
	oNavigator.coverTheBackground("video_area", this.innerWidth, this.innerHeight);
	this.playVideo(website, language);
}

CourseOW.prototype.playVideo = function(website, language){
	var div = document.getElementById("chapter_1_video");
	oNavigator.locateVideo(div, this.innerWidth, this.innerHeight, 480, 320);
	/*var positionLeft = (this.innerWidth-480)/2;
	var positionTop = (this.innerHeight-320)/2;
	div.style.left = positionLeft + "px";
	div.style.top = positionTop + "px";*/
	div.style.display = "block";
	div.innerHTML = "<div id=\"close_video\"><img src=\""+website+"images/window_close.gif\" onclick=\"javascript:oCourseOW.stopVideo();\" onMouseOver=\"javascript:this.style.cursor='pointer';\"></id><embed id=\"video\" src=\""+website+"images/mediaplayer.swf\" width=\"480\" height=\"320\" allowscriptaccess=\"always\" allowfullscreen=\"true\" flashvars=\"width=480&height=320&file="+website+"download/video/PADI/PADI_OW_Chapter_1_"+language+".flv&displaywidth=480&displayheight=320&showstop=true&autoscroll=true&autostart=true\" />";
	//div.innerHTML = "<div id=\"close_video\"><img src=\""+website+"images/window_close.gif\" onclick=\"javascript:oCourseOW.stopVideo();\"></id>";
}

CourseOW.prototype.stopVideo = function(){
	oNavigator.recoverTheBackground("video_area");
	var div = document.getElementById("chapter_1_video");
	div.style.innerHTML = "";
	div.style.display = "none";
}

CourseOW.prototype.relocateVideo = function(){
	this.innerWidth = oNavigator.getInnerWidth();
	this.innerHeight = oNavigator.getInnerHeight();

	var divVideoArea = document.getElementById("video_area");
	divVideoArea.style.width = this.innerWidth;
	divVideoArea.style.height = this.innerHeight;

	var divVideo = document.getElementById("chapter_1_video");
	oNavigator.locateVideo(divVideo, this.innerWidth, this.innerHeight, 480, 320);
}
