// JavaScript Document


<!--
function wload(vurl) {
var load = window.open(vurl,'vidwin','scrollbars=yes,menubar=no,height=690,width=780,resizable=yes,toolbar=no,location=no,status=no'); 
load.window.focus(); 
//return false;
}
// -->

function openWindow(width,height,url) {
    x = (640 - width)/2, y = (480 - height)/2;

    if (screen) {
        y = (screen.availHeight - height)/2;
        x = (screen.availWidth - width)/2;
    }

    window.open(url,'newWin','scrollbars=yes,width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
}

<!--
function eload(url) {
var load = window.open(url,'econwin','scrollbars=yes,menubar=no,height=450,width=670,resizable=yes,toolbar=no,location=no,status=no'); 
load.window.focus(); 
//return false;
}

/* video playing */
function playVid(tmpVid) {
	if (tmpVid == '0') {
		MediaPlayer1.play();
	}
	if (tmpVid == '1') {
		MediaPlayer2.play();
	}
	if (tmpVid == '2') {
		MediaPlayer3.controls.play();
	}
}
/* rewind video */
function rewVid(tmpVid) {
	if (tmpVid == '0') {
		MediaPlayer1.currentPosition = 0;		
	}
	if (tmpVid == '2') {
		MediaPlayer3.controls.currentPosition = 1;	
	}
}
/* stopping video */
/* stopping video */
function stpVid(tmpVid) {
	if (tmpVid == '0') {
		MediaPlayer1.stop();		
		MediaPlayer1.currentPosition = 0;		
		MediaPlayer1.stop();
		document.getElementById('vid1').style.display = 'none';
	    document.getElementById('vid2').style.display = 'block';				
	}
	if (tmpVid == '2') {
		MediaPlayer3.controls.stop();	
		document.getElementById('vid1').style.display = 'none';
	    document.getElementById('vid2').style.display = 'block';
		//document.MediaPlayer3.SetCurrentPosition(0);		
	}
}
/* pausing video */
function pauVid(tmpVid) {
	if (tmpVid == '0') {
		MediaPlayer1.pause();		
	}
	if (tmpVid == '2') {
		MediaPlayer3.controls.pause();	
	}
}
function playLongVid() {
	document.getElementById('vid2').style.display = 'none';
	document.getElementById('vid1').style.display = 'block';
	vid1.focus();
	playVid('0');	
}

function btnOver(tmpId) {
	var tmpArr = tmpId.split("-")
	//alert(tmpArr[1])
	document.getElementById(tmpArr[0] + "-" + tmpArr[1]).src = "/canada/home/internetandsecurity/images/" + tmpArr[1] + ".gif";
}
function btnOut(tmpId) {
	
	var tmpArr = tmpId.split("-")
	document.getElementById(tmpArr[0] + "-" + tmpArr[1]).src = "/canada/home/internetandsecurity/images/" + tmpArr[1] + "_def.gif";
}
/* volume bar WMPOld versions */
WMPOld_newVolume = 60;
WMPOld_oldVolume = 60;
WMPOld_currentVolume = 0;
function WMPOld_startVolume(thisEvent){
	changing=true;
	volPointerStart = thisEvent.clientX;
	document.attachEvent('onmousemove',WMPOld_checkVolume);
	document.attachEvent('onmouseup',WMPOld_stopVolume);	
}


function WMPOld_stopVolume(anObj){

	changing=false;
	document.detachEvent('onmousemove',WMPOld_checkVolume);
	document.detachEvent('onmouseup',WMPOld_stopVolume);
	WMPOld_oldVolume = WMPOld_newVolume;
}

function WMPOld_checkVolume(){
	if(changing==true){
		WMPOld_newVolume = WMPOld_oldVolume + ((event.clientX - volPointerStart )  );
		if(WMPOld_newVolume < 0){
			WMPOld_newVolume=0
		}
		if(WMPOld_newVolume > 60){
			WMPOld_newVolume=60
		}
		WMPOld_currentVolume = (4950 - ((WMPOld_newVolume) * 82.5)) * -1;
		//currentVolume = currentVolume - 50;
	
		document.getElementById('volumeButton1').style.left=WMPOld_newVolume+"px";
		//document.getElementById('vol').value = WMPOld_currentVolume;
		//document.getElementById('oldvol').value = WMPOld_oldVolume;
		//document.getElementById('newvol').value = WMPOld_newVolume;

		WMPOld_newVol(MediaPlayer1,WMPOld_currentVolume);
	}
	return false;
}
function WMPOld_newVol(WMPOld_anObj,WMPOld_Volume){
	WMPOld_anObj.volume = WMPOld_Volume;
}

/* volume bar WMPlatest versions */
newVolume = 65;
oldVolume = 65;
currentVolume = 0;
function startVolume(thisEvent){
	changing=true;
	volPointerStart = thisEvent.clientX;
	document.attachEvent('onmousemove',checkVolume);
	document.attachEvent('onmouseup',stopVolume);	
}


function stopVolume(anObj){

	changing=false;
	document.detachEvent('onmousemove',checkVolume);
	document.detachEvent('onmouseup',stopVolume);
	oldVolume = newVolume;
}

function checkVolume(){
	if(changing==true){
		newVolume = oldVolume + ((event.clientX - volPointerStart )  );
		if(newVolume < 0){
			newVolume=0
		}
		if(newVolume > 65){
			newVolume=65
		}
		currentVolume = (newVolume) * 1;
		//currentVolume = currentVolume - 50;
	
		document.getElementById('volumeButton2').style.left=newVolume+"px";
		newVol(MediaPlayer1,currentVolume);
	}
	return false;
}

function newVol(anObj,Volume){
anObj.settings.volume = Volume;
}
