Difference between revisions of "MediaWiki:Common.js"

From MadaCamp
Jump to: navigation, search
Line 4: Line 4:
 
     theme : 'white'
 
     theme : 'white'
 
  };
 
  };
 +
 +
 +
/* start rotating banner */
 +
/* Banner 143x77 */
 +
/* Add image and URL in array and upload/protect image
 +
  (first letter or image name must be capitalised) */
 +
 +
/* define the images directory including trailing slash */
 +
var madacamp_banner_dir = '/static_images/';
 +
 +
/* The arrays with images and their corresponding URLs */
 +
 +
var madacamp_banners = new Array("Anakao_banner.gif",
 +
                        "Boabab_Avenue_banner.gif",
 +
                        "Sakalava_Bay_banner.gif");
 +
 +
var madacamp_links = new Array("/Anakao",
 +
                            "/Baobab_Avenue",
 +
                            "/Sakalava_Bay");
 +
 +
function start_animation(){
 +
setTimeout('madacamp_blender()',15000); /* 15 second */
 +
}
 +
 +
madacamp_banner0 = new Image(145,77);
 +
madacamp_banner0.src = madacamp_banner_dir + "allson_angkor_hotel.gif";
 +
 +
madacamp_banner1 = new Image(145,77);
 +
madacamp_banner1.src = madacamp_banner_dir + "madacamp_hotel.gif";
 +
 +
madacamp_banner2 = new Image(145,77);
 +
madacamp_banner2.src = madacamp_banner_dir +"allson_angkor_paradise_hotel.gif";
 +
 +
 +
function madacamp_swap(){
 +
opacity = 0;
 +
IE_opacity = 0;
 +
 +
if (navigator.appVersion.indexOf("MSIE") != -1){
 +
document.getElementById("blendinger").style.filter = "alpha(opacity=0)";
 +
interval = setInterval("blendinger_IE()",50)
 +
 +
}
 +
else {
 +
document.getElementById("blendinger").style.opacity=0;
 +
interval = setInterval("blendinger_opacity()",50)
 +
}
 +
}
 +
 +
function blendinger_IE(){
 +
if (IE_opacity < 100){
 +
IE_opacity = IE_opacity +4;
 +
document.getElementById("blendinger").style.filter = "alpha(opacity="+IE_opacity+")";
 +
 +
}
 +
 +
else{
 +
clearInterval(interval);
 +
IE_count = 0;
 +
}
 +
}
 +
 +
function blendinger_opacity(){
 +
 +
if (opacity < 1){
 +
opacity = (Math.floor(opacity * 100) +4) / 100;
 +
document.getElementById("blendinger").style.opacity=opacity;
 +
 +
}
 +
else{
 +
clearInterval(interval);
 +
 +
}
 +
}
 +
 +
var madacamp_array_index = madacamp_links.length -1;
 +
var first_madacamp_index = Math.round(madacamp_array_index * Math.random())
 +
 +
var madacamp_cycle = first_madacamp_index;
 +
var madacamp_total = madacamp_banners.length -1;
 +
var madacamp_link = madacamp_links[madacamp_cycle]; /* initially the first */
 +
 +
function madacamp_blender(){
 +
 +
/* first set current image as background */
 +
 +
document.getElementById('background_image').style.backgroundImage='url('+madacamp_banner_dir+madacamp_banners[madacamp_cycle]+')';
 +
 +
madacamp_cycle++;
 +
 +
if (madacamp_cycle == madacamp_banners.length){
 +
madacamp_cycle = 0;
 +
}
 +
 +
madacamp_swap();
 +
 +
setTimeout("document.images.madacamp_animation.src=madacamp_banner_dir + madacamp_banners[madacamp_cycle];",10)
 +
             
 +
madacamp_link = madacamp_links[madacamp_cycle] /* update link values */
 +
 +
}
 +
 +
/* end rotaing banner */

Revision as of 16:09, 11 February 2010

/* Any JavaScript here will be loaded for all users on every page load. */

var RecaptchaOptions = {
    theme : 'white'
 };


/* start rotating banner */
/* Banner 143x77 */
/* Add image and URL in array and upload/protect image
   (first letter or image name must be capitalised) */

/* define the images directory including trailing slash */
var madacamp_banner_dir = '/static_images/';

/* The arrays with images and their corresponding URLs */

var madacamp_banners = new Array("Anakao_banner.gif",
                        "Boabab_Avenue_banner.gif",
                        "Sakalava_Bay_banner.gif");
 
var madacamp_links = new Array("/Anakao",
                             "/Baobab_Avenue",
                             "/Sakalava_Bay");

function start_animation(){
setTimeout('madacamp_blender()',15000); /* 15 second */
}

madacamp_banner0 = new Image(145,77);
madacamp_banner0.src = madacamp_banner_dir + "allson_angkor_hotel.gif";

madacamp_banner1 = new Image(145,77);
madacamp_banner1.src = madacamp_banner_dir + "madacamp_hotel.gif";

madacamp_banner2 = new Image(145,77);
madacamp_banner2.src = madacamp_banner_dir +"allson_angkor_paradise_hotel.gif";


function madacamp_swap(){
opacity = 0;
IE_opacity = 0;

if (navigator.appVersion.indexOf("MSIE") != -1){
document.getElementById("blendinger").style.filter = "alpha(opacity=0)";
interval = setInterval("blendinger_IE()",50)

}
else {
document.getElementById("blendinger").style.opacity=0;
interval = setInterval("blendinger_opacity()",50)
}
}

function blendinger_IE(){
if (IE_opacity < 100){
IE_opacity = IE_opacity +4;
document.getElementById("blendinger").style.filter = "alpha(opacity="+IE_opacity+")";

}

else{
clearInterval(interval);
IE_count = 0;
}
}

function blendinger_opacity(){
 
if (opacity < 1){
opacity = (Math.floor(opacity * 100) +4) / 100;
document.getElementById("blendinger").style.opacity=opacity;

}
else{
clearInterval(interval);

}
}

var madacamp_array_index = madacamp_links.length -1;
var first_madacamp_index = Math.round(madacamp_array_index * Math.random())

var madacamp_cycle = first_madacamp_index;
var madacamp_total = madacamp_banners.length -1;
var madacamp_link = madacamp_links[madacamp_cycle]; /* initially the first */

function madacamp_blender(){

/* first set current image as background */

document.getElementById('background_image').style.backgroundImage='url('+madacamp_banner_dir+madacamp_banners[madacamp_cycle]+')';

madacamp_cycle++;

if (madacamp_cycle == madacamp_banners.length){
madacamp_cycle = 0;
}
 
madacamp_swap();

setTimeout("document.images.madacamp_animation.src=madacamp_banner_dir + madacamp_banners[madacamp_cycle];",10)
               
madacamp_link = madacamp_links[madacamp_cycle] /* update link values */
 
}

/* end rotaing banner */