File "beamer.js"
Full path: E:/sites/Single15/tinmung2007/webroot/Tin VUI_BUON/Khan Tron/album/res/beamer.js
File size: 10.82 KiB (11081 bytes)
MIME-type:
Charset: utf-8
//////////////////////////
function goToFullscreenOrNot(url) {
url = makeDestinationUrl(1, url); //With own set as referrer.
if (theUrlArguments.get("fullscreen") == "yes") {
theNewWindow = window.open(url, "fullscreen", "toolbar=0,scrollbars=auto,menubar=0,location=0,resizable=1,directories=0,status=0,fullscreen=yes,width=" + (screen.width) + ",height=" + (screen.height) + ",left=0,top=0");
theNewWindow.focus();
} else {
top.document.location.href = url;
//top.document.location.replace(url);
//theNewWindow = window.open(url, "screen", "");
//theNewWindow.focus();
}
}
function doClose() {
var continueClose = true;
//Ask a confirmation when a user tries to close the launch window. (IE does this by it self.)
//Can't do this check for IE since it does not give the correct window.name back.
//alert("navigator.userAgent = " + navigator.userAgent + ", " + navigator.userAgent.indexOf("Netscape"));
if (navigator.userAgent.indexOf("Netscape") > -1) {
if (window.name != "fullscreen") {
var continueClose = window.confirm("Are you sure you want to close this window?");
}
}
if (continueClose == true) {
window.close();
}
}
function doGoBack() {
history.go(-1);
}
/*
*Toggles on or off the Exif Info display.
*/
function toggleExifInfo() {
if (showingExif == false) {
if (document.all || document.getElementById) document.getElementById('imageinfo').style.visibility="visible"; // IE & Gecko
else document.layers['imageinfo'].visibility="show"; // Netscape 4
showingExif = true;
}
else {
if (document.all || document.getElementById) document.getElementById('imageinfo').style.visibility="hidden"; // IE & Gecko
else document.layers['imageinfo'].visibility="hide"; // Netscape 4
showingExif = false;
}
}
/*
*Toggles on or off the file base name display.
*/
function toggleFileBaseNameDisplay() {
if (howToShowFileBaseName == "top") {
howToShowFileBaseName = "bottom";
theUrlArguments.set("imageFileName", "bottom");
//alert("False, Before: ");
goTo(""); //Reload page with new URL state settings.
//Better would be to be able to update the URL state form the array on the page unload().
//alert("False, After: ");
}
else if (howToShowFileBaseName == "bottom") {
howToShowFileBaseName = "hide";
theUrlArguments.set("imageFileName", "hide");
//alert("True, Before: ");
goTo(""); //Reload page with new URL state settings.
//Better would be to be able to update the URL state form the array on the page unload().
//alert("True, After: ");
}
else {
howToShowFileBaseName = "top";
theUrlArguments.set("imageFileName", "top");
//alert("True, Before: ");
goTo(""); //Reload page with new URL state settings.
//Better would be to be able to update the URL state form the array on the page unload().
//alert("True, After: ");
}
}
/*
*Shows/hides the file base name.
*Call this function at body onload.
*/
function fileBaseNameDisplay() {
if (howToShowFileBaseName == "top") {
//alert("fileName top");
if (document.all || document.getElementById) {
document.getElementById('fileBaseNameTop').style.visibility="visible"; // IE & Gecko
document.getElementById('fileBaseNameBottom').style.visibility="hidden"; // IE & Gecko
}
else {
document.layers['fileBaseNameTop'].visibility="show"; // Netscape 4
document.layers['fileBaseNameBottom'].visibility="hide"; // Netscape 4
}
}
else if (howToShowFileBaseName == "bottom") {
//alert("fileName bottom");
if (document.all || document.getElementById) {
document.getElementById('fileBaseNameTop').style.visibility="hidden"; // IE & Gecko
document.getElementById('fileBaseNameBottom').style.visibility="visible"; // IE & Gecko
}
else {
document.layers['fileBaseNameTop'].visibility="hide"; // Netscape 4
document.layers['fileBaseNameBottom'].visibility="show"; // Netscape 4
}
}
else {
//alert("fileName hide");
if (document.all || document.getElementById) {
document.getElementById('fileBaseNameTop').style.visibility="hidden"; // IE & Gecko
document.getElementById('fileBaseNameBottom').style.visibility="hidden"; // IE & Gecko
}
else {
document.layers['fileBaseNameTop'].visibility="hide"; // Netscape 4
document.layers['fileBaseNameBottom'].visibility="hide"; // Netscape 4
}
}
}
/*
*Toggles on or off the navigation box display.
*/
function toggleNavigationBoxDisplay() {
if (showingNavigationBox == false) {
if (document.all || document.getElementById) document.getElementById('navigationBox').style.visibility="visible"; // IE & Gecko
else document.layers['navigationBox'].visibility="show"; // Netscape 4
showingNavigationBox = true;
theUrlArguments.set("hideNavigationBox", "no");
//alert("False, Before: ");
goTo(""); //Reload page with new URL state settings.
//Better would be to be able to update the URL state form the array on the page unload().
//alert("False, After: ");
}
else {
if (document.all || document.getElementById) document.getElementById('navigationBox').style.visibility="hidden"; // IE & Gecko
else document.layers['navigationBox'].visibility="hide"; // Netscape 4
showingNavigationBox = false;
theUrlArguments.set("hideNavigationBox", "yes");
//alert("True, Before: ");
goTo(""); //Reload page with new URL state settings.
//Better would be to be able to update the URL state form the array on the page unload().
//alert("True, After: ");
}
}
/*
*Shows/hides the navigation box.
*Call this function at body onload.
*/
function navigationBoxDisplay() {
if (showingNavigationBox == true) {
///alert("Showing Navigation Box!");
if (document.all || document.getElementById) document.getElementById('navigationBox').style.visibility="visible"; // IE & Gecko
else document.layers['navigationBox'].visibility="show"; // Netscape 4
}
else {
//alert("Hiding Navigation Box!");
if (document.all || document.getElementById) document.getElementById('navigationBox').style.visibility="hidden"; // IE & Gecko
else document.layers['navigationBox'].visibility="hide"; // Netscape 4
}
}
/*
*Toggles on or off the auto play mode.
*/
function togglePlayPause() {
if (playing == true) {
playing = false;
clearTimeout(timeout);
timeout = 0;
document.images['playpause'].src = play_img.src;
theUrlArguments.set("play", "no");
goTo(""); //Reload page with new URL state settings.
}
else {
playing = true;
document.images['playpause'].src = pause_img.src;
theUrlArguments.set("play", "yes");
//goTo(""); //Reload page with new URL state settings.
next();
}
}
/*
*Prepares for auto load of next slide after timeout.
*Call this function at body onload.
*/
function playPause() {
if (playing == true) {
if (atEnd == true && !mustLoop == true) {
togglePlayPause();
}
else {
timeout = setTimeout(next, delay);
document.images['playpause'].src = pause_img.src;
}
}
else {
document.images['playpause'].src = play_img.src;
}
}
/*
*Navigation with keys.
*/
function keyEvent(e) {
if(!e) {
if(window.event) {
e = window.event;
}
else {
return;
}
}
if(typeof(e.which) == 'number') {
e = e.which;
}
else {
if(typeof(e.keyCode) == 'number') {
e = e.keyCode;
}
else {
return;
}
}
//window.alert('The key pressed has keycode ' + e + ' and is key [' + String.fromCharCode(e) + '].');
/*
if ((e == 34) || (e == 13)) { //Page Down or Enter.
next();
}
if (e == 33) { //Page Up.
previous();
}
*/
switch (e) {
case 34: //Page Down
case 13: //Enter
next();
break;
case 33: //Page Up
previous();
break;
case 73: //i
goToIndexPage();
break;
case 80: //p
togglePlayPause();
break;
case 69: //e
toggleExifInfo();
break;
case 70: //f
toggleFileBaseNameDisplay();
break;
case 66: //b
toggleNavigationBoxDisplay();
break;
case 27: //Esc
doClose();
break;
default:
//alert("Unsupported key.");
break;
}
}
function displayCommentTopOrBottom() {
if (howToShowCaption == "top") {
//alert("Showing Caption at Top");
if (document.all || document.getElementById) {
document.getElementById('commentTop_shadow').style.visibility="visible"; // IE & Gecko
document.getElementById('commentTop').style.visibility="visible"; // IE & Gecko
document.getElementById('commentBottom_shadow').style.visibility="hidden"; // IE & Gecko
document.getElementById('commentBottom').style.visibility="hidden"; // IE & Gecko
}
else {
document.layers['commentTop_shadow'].visibility="show"; // Netscape 4
document.layers['commentTop'].visibility="show"; // Netscape 4
document.layers['commentBottom_shadow'].visibility="hide"; // Netscape 4
document.layers['commentBottom'].visibility="hide"; // Netscape 4
}
}
else if (howToShowCaption == "bottom") {
//alert("Showing Caption at Bottom");
if (document.all || document.getElementById) {
document.getElementById('commentTop_shadow').style.visibility="hidden"; // IE & Gecko
document.getElementById('commentTop').style.visibility="hidden"; // IE & Gecko
document.getElementById('commentBottom_shadow').style.visibility="visible"; // IE & Gecko
document.getElementById('commentBottom').style.visibility="visible"; // IE & Gecko
}
else {
document.layers['commentTop_shadow'].visibility="hide"; // Netscape 4
document.layers['commentTop'].visibility="hide"; // Netscape 4
document.layers['commentBottom_shadow'].visibility="show"; // Netscape 4
document.layers['commentBottom'].visibility="show"; // Netscape 4
}
}
else {
//alert("Hiding Caption");
if (document.all || document.getElementById) {
document.getElementById('commentTop_shadow').style.visibility="hidden"; // IE & Gecko
document.getElementById('commentTop').style.visibility="hidden"; // IE & Gecko
document.getElementById('commentBottom_shadow').style.visibility="hidden"; // IE & Gecko
document.getElementById('commentBottom').style.visibility="hidden"; // IE & Gecko
}
else {
document.layers['commentTop_shadow'].visibility="hide"; // Netscape 4
document.layers['commentTop'].visibility="hide"; // Netscape 4
document.layers['commentBottom_shadow'].visibility="hide"; // Netscape 4
document.layers['commentBottom'].visibility="hide"; // Netscape 4
}
}
}