var Popwindow;
var Videowindow;
var videowindowf;
var currentvideo=null;
var currentvideotitle= "";
var currentitem= "";
var currentchapter=1;
Window.onload=initpage;
Initialization
function Initpage () {
Adjustiframesize ()
BINDIFRAMEEVT ()
}
function Bindiframeevt () {
To bind an onload event to an IFRAME
var Cnt=document.getelementbyid ("Rightmain");
if (Cnt.addeventlistener) {
Cnt.addeventlistener ("Load", adjustiframesize, false);
} else {
Cnt.attachevent ("onload", adjustiframesize);
}
}
IFRAME Control
function Adjustiframesize () {
var myiframe = document.getElementById ("Rightmain");
if (myiframe) {
if (myiframe.contentdocument && myIframe.contentDocument.body.offsetHeight) {
Syntax DOM (and Mozilla)
if (myiframe.contentdocument.body.offsetheight>screen.availheight-404) {
Myiframe.height = myiframe.contentdocument.body.offsetheight+100;
}else{
Myiframe.height =screen.availheight-374
}
} else if (myiframe.document && myIframe.Document.body.scrollHeight) {
IE DOM Syntax
if (myiframe.document.body.scrollheight>screen.availheight-404) {
Myiframe.height = myiframe.document.body.scrollheight+100;
}else{
myiframe.height=screen.availheight-374
}
}
}
}
function Showtips (target) {
Target.blur ()
var theelement=target.nextsibling
if (theelement.style.display== "inline") {
Theelement.style.display= "None"
}else{
theelement.style.display= "inline"
}
Adjustiframesize ()
}
function Showhideanswer (target) {
Target.blur ()
var theelement=target.parentnode.parentnode.nextsibling
Alert (TheElement.style.display)
if (theelement.style.display== "block") {
Theelement.style.display= "None"
}else{
theelement.style.display= "Block"
}
Adjustiframesize ()
}
function Showhidenote (target) {
Target.blur ()
var theelement=target.parentnode.parentnode.nextsibling
Alert (TheElement.style.display)
if (theelement.style.display== "block") {
Theelement.style.display= "None"
}else{
theelement.style.display= "Block"
}
Adjustiframesize ()
}
////////////////////////////
function Launchvideo (VIDEOID,VIDEOTITLE,CC) {
if (VIDEOWINDOWF) {
Videowindowf.close ();
}
currentvideo=videoid;
Currentvideotitle=videotitle;
CURRENTCHAPTER=CC;
var videodirectory= ""
if (currentitem== "Videolist") {
Videodirectory= ". /.. /media/";
}else{
Videodirectory= ". /.. /media/";
}
Alert (WINDOW.LOCATION.HREF)
videowindow= window.open (videodirectory+ "videoplayer.html", "Videos", "Width=470,height=510,resizable=no, Scrollbars=no ");
Videowindow.moveto (0,0);
Videowindow.focus ();
}
function Launchvideo_f (videoid,videotitle) {
if (Videowindow) {
Videowindow.close ();
}
if (videoid) {
currentvideo=videoid;
}
if (videotitle) {
Currentvideotitle=videotitle;
}
var videodirectory= "";
var thew=780;
if (screen.availwidth) {
thew=screen.availwidth-10;
}
var theh=560;
if (screen.availheight) {
theh=screen.availheight-40;
}
videowindowf= window.open (videodirectory+ "videoplayer_f.html", "Videos_f", "width=" +thew+ ", height=" +theH+ ", Resizable=yes,scrollbars=no ");
Videowindowf.moveto (0,0);
Videowindowf.focus ();
}
////////////////////////////////
function Launchquiz (Quizid) {
var quizurl=quizid+ ". html"
popwindow= window.open (Quizurl, "Popwin", "Width=579,height=600,resizable=no,scrollbars=yes");
Popwindow.focus ();
}
function Launchreadings (readingid) {
var readingurl= "readings/" +readingid+ ". html";
popwindow= window.open (Readingurl, "Popwin", "Width=579,height=600,resizable=no,scrollbars=yes");
Popwindow.focus ();
}
function Launchreference (Referenceid) {
var referenceurl= ".. /references/"+referenceid+". html ";
popwindow= window.open (Referenceurl, "Popwin", "Width=579,height=550,resizable=no,scrollbars=yes");
Popwindow.focus ();
}
Web Development JS---JS call video playback