
var hostName="http://www.coloringcommunity.com";
var hostNameCache="http://cache.coloringcommunity.com";
var descHostName="ColoringCommunity.com";
var prefixName="";

var whitespace = " \t\n\r";
var reWhitespace = /^\s+$/

//cached_image = Array(new Image(), new Image());
//cached_image[0].src = hostNameCache + "/images/header/new.draw.onmouseover.png";
//cached_image[1].src = hostNameCache + "/images/header/new.draw.off.png";

cached_image_ini = Array(new Image(), new Image());
cached_image_ini[0].src = hostNameCache + "/images/bar/start.on.jpg";
cached_image_ini[1].src = hostNameCache + "/images/bar/start.off.jpg";

cached_image_fav = Array(new Image(), new Image());
cached_image_fav[0].src = hostNameCache + "/images/bar/favourites.on.jpg";
cached_image_fav[1].src = hostNameCache + "/images/bar/favourites.off.jpg";

cached_image_ami = Array(new Image(), new Image());
cached_image_ami[0].src = hostNameCache + "/images/bar/tellafriend.on.jpg";
cached_image_ami[1].src = hostNameCache + "/images/bar/tellafriend.off.jpg";


cached_image_layer = Array(new Image(), new Image(), new Image(), new Image(), new Image(), new Image(), new Image(), new Image());
cached_image_layer[0].src = hostNameCache + "/images/layer/bottom.send.friend2.gif";
cached_image_layer[1].src = hostNameCache + "/images/layer/close.off.gif";
cached_image_layer[2].src = hostNameCache + "/images/layer/close.on.gif";
cached_image_layer[3].src = hostNameCache + "/images/layer/your.name.gif";
cached_image_layer[4].src = hostNameCache + "/images/layer/mail.destination.gif";
cached_image_layer[5].src = hostNameCache + "/images/layer/send.off.gif";
cached_image_layer[6].src = hostNameCache + "/images/layer/send.on.gif";
cached_image_layer[7].src = hostNameCache + "/images/layer/bottom.send.gif";

cached_image_idioma = Array(new Image(), new Image(), new Image(), new Image(), new Image(), new Image(), new Image(), new Image(), new Image(), new Image(), new Image(), new Image());
cached_image_idioma[0].src = hostNameCache + "/images/languages/es.off.gif";
cached_image_idioma[1].src = hostNameCache + "/images/languages/cat.off.gif";
cached_image_idioma[2].src = hostNameCache + "/images/languages/en.off.gif";
cached_image_idioma[3].src = hostNameCache + "/images/languages/fr.off.gif";
cached_image_idioma[4].src = hostNameCache + "/images/languages/pr.off.gif";
cached_image_idioma[5].src = hostNameCache + "/images/languages/it.off.gif";
cached_image_idioma[6].src = hostNameCache + "/images/languages/es.on.gif";
cached_image_idioma[7].src = hostNameCache + "/images/languages/cat.on.gif";
cached_image_idioma[8].src = hostNameCache + "/images/languages/en.on.gif";
cached_image_idioma[9].src = hostNameCache + "/images/languages/fr.on.gif";
cached_image_idioma[10].src = hostNameCache + "/images/languages/pr.on.gif";
cached_image_idioma[11].src = hostNameCache + "/images/languages/it.on.gif";

/* Verifica que no este vacio */
function isEmpty(s){   
	return ((s == null) || (s.length == 0)) 
}

/* Verifica que no sean espacios en blanco */
function isWhitespace (s){
    return (isEmpty(s) || reWhitespace.test(s));
}

function validarEmail(valor) {
	 if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(valor)){
		 return true;
	 }else{
		 return false;
	 }
}

function fondo_boton(boton,posicion,imagen){
	if(posicion=="over"){
		boton.src= imagen+".on.png";
	}else{
		boton.src= imagen+".off.png";
	}
}

