//______________________________________________ Dreamweaver __//
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.01
  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() { //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];}
}

//______________________________________________ Placom __//
(function($){var _fichRecurso="recurso.php";$.placom=$.placom||{};$.placom.Placom={getFicheroRecurso:function(){return _fichRecurso},setFicheroRecurso:function(fichero){_fichRecurso=fichero;return this}};$.placom.Clase=function(){var hasBase=typeof(arguments[0])=="function",base=hasBase?arguments[0]:function(){},override=arguments[hasBase?1:0],statical=arguments[hasBase?2:1],result=function(){if(this.__construct){this.__construct.apply(this,arguments)}},inheritance=function(){};$.extend(result,base,statical);inheritance.prototype=base.prototype;result.prototype=new inheritance();result.prototype.constructor=result;result.prototype.__self=result;if(override){var _override=[];$.each(override,function(i){_override.push(i)});for(var i in override){if(override.hasOwnProperty(i)){_override.push(i)}}if(override.toString&&$.inArray("toString",_override)==-1){_override.push("toString")}$.each(_override,function(){if(hasBase&&typeof(base.prototype[this])=="function"&&typeof(result.prototype[this])=="function"){(function(methodName){result.prototype[methodName]=function(){var __baseSaved=this.__base;this.__base=base.prototype[methodName];var result=override[methodName].apply(this,arguments);this.__base=__baseSaved;return result}})(this)}else{result.prototype[this]=override[this]}})}return result};var _toString=Object.prototype.toString;$.extend(jQuery,{isNumber:function(object){return typeof object=="number"},isString:function(object){return _toString.call(object)=="[object String]"},isUndefined:function(object){return typeof object==="undefined"}});$.extend(Function.prototype,{unir:function(){if(arguments.length<2&&arguments[0]===undefined){return this}var __method=this,args=$.merge([],arguments),object=args.shift();return function(){return __method.apply(object,args.concat($.merge([],arguments)))}},unirConEvento:function(){var __method=this,args=$.merge([],arguments),object=args.shift();return function(event){return __method.apply(object,[event||window.event].concat(args))}}});var $break={};var metodosExtArray={__extendido:true,_each:function(iterator){for(var i=0,length=this.length;i<length;i++){iterator(this[i])}},all:function(iterator,context){iterator=iterator||function(x){return x};var result=true;this.each(function(value,index){result=result&&!!iterator.call(context,value,index);if(!result){throw $break}});return result},any:function(iterator,context){iterator=iterator||function(x){return x};var result=false;this.each(function(value,index){if(result=!!iterator.call(context,value,index)){throw $break}});return result},clear:function(){this.length=0;return this},clone:function(){return[].concat(this).extendido()},collect:function(iterator,context){iterator=iterator||function(x){return x};var results=[].extendido();this.each(function(value,index){results.push(iterator.call(context,value,index))});return results},detect:function(iterator,context){var result;this.each(function(value,index){if(iterator.call(context,value,index)){result=value;throw $break}});return result},compact:function(){return this.select(function(value){return value!==null}).extendido()},each:function(iterator,context){context=context||this;var index=0;try{this._each(function(value){iterator.call(context,value,index++)})}catch(e){if(e!=$break){throw e}}return this},eachSlice:function(number,iterator,context){var index=-number,slices=[],array=this.toArray();if(number<1){return array}while((index+=number)<array.length){slices.push(array.slice(index,index+number))}return slices.extendido().collect(iterator,context)},extended:function(){return true},findAll:function(iterator,context){var results=[].extendido();this.each(function(value,index){if(iterator.call(context,value,index)){results.push(value)}});return results},flatten:function(){return this.inject([],function(array,value){return array.concat($.isArray(value)?value.extendido().flatten():[value]).extendido()})},first:function(){return this[0]},grep:function(filter,iterator,context){iterator=iterator||function(x){return x};var results=[].extendido();if(typeof filter==="string"){filter=new RegExp(filter)}this.each(function(value,index){if(filter.test(value)){results.push(iterator.call(context,value,index))}});return results},include:function(object){if($.isFunction(this.indexOf)){if(this.indexOf(object)!=-1){return true}}var found=false;this.each(function(value){if(value==object){found=true;throw $break}});return found},indexOf:function(item,i){i||(i=0);var length=this.length;if(i<0){i=length+i}for(;i<length;i++){if(this[i]===item){return i}}return -1},inGroupsOf:function(number,fillWith){fillWith=fillWith?null:fillWith;return this.eachSlice(number,function(slice){while(slice.length<number){slice.push(fillWith)}return slice})},inject:function(memo,iterator,context){this.each(function(value,index){memo=iterator.call(context,memo,value,index)});return memo},inspect:function(){return"["+this.map($.inspect).join(", ")+"]"},intersect:function(array){array.extendido();return this.uniq().findAll(function(item){return array.detect(function(value){return item===value})})},invoke:function(method){var args=$.makeArray(arguments).slice(1);return this.map(function(value){return value[method].apply(value,args)})},last:function(){return this[this.length-1]},lastIndexOf:function(item,i){i=isNaN(i)?this.length:(i<0?this.length+i:i)+1;var n=this.slice(0,i).reverse().extendido().indexOf(item);return(n<0)?n:i-n-1},max:function(iterator,context){iterator=iterator||function(x){return x};var result;this.each(function(value,index){value=iterator.call(context,value,index);if(result==null||value>=result){result=value}});return result},min:function(iterator,context){iterator=iterator||function(x){return x};var result;this.each(function(value,index){value=iterator.call(context,value,index);if(result==null||value<result){result=value}});return result},partition:function(iterator,context){iterator=iterator||function(x){return x};var trues=[],falses=[];this.each(function(value,index){(iterator.call(context,value,index)?trues:falses).push(value)});return[trues,falses]},pluck:function(property){var results=[].extendido();this.each(function(value){results.push(value[property])});return results},purge:function(){return[].concat(this)},reduce:function(){return this.length>1?this:this[0]},reject:function(iterator,context){var results=[].extendido();this.each(function(value,index){if(!iterator.call(context,value,index)){results.push(value)}});return results},size:function(){return this.length},sortBy:function(iterator,context){return this.map(function(value,index){return{value:value,criteria:iterator.call(context,value,index)}}).sort(function(left,right){var a=left.criteria,b=right.criteria;return a<b?-1:a>b?1:0}).pluck("value")},toArray:function(){return this.map().clone()},uniq:function(sorted){return this.inject([],function(array,value,index){array.extendido();if(0===index||(sorted?array.last()!=value:!array.include(value))){array.push(value)}return array}).extendido()},without:function(){var values=$.makeArray(arguments).extendido();return this.select(function(value){return !values.include(value)})},zip:function(){var iterator=function(x){return x},args=$.makeArray(arguments).extendido();if($.isFunction(args.last())){iterator=args.pop()}var collections=[this].concat(args).extendido().map();return this.map(function(value,index){return iterator(collections.pluck(index))})}};$.extend(metodosExtArray,{map:metodosExtArray.collect,find:metodosExtArray.detect,select:metodosExtArray.findAll,filter:metodosExtArray.findAll,member:metodosExtArray.include,entries:metodosExtArray.toArray,every:metodosExtArray.all,some:metodosExtArray.any});$.extend(Array.prototype,{extendido:function(){if(!this.__extendido){$.extend(this,metodosExtArray)}return this}});$.extend(String,{interpret:function(value){return value==null?"":String(value)},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});var metodosExtString=(function(){function prepareReplacement(replacement){if($.isFunction(replacement)){return replacement}var template=new $.placom.Template(replacement);return function(match){return template.evaluate(match)}}function gsub(pattern,replacement){var result="",source=this,match;replacement=prepareReplacement(replacement);if($.isString(pattern)){pattern=RegExp.escape(pattern)}if(!(pattern.length||pattern.source)){replacement=replacement("");return replacement+source.split("").join(replacement)+replacement}while(source.length>0){if(match=source.match(pattern)){result+=source.slice(0,match.index);result+=String.interpret(replacement(match));source=source.slice(match.index+match[0].length)}else{result+=source,source=""}}return result}function sub(pattern,replacement,count){replacement=prepareReplacement(replacement);count=$.isUndefined(count)?1:count;return this.gsub(pattern,function(match){if(--count<0){return match[0]}return replacement(match)})}function scan(pattern,iterator){this.gsub(pattern,iterator);return String(this)}function truncate(length,truncation){length=length||30;truncation=$.isUndefined(truncation)?"...":truncation;return this.length>length?this.slice(0,length-truncation.length)+truncation:String(this)}function strip(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}function stripTags(){return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi,"")}function stripScripts(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")}function extractScripts(){var matchAll=new RegExp(Prototype.ScriptFragment,"img");var matchOne=new RegExp(Prototype.ScriptFragment,"im");return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||["",""])[1]})}function evalScripts(){return this.extractScripts().map(function(script){return eval(script)})}function escapeHTML(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function unescapeHTML(){return this.stripTags().replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}function toQueryParams(separator){var match=this.strip().match(/([^?#]*)(#.*)?$/);if(!match){return{}}return match[1].split(separator||"&").inject({},function(hash,pair){if((pair=pair.split("="))[0]){var key=decodeURIComponent(pair.shift());var value=pair.length>1?pair.join("="):pair[0];if(value!=undefined){value=decodeURIComponent(value)}if(key in hash){if(!$.isArray(hash[key])){hash[key]=[hash[key]]}hash[key].push(value)}else{hash[key]=value}}return hash})}function toArray(){return this.split("")}function succ(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)}function times(count){return count<1?"":new Array(count+1).join(this)}function camelize(){var parts=this.split("-"),len=parts.length;if(len==1){return parts[0]}var camelized=this.charAt(0)=="-"?parts[0].charAt(0).toUpperCase()+parts[0].substring(1):parts[0];for(var i=1;i<len;i++){camelized+=parts[i].charAt(0).toUpperCase()+parts[i].substring(1)}return camelized}function capitalize(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()}function underscore(){return this.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/-/g,"_").toLowerCase()}function dasherize(){return this.replace(/_/g,"-")}function inspect(useDoubleQuotes){var escapedString=this.replace(/[\x00-\x1f\\]/g,function(character){if(character in String.specialChar){return String.specialChar[character]}return"\\u00"+character.charCodeAt().toPaddedString(2,16)});if(useDoubleQuotes){return'"'+escapedString.replace(/"/g,'\\"')+'"'}return"'"+escapedString.replace(/'/g,"\\'")+"'"}function toJSON(){return this.inspect(true)}function unfilterJSON(filter){return this.replace(filter||Prototype.JSONFilter,"$1")}function isJSON(){var str=this;if(str.blank()){return false}str=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str)}function evalJSON(sanitize){var json=this.unfilterJSON();try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())}function include(pattern){return this.indexOf(pattern)>-1}function startsWith(pattern){return this.indexOf(pattern)===0}function endsWith(pattern){var d=this.length-pattern.length;return d>=0&&this.lastIndexOf(pattern)===d}function empty(){return this==""}function blank(){return/^\s*$/.test(this)}function interpolate(object,pattern){return new $.placom.Template(this,pattern).evaluate(object)}return{__extendido:true,gsub:gsub,sub:sub,scan:scan,truncate:truncate,strip:String.prototype.trim?String.prototype.trim:strip,stripTags:stripTags,stripScripts:stripScripts,extractScripts:extractScripts,evalScripts:evalScripts,escapeHTML:escapeHTML,unescapeHTML:unescapeHTML,toQueryParams:toQueryParams,parseQuery:toQueryParams,toArray:toArray,succ:succ,times:times,camelize:camelize,capitalize:capitalize,underscore:underscore,dasherize:dasherize,inspect:inspect,toJSON:toJSON,unfilterJSON:unfilterJSON,isJSON:isJSON,evalJSON:evalJSON,include:include,startsWith:startsWith,endsWith:endsWith,empty:empty,blank:blank,interpolate:interpolate}})();$.extend(String.prototype,{extendido:function(){if(!this.__extendido){$.extend(this,metodosExtString)}return this}});$.placom.Template=$.placom.Clase({__construct:function(template,pattern){this.template=template.toString().extendido();this.pattern=pattern||this.__self.Pattern},evaluate:function(object){if(object&&$.isFunction(object.toTemplateReplacements)){object=object.toTemplateReplacements()}return this.template.gsub(this.pattern,function(match){if(object==null){return(match[1]+"")}var before=match[1]||"";if(before=="\\"){return match[2]}var ctx=object,expr=match[3];var pattern=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;match=pattern.exec(expr);if(match==null){return before}while(match!=null){var comp=match[1].extendido().startsWith("[")?match[2].replace(/\\\\]/g,"]"):match[1];ctx=ctx[comp];if(null==ctx||""==match[3]){break}expr=expr.substring("["==match[3]?match[1].length:match[0].length);match=pattern.exec(expr)}return before+String.interpret(ctx)})}},{Pattern:/(^|.|\r|\n)(#\{(.*?)\})/})})(jQuery);
//______________________________________________ Estilo __//
(function(c){if(typeof(c.placom)=="undefined"){throw new Error("Debe estar cargada la librería placom.Placom")}var a={};var b=function(e){var d=c.makeArray(document.styleSheets).extendido();if(e){e=e.split(",").extendido();d=d.select(function(f){return e.any(function(g){return f.href&&f.href.match(g)})})}return d};c.placom.Estilo={fijaPng:(c.browser.msie&&c.browser.version<7)?function(h){var f=b(h);var d='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="#{src}",sizingMethod="#{method}")'.extendido();function g(k,l){if(k.imports){c.makeArray(k.imports).extendido().each(g)}var j=k.href||document.location.href;var i=j.substr(0,j.lastIndexOf("/"));c.makeArray(k.rules||k.cssRules).extendido().each(function(m){l.call(this,m,i)})}function e(l,j){var i=l.style.backgroundImage;if(i&&i!="none"&&i.match(/^url[("']+(.*\.png(&v=[0-9]+)?)[)"']+$/i)){var m=RegExp.$1;var k=l.style.backgroundRepeat;if(m[0]!="/"&&!m.match(/^http?:/)){m=j+"/"+m}l.style.filter=d.interpolate({src:m,method:k=="no-repeat"?"crop":"scale"});l.style.backgroundImage="none"}}f.each(function(i){g.call(this,i,e)});return this}:function(){return this},precargaImgs:function(t,r){var q=b(t);r=(typeof(r)=="string")?new RegExp(r+"\\.(gif|jpg|png)(&v=[0-9]+)?$"):null;var o=c.placom.Placom.getFicheroRecurso();for(var p=0,s=q.length;p<s;p++){var h=q[p];var g=h.href;var u=g.substr(0,g.lastIndexOf("/"));var e=(h.rules||h.cssRules);for(var n=0,m=e.length;n<m;n++){var l=e[n];var f=l.style.backgroundImage;if(f&&f!="none"&&f!="initial"){if(!a[f]){f.match(/^url\(["']?([^"']*)["']?\)$/i);var d=RegExp.$1;if(r&&!d.match(r)){continue}if(!(d[0]=="/"||d.match(/^file:/)||d.match(/^https?:/))){d=u+"/"+d}a[f]=1;var k=new Image();k.src=d}}}}return this}}})(jQuery);

//______________________________________________ Aplicación __//
$(document).ready(function(){
	$('#menu-superior > li').each(function(){
		var li = $(this);
		var ul = $('ul', this).fadeTo(0, 0);
		var sobre = false;
		$(this).hover(function(){ 
				sobre = true;
				li.addClass('hover');
				ul.fadeTo(400, 1); 
		}, function(){
				sobre = false;
				ul.fadeTo(100, 0, function(){
					if(!sobre) 
						li.removeClass('hover'); 
				}); 
		});
	});
	$('#login .inputLogin')
		.focus(function(){
			$(this).addClass('inputLoginOver');
		})
		.blur(function(){
			$(this).removeClass('inputLoginOver');
		});
	$('#login .enviarLogin')
		.hover(function(){
			$(this).addClass('enviarLoginOver');
		}, function(){
			$(this).removeClass('enviarLoginOver');
		});
	if($.browser.msie && $.browser.version < 7) 
		$.placom.Estilo.fijaPng('_imgTransp'); 
	$.placom.Estilo.precargaImgs("_imgOver", "(Over)");
});
var app = {
	contactoOnReady:function()
	{
		$('#btnEnviarFrmContacto').hover(function(){
			$(this).addClass('btnEnviarFrmContactoOver');
		}, function(){
			$(this).removeClass('btnEnviarFrmContactoOver');
		});
		$('#formContacto .campoVerde')
			.focus(function(){
				$(this).addClass('campoVerdeOver'); })
			.blur(function(){
				$(this).removeClass('campoVerdeOver'); });
	},
	particularesInternetMasTelefonia:function()
	{
		$('#btnLlamadasSinTP').click(function()
		{
			var textoLlamadasSinTP = $('#txtLlamadasSinTP');
			if(textoLlamadasSinTP.is(':visible'))
				textoLlamadasSinTP.slideUp(300);
			else
				textoLlamadasSinTP.slideDown(300);
		});
		$('#btnLlamadasMovil').click(function()
		{
			var textoLlamadasMovil = $('#txtLlamadasMovil');
			if(textoLlamadasMovil.is(':visible'))
				textoLlamadasMovil.slideUp(300);
			else
				textoLlamadasMovil.slideDown(300);
		});
	}
};

