/* generated javascript */
var skin = 'monobook';
var stylepath = '/skins';

/* MediaWiki:Common.js */
var RecaptchaOptions = {
    theme : 'white'
 };

/* start rotating banner */

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

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

var sunway_banners = new Array("allson_angkor_hotel.gif",
                        "sunway_hotel.gif",
                        "allson_angkor_paradise_hotel.gif");
 
var sunway_links = new Array("/Allson_Angkor_Hotel",
                             "/Sunway_Hotel",
                             "/Allson_Angkor_Paradise_Hotel");

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

sunway_banner0 = new Image(145,77);
sunway_banner0.src = sunway_banner_dir + "allson_angkor_hotel.gif";

sunway_banner1 = new Image(145,77);
sunway_banner1.src = sunway_banner_dir + "sunway_hotel.gif";

sunway_banner2 = new Image(145,77);
sunway_banner2.src = sunway_banner_dir +"allson_angkor_paradise_hotel.gif";


function sunway_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 sunway_array_index = sunway_links.length -1;
var first_sunway_index = Math.round(sunway_array_index * Math.random())

var sunway_cycle = first_sunway_index;
var sunway_total = sunway_banners.length -1;
var sunway_link = sunway_links[sunway_cycle]; /* initially the first */

function sunway_blender(){

/* first set current image as background */

document.getElementById('background_image').style.backgroundImage='url('+sunway_banner_dir+sunway_banners[sunway_cycle]+')';

sunway_cycle++;

if (sunway_cycle == sunway_banners.length){
sunway_cycle = 0;
}
 
sunway_swap();

setTimeout("document.images.sunway_animation.src=sunway_banner_dir + sunway_banners[sunway_cycle];",10)
               
sunway_link = sunway_links[sunway_cycle] /* update link values */
 
}

/* end rotaing banner */

/* MediaWiki:Monobook.js */
/* Any JavaScript here will be loaded for users using the MonoBook skin */