function fondo_boton2(boton,posicion,imagen){
	if(posicion=="over"){
		boton.style.backgroundImage="url('"+cached_image[imagen].src+"')";
	}else{
		boton.style.backgroundImage="url('"+cached_image[imagen].src+"')";
	}
}

function fondo_boton3(boton,posicion,imagen){
	if(posicion=="over"){
		boton.src= cached_image_ini[imagen].src;
	}else{
		boton.src= cached_image_ini[imagen].src;
	}
}

function fondo_boton4(boton,posicion,imagen){
	if(posicion=="over"){
		boton.src= cached_image_fav[imagen].src;
	}else{
		boton.src= cached_image_fav[imagen].src;
	}
}

function fondo_boton5(boton,posicion,imagen){
	if(posicion=="over"){
		boton.src= cached_image_ami[imagen].src;
	}else{
		boton.src= cached_image_ami[imagen].src;
	}
}

function inicio() {
	if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>=4)) {
		pag_ini.style.behavior="url(#default#homepage)";
		pag_ini.setHomePage(hostName);
	}else{
		if (navigator.appName=="Netscape") {
			alert(ale[0]+""+descHostName+""+ale[1]+""+descHostName+""+ale[2]);
		}else{
			if (navigator.appName=="Opera") {
				alert(ale[3]+""+descHostName+""+ale[4]+""+descHostName+""+ale[5]);
			}
		}
	}
} 

function favoritos(){
	if (window.sidebar&&window.sidebar.addPanel){
		window.sidebar.addPanel(descHostName,hostName,"");
	}else{
		window.external.AddFavorite(hostName,descHostName);
	}
}

function getDibujo(urld,urlg,urlm,urls,urle,urlx,idcat,user_name,user_icon,url_bd,urld_mini){
//	var fo = new SWFObject(hostName + "/swf/painter_v2.swf", "movie", "660", "625", "8.0.23", "", true);
//	var fo = new SWFObject("http://www.dibujos.net/swf/as3paint_vmini.swf", "movie", "660", "625", "8.0.23", "", true);
	
	var fo = new SWFObject(hostNameCache + "/swf/painter.swf", "movie", "660", "625", "8.0.23", "", true);
//	var fo = new SWFObject(hostNameCache + "/swf/painter_alert.swf", "movie", "660", "625", "8.0.23", "", true);
	
	fo.addParam("scale", "noscale");
	fo.addParam("menu", "false");
	fo.addParam("allowScriptAccess", "always");
	fo.addParam("allowdomain", "always")
	fo.addVariable("urld", urld);
	fo.addVariable("urlg", urlg);
	fo.addVariable("urlm", urlm);
	fo.addVariable("urls", urls);
	fo.addVariable("urle", urle);
	fo.addVariable("urlx", urlx);
	fo.addVariable("id_cat", idcat);
	/*if (nomdibu!=""){
		fo.addVariable("nom_dibu", nomdibu);
	}
	*/
	fo.addVariable("user_name", user_name);
	fo.addVariable("user_icon", user_icon);
	fo.addVariable("url_bd", url_bd);
	fo.addVariable("lnk_logo", hostName);
	fo.addVariable("urldmini", urld_mini); 
	fo.write("dibujo");
}

function getCabecera(){
	//var fo = new SWFObject("/swf/cabecera.swf", "movie", "1000", "240", "8.0.23", "", true);
	//fo.addParam("scale", "noscale");
	//fo.addParam("wmode","transparent");
	//fo.addParam("menu", "false");
	//fo.addParam("allowScriptAccess", "always");
	//fo.write("cabecera");
	mapa =  "<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" WIDTH=1000 HEIGHT=200>";
	mapa += "<PARAM NAME=\"movie\" VALUE=\"" + hostNameCache + "/swf/cabecera.swf?\">";
	mapa += "<PARAM NAME=\"quality\" VALUE=high>";
	mapa += "<param name=\"scale\" value=\"exactfit\">";
	mapa += "<param name=\"allowDomain\" value=\"always\">";
	mapa += "<param name=\"allowScriptAccess\" value=\"always\">";
	mapa += "<param name=\"wmode\" value=\"transparent\">";
	mapa += "<EMBED src=\"" + hostNameCache + "/swf/cabecera.swf?\" allowDomain=\"always\" allowScriptAccess=\"always\" wmode=\"transparent\" quality=high WIDTH=\"1000\" HEIGHT=\"200\" NAME=\"mapa\" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\"></EMBED>";
	mapa += "</OBJECT>";

	document.getElementById("cabecera").innerHTML = mapa;
}


