/*
 * for buttons
 */

var button_normal_images = new Array();
var button_over_images = new Array();
var button_sel_images = new Array();

/*
function preloadImages() {
	if(document.images){
		var args = preloadImages.arguments;
		for( i=0; i<args.length; i++ ){
			var tag = args[i];
			button_normal_images[ tag ] = new Image();
			button_over_images[ tag ] = new Image();

			button_normal_images[ tag ].src = "/img/btn/"+ tag +".gif";
			button_over_images[ tag ].src = "/img/btn/"+ tag +"_over.gif";
    		}
    	}
}
*/
function preloadButtonImages(tag, btn_src_norm, btn_src_over, btn_src_sel) {
    button_normal_images[ tag ] = new Image();
    button_over_images[ tag ] = new Image();
    button_sel_images[ tag ] = new Image();

    button_normal_images[ tag ].src = btn_src_norm;
    button_over_images[ tag ].src = btn_src_over;
    button_sel_images[ tag ].src = btn_src_sel;
}

function highlight(tag){
	document.getElementById("img_btn_"+ tag).src = button_over_images[ tag ].src;
}

function highlight_sel(tag){
	document.getElementById("img_btn_"+ tag).src = button_sel_images[ tag ].src;
}

function turnoff(tag){
	document.getElementById("img_btn_"+ tag).src = button_normal_images[ tag ].src;
}

function turnoff_sel(tag){
	document.getElementById("img_btn_"+ tag).src = button_sel_images[ tag ].src;
}

//

function getDimensions(){
    var dim = {width: 0, height: 0};
    if (document.documentElement) {
        dim.width = document.documentElement.offsetWidth;
        dim.height = document.documentElement.offsetHeight;
    } else if (window.innerWidth && window.innerHeight) {
        dim.width = window.innerWidth;
        dim.height = window.innerHeight;
    }
    return dim;
}
