var imgs=DIR+"/artworks";

//CAMBIAR COLOR TR
function mOvr(src,clrOver) {
	if(clrOver=='') {clrOver = '#B9D7EA'};
	//if (!src.contains(event.fromElement)) { defaultColor = src.bgColor; src.bgColor = clrOver; }
	defaultColor = src.bgColor;
	src.bgColor = clrOver;
}
function mOut(src) {
	//if (!src.contains(event.toElement)) src.bgColor = defaultColor;
	src.bgColor = defaultColor;
}

// CAMBIO DE BACKROUND
function change_background(obj,img) {obj.background=img;}

function hide_unhide(id_obj) {
	obj=getObj(id_obj);
	if (obj.style.visibility=="visible") {
		obj.style.visibility="hidden";
	} else {
		obj.style.visibility="visible";
	}
}

//CAMBIAR CLASE
function MO(o,clase) {o.className=clase;}

//BOOKMARK
function SetBookMark() {
	var title="Mundocolor pinturas";
	if( window.sidebar && window.sidebar.addPanel ) {
		window.sidebar.addPanel(title,location.href,'');
	} else {
		window.external.AddFavorite(location.href,title);
	}
}
function MOcategorias01(o,clase) {
	if (clase=="cat01_on")
	{
		o.style.background = "#D8F4FF";
		o.style.color = "#7ECEEB";
	}
	else
	{
		o.style.background = "Transparent";
	}
}
function MOcategorias02(o,clase) {
	if (clase=="cat02_on")
	{
		o.style.background = "#FFF7C9";
		o.style.color = "#5F0000";
	}
	else
	{
		o.style.background = "Transparent";
	}
}
function MOcategorias03(o,clase) {
	if (clase=="cat03_on")
	{
		o.style.background = "#F3FFDF";
		o.style.color = "#3C6200";
	}
	else
	{
		o.style.background = "Transparent";
	}
}

//OCULTAR LAYERS
function force_hide2(ly) {
ly=document.getElementById(ly);
if (ly!=null) {ly.style.display="none";}
}

//OCULTAR LAYERS
function force_hide(ly) {
ly=document.getElementById(ly);
if (ly!=null) {ly.style.visibility="hidden";}
}

function force_unhide(ly) {
ly=document.getElementById(ly);
if (ly!=null) {ly.style.visibility="visible";}
}

function set_tab(id) {

	tab=getObj("tab_"+id);
	if (tab.style.display=="none") {

		for (var i=1;i<20;i++) {
			tab=getObj("tab_"+i);
			if (tab==null) {break;}

			tab2=getObj("divContent"+i);
			tab2a=getObj("divContainer"+i);
			tab3=getObj("ly_up"+i);
			tab4=getObj("ly_down"+i);
			//alert(tab2);

			if (id==i) {
				tab.style.display="";
				tab2.style.display="";
				tab2a.style.display="";
				tab3.style.display="";
				tab4.style.display="";
				//o.className="item_alpha_on";
			} else {
				//reset
				tab.style.display="none";
				tab2.style.display="none";
				tab2a.style.display="none";
				tab3.style.display="none";
				tab4.style.display="none";
				tab.filters.alpha.opacity=0;
				//o.className="item_alpha_off";
			}

			//alert(i+' '+tab2.style.display);
		}
		fading('tab_'+id,20,10)
	} else {

		fading('tab_'+id,20,10,"hide_menu_mc("+id+")");

	}

}


function hide_menu_mc(id) {

	tab2=getObj("divContent"+id);
	tab2a=getObj("divContainer"+id);
	tab3=getObj("ly_up"+id);
	tab4=getObj("ly_down"+id);
	tab.style.display="none";
	tab2.style.display="none";
	tab2a.style.display="none";
	tab3.style.display="none";
	tab4.style.display="none";
	tab.filters.alpha.opacity=0;
	//o.className="item_alpha_off";

}
function set_tab_internas(id) {

	for (var i=1;i<20;i++) {

		tab=getObj("tab_"+i);
		if (tab==null) {break;}

		if (id==i) {
			tab.style.display="";
		} else {
			//reset
			tab.style.display="none";
		}
	}
}

function showAndCenter(id) {

	obj=getObj(id);
	if (obj==null) {obj=window.parent.document.getElementById(id);}
	ancho_layer=obj.style.width;
	ancho_layer=ancho_layer.replace("px","");
	alto_layer=obj.style.height;
	alto_layer=alto_layer.replace("px","");

	var X = ((window.parent.document.body.scrollWidth-alto_layer)/2);
	var Y = ((window.parent.screen.availHeight-alto_layer)/2);

	obj.style.zIndex=99999999;
	obj.style.display="";
	obj.style.visibility="visible";
	obj.style.left=(window.parent.document.body.scrollLeft+(X))-100;
	obj.style.top =(window.parent.document.body.scrollTop +(Y))-100;

}

function hideAndReset(id) {

	obj=getObj(id);
	if (obj==null) {obj=window.parent.document.getElementById(id);}
	obj.style.zIndex=-1;
	obj.style.visibility="hidden";
	obj.style.left=0;
	obj.style.top=0;
}

function activar_layer_transparente() {

	var obj=getObj("ly_transparente");

	obj.style.display="";
	obj.style.width=getPageSize()[0];
	obj.style.height=getPageSize()[1];
}

function desactivar_layer_transparente() {

	var obj=getObj("ly_transparente");
	obj.style.display="none";
}

function getPageSize(){
	var xScroll, yScroll;

	if (window.innerHeight && window.scrollMaxY) {
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}

	var windowWidth, windowHeight;
	if (self.innerHeight) {// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}

	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else {
		pageHeight = yScroll;
	}

	if(xScroll < windowWidth){
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}
	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
	return arrayPageSize;
}