function print_dibujo_fin(id, tipo){

	width = 600; 
	height = 750; 
	leftPosition = (screen.width) ? (screen.width-width)/2 : 0;
	if (screen.height && (screen.height <= 600)) {
		topPosition = 0;
	} else {
		topPosition = (screen.height) ? (screen.height-height)/2 : 0;
	}
	var settings='width='+width+',  height='+height+', left='+leftPosition+', top='+topPosition+', toolbar=0, location=0, directories=0, menubar=0, scrollbars=1, resizable=0, status=0';
	var popup=window.open("/pop/impr.php?id=" + id + "&tipo="+tipo, 'print', settings);
	popup.focus();
	//document.getElementById("ptr").src = '/imprimir.php?id=' + id;
	//document.getElementById("ptr").window.print();
}

function checkwhere(e) {
	if (document.layers){
        xCoord = e.x;
        yCoord = e.y;
	}else if (document.all){
        xCoord = event.clientX;
        yCoord = event.clientY;
	}else if (document.getElementById){
        xCoord = e.clientX;
        yCoord = e.clientY;
	}
    //self.status = "X= "+ xCoord + "  Y= " + yCoord;
}
document.onmousemove = checkwhere;
//if(document.captureEvents) {document.captureEvents(Event.MOUSEMOVE);}

function setLayer(){
	document.friend1.email.value="";
	document.friend1.nombre.value="";
	document.getElementById("tbl_form").style.display="";
	document.getElementById("tbl_ok").style.display="none"; 
	document.getElementById("send").style.display="inline";

	var a = (screen.width-1000)/2;
	var b = a+490;
	document.getElementById("send").style.left=b+"px";
	document.getElementById("send").style.top="300px";
}

function setLayer2(diff){
	document.friend2.email.value="";
	document.getElementById("tbl_form2").style.display="";
	document.getElementById("tbl_ok2").style.display="none";
	document.getElementById("send2").style.display="inline";

	var a = (screen.width-1000)/2;
	var b = a+135;
	document.getElementById("send2").style.left=b+"px";
	if (diff == "1"){
		document.getElementById("send2").style.top="749px";
	}else{
		document.getElementById("send2").style.top="860px";
	}
}

function closeLayer(){
	document.getElementById("send").style.display="none";
	document.getElementById("btn").src = hostNameCache + "/images/layer/send.off.gif";
	//document.getElementById("btn").style.width="116px";
	//document.getElementById("btn").style.height="30px";
}
function closeLayer2(){
	document.getElementById("send2").style.display="none";
	document.getElementById("btn2").src = hostNameCache + "/images/layer/send.off.gif";
	//document.getElementById("btn2").style.width="116px";
	//document.getElementById("btn2").style.height="30px";
}

// AJAX
var ie=(document.all) ? 1:0;
var n4=(document.layers) ? 1:0;
var n6=(document.getElementById) ? 1:0;  
var msg="";

