function ComprobarClaves(textBox1,textBox2)
{val1=MM_findObj(textBox1);val1=val1.value;val2=MM_findObj(textBox2);val2=val2.value;if(val1!=val2)
{alert('Las claves no coinciden.');document.MM_returnValue=false;return false;}
else
{document.MM_returnValue=(document.MM_returnValue&&true);return true;}}
function SubirFichero(nombre,ruta,objTexto)
{if(ventanafichero)
ventanafichero.close();ventanafichero=null;ruta='includes/upload_file/upload_one.php?nom='+nombre+'&path='+ruta+'&otxt='+objTexto;opciones='toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,';anchoVentana=352;altoVentana=180;opciones=opciones+'width='+anchoVentana+',height='+altoVentana;nombreventana='previoFichero';ventanafichero=window.open(ruta,nombreventana,opciones);ventanafichero.focus();}
ventanafichero=null;function SubirFoto(nombreFoto,objTexto,objImagen,objTextoIcono,objTextoPrevio,id_subgaleria)
{if(ventanaprevio)
ventanaprevio.close();ventanaprevio=null;ruta='includes/upload_img/previo_all.php?nom='+nombreFoto+'&otxt='+objTexto+'&oimg='+objImagen+'&otxtico='+objTextoIcono+'&otxtpre='+objTextoPrevio+'&id='+id_subgaleria;opciones='toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,';anchoVentana=352;altoVentana=585;opciones=opciones+'width='+anchoVentana+',height='+altoVentana;nombreventana='previoFoto';ventanaprevio=window.open(ruta,nombreventana,opciones);ventanaprevio.focus();}
function SubirSoloFoto(anchoFoto,altoFoto,nombreFoto,rutaIcono,rutaPrevio,anchoPre,altoPre,objTexto,objImagen)
{if(ventanaprevio)
ventanaprevio.close();ventanaprevio=null;ruta='includes/upload_img/previo.php?ancho='+anchoFoto+'&alto='+altoFoto+'&nom='+nombreFoto+'&rico='+rutaIcono+'&rpre='+rutaPrevio+'&wpre='+anchoPre+'&hpre='+altoPre+'&otxt='+objTexto+'&oimg='+objImagen;opciones='toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,';anchoVentana=352;if(anchoFoto>290)
anchoVentana=anchoFoto+110;altoVentana=altoFoto+232;opciones=opciones+'width='+anchoVentana+',height='+altoVentana;nombreventana='previoFoto';ventanaprevio=window.open(ruta,nombreventana,opciones);ventanaprevio.focus();}
function SubirFotoTres(anchoFoto,altoFoto,nombreFoto,rutaIcono,rutaPrevio,anchoPre,altoPre,objTexto,objImagen)
{if(ventanaprevio)
ventanaprevio.close();ventanaprevio=null;ruta='includes/upload_img/previo_tres.php?ancho='+anchoFoto+'&alto='+altoFoto+'&nom='+nombreFoto+'&rico='+rutaIcono+'&rpre='+rutaPrevio+'&wpre='+anchoPre+'&hpre='+altoPre+'&otxt='+objTexto+'&oimg='+objImagen;opciones='toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,';anchoVentana=352;if(anchoFoto>290)
anchoVentana=anchoFoto+110;altoVentana=altoFoto+232;opciones=opciones+'width='+anchoVentana+',height='+altoVentana;nombreventana='previoFoto';ventanaprevio=window.open(ruta,nombreventana,opciones);ventanaprevio.focus();}
function SubirFotoReal(nombreFoto,ruta,objTexto,objImagen)
{if(ventanaprevio)
ventanaprevio.close();ventanaprevio=null;ruta='includes/upload_img/previo_real.php?nom='+nombreFoto+'&ruta='+ruta+'&otxt='+objTexto+'&oimg='+objImagen;opciones='toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,';anchoVentana=435;altoVentana=485;opciones=opciones+'width='+anchoVentana+',height='+altoVentana;nombreventana='previoFoto';ventanaprevio=window.open(ruta,nombreventana,opciones);ventanaprevio.focus();}
ventanaprevio=null;function CambiarPrevio(rutaFichero,nombreFichero,objetoTexto,objetoImagen)
{val=MM_findObj(objetoTexto);val.value=nombreFichero;val2=MM_findObj(objetoImagen);if(nombreFichero!="")
val2.src="http://www.bitmarketing.es/"+rutaFichero+nombreFichero;else
val2.src="http://www.bitmarketing.es/admin/img/puntovacio.gif";}
function CambiarPrevio2(rutaFichero,nombreFichero,objetoTexto,objetoImagen)
{val=MM_findObj(objetoTexto);val.value=nombreFichero;val2=MM_findObj(objetoImagen);if(nombreFichero!="")
val2.src="http://www.bitmarketing.es/admin/includes/upload_img/"+rutaFichero+nombreFichero;else
val2.src="http://www.bitmarketing.es/admin/img/puntovacio.gif";}
function CambiarTexto(rutaFichero,nombreFichero,objetoTexto)
{val=MM_findObj(objetoTexto);val.value=nombreFichero;}
function ConfirmarEliminacion(nombre)
{var mensaje;mensaje="Está seguro que quiere eliminar toda la información asociada con:\n'"+nombre+"'";document.ConfirmarEliminar=confirm(mensaje);}
function ImpedirSeleccion(objSelect,valor)
{val=MM_findObj(objSelect);if(val.value==valor)
{val.selectedIndex=0;}}
function LimpiarFoto(txtObj,imgObj)
{val1=MM_findObj(txtObj);val1.value='';val2=MM_findObj(imgObj);val2.src="img/prev_img.gif";}
function ActivarCampo(obj){var campo=MM_findObj(obj);if(campo.value=="Nombre"||campo.value=="Telefono"||campo.value=="E-mail")
{campo.value="";}}
function ValidarFormulario(objNombre,objTelefono,objMail){var campoNombre=MM_findObj(objNombre);var campoTelefono=MM_findObj(objTelefono);var campoMail=MM_findObj(objMail);if(campoNombre.value==""||campoNombre.value=="Nombre")
{alert('El campo Nombre es obligatorio. Y al menos el campo Teléfono o E-mail para que podamos contactar usted.');document.MM_returnValue=false;return;}
else
{if((campoTelefono.value==""||campoTelefono.value=="Nombre")&&(campoMail.value==""||campoMail.value=="Nombre"))
{alert('El campo Nombre es obligatorio y al menos el campo Teléfono o E-mail para que podamos contactar con usted');document.MM_returnValue=false;return;}}
document.MM_returnValue=true;if(document.MM_returnValue==true){document.formMini.submit();}
return;}
var jActivating={isMSIE:(document.all&&!window.opera)?true:false,reinsertContent:function()
{var totalNodes=new Array(3);totalNodes['object']=document.getElementsByTagName('object').length;totalNodes['embed']=document.getElementsByTagName('embed').length;totalNodes['applet']=document.getElementsByTagName('applet').length;for(var tagName in totalNodes)
{var counter=totalNodes[tagName]-1;for(var node;node=document.getElementsByTagName(tagName)[counter];counter--)
{sourceCode=jActivating.getSourceCode(node);if(sourceCode)
{node.outerHTML=sourceCode;}}}
jActivating.isMSIE=null;},getSourceCode:function(node)
{var sourceCode=node.outerHTML;switch(node.nodeName.toLowerCase())
{case'embed':return sourceCode;break;case'object':case'applet':var openTag=sourceCode.substr(0,sourceCode.indexOf('>')+1);var closeTag=sourceCode.substr(sourceCode.length-9).toLowerCase();if(closeTag!='</object>'&&closeTag!='</applet>')
{return null;}
if(jActivating.isMSIE)
{var innerCode=jActivating.getInnerCode(node);sourceCode=openTag+innerCode+closeTag;}
return sourceCode;break;}},getInnerCode:function(node)
{var innerCode='';var totalChilds=node.childNodes.length-1;for(var counter=totalChilds,child;child=node.childNodes[counter];counter--)
{innerCode+=child.outerHTML;}
return innerCode;}}
if(document.attachEvent)
{if(window.opera)
{document.attachEvent("DOMContentLoaded",jActivating.reinsertContent);}
else
{jActivating.reinsertContent();}}
function AbrirDelicious(){window.open('http://www.delicious.com/save?v=5&jump=close&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title),'delicious','toolbar=no,width=550,height=550');}
function LinkTweet(){document.write("<a href='http://twitter.com/share' class='twitter-share-button' data-count='horizontal' data-via='bitmarketing' data-lang='es'\>Tweet</a\>");}
function MM_showHideLayers(){var i,p,v,obj,args=MM_showHideLayers.arguments;for(i=0;i<(args.length-2);i+=3)
if((obj=MM_findObj(args[i]))!=null)
{v=args[i+2];if(obj.style)
{obj=obj.style;v=(v=='show')?'visible':(v=='hide')?'hidden':v;}
obj.visibility=v;}}
function MM_swapImgRestore(){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_preloadImages(){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_findObj(n,d){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&&d.getElementById)x=d.getElementById(n);return x;}
function MM_swapImage(){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_reloadPage(init){if(init==true)with(navigator){if((appName=="Netscape")&&(parseInt(appVersion)==4)){document.MM_pgW=innerWidth;document.MM_pgH=innerHeight;onresize=MM_reloadPage;}}
else if(innerWidth!=document.MM_pgW||innerHeight!=document.MM_pgH)location.reload();}
function MM_validateForm(){var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;for(i=0;i<(args.length-2);i+=3){test=args[i+2];val=MM_findObj(args[i]);if(val){nm=val.name;if((val=val.value)!=""){if(test.indexOf('isEmail')!=-1){p=val.indexOf('@');if(p<1||p==(val.length-1))errors+='- '+nm+' debe contener una dirección de e-mail.\n';}else if(test!='R'){num=parseFloat(val);if(isNaN(val))errors+='- '+nm+' debe contener un número.\n';if(test.indexOf('inRange')!=-1){p=test.indexOf(':');min=test.substring(8,p);max=test.substring(p+1);if(num<min||max<num)errors+='- '+nm+' debe contener un número entre '+min+' y '+max+'.\n';}}}else if(test.charAt(0)=='R')errors+='- '+nm+' es obligatorio.\n';}}if(errors)alert('Los siguientes errores han ocurrido:\n'+errors);document.MM_returnValue=(errors=='');}
function MM_changeProp(objName,x,theProp,theValue){var obj=MM_findObj(objName);if(obj&&(theProp.indexOf("style.")==-1||obj.style)){if(theValue==true||theValue==false)
{eval("obj."+theProp+"="+theValue);}
else eval("obj."+theProp+"='"+theValue+"'");}}
function MM_goToURL(){var i,args=MM_goToURL.arguments;document.MM_returnValue=false;for(i=0;i<(args.length-1);i+=2)eval(args[i]+".location='"+args[i+1]+"'");}
var TINY={};function $(i){return document.getElementById(i)}function $$(e,p){p=p||document;return p.getElementsByTagName(e)}TINY.slideshow=function(n){this.infoSpeed=this.imgSpeed=this.speed=10;this.thumbOpacity=this.navHover=70;this.navOpacity=25;this.scrollSpeed=5;this.letterbox='#000';this.n=n;this.c=0;this.a=[]};TINY.slideshow.prototype={init:function(s,z,b,f,q){s=$(s);var m=$$('li',s),i=0,w=0;this.l=m.length;this.q=$(q);this.f=$(z);this.r=$(this.info);this.o=parseInt(TINY.style.val(z,'width'));if(this.thumbs){var u=$(this.left),r=$(this.right);u.onmouseover=new Function('TINY.scroll.init("'+this.thumbs+'",-1,'+this.scrollSpeed+')');u.onmouseout=r.onmouseout=new Function('TINY.scroll.cl("'+this.thumbs+'")');r.onmouseover=new Function('TINY.scroll.init("'+this.thumbs+'",1,'+this.scrollSpeed+')');this.p=$(this.thumbs)}for(i;i<this.l;i++){this.a[i]={};var h=m[i],a=this.a[i];a.t=$$('h3',h)[0].innerHTML;a.d=$$('p',h)[0].innerHTML;a.l=$$('a',h)[0]?$$('a',h)[0].href:'';a.p=$$('span',h)[0].innerHTML;if(this.thumbs){var g=$$('img',h)[0];this.p.appendChild(g);w+=parseInt(g.offsetWidth);if(i!=this.l-1){g.style.marginRight=this.spacing+'px';w+=this.spacing}this.p.style.width=w+'px';g.style.opacity=this.thumbOpacity/100;g.style.filter='alpha(opacity='+this.thumbOpacity+')';g.onmouseover=new Function('TINY.alpha.set(this,100,5)');g.onmouseout=new Function('TINY.alpha.set(this,'+this.thumbOpacity+',5)');g.onclick=new Function(this.n+'.pr('+i+',1)')}}if(b&&f){b=$(b);f=$(f);b.style.opacity=f.style.opacity=this.navOpacity/100;b.style.filter=f.style.filter='alpha(opacity='+this.navOpacity+')';b.onmouseover=f.onmouseover=new Function('TINY.alpha.set(this,'+this.navHover+',5)');b.onmouseout=f.onmouseout=new Function('TINY.alpha.set(this,'+this.navOpacity+',5)');b.onclick=new Function(this.n+'.mv(-1,1)');f.onclick=new Function(this.n+'.mv(1,1)')}this.auto?this.is(0,0):this.is(0,1)},mv:function(d,c){var t=this.c+d;this.c=t=t<0?this.l-1:t>this.l-1?0:t;this.pr(t,c)},pr:function(t,c){clearTimeout(this.lt);if(c){clearTimeout(this.at)}this.c=t;this.is(t,c)},is:function(s,c){if(this.info){TINY.height.set(this.r,1,this.infoSpeed/2,-1)}var i=new Image();i.style.opacity=0;i.style.filter='alpha(opacity=0)';this.i=i;i.onload=new Function(this.n+'.le('+s+','+c+')');i.src=this.a[s].p;if(this.thumbs){var a=$$('img',this.p),l=a.length,x=0;for(x;x<l;x++){a[x].style.borderColor=x!=s?'':this.active}}},le:function(s,c){this.f.appendChild(this.i);var w=this.o-parseInt(this.i.offsetWidth);if(w>0){var l=Math.floor(w/2);this.i.style.borderLeft=l+'px solid '+this.letterbox;this.i.style.borderRight=(w-l)+'px solid '+this.letterbox}TINY.alpha.set(this.i,100,this.imgSpeed);var n=new Function(this.n+'.nf('+s+')');this.lt=setTimeout(n,this.imgSpeed*100);if(!c){this.at=setTimeout(new Function(this.n+'.mv(1,0)'),this.speed*1000)}if(this.a[s].l!=''){this.q.onclick=new Function('window.location="clientes.html"');this.q.onmouseover=new Function('this.className="'+this.link+'"');this.q.onmouseout=new Function('this.className=""');this.q.style.cursor='pointer'}else{this.q.onclick=this.q.onmouseover=null;this.q.style.cursor='default'}var m=$$('img',this.f);if(m.length>2){this.f.removeChild(m[0])}},nf:function(s){if(this.info){s=this.a[s];$$('h3',this.r)[0].innerHTML=s.t;$$('p',this.r)[0].innerHTML=s.d;this.r.style.height='auto';var h=parseInt(this.r.offsetHeight);this.r.style.height=0;TINY.height.set(this.r,h,this.infoSpeed,0)}}};TINY.scroll=function(){return{init:function(e,d,s){e=typeof e=='object'?e:$(e);var p=e.style.left||TINY.style.val(e,'left');e.style.left=p;var l=d==1?parseInt(e.offsetWidth)-parseInt(e.parentNode.offsetWidth):0;e.si=setInterval(function(){TINY.scroll.mv(e,l,d,s)},20)},mv:function(e,l,d,s){var c=parseInt(e.style.left);if(c==l){TINY.scroll.cl(e)}else{var i=Math.abs(l+c);i=i<s?i:s;var n=c-i*d;e.style.left=n+'px'}},cl:function(e){e=typeof e=='object'?e:$(e);clearInterval(e.si)}}}();TINY.height=function(){return{set:function(e,h,s,d){e=typeof e=='object'?e:$(e);var oh=e.offsetHeight,ho=e.style.height||TINY.style.val(e,'height');ho=oh-parseInt(ho);var hd=oh-ho>h?-1:1;clearInterval(e.si);e.si=setInterval(function(){TINY.height.tw(e,h,ho,hd,s)},20)},tw:function(e,h,ho,hd,s){var oh=e.offsetHeight-ho;if(oh==h){clearInterval(e.si)}else{if(oh!=h){e.style.height=oh+(Math.ceil(Math.abs(h-oh)/s)*hd)+'px'}}}}}();TINY.alpha=function(){return{set:function(e,a,s){e=typeof e=='object'?e:$(e);var o=e.style.opacity||TINY.style.val(e,'opacity'),d=a>o*100?1:-1;e.style.opacity=o;clearInterval(e.ai);e.ai=setInterval(function(){TINY.alpha.tw(e,a,d,s)},20)},tw:function(e,a,d,s){var o=Math.round(e.style.opacity*100);if(o==a){clearInterval(e.ai)}else{var n=o+Math.ceil(Math.abs(a-o)/s)*d;e.style.opacity=n/100;e.style.filter='alpha(opacity='+n+')'}}}}();TINY.style=function(){return{val:function(e,p){e=typeof e=='object'?e:$(e);return e.currentStyle?e.currentStyle[p]:document.defaultView.getComputedStyle(e,null).getPropertyValue(p)}}}();
