window.onload = function() {
	//ajaxInit();
	renderSwfs();
	if (document.getElementById("slideBox")) {
		slideInit("r", 3000, 10, 5, "slideBox", "slide_"); //direction, delay, pixelsToSlide, speed, id_main_box, id_prefix
	}
}

function renderSwfs() {
	if (document.getElementById("swf_clickus")) {
		var params = {
			wmode: "transparent"
		};
		swfobject.embedSWF("swf/clickus.swf", "swf_clickus", "682", "293", "9.0.0", "swf/expressInstall.swf", {}, params, {});
	}
	/*if (document.getElementById("swf_clickus")) {
		var params = {
			wmode: "transparent"
		};
		var nome = document.getElementById("swf_clickus").innerHTML;
		swfobject.embedSWF("swf/" + nome + ".swf", "swf_clickus", "682", "293", "9.0.0", "swf/expressInstall.swf", {}, params, {});
	}*/
}

function RefreshImage(valImageId) {
	var objImage = document.images[valImageId];
	if (objImage == undefined) {
		return;
	}
	var now = new Date();
	objImage.src = objImage.src.split('?')[0] + '?x=' + now.toUTCString();
}

function resize(Elem, Img) {
	var obj = document.getElementById(Elem);
	var img = document.getElementById(Img);
	obj.style.width = (img.style.width + 4) + "px";
	obj.style.height = (img.style.height + 4) + "px";
	obj.style.left = (getWindowProperty("w")/2 - getElementProperty(Img, "w") /2) + "px";
	obj.style.top = (getWindowProperty("h")/2 - getElementProperty(Img, "h") /2) + "px";
}

function getWindowProperty(which) {
	var value = 0;
	if (document.layers||(document.getElementById&&!document.all)) {
		if (which == "w") {
			value = window.innerWidth;
		} else if (which == "h") {
			value = window.innerHeight;
		}
	} else if (document.all) {
		if (which == "w") {
			value = document.documentElement.clientWidth;
		} else if (which == "h") {
			value = document.documentElement.clientHeight;
		}
	}
	return value;
}

/*if(document.layers||(document.getElementById&&!document.all)){
   browseWidth=window.outerWidth;
   browseHeight=window.outerHeight;
}else if(document.all){
   browseWidth=document.body.clientWidth;
   browseHeight=document.body.clientHeight;
}*/


function getElementProperty(Elem, which) {
	var value = 0;
	if (document.getElementById) {
		var elem = document.getElementById(Elem);
	} else if (document.all) {
		var elem = document.all[Elem];
	}
	if (which == "w") {
		value = elem.offsetWidth;
	} else if (which == "h") {
		value = elem.offsetHeight;
	}
	return value;
}

function toggle(id_objs) {
	var id_obj_array  = id_objs.split(", ");
	for (n=0; n<id_obj_array.length;n++) {
		id_obj = id_obj_array[n];
		if (id_obj != "") {
			obj = document.getElementById(id_obj);
			obj.style.display = (obj.style.display == "block" ? "none" : "block");
		}
	}
	
/*function hideDiv (id) {
	var div = document.getElementById(id)
	var id_div = div (id : {'1','2','3','4'})
	If document.getElementByClassName('horizontal_accordion_content') {
		obj = document.getElementById(id_div)
		obj.document.display = 'block'
	}
}*/
		
}