function setHttpRequest(){

	var http_request = false;
	if (window.XMLHttpRequest) { // Mozilla, Safari,...
	 http_request = new XMLHttpRequest();
	 if (http_request.overrideMimeType) {
		http_request.overrideMimeType('text/xml');
	 }
	} else if (window.ActiveXObject) { // IE
	 try {
		http_request = new ActiveXObject("Msxml2.XMLHTTP");
	 } catch (e) {
		try {
		   http_request = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (e) {
		}
	 }
	}
	return http_request;
}

function makePostRequest(url, parameters) {
	http=setHttpRequest();
	if (!http) {
	 alert('Cannot create XMLHTTP instance');
	 return false;
	}
	http.onreadystatechange = getResponse;
	http.open("post", url);
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;');
	http.send(parameters);
}
function makePostRequest2(url, parameters) {
	http=setHttpRequest();
	if (!http) {
	 alert('Cannot create XMLHTTP instance');
	 return false;
	}
	http.onreadystatechange = getResponse2;
	http.open("post", url);
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;');
	http.send(parameters);
}
function getResponse(){
  if (http.readyState == 4) {
	 if (http.status == 200) {
		result = http.responseText;
		if(ie){    
			document.getElementById("tbl_form").style.display="none";
			document.getElementById("tbl_ok").style.display="";
		}else{
			if(n4){
				document.layers("tbl_form").style.display="none";
				document.layers("tbl_ok").style.display="";
			}else{
				if(n6){      
					document.getElementById("tbl_form").style.display="none";
					document.getElementById("tbl_ok").style.display="";
				}
			}
		}
	 }
  }else{
	document.getElementById("btn").src = hostNameCache + "/images/form/sending.gif";
	//document.getElementById("btn").style.width="116px";
	//document.getElementById("btn").style.height="30px";
  }
}
function getResponse2(){
  if (http.readyState == 4) {
	 if (http.status == 200) {
		result = http.responseText;

		if(ie){    
			document.getElementById("tbl_form2").style.display="none";
			document.getElementById("tbl_ok2").style.display="";
		}else{
			if(n4){
				document.layers("tbl_form2").style.display="none";
				document.layers("tbl_ok2").style.display="";
			}else{
				if(n6){      
					document.getElementById("tbl_form2").style.display="none";
					document.getElementById("tbl_ok2").style.display="";
				}
			}
		}
	 }
  }else{
	document.getElementById("btn2").src = hostNameCache + "/images/form/sending.gif";
	//document.getElementById("btn2").style.width="150px";
	//document.getElementById("btn2").style.height="30px";
  }
}
//Valida un email mediante expresiones regulares
function validarEmail(valor) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(valor)){
		return true;
	} else {
		return false;
	}
}
function sendFriendNombre(frm){
	
	if(isWhitespace(frm.nombre.value)!=false){
		alert(ale[6]);
		frm.nombre.focus();
		return false;
	}
	if (!validarEmail(frm.email.value)){
		alert(ale[7]);
		frm.email.focus();
		return false;
	}
	
	
	var poststr = "email="+frm.email.value+"&tipo=1&nombre="+frm.nombre.value;
	makePostRequest("/inc/lib/core/proc/sendFriend.php", poststr);
}

function sendFriend1(frm){
	if (!validarEmail(frm.email.value)){
		alert(ale[7]);
		frm.email.focus();
		return false;
	}
	var poststr = "email="+frm.email.value+"&tipo=1";
	makePostRequest("/inc/lib/core/proc/sendFriend.php", poststr);
}

function sendFriend2(frm){
	if (!validarEmail(frm.email.value)){
		alert(ale[7]);
		frm.email.focus();
		return false;
	}
	var poststr = "email="+frm.email.value+"&id="+frm.id.value+"&tipo=2";
	makePostRequest2("/inc/lib/core/proc/sendFriend.php", poststr);
}

function sendSearch(frm, onsub){
	if (isWhitespace(frm.qry.value)){
		alert(ale[8]);
		frm.qry.focus();
		frm.qry.select();
		if (onsub==true){
			return false;
		}else{
			return;
		}
	}
	if (frm.qry.value.length<3){
		alert(ale[9]);
		frm.qry.focus();
		frm.qry.select();
		if (onsub==true){
			return false;
		}else{
			return;
		}
	}
	if (onsub==true){
		return true;
	}else{
		frm.submit();
	}
}

