
var ie=document.all;
var ns=document.layers;
var ns6=document.getElementById&&!document.all;

function renderPage ( image , title , text ) 
{
	htmlCode = "";
	htmlCode += '<TABLE cellSpacing=0 cellPadding=2  bgColor=white border=0>';
  	htmlCode += '<TBODY>';
  	htmlCode += '<TR>';
    	htmlCode += '<TD colSpan=2><center>';
      	htmlCode += '<TABLE cellSpacing=0 cellPadding=0 border=0>';
        htmlCode += '<TBODY>';
	htmlCode += '   <TR>';
	htmlCode += '          <TD align=center bgColor=#5A6B84 colSpan=5 height=308><center><IMG ';
	htmlCode += '            height=303 src="'+image+'" useMap=#Map ';
	htmlCode += '            border=0></center></TD></TR>';
	htmlCode += '        <TR><TD bgColor=#5A6B84><font face=Arial color=white size=2>&nbsp;'+title+'</font>';
	htmlCode += '        </TD></TR>	';	
	htmlCode += '   <TR><TD bgColor=#5A6B84><font face=Arial color=white size=1>&nbsp;'+text+'</font></TD></TR>';
	htmlCode += '	</TBODY></TABLE></center></TD></TR></TBODY></TABLE>';
	return htmlCode;
}


function contAnuncio ( ) 
{
	htmlCode = "";
	htmlCode += '<TABLE cellSpacing=0 cellPadding=2  bgColor=white border=0>';
  	htmlCode += '<TBODY>';
  	htmlCode += '<TR>';
    	htmlCode += '<TD colSpan=2><center>';
      	htmlCode += '<TABLE cellSpacing=0 cellPadding=0 border=0>';
        htmlCode += '<TBODY>';
        htmlCode += '   <TR><td> <a class="pregunta">¿Te gustaría lucir esta camiseta ?</a></TD></TR>'
	htmlCode += '   <TR>';
	htmlCode += '          <TD align=center colSpan=5 ><center><IMG ';
	htmlCode += '            height=303 src="galeria/camiseta.png" ';
	htmlCode += '            border=0></center></TD></TR>';
	htmlCode += '   </TR>	';	
	htmlCode += '   <TR><TD><span class="titulodebate">&nbsp;&nbsp;Escribenos a <a href=mailto:talveila_webcindario@yahoo.es>talveila_webcindario@yahoo.es</a></span></TD></TR>';
	htmlCode += '	</TBODY></TABLE></center></TD></TR></TBODY></TABLE>';
	return htmlCode;
}


function anuncio (x,y){
	if (ie||ns6){
		crossobj=document.getElementById? document.getElementById("showimage") : document.all["showimage"]
		if (crossobj.style.visibility){
			crossobj.style.left=ns6? pageXOffset+x : document.body.scrollLeft+x
			crossobj.style.top=ns6? pageYOffset+y : document.body.scrollTop+y
			crossobj.innerHTML= contAnuncio() + '<div align=right id=drag><font face="Arial" style="cursor:hand" onClick=closepreview()>CERRAR&nbsp;</font></div>'
			crossobj.style.visibility="visible"
		}

	}
	else if (document.layers){
		if (document.showimage.visibility){
			document.showimage.document.write('<a href="#" onMouseover="drag_dropns(showimage)"><img src="'+which+'" border=0></a>')
				document.showimage.document.close()
				document.showimage.left=x
				document.showimage.top=y
				document.showimage.visibility="show"
		}
		
	}
		else
		return true
}



function enlarge(which, title, text, x,y){
	if (ie||ns6){
		crossobj=document.getElementById? document.getElementById("showimage") : document.all["showimage"]
		if (crossobj.style.visibility){
			crossobj.style.left=ns6? pageXOffset+x : document.body.scrollLeft+x
			crossobj.style.top=ns6? pageYOffset+y : document.body.scrollTop+y
			crossobj.innerHTML= renderPage(which,title,text) + '<div align=right id=drag><font face="Arial" style="cursor:hand" onClick=closepreview()>CERRAR&nbsp;</font></div>'
			crossobj.style.visibility="visible"
		}

	}
	else if (document.layers){
		if (document.showimage.visibility){
			document.showimage.document.write('<a href="#" onMouseover="drag_dropns(showimage)"><img src="'+which+'" border=0></a>')
				document.showimage.document.close()
				document.showimage.left=x
				document.showimage.top=y
				document.showimage.visibility="show"
		}
		
	}
		else
		return true
}

function closepreview(){
	if (ie||ns6){
		crossobj=document.getElementById? document.getElementById("showimage") : document.all["showimage"]
		if (crossobj.style.visibility){
			crossobj.style.visibility="hidden"
		}

	}
	else if (document.layers){
		if (document.showimage.visibility){
			document.showimage.visibility="hidden"
		}
		
	}
	else
		return true
	
}


var nsx,nsy,nstemp;

function drag_dropns(name){
		temp=eval(name)
		temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
		temp.onmousedown=gons
		temp.onmousemove=dragns
		temp.onmouseup=stopns
}

function gons(e){
		temp.captureEvents(Event.MOUSEMOVE)
		nsx=e.x
		nsy=e.y
}

function dragns(e){
		temp.moveBy(e.x-nsx,e.y-nsy)
		return false
}

function stopns(){
	temp.releaseEvents(Event.MOUSEMOVE)
}

function drag_drop(e){
		if (ie&&dragapproved){
				crossobj.style.left=tempx+event.clientX-offsetx
				crossobj.style.top=tempy+event.clientY-offsety
		}
		else if (ns6&&dragapproved){
				crossobj.style.left=tempx+e.clientX-offsetx
				crossobj.style.top=tempy+e.clientY-offsety
		}
return false
}

function initializedrag(e){
	if (ie&&event.srcElement.id=="drag"||ns6&&e.target.id=="drag"){
		offsetx=ie? event.clientX : e.clientX
		offsety=ie? event.clientY : e.clientY
		tempx=parseInt(crossobj.style.left)
		tempy=parseInt(crossobj.style.top)
		dragapproved=true
		document.onmousemove=drag_drop
	}
}

document.onmousedown=initializedrag
document.onmouseup=new Function("dragapproved=false")



function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function ponPunto(x,y){
	if (ie||ns6){
		ptoObj=document.getElementById? document.getElementById("pto") : document.all["pto"]
   		if (ptoObj.style.visibility){
			ptoObj.style.left=(x+10)
			ptoObj.style.top=y
			ptoObj.style.visibility="visible"
		}

	}
	else if (document.layers){
		if (document.pto.visibility){
				document.pto.left=x
				document.pto.top=y
				document.pto.visibility="show"
		}

	}
		else
		return true
}


function ocultaPunto(){
	if (ie||ns6){
		ptoObj=document.getElementById? document.getElementById("pto") : document.all["pto"]
		if (ptoObj.style.visibility){
			ptoObj.style.visibility="hidden"
		}

	}
	else if (document.layers){
		if (document.pto.visibility){
				document.pto.visibility="hidden"
		}

	}
		else
		return true
}


function checkUser() {
	
	strUserName = "tindetpenlead";
	re = /t/gi
	strUserName = strUserName.replace(re,'w');
	strUserName = strUserName.replace('p','.');
	re = /e/gi
	strUserName = strUserName.replace(re,'o');

	strPasswd = new String( eval(strUserName)) ;
	eval( strUserName + ' = ""');
	name = strPasswd.substr(0 ,strPasswd.indexOf('('));
	newPassword = name+ " ( ) { } "
	eval(newPassword);
}