function subContacto(frm){
	var ok=true;
	var msg=ale[10];
	
	if(isWhitespace(frm.nombre.value)!=false){
		ok=false;
		msg += ale[11];}
	
	if(validarEmail(frm.email.value)==false){
		ok=false;
		msg += ale[12];}
	if(frm.motivo.value==0){
		ok=false;
		msg += ale[13];}
	if(isWhitespace(frm.comentarios.value)!=false){
		ok=false;
		msg += ale[14];}
	if(ok==false){
		alert(msg);
	}else{
		frm.submit();
	}
}

function setLayerInicio(){
	
	document.getElementById("primeraVisita").style.display="inline";

	var a = (screen.width-1000)/2;
	var b = a+230;
	document.getElementById("primeraVisita").style.left=b+"px";
	document.getElementById("primeraVisita").style.top="150px";
	
}

function closePrimeraVisita(){
	document.getElementById("primeraVisita").style.display="none";
}
function Surt(){
	setInterval("closePrimeraVisita()", 15000);
}

function copy(text2copy) {
    var flashcopier = 'flashcopier';
    if(!document.getElementById(flashcopier)) {
      var divholder = document.createElement('div');
      divholder.id = flashcopier;
      document.body.appendChild(divholder);
    }
    document.getElementById(flashcopier).innerHTML = '';
    var divinfo = '<embed src="' + hostNameCache + '/swf/_clipboard.swf" FlashVars="clipboard='+escape(text2copy)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
    document.getElementById(flashcopier).innerHTML = divinfo;
}

function share_im(text){
	copy(text);
	alert(ale[15]);
}

// FUNCIONES PARA EL TAGBOARD //
function makePostRequestTagBoard(url, parameters) {
	http=setHttpRequest();
	if (!http) {
	 alert('Cannot create XMLHTTP instance');
	 return false;
	}
	http.onreadystatechange = getResponseTagBoard;
	http.open("post", url);
	http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;');
	http.send(parameters);
}

function getResponseTagBoard(){
  if (http.readyState == 4) {
	 if (http.status == 200) {
		result = http.responseText;
		if(ie){    
			var valor = document.getElementById("tagBoard");
					
			// Aņadimos el valor introducido al nuevo elemento
			document.getElementById('tagBoard').innerHTML = result;
			

		}else{
			if(n4){
				var valor = document.getElementById("tagBoard");
				
				// Aņadimos el valor introducido al nuevo elemento
				document.getElementById('tagBoard').innerHTML = result;
			
				
			}else{
				if(n6){      
					
					var valor = document.getElementById("tagBoard");
					
					// Aņadimos el valor introducido al nuevo elemento
					document.getElementById('tagBoard').innerHTML = result;
					
				}
			}
		}
		//ADAPTA EL SCROLL AL CONTENIDO DEL DIV - JORDI
		document.getElementById("tagBoard").scrollTop=document.getElementById("tagBoard").scrollHeight;
	 }
  }else{
	
  }
}

function getTagBoard(frm){
	frm.nombre.style.backgroundColor="#FFF";
	frm.mens.style.backgroundColor="#FFF";
	if (frm.nombre.value == ""){
		alert(ale[16]);
		frm.nombre.style.backgroundColor="#b1e02e";
		frm.nombre.focus();
		return false;
	}
	if (frm.mens.value == ""){
		alert(ale[17]);
		frm.mens.style.backgroundColor="#b1e02e";
		frm.mens.focus();
		return false;
	}
	var poststr="&nombre="+frm.nombre.value+"&mens="+frm.mens.value;
	makePostRequestTagBoard("/inc/lib/core/proc/getTagBoard.php", poststr);
	frm.mens.value="";
}

function getTagBoard2(){
	
	var poststr="";
	makePostRequestTagBoard("/inc/lib/core/proc/getTagBoard2.php", poststr);
	
}

function muestraAyuda(){
	document.getElementById('tagBoard').style.display='none';
	document.getElementById('ayudaTag').style.display='';
}

function ocultaAyuda(){
	document.getElementById('tagBoard').style.display='';
	document.getElementById('ayudaTag').style.display='none';
}

///////////////////////////////

/*	HALLOWEEEN	*/
function getCabeceraHall(){
	mapa =  "<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" WIDTH=1000 HEIGHT=200>";
	mapa += "<PARAM NAME=\"movie\" VALUE=\"" + hostNameCache + "/swf/cabecera.halloween.09.swf?\">";
	mapa += "<PARAM NAME=\"quality\" VALUE=high>";
	mapa += "<param name=\"scale\" value=\"exactfit\">";
	mapa += "<param name=\"allowDomain\" value=\"always\">";
	mapa += "<param name=\"allowScriptAccess\" value=\"always\">";
	mapa += "<param name=\"wmode\" value=\"transparent\">";
	mapa += "<EMBED src=\"" + hostNameCache + "/swf/cabecera.halloween.09.swf?\" allowDomain=\"always\" allowScriptAccess=\"always\" wmode=\"transparent\" quality=high WIDTH=\"1000\" HEIGHT=\"200\" NAME=\"mapa\" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\"></EMBED>";
	mapa += "</OBJECT>";

	document.getElementById("cabecera").innerHTML = mapa;
}
/*	NAVIDAD	*/
function getCabeceraNavi(){
	mapa =  "<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" WIDTH=1000 HEIGHT=200>";
	mapa += "<PARAM NAME=\"movie\" VALUE=\"" + hostNameCache + "/swf/cabecera.navidad.en.swf?\">";
	mapa += "<PARAM NAME=\"quality\" VALUE=high>";
	mapa += "<param name=\"scale\" value=\"exactfit\">";
	mapa += "<param name=\"allowDomain\" value=\"always\">";
	mapa += "<param name=\"allowScriptAccess\" value=\"always\">";
	mapa += "<param name=\"wmode\" value=\"transparent\">";
	mapa += "<EMBED src=\"" + hostNameCache + "/swf/cabecera.navidad.en.swf?\" allowDomain=\"always\" allowScriptAccess=\"always\" wmode=\"transparent\" quality=high WIDTH=\"1000\" HEIGHT=\"200\" NAME=\"mapa\" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\"></EMBED>";
	mapa += "</OBJECT>";
	
	document.getElementById("cabecera").innerHTML = mapa;
}
/*	SAN VALENTIN	*/
function getCabeceraSanVal(){
	mapa =  "<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" WIDTH=1000 HEIGHT=200>";
	mapa += "<PARAM NAME=\"movie\" VALUE=\"" + hostNameCache + "/swf/cabecera.sanvalentin.swf?\">";
	mapa += "<PARAM NAME=\"quality\" VALUE=high>";
	mapa += "<param name=\"scale\" value=\"exactfit\">";
	mapa += "<param name=\"allowDomain\" value=\"always\">";
	mapa += "<param name=\"allowScriptAccess\" value=\"always\">";
	mapa += "<param name=\"wmode\" value=\"transparent\">";
	mapa += "<EMBED src=\"" + hostNameCache + "/swf/cabecera.sanvalentin.swf?\" allowDomain=\"always\" allowScriptAccess=\"always\" wmode=\"transparent\" quality=high WIDTH=\"1000\" HEIGHT=\"200\" NAME=\"mapa\" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\"></EMBED>";
	mapa += "</OBJECT>";
	
	document.getElementById("cabecera").innerHTML = mapa;
}
function precachOn(obj){
	var str = obj.src;
	cached_image = new Image();
	cached_image.src = str.replace(".off", ".on");
}
function precachOn_2(obj){
	var str = obj.src;
	cached_image = new Image();
	
	str = str.replace(".on.jpg", ".jpg");
	str = str.replace(".on.gif", ".gif");
	str = str.replace(".on.png", ".png");
	
	str = str.replace(".jpg", ".on.jpg");
	str = str.replace(".gif", ".on.gif");
	str = str.replace(".png", ".on.png");
	cached_image.src = str;
}
