// source --> https://www.eventconecta.com/wp-content/plugins/foobox-image-lightbox/free/js/foobox.free.min.js?ver=2.7.33 
!function(a,r){var e;a&&r&&(r.FooBox={},FooBox.$=a,FooBox.version="2.4.7",FooBox.defaults={affiliate:{enabled:!(FooBox.instances=[]),prefix:"Powered by ",url:"http://fooplugins.com/plugins/foobox/"},alwaysInit:!0,closeOnOverlayClick:!0,containerCssClass:"fbx-instance",countMessage:"item %index of %total",error:"Could not load the item",excludes:".fbx-link, .nofoobox",externalSelector:"a[data-foobox],input[data-foobox]",fitToScreen:!1,hideScrollbars:!0,loadDelay:0,loaderTimeout:600,modalClass:"",preload:!1,rel:null,resizeSpeed:300,selector:"a",showButtons:!0,showCount:!0,style:"fbx-rounded",theme:"fbx-light",transitionInSpeed:200,transitionOutSpeed:200,initCallback:null,loop:!0},FooBox.isjQuery=function(e){return e instanceof jQuery||e&&e.jquery},FooBox.isFn=function(e){return e===r.alert||"[object Function]"===Object.prototype.toString.call(e)},FooBox.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},FooBox.inArray=function(e,o){return FooBox.isArray(o)?o.indexOf(e):-1},FooBox.trim=function(e){return"[object String]"===Object.prototype.toString.call(e)?e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""):""},FooBox.ready=function(e){function o(){try{e.call(r,FooBox.$)}catch(e){console.error(e)}}(Function("/*@cc_on return true@*/")()?"complete"===document.readyState:"loading"!==document.readyState)?o():document.addEventListener("DOMContentLoaded",o,!1)},FooBox.browser={isIE:!(FooBox.format=function(e,o,t){for(var i,n=e,s=0;s<arguments.length-1;s++)i=new RegExp("\\{"+s+"\\}","gm"),n=n.replace(i,arguments[s+1]);return n}),isChrome:!1,isSafari:!1,isLtSafari10:!1,version:0,css:"",iOS:!1,Mac:!1,isMobile:(e=navigator.userAgent||navigator.vendor||r.opera,/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0,4))),check:function(){var e=navigator.appVersion.toLowerCase(),o=navigator.userAgent.toLowerCase(),t=navigator.platform,i=(FooBox.browser.iOS=/(iPad|iPhone|iPod)/g.test(t),FooBox.browser.iOS12OrBelow=!1,FooBox.browser.iOS&&(FooBox.browser.css+=" fbx-ios",FooBox.browser.iOS12OrBelow=(i=e.match(/OS (\d+)_(\d+)_?(\d+)?/i),[parseInt(i[1],10),parseInt(i[2],10),parseInt(i[3]||0,10)][0]<=12),FooBox.browser.iOS12OrBelow)&&(FooBox.browser.css+=" fbx-ios-12-or-below"),FooBox.browser.Mac=/(Mac)/g.test(t),FooBox.browser.Mac&&(FooBox.browser.css+=" fbx-mac"),FooBox.browser.isChrome=-1<e.indexOf("chrome")||-1<e.indexOf("crios"),FooBox.browser.isChrome&&(FooBox.browser.css+=" fbx-chrome"),FooBox.browser.isSafari=-1<e.indexOf("safari")&&!FooBox.browser.isChrome,FooBox.browser.isSafari&&(FooBox.browser.css+=" fbx-safari",FooBox.browser.isLtSafari10=/constructor/i.test(r.HTMLElement)),FooBox.browser.isFirefox=-1<o.indexOf("firefox"),FooBox.browser.isFirefox&&(FooBox.browser.css+=" fbx-firefox"),o.indexOf("msie ")),t=o.indexOf("trident/"),e=o.indexOf("edge/");FooBox.browser.isIE=-1<i||-1<t||-1<e,FooBox.browser.isIE&&(-1<i?FooBox.browser.version=parseInt(o.substring(i+5,o.indexOf(".",i)),10):-1<t?(t=o.indexOf("rv:"),FooBox.browser.version=parseInt(o.substring(t+3,o.indexOf(".",t)),10)):-1<e&&(FooBox.browser.version=parseInt(o.substring(e+5,o.indexOf(".",e)),10)),FooBox.browser.css="fbx-ie fbx-ie"+FooBox.browser.version)},supportsTransitions:function(){var e=(document.body||document.documentElement).style;if("string"==typeof e[t="transition"])return!0;for(var o=["Moz","Webkit","Khtml","O","ms"],t=t.charAt(0).toUpperCase()+t.substr(1),i=0;i<o.length;i++)if("string"==typeof e[o[i]+t])return!0;return!1},transitionEnd:function(){var e,o=document.createElement("fakeelement"),t={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(e in t)if(t.hasOwnProperty(e)&&void 0!==o.style[e])return t[e];return null}},FooBox.browser.check(),FooBox.qualifiedURL=function(e){var o=document.createElement("a");return o.href=e,o.href},jQuery.Event.prototype.fb={instance:null,modal:null,options:null,handled:!1},FooBox.raise=function(e,o,t){t=t||{};var i=a.Event(o);return i.fb={},i.fb.instance=e,i.fb.modal=e.modal.element,i.fb.options=e.options,a.extend(!0,i.fb,t),e.element.one(o,function(e){e.stopPropagation()}).trigger(i),i},FooBox.options={isMultipart:function(e,o){return"string"==typeof e&&0<e.length&&-1!==e.indexOf(o)},hasProperties:function(e){if("object"==typeof e)for(var o in e)if(e.hasOwnProperty(o))return!0;return!1},get:function(e,o){var t,i;return FooBox.options.isMultipart(o,".")?(t=o.substring(0,o.indexOf(".")),i=o.substring(o.indexOf(".")+1),e[t]=e[t]||{},FooBox.options.get(e[t],i)):e[o]},set:function(e,o,t){var i,n;FooBox.options.isMultipart(o,".")?(i=o.substring(0,o.indexOf(".")),n=o.substring(o.indexOf(".")+1),e[i]=e[i]||{},FooBox.options.set(e[i],n,t)):e[o]=t},merge:function(e,o,t){var i,n=Array.prototype.slice.call(arguments);for(e=n.shift(),o=n.shift(),FooBox.options._merge(e,o),i=0;i<n.length;i++)t=n[i],FooBox.options._merge(e,t);return e},_merge:function(e,o){for(var t in o)o.hasOwnProperty(t)&&(FooBox.options.hasProperties(o[t])&&!FooBox.isArray(o[t])?(e[t]=e[t]||{},FooBox.options._merge(e[t],o[t])):FooBox.isArray(o[t])?(e[t]=[],a.extend(!0,e[t],o[t])):e[t]=o[t])}},FooBox.objects={registered:{},ensure:function(e){return FooBox.objects.registered[e]=FooBox.objects.registered[e]||[]},register:function(e,o,t){return FooBox.objects.ensure(e).push(o),"object"==typeof t&&a.extend(!0,FooBox.defaults,t),!0},load:function(e,o){for(var t,i=[],n=FooBox.objects.ensure(e),s=0;s<n.length;s++)try{t=n[s],i.push(new t(o))}catch(e){console.error(e)}o.objects=o.objects||{},o.objects[e]=i},call:function(e,o,t,i,n){for(var s,a=Array.prototype.slice.call(arguments),r=(e=a.shift(),o=a.shift(),t=a.shift(),o.objects[e]||[]),l=0;l<r.length;l++)try{s=r[l],FooBox.isFn(s[t])&&s[t].apply(s,a)}catch(e){console.error(e)}},get:function(e,o,t){var i,n=o.objects[e];if(n&&FooBox.isFn(t))for(i=0;i<n.length;i++)if(t(n[i]))return n[i];return null}},FooBox.addons={_ns:"addons",validate:function(e){return!!FooBox.isFn(e)||(console.error(FooBox.format('Expected type "function", received type "{0}".',typeof e)),!1)},register:function(e,o){return FooBox.addons.validate(e)?FooBox.objects.register(FooBox.addons._ns,e,o):(console.error("Failed to register the addon."),!1)},load:function(e){FooBox.objects.load(FooBox.addons._ns,e)},call:function(e,o,t,i){var n=Array.prototype.slice.call(arguments);n.unshift(FooBox.addons._ns),FooBox.objects.call.apply(this,n)}},FooBox.handlers={_ns:"handlers",validate:function(e){var o;return FooBox.isFn(e)?(o=new e,FooBox.isFn(o.handles)?FooBox.isFn(o.defaults)?FooBox.isFn(o.parse)?FooBox.isFn(o.load)?FooBox.isFn(o.getSize)?FooBox.isFn(o.hasChanged)?!!FooBox.isFn(o.preload)||(console.error('The required "preload" method is not implemented.'),!1):(console.error('The required "hasChanged" method is not implemented.'),!1):(console.error('The required "getSize" method is not implemented.'),!1):(console.error('The required "load" method is not implemented.'),!1):(console.error('The required "parse" method is not implemented.'),!1):(console.error('The required "defaults" method is not implemented.'),!1):(console.error('The required "handles" method is not implemented.'),!1)):(console.error(FooBox.format('Expected type "function", received type "{0}".',typeof e)),!1)},register:function(e,o){return FooBox.handlers.validate(e)?FooBox.objects.register(FooBox.handlers._ns,e,o):(console.error("Failed to register the handler."),!1)},load:function(e){FooBox.objects.load(FooBox.handlers._ns,e)},call:function(e,o,t,i){var n=Array.prototype.slice.call(arguments);n.unshift(FooBox.handlers._ns),FooBox.objects.call.apply(this,n)},get:function(e,o){return FooBox.objects.get(FooBox.handlers._ns,e,function(e){return e.type==o})}},FooBox.Item=function(e,o,t){return this.type=e,this.element=FooBox.isjQuery(o)?o:a(o),this.handler=t,this.width=null,this.height=null,this.url=null,this.overflow=!1,this.preloaded=!1,this.proportion=!1,this.error=!1,this},FooBox.Size=function(e,o){return this.width="number"==typeof e?e:parseInt(e,0),this.height="number"==typeof o?o:parseInt(o,0),this.equalTo=function(e){return this.width==e.width&&this.height==e.height},this},FooBox.Size.check=function(e){return"number"==typeof e?e:isNaN(parseInt(e))?null:parseInt(e)},FooBox.Timer=function(){this.id=null,this.busy=!1;var i=this;return this.start=function(e,o,t){t=t||e,i.stop(),i.id=setTimeout(function(){e.call(t),i.id=null,i.busy=!1},o),i.busy=!0},this.stop=function(){null!==i.id&&!1!==i.busy&&(clearTimeout(i.id),i.id=null,i.busy=!1)},this},a.fn.foobox=function(i){return i=i||{},this.each(function(){var e=a(this),o=e.data("fbx_instance"),t=e.data("__FooGallery__"),e=a.extend(!0,{},i,e.data("foobox"));o instanceof FooBox.Instance?!0===o.options.alwaysInit||t?((t=o.options).alwaysInit=!0,o.destroy(),(o=new FooBox.Instance(o.id)).init(this,a.extend(!0,t,e))):o.reinit(e):(o=a(this).data("fbx_p_instance"))instanceof FooBox.Instance||(o=new FooBox.Instance).init(this,e)})},FooBox.open=function(e){var o,t,i=null;return null!=(i="object"==typeof e?(t=document.createElement("a"),a(t).foobox(e),a(t).data("fbx_instance")):(o=(o="number"==typeof e?e:(o=parseInt(e||0),isNaN(o)?0:o))>FooBox.instances.length-1?FooBox.instances.length-1:o<0?0:o,FooBox.instances[o]))&&i.modal instanceof FooBox.Modal?(i.modal.show(!0),i):null},FooBox.close=function(){for(var e=[],o=null,t=0;t<FooBox.instances.length;t++)null!=(o=FooBox.instances[t])&&o.modal instanceof FooBox.Modal&&FooBox.isjQuery(o.modal.element)&&o.modal.element.hasClass("fbx-show")&&e.push(o);for(t=0;t<e.length;t++)(o=e[t]).modal.close()},FooBox.resize=function(e,o){if(e||o)for(var t,i,n,s=0;s<FooBox.instances.length;s++)null!=(t=FooBox.instances[s])&&t.modal instanceof FooBox.Modal&&FooBox.isjQuery(t.modal.element)&&t.modal.element.hasClass("fbx-show")&&(i=t.items.current(),n=new FooBox.Size(e||i.width||0,o||i.height||0),i.width=n.width,i.height=n.height,t.modal.resize(n,t.modal.element.find(".fbx-item-current")));else a(r).trigger("resize.foobox")},FooBox.lateBind=function(e,o){var t=a.extend(!0,{},FooBox.defaults,o||r.FOOBOX&&FOOBOX.o||{}),i=a(e);i.on("click.foobox",t.selector,function(e){e.preventDefault();e=i.data("fbx_instance");(e=e||i.foobox(t).data("fbx_instance"))instanceof FooBox.Instance&&"number"==typeof this.index&&(e.items.indexes.set(this.index),e.modal.show(!0))})})}(jQuery,window),function(e){let t=new globalThis.Set(["accesskey","autocapitalize","autofocus","class","contenteditable","data-","dir","draggable","enterkeyhint","exportparts","hidden","id","inert","inputmode","is","itemid","itemprop","itemref","itemscope","itemtype","lang","nonce","part","popover","role","slot","spellcheck","style","tabindex","title","translate"]),i=new globalThis.Map([["html",["xmlns"]],["base",["href","target"]],["head",[]],["link",["as","crossorigin","disabled","fetchpriority","href","hreflang","imagesizes","imagesrcset","integrity","media","referrerpolicy","rel","sizes","type"]],["meta",["charset","content","http-equiv","name"]],["style",["media"]],["title",[]],["body",["onafterprint","onbeforeprint","onbeforeunload","onblur","onerror","onfocus","onhashchange","onlanguagechange","onload","onmessage","onoffline","ononline","onpopstate","onresize","onstorage","onunload"]],["address",[]],["article",[]],["aside",[]],["footer",[]],["header",[]],["h1",[]],["h2",[]],["h3",[]],["h4",[]],["h5",[]],["h6",[]],["hgroup",[]],["main",[]],["nav",[]],["section",[]],["search",[]],["blockquote",["cite"]],["dd",[]],["div",[]],["dl",[]],["dt",[]],["figcaption",[]],["figure",[]],["hr",[]],["li",["value"]],["menu",[]],["ol",["reversed","start","type"]],["p",[]],["pre",[]],["ul",[]],["a",["download","href","hreflang","ping","referrerpolicy","rel","target","type"]],["abbr",[]],["b",[]],["bdi",[]],["bdo",[]],["br",[]],["cite",[]],["code",[]],["data",["value"]],["dfn",[]],["em",[]],["i",[]],["kbd",[]],["mark",[]],["q",["cite"]],["rp",[]],["rt",[]],["ruby",[]],["s",[]],["samp",[]],["small",[]],["span",[]],["strong",[]],["sub",[]],["sup",[]],["time",["datetime"]],["u",[]],["var",[]],["wbr",[]],["area",["alt","coords","download","href","ping","referrerpolicy","rel","shape","target"]],["audio",["autoplay","controls","controlslist","crossorigin","disableremoteplayback","loop","muted","preload","src"]],["img",["alt","crossorigin","decoding","elementtiming","fetchpriority","height","ismap","loading","referrerpolicy","sizes","src","srcset","usemap","width"]],["map",["name"]],["track",["default","kind","label","src","srclang"]],["video",["autoplay","controls","controlslist","crossorigin","disablepictureinpicture","disableremoteplayback","height","loop","muted","playsinline","poster","preload","src","width"]],["embed",["height","src","type","width"]],["iframe",["allow","allowfullscreen","height","loading","name","referrerpolicy","sandbox","src","srcdoc","width"]],["object",["data","form","height","name","type","width"]],["picture",[]],["portal",["referrerpolicy","src"]],["source",["height","media","sizes","src","srcset","type","width"]],["svg",["height","preserveaspectratio","viewbox","width","x","y"]],["canvas",["height","width"]],["noscript",[]],["script",["async","crossorigin","defer","fetchpriority","integrity","nomodule","referrerpolicy","src","type"]],["del",["cite","datetime"]],["ins",["cite","datetime"]],["caption",[]],["col",["span"]],["colgroup",["span"]],["table",[]],["tbody",[]],["td",["colspan","headers","rowspan"]],["tfoot",[]],["th",["abbr","colspan","headers","rowspan","scope"]],["thead",[]],["tr",[]],["button",["disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","name","popovertarget","popovertargetaction","type","value"]],["datalist",[]],["fieldset",["disabled","form","name"]],["form",["accept-charset","autocomplete","name","rel"]],["input",[]],["label",["for"]],["legend",[]],["meter",["form","high","low","max","min","optimum","value"]],["optgroup",["disabled","label"]],["option",["disabled","label","selected","value"]],["output",["for","form","name"]],["progress",["max","value"]],["select",["autocomplete","disabled","form","multiple","name","required","size"]],["textarea",["autocomplete","cols","dirname","disabled","form","maxlength","minlength","name","placeholder","readonly","required","rows","wrap"]],["details",["name","open"]],["dialog",["open"]],["summary",[]],["slot",["name"]],["template",["shadowrootclonable","shadowrootdelegatesfocus","shadowrootmode"]]]),n=new globalThis.Set(["code","codebase","src","href","formaction","ping","cite","action","background","poster","profile","manifest","data"]),s=(["script","embed","object"].forEach(e=>i.delete(e)),e=>(e instanceof globalThis.Node?e.nodeName:"string"==typeof e?e:"").toLowerCase()),a=e=>{if(e instanceof globalThis.Attr){var o=s(e.ownerElement);if(i.has(o))return i.get(o).includes(e.name)}return!1},o=/^(?!javascript|vbscript|livescript|mocha)(?:[a-z0-9+.-]+:[^<>]*$|[^&:\/?#]*(?:[\/?#]|$))/i,r=e=>o.test(e),l=/@import|expression|behaviou?r|binding|(?:javascript|vbscript|livescript|mocha):|[\x00-\x08\x0E-\x1F\x7F-\uFFFF]|\/\*.*?\*\/|<--.*?-->/i,d=e=>!l.test(e.replace(/\s+/g," ")),h=/^[a-z](?:[\x2D.0-9_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/,c=e=>h.test(s(e)),f=/^[a-z](?:[.0-9_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*-(?:[\x2D.0-9_a-z\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C\u200D\u203F\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])*$/,p=e=>f.test(s(e)),m=e=>p(e?.ownerElement)&&c(e),u=e=>{var o=s(e);return!o.startsWith("on")&&(!(!o.startsWith("aria-")&&!o.startsWith("data-"))||(t.has(o)||a(e)?n.has(o)?r(e.value):"style"!==o||d(e.value):m(e)))},x=e=>{if(e instanceof globalThis.Element){var o=s(e);if(i.has(o)||p(e)){for(var t of e.attributes)if(!u(t))return!1;return"style"===o?d(e.textContent):!0}}return!1},v=(e,o=!1)=>{if(e instanceof globalThis.Element){var t;if(x(e))return t=e.cloneNode(!1),o&&e.hasChildNodes()&&t.append(...b(e.childNodes,o)),t;throw new TypeError("UNSAFE_NODE")}return e instanceof globalThis.Text?e.cloneNode():null},b=(e,o=!1)=>{var t,i=[];for(t of e){var n=v(t,o);n instanceof globalThis.Node&&i.push(n)}return i},g;e.safeParse=e=>{if("string"==typeof e)try{var o=(g instanceof globalThis.DOMParser?g:g=new globalThis.DOMParser).parseFromString(e,"text/html");if(o.body.hasChildNodes())return b(o.body.childNodes,!0).map(e=>1===e.nodeType?e.outerHTML:3===e.nodeType?e.nodeValue:"").join("")}catch(e){"UNSAFE_NODE"!==e.message&&console.error("FooBox.safeParse: Unexpected Error",e)}return""}}(window.FooBox),function(n,e){e.Icons=function(){return this.className="fbx-icon",this.registered={default:{close:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path class="[CURRENT_ICON_CLASS]-default" d="M13.405 11.404q0 0.357-0.25 0.607l-1.214 1.214q-0.25 0.25-0.607 0.25t-0.607-0.25l-2.625-2.625-2.625 2.625q-0.25 0.25-0.607 0.25t-0.607-0.25l-1.214-1.214q-0.25-0.25-0.25-0.607t0.25-0.607l2.625-2.625-2.625-2.625q-0.25-0.25-0.25-0.607t0.25-0.607l1.214-1.214q0.25-0.25 0.607-0.25t0.607 0.25l2.625 2.625 2.625-2.625q0.25-0.25 0.607-0.25t0.607 0.25l1.214 1.214q0.25 0.25 0.25 0.607t-0.25 0.607l-2.625 2.625 2.625 2.625q0.25 0.25 0.25 0.607z"></path><path class="[CURRENT_ICON_CLASS]-flat" d="M12.667 3q0.286 0 0.477 0.19t0.19 0.477q0 0.281-0.193 0.474l-4.198 4.193 4.198 4.193q0.193 0.193 0.193 0.474 0 0.286-0.19 0.477t-0.477 0.19q-0.281 0-0.474-0.193l-4.193-4.198-4.193 4.198q-0.193 0.193-0.474 0.193-0.286 0-0.477-0.19t-0.19-0.477q0-0.281 0.193-0.474l4.198-4.193-4.198-4.193q-0.193-0.193-0.193-0.474 0-0.286 0.19-0.477t0.477-0.19q0.281 0 0.474 0.193l4.193 4.198 4.193-4.198q0.193-0.193 0.474-0.193z"></path></svg>',prev:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path class="[ICON_CLASS]-arrows-default" d="M14.57 8.643q0 0.473-0.29 0.808t-0.754 0.335h-6.286l2.616 2.625q0.339 0.321 0.339 0.804t-0.339 0.804l-0.67 0.679q-0.33 0.33-0.804 0.33-0.464 0-0.813-0.33l-5.813-5.821q-0.33-0.33-0.33-0.804 0-0.464 0.33-0.813l5.813-5.804q0.339-0.339 0.813-0.339 0.464 0 0.804 0.339l0.67 0.661q0.339 0.339 0.339 0.813t-0.339 0.813l-2.616 2.616h6.286q0.464 0 0.754 0.335t0.29 0.808z"></path><path class="[ICON_CLASS]-arrows-flat" d="M6.667 3q0.276 0 0.471 0.195t0.195 0.471q0 0.281-0.198 0.474l-3.526 3.526h10.391q0.276 0 0.471 0.195t0.195 0.471-0.195 0.471-0.471 0.195h-10.391l3.526 3.526q0.198 0.193 0.198 0.474 0 0.276-0.195 0.471t-0.471 0.195q-0.281 0-0.474-0.193l-4.667-4.667q-0.193-0.203-0.193-0.474t0.193-0.474l4.667-4.667q0.198-0.193 0.474-0.193z"></path><path class="[ICON_CLASS]-arrows-1" d="M10 16l3-3-5-5 5-5-3-3-8 8z"></path><path class="[ICON_CLASS]-arrows-2" d="M0 8l16 7-3-7 3-7z"></path><path class="[ICON_CLASS]-arrows-3" d="M12 0l-8 8 8 8-4-8z"></path><path class="[ICON_CLASS]-arrows-4" d="M10 4l-4 4 4 4z"></path><path class="[ICON_CLASS]-arrows-5" d="M0 8l8 8v-5h8l0-6h-8v-5l-8 8zM2.375 7.039l0.25-0.25v2.422l-0.25-0.25v-1.922zM2.125 8.711l-0.25-0.25v-0.922l0.25-0.25v1.422zM2.875 6.539l0.25-0.25v3.422l-0.25-0.25v-2.922zM3.375 6.039l0.25-0.25v4.422l-0.25-0.25v-3.922zM3.875 5.539l0.25-0.25v5.422l-0.25-0.25v-4.922zM4.375 5.039l0.25-0.25v6.422l-0.25-0.25v-5.922zM4.875 4.539l0.25-0.25v7.422l-0.25-0.25v-6.922zM5.375 4.039l0.25-0.25v8.422l-0.25-0.25v-7.922zM5.875 3.539l0.25-0.25v9.422l-0.25-0.25v-8.922zM6.375 3.039l0.25-0.25v10.422l-0.25-0.25v-9.922zM1.625 7.789v0.422l-0.211-0.211 0.211-0.211zM7.375 10v-4h0.25v4h-0.25zM7.875 10v-4h0.25v4h-0.25zM8.375 10v-4h0.25v4h-0.25zM8.875 10v-4h0.25v4h-0.25zM9.375 10v-4h0.25v4h-0.25zM9.875 10v-4h0.25v4h-0.25zM10.375 10v-4h0.25v4h-0.25zM10.875 10v-4h0.25v4h-0.25zM11.375 10v-4h0.25v4h-0.25zM11.875 10v-4h0.25v4h-0.25zM12.375 10v-4h0.25v4h-0.25zM12.875 10v-4h0.25v4h-0.25zM13.375 10v-4h0.25v4h-0.25zM13.875 10v-4h0.25v4h-0.25zM14.375 10v-4h0.25v4h-0.25zM15 10h-0.125v-4h0.125l-0 4zM7 6h0.125v4h-0.125v3.586l-0.125-0.125v-10.922l0.125-0.125v3.586z"></path><path class="[ICON_CLASS]-arrows-6" d="M0 8l8 8v-5h8l0-6h-8v-5z"></path><path class="[ICON_CLASS]-arrows-7" d="M8 0c4.418 0 8 3.582 8 8s-3.582 8-8 8-8-3.582-8-8 3.582-8 8-8zM3.293 8.707l4 4c0.195 0.195 0.451 0.293 0.707 0.293s0.512-0.098 0.707-0.293c0.391-0.391 0.391-1.024 0-1.414l-2.293-2.293h5.586c0.552 0 1-0.448 1-1s-0.448-1-1-1h-5.586l2.293-2.293c0.391-0.391 0.391-1.024 0-1.414s-1.024-0.391-1.414 0l-4 4c-0.391 0.391-0.391 1.024-0 1.414z"></path><path class="[ICON_CLASS]-arrows-8" d="M0 16h16v-16h-16l0 16zM14 2v12h-12l-0-12h12zM7 11.5l-3.5-3.5 3.5-3.5v2.5h5v2h-5v2.5z"></path><path class="[ICON_CLASS]-arrows-9" d="M15 5h1v6h-1zM13 5h1v6h-1zM11 5h1v6h-1zM0 8l7-7v4h3v6h-3v4z"></path><path class="[ICON_CLASS]-arrows-10" d="M8 0c4.418 0 8 3.582 8 8s-3.582 8-8 8-8-3.582-8-8 3.582-8 8-8zM7 11.5v-2.5h5v-2h-5v-2.5l-3.5 3.5 3.5 3.5z"></path><path class="[ICON_CLASS]-arrows-11" d="M8 0c4.418 0 8 3.582 8 8s-3.582 8-8 8-8-3.582-8-8 3.582-8 8-8zM8 14.5c3.59 0 6.5-2.91 6.5-6.5s-2.91-6.5-6.5-6.5-6.5 2.91-6.5 6.5 2.91 6.5 6.5 6.5zM3.293 7.293l4-4c0.391-0.391 1.024-0.391 1.414 0s0.391 1.024 0 1.414l-2.293 2.293h5.586c0.552 0 1 0.448 1 1s-0.448 1-1 1h-5.586l2.293 2.293c0.391 0.391 0.391 1.024 0 1.414-0.195 0.195-0.451 0.293-0.707 0.293s-0.512-0.098-0.707-0.293l-4-4c-0.39-0.391-0.39-1.024 0-1.414z"></path></svg>',next:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path class="[ICON_CLASS]-arrows-default" d="M14.57 8.071q0 0.482-0.33 0.813l-5.813 5.813q-0.348 0.33-0.813 0.33-0.455 0-0.804-0.33l-0.67-0.67q-0.339-0.339-0.339-0.813t0.339-0.813l2.616-2.616h-6.286q-0.464 0-0.754-0.335t-0.29-0.808v-1.143q0-0.473 0.29-0.808t0.754-0.335h6.286l-2.616-2.625q-0.339-0.321-0.339-0.804t0.339-0.804l0.67-0.67q0.339-0.339 0.804-0.339 0.473 0 0.813 0.339l5.813 5.813q0.33 0.313 0.33 0.804z"></path><path class="[ICON_CLASS]-arrows-flat" d="M9.333 3q0.281 0 0.474 0.193l4.667 4.667q0.193 0.193 0.193 0.474t-0.193 0.474l-4.667 4.667q-0.193 0.193-0.474 0.193-0.286 0-0.477-0.19t-0.19-0.477q0-0.281 0.193-0.474l3.531-3.526h-10.391q-0.276 0-0.471-0.195t-0.195-0.471 0.195-0.471 0.471-0.195h10.391l-3.531-3.526q-0.193-0.193-0.193-0.474 0-0.286 0.19-0.477t0.477-0.19z"></path><path class="[ICON_CLASS]-arrows-1" d="M6 0l-3 3 5 5-5 5 3 3 8-8z"></path><path class="[ICON_CLASS]-arrows-2" d="M16 8l-16-7 3 7-3 7z"></path><path class="[ICON_CLASS]-arrows-3" d="M4 16l8-8-8-8 4 8z"></path><path class="[ICON_CLASS]-arrows-4" d="M6 12l4-4-4-4z"></path><path class="[ICON_CLASS]-arrows-5" d="M16 8l-8-8v5h-8l-0 6h8v5l8-8zM13.625 8.961l-0.25 0.25v-2.422l0.25 0.25v1.922zM13.875 7.289l0.25 0.25v0.922l-0.25 0.25v-1.422zM13.125 9.461l-0.25 0.25v-3.422l0.25 0.25v2.922zM12.625 9.961l-0.25 0.25v-4.422l0.25 0.25v3.922zM12.125 10.461l-0.25 0.25v-5.422l0.25 0.25v4.922zM11.625 10.961l-0.25 0.25v-6.422l0.25 0.25v5.922zM11.125 11.461l-0.25 0.25v-7.422l0.25 0.25v6.922zM10.625 11.961l-0.25 0.25v-8.422l0.25 0.25v7.922zM10.125 12.461l-0.25 0.25v-9.422l0.25 0.25v8.922zM9.625 12.961l-0.25 0.25v-10.422l0.25 0.25v9.922zM14.375 8.211v-0.422l0.211 0.211-0.211 0.211zM8.625 6v4h-0.25v-4h0.25zM8.125 6v4h-0.25v-4h0.25zM7.625 6v4h-0.25v-4h0.25zM7.125 6v4h-0.25v-4h0.25zM6.625 6v4h-0.25v-4h0.25zM6.125 6v4h-0.25v-4h0.25zM5.625 6v4h-0.25v-4h0.25zM5.125 6v4h-0.25v-4h0.25zM4.625 6v4h-0.25v-4h0.25zM4.125 6v4h-0.25v-4h0.25zM3.625 6v4h-0.25v-4h0.25zM3.125 6v4h-0.25v-4h0.25zM2.625 6v4h-0.25v-4h0.25zM2.125 6v4h-0.25v-4h0.25zM1.625 6v4h-0.25v-4h0.25zM1 6h0.125v4h-0.125l0-4zM9 10h-0.125v-4h0.125v-3.586l0.125 0.125v10.922l-0.125 0.125v-3.586z"></path><path class="[ICON_CLASS]-arrows-6" d="M16 8l-8-8v5h-8l-0 6h8v5z"></path><path class="[ICON_CLASS]-arrows-7" d="M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM12.707 8.707l-4 4c-0.195 0.195-0.451 0.293-0.707 0.293s-0.512-0.098-0.707-0.293c-0.391-0.391-0.391-1.024 0-1.414l2.293-2.293h-5.586c-0.552 0-1-0.448-1-1s0.448-1 1-1h5.586l-2.293-2.293c-0.391-0.391-0.391-1.024 0-1.414s1.024-0.391 1.414 0l4 4c0.391 0.391 0.391 1.024 0 1.414z"></path><path class="[ICON_CLASS]-arrows-8" d="M16 16h-16v-16h16l-0 16zM2 2v12h12l0-12h-12zM9 11.5l3.5-3.5-3.5-3.5v2.5h-5v2h5v2.5z"></path><path class="[ICON_CLASS]-arrows-9" d="M0 5h1v6h-1zM2 5h1v6h-1zM4 5h1v6h-1zM16 8l-7-7v4h-3v6h3v4z"></path><path class="[ICON_CLASS]-arrows-10" d="M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM9 11.5v-2.5h-5v-2h5v-2.5l3.5 3.5-3.5 3.5z"></path><path class="[ICON_CLASS]-arrows-11" d="M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 14.5c-3.59 0-6.5-2.91-6.5-6.5s2.91-6.5 6.5-6.5 6.5 2.91 6.5 6.5-2.91 6.5-6.5 6.5zM12.707 7.293l-4-4c-0.39-0.391-1.024-0.391-1.414 0s-0.391 1.024 0 1.414l2.293 2.293h-5.586c-0.552 0-1 0.448-1 1s0.448 1 1 1h5.586l-2.293 2.293c-0.391 0.391-0.391 1.024 0 1.414 0.195 0.195 0.451 0.293 0.707 0.293s0.512-0.098 0.707-0.293l4-4c0.39-0.391 0.39-1.024 0-1.414z"></path></svg>',error:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M8 1.5c-1.736 0-3.369 0.676-4.596 1.904s-1.904 2.86-1.904 4.596c0 1.736 0.676 3.369 1.904 4.596s2.86 1.904 4.596 1.904c1.736 0 3.369-0.676 4.596-1.904s1.904-2.86 1.904-4.596c0-1.736-0.676-3.369-1.904-4.596s-2.86-1.904-4.596-1.904zM8 0v0c4.418 0 8 3.582 8 8s-3.582 8-8 8c-4.418 0-8-3.582-8-8s3.582-8 8-8zM7 11h2v2h-2zM7 3h2v6h-2z"></path></svg>',spinner:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path class="[CURRENT_ICON_CLASS]-default" d="M3 8c0-0.19 0.011-0.378 0.032-0.563l-2.89-0.939c-0.092 0.487-0.141 0.989-0.141 1.502 0 2.3 0.971 4.374 2.526 5.833l1.786-2.458c-0.814-0.889-1.312-2.074-1.312-3.375zM13 8c0 1.301-0.497 2.486-1.312 3.375l1.786 2.458c1.555-1.459 2.526-3.533 2.526-5.833 0-0.513-0.049-1.015-0.141-1.502l-2.89 0.939c0.021 0.185 0.032 0.373 0.032 0.563zM9 3.1c1.436 0.292 2.649 1.199 3.351 2.435l2.89-0.939c-1.144-2.428-3.473-4.188-6.241-4.534v3.038zM3.649 5.535c0.702-1.236 1.914-2.143 3.351-2.435v-3.038c-2.769 0.345-5.097 2.105-6.241 4.534l2.89 0.939zM10.071 12.552c-0.631 0.288-1.332 0.448-2.071 0.448s-1.44-0.16-2.071-0.448l-1.786 2.458c1.144 0.631 2.458 0.99 3.857 0.99s2.713-0.359 3.857-0.99l-1.786-2.458z"></path><path class="[CURRENT_ICON_CLASS]-flat" d="M10.833 10.495q0.271 0 0.469 0.198l1.885 1.885q0.198 0.198 0.198 0.474 0 0.271-0.198 0.469t-0.469 0.198q-0.276 0-0.474-0.198l-1.885-1.885q-0.193-0.193-0.193-0.474 0-0.276 0.195-0.471t0.471-0.195zM5.172 10.495q0.276 0 0.471 0.195t0.195 0.471-0.198 0.474l-1.885 1.885q-0.198 0.198-0.469 0.198-0.276 0-0.471-0.195t-0.195-0.471q0-0.281 0.193-0.474l1.885-1.885q0.198-0.198 0.474-0.198zM1.333 7.667h2.667q0.276 0 0.471 0.195t0.195 0.471-0.195 0.471-0.471 0.195h-2.667q-0.276 0-0.471-0.195t-0.195-0.471 0.195-0.471 0.471-0.195zM8 11.667q0.276 0 0.471 0.195t0.195 0.471v2.667q0 0.276-0.195 0.471t-0.471 0.195-0.471-0.195-0.195-0.471v-2.667q0-0.276 0.195-0.471t0.471-0.195zM3.286 2.948q0.271 0 0.469 0.198l1.885 1.885q0.198 0.198 0.198 0.469 0 0.276-0.195 0.471t-0.471 0.195q-0.281 0-0.474-0.193l-1.885-1.885q-0.193-0.193-0.193-0.474 0-0.276 0.195-0.471t0.471-0.195zM12 7.667h2.667q0.276 0 0.471 0.195t0.195 0.471-0.195 0.471-0.471 0.195h-2.667q-0.276 0-0.471-0.195t-0.195-0.471 0.195-0.471 0.471-0.195zM8 1q0.276 0 0.471 0.195t0.195 0.471v2.667q0 0.276-0.195 0.471t-0.471 0.195-0.471-0.195-0.195-0.471v-2.667q0-0.276 0.195-0.471t0.471-0.195zM12.719 2.948q0.271 0 0.469 0.198t0.198 0.469q0 0.276-0.198 0.474l-1.885 1.885q-0.193 0.193-0.469 0.193-0.286 0-0.477-0.19t-0.19-0.477q0-0.276 0.193-0.469l1.885-1.885q0.198-0.198 0.474-0.198z"></path><path class="[CURRENT_ICON_CLASS]-1" d="M5.569 12q0 0.536-0.379 0.911t-0.906 0.375q-0.536 0-0.911-0.375t-0.375-0.911 0.375-0.911 0.911-0.375q0.527 0 0.906 0.375t0.379 0.911zM9.426 13.714q0 0.473-0.335 0.808t-0.808 0.335-0.808-0.335-0.335-0.808 0.335-0.808 0.808-0.335 0.808 0.335 0.335 0.808zM3.857 8q0 0.589-0.42 1.009t-1.009 0.42-1.009-0.42-0.42-1.009 0.42-1.009 1.009-0.42 1.009 0.42 0.42 1.009zM13.283 12q0 0.411-0.295 0.705t-0.705 0.295-0.705-0.295-0.295-0.705 0.295-0.705 0.705-0.295 0.705 0.295 0.295 0.705zM5.854 4q0 0.652-0.46 1.112t-1.112 0.46-1.112-0.46-0.46-1.112 0.46-1.112 1.112-0.46 1.112 0.46 0.46 1.112zM9.997 2.286q0 0.714-0.5 1.214t-1.214 0.5-1.214-0.5-0.5-1.214 0.5-1.214 1.214-0.5 1.214 0.5 0.5 1.214zM14.844 8q0 0.357-0.25 0.607t-0.607 0.25-0.607-0.25-0.25-0.607 0.25-0.607 0.607-0.25 0.607 0.25 0.25 0.607zM12.997 4q0 0.295-0.21 0.504t-0.504 0.21-0.504-0.21-0.21-0.504 0.21-0.504 0.504-0.21 0.504 0.21 0.21 0.504z"></path><path class="[CURRENT_ICON_CLASS]-2" d="M16 8c-0.020-1.045-0.247-2.086-0.665-3.038-0.417-0.953-1.023-1.817-1.766-2.53s-1.624-1.278-2.578-1.651c-0.953-0.374-1.978-0.552-2.991-0.531-1.013 0.020-2.021 0.24-2.943 0.646-0.923 0.405-1.758 0.992-2.449 1.712s-1.237 1.574-1.597 2.497c-0.361 0.923-0.533 1.914-0.512 2.895 0.020 0.981 0.234 1.955 0.627 2.847 0.392 0.892 0.961 1.7 1.658 2.368s1.523 1.195 2.416 1.543c0.892 0.348 1.851 0.514 2.799 0.493 0.949-0.020 1.89-0.227 2.751-0.608 0.862-0.379 1.642-0.929 2.287-1.604s1.154-1.472 1.488-2.335c0.204-0.523 0.342-1.069 0.415-1.622 0.019 0.001 0.039 0.002 0.059 0.002 0.552 0 1-0.448 1-1 0-0.028-0.001-0.056-0.004-0.083h0.004zM14.411 10.655c-0.367 0.831-0.898 1.584-1.55 2.206s-1.422 1.112-2.254 1.434c-0.832 0.323-1.723 0.476-2.608 0.454-0.884-0.020-1.759-0.215-2.56-0.57-0.801-0.354-1.526-0.867-2.125-1.495s-1.071-1.371-1.38-2.173c-0.31-0.801-0.457-1.66-0.435-2.512s0.208-1.694 0.551-2.464c0.342-0.77 0.836-1.468 1.441-2.044s1.321-1.029 2.092-1.326c0.771-0.298 1.596-0.438 2.416-0.416s1.629 0.202 2.368 0.532c0.74 0.329 1.41 0.805 1.963 1.387s0.988 1.27 1.272 2.011c0.285 0.74 0.418 1.532 0.397 2.32h0.004c-0.002 0.027-0.004 0.055-0.004 0.083 0 0.516 0.39 0.94 0.892 0.994-0.097 0.544-0.258 1.075-0.481 1.578z"></path><path class="[CURRENT_ICON_CLASS]-3" d="M7 4c0-0.552 0.448-1 1-1s1 0.448 1 1c0 0.552-0.448 1-1 1s-1-0.448-1-1zM8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 13c-0.552 0-1-0.448-1-1s0.448-1 1-1c0.552 0 1 0.448 1 1s-0.448 1-1 1zM8 8c-1.795 0-3.25 1.455-3.25 3.25s1.455 3.25 3.25 3.25c-3.59 0-6.5-2.91-6.5-6.5s2.91-6.5 6.5-6.5c1.795 0 3.25 1.455 3.25 3.25s-1.455 3.25-3.25 3.25z"></path><path class="[CURRENT_ICON_CLASS]-4" d="M6 2c0-1.105 0.895-2 2-2s2 0.895 2 2c0 1.105-0.895 2-2 2s-2-0.895-2-2zM10.243 3.757c0-1.105 0.895-2 2-2s2 0.895 2 2c0 1.105-0.895 2-2 2s-2-0.895-2-2zM13 8c0-0.552 0.448-1 1-1s1 0.448 1 1c0 0.552-0.448 1-1 1s-1-0.448-1-1zM11.243 12.243c0-0.552 0.448-1 1-1s1 0.448 1 1c0 0.552-0.448 1-1 1s-1-0.448-1-1zM7 14c0 0 0 0 0 0 0-0.552 0.448-1 1-1s1 0.448 1 1c0 0 0 0 0 0 0 0.552-0.448 1-1 1s-1-0.448-1-1zM2.757 12.243c0 0 0 0 0 0 0-0.552 0.448-1 1-1s1 0.448 1 1c0 0 0 0 0 0 0 0.552-0.448 1-1 1s-1-0.448-1-1zM2.257 3.757c0 0 0 0 0 0 0-0.828 0.672-1.5 1.5-1.5s1.5 0.672 1.5 1.5c0 0 0 0 0 0 0 0.828-0.672 1.5-1.5 1.5s-1.5-0.672-1.5-1.5zM0.875 8c0-0.621 0.504-1.125 1.125-1.125s1.125 0.504 1.125 1.125c0 0.621-0.504 1.125-1.125 1.125s-1.125-0.504-1.125-1.125z"></path><path class="[CURRENT_ICON_CLASS]-5" d="M8 0c-4.355 0-7.898 3.481-7.998 7.812 0.092-3.779 2.966-6.812 6.498-6.812 3.59 0 6.5 3.134 6.5 7 0 0.828 0.672 1.5 1.5 1.5s1.5-0.672 1.5-1.5c0-4.418-3.582-8-8-8zM8 16c4.355 0 7.898-3.481 7.998-7.812-0.092 3.779-2.966 6.812-6.498 6.812-3.59 0-6.5-3.134-6.5-7 0-0.828-0.672-1.5-1.5-1.5s-1.5 0.672-1.5 1.5c0 4.418 3.582 8 8 8z"></path><path class="[CURRENT_ICON_CLASS]-6" d="M0.001 8.025l-0 0c0 0 0 0.001 0 0.003 0.002 0.061 0.009 0.12 0.021 0.177 0.003 0.027 0.007 0.057 0.011 0.090 0.003 0.029 0.007 0.061 0.011 0.095 0.006 0.040 0.012 0.083 0.019 0.128 0.013 0.090 0.028 0.189 0.045 0.296 0.021 0.101 0.044 0.21 0.068 0.326 0.011 0.058 0.028 0.117 0.044 0.178s0.032 0.123 0.049 0.188c0.009 0.032 0.016 0.065 0.027 0.097s0.021 0.065 0.031 0.098 0.043 0.134 0.065 0.203c0.006 0.017 0.011 0.035 0.017 0.052s0.013 0.034 0.019 0.052 0.026 0.070 0.039 0.105c0.027 0.070 0.053 0.142 0.081 0.215 0.031 0.071 0.062 0.144 0.094 0.218 0.016 0.037 0.032 0.074 0.048 0.111s0.035 0.073 0.053 0.111 0.073 0.148 0.11 0.224c0.039 0.075 0.081 0.149 0.123 0.224 0.021 0.037 0.042 0.075 0.063 0.113s0.045 0.074 0.068 0.112 0.093 0.149 0.14 0.224c0.198 0.295 0.417 0.587 0.66 0.864 0.245 0.275 0.511 0.535 0.792 0.775 0.284 0.236 0.582 0.452 0.886 0.642 0.306 0.188 0.619 0.349 0.928 0.487 0.078 0.032 0.156 0.063 0.232 0.095 0.038 0.015 0.076 0.032 0.115 0.046s0.077 0.027 0.115 0.041 0.151 0.054 0.226 0.078c0.075 0.022 0.15 0.044 0.224 0.066 0.037 0.011 0.073 0.022 0.109 0.031s0.073 0.018 0.109 0.027 0.143 0.035 0.213 0.052c0.070 0.014 0.139 0.027 0.207 0.040 0.034 0.006 0.067 0.013 0.101 0.019 0.017 0.003 0.033 0.006 0.049 0.009s0.033 0.005 0.049 0.007c0.066 0.009 0.13 0.018 0.192 0.027 0.031 0.004 0.062 0.009 0.093 0.013s0.061 0.006 0.091 0.009 0.118 0.010 0.174 0.015c0.056 0.005 0.111 0.011 0.164 0.012 0.004 0 0.007 0 0.011 0 0.010 0.544 0.453 0.982 1 0.982 0.008 0 0.017-0 0.025-0.001v0c0 0 0.001-0 0.004-0 0.061-0.002 0.12-0.009 0.177-0.021 0.027-0.003 0.057-0.007 0.090-0.011 0.029-0.003 0.061-0.007 0.095-0.011 0.040-0.006 0.083-0.012 0.128-0.019 0.090-0.013 0.189-0.028 0.296-0.045 0.101-0.021 0.21-0.044 0.326-0.068 0.058-0.011 0.117-0.028 0.178-0.044s0.123-0.033 0.188-0.049c0.032-0.009 0.065-0.016 0.097-0.027s0.065-0.021 0.098-0.031 0.134-0.043 0.203-0.065c0.017-0.006 0.035-0.011 0.052-0.017s0.034-0.013 0.052-0.019 0.070-0.026 0.105-0.039c0.070-0.027 0.142-0.053 0.215-0.081 0.071-0.031 0.144-0.062 0.218-0.094 0.037-0.016 0.074-0.032 0.111-0.048s0.073-0.035 0.111-0.053 0.148-0.073 0.224-0.11c0.075-0.039 0.149-0.081 0.224-0.123 0.037-0.021 0.075-0.042 0.113-0.063s0.074-0.045 0.112-0.068 0.149-0.093 0.224-0.14c0.295-0.197 0.587-0.417 0.864-0.66 0.275-0.245 0.535-0.511 0.775-0.792 0.236-0.284 0.452-0.582 0.642-0.886 0.188-0.306 0.349-0.619 0.487-0.928 0.032-0.078 0.063-0.156 0.095-0.232 0.015-0.038 0.032-0.076 0.046-0.115s0.027-0.077 0.040-0.115 0.054-0.151 0.078-0.226c0.022-0.075 0.044-0.15 0.066-0.224 0.011-0.037 0.022-0.073 0.031-0.109s0.018-0.073 0.027-0.109 0.035-0.143 0.052-0.213c0.014-0.070 0.027-0.139 0.040-0.207 0.006-0.034 0.013-0.067 0.019-0.101 0.003-0.017 0.006-0.033 0.009-0.049s0.005-0.033 0.007-0.050c0.009-0.065 0.018-0.13 0.027-0.192 0.004-0.031 0.009-0.062 0.013-0.093s0.006-0.061 0.009-0.091 0.010-0.118 0.015-0.174c0.005-0.056 0.011-0.111 0.012-0.165 0-0.008 0.001-0.016 0.001-0.025 0.55-0.002 0.996-0.449 0.996-1 0-0.008-0-0.017-0.001-0.025h0c0 0-0-0.001-0-0.003-0.002-0.061-0.009-0.12-0.021-0.177-0.003-0.027-0.007-0.057-0.011-0.090-0.003-0.029-0.007-0.061-0.011-0.095-0.006-0.040-0.012-0.083-0.019-0.128-0.013-0.090-0.028-0.189-0.045-0.296-0.021-0.101-0.044-0.21-0.068-0.326-0.011-0.058-0.028-0.117-0.044-0.178s-0.032-0.123-0.049-0.188c-0.009-0.032-0.016-0.065-0.027-0.097s-0.021-0.065-0.031-0.098-0.043-0.134-0.065-0.203c-0.005-0.017-0.011-0.035-0.017-0.052s-0.013-0.034-0.019-0.052-0.026-0.070-0.039-0.105c-0.027-0.070-0.053-0.142-0.081-0.215-0.031-0.071-0.062-0.144-0.094-0.218-0.016-0.037-0.032-0.074-0.048-0.111s-0.035-0.073-0.053-0.111-0.073-0.148-0.11-0.224c-0.039-0.075-0.081-0.149-0.123-0.224-0.021-0.037-0.042-0.075-0.063-0.113s-0.045-0.074-0.068-0.112-0.093-0.149-0.14-0.224c-0.197-0.295-0.417-0.587-0.66-0.864-0.245-0.275-0.511-0.535-0.792-0.775-0.284-0.236-0.582-0.452-0.886-0.642-0.306-0.188-0.619-0.349-0.928-0.487-0.078-0.032-0.156-0.063-0.232-0.095-0.038-0.015-0.076-0.032-0.115-0.046s-0.077-0.027-0.115-0.040-0.151-0.054-0.226-0.078c-0.075-0.022-0.15-0.044-0.224-0.066-0.037-0.010-0.073-0.022-0.109-0.031s-0.073-0.018-0.109-0.027-0.143-0.035-0.213-0.052c-0.070-0.014-0.139-0.027-0.207-0.040-0.034-0.006-0.067-0.013-0.101-0.019-0.017-0.003-0.033-0.006-0.049-0.009s-0.033-0.005-0.049-0.007c-0.066-0.009-0.13-0.018-0.192-0.027-0.031-0.004-0.062-0.009-0.093-0.013s-0.061-0.006-0.091-0.009-0.118-0.010-0.174-0.015c-0.056-0.005-0.111-0.011-0.164-0.012-0.013-0-0.026-0.001-0.039-0.001-0.010-0.543-0.454-0.981-0.999-0.981-0.008 0-0.017 0-0.025 0.001l-0-0c0 0-0.001 0-0.003 0-0.061 0.002-0.12 0.009-0.177 0.021-0.027 0.003-0.057 0.007-0.090 0.011-0.029 0.003-0.061 0.007-0.095 0.011-0.040 0.006-0.083 0.012-0.128 0.019-0.090 0.013-0.189 0.028-0.296 0.045-0.101 0.021-0.21 0.044-0.326 0.068-0.058 0.011-0.117 0.028-0.178 0.044s-0.123 0.033-0.188 0.049c-0.032 0.009-0.065 0.016-0.097 0.027s-0.065 0.021-0.098 0.031-0.134 0.043-0.203 0.065c-0.017 0.006-0.035 0.011-0.052 0.017s-0.034 0.013-0.052 0.019-0.070 0.026-0.105 0.039c-0.070 0.027-0.142 0.053-0.215 0.081-0.071 0.031-0.144 0.062-0.218 0.094-0.037 0.016-0.074 0.032-0.111 0.048s-0.073 0.035-0.111 0.053-0.148 0.073-0.224 0.11c-0.075 0.039-0.149 0.081-0.224 0.123-0.037 0.021-0.075 0.042-0.113 0.063s-0.074 0.045-0.112 0.068-0.149 0.093-0.224 0.14c-0.295 0.198-0.587 0.417-0.864 0.66-0.275 0.245-0.535 0.511-0.775 0.792-0.236 0.284-0.452 0.582-0.642 0.886-0.188 0.306-0.349 0.619-0.487 0.928-0.032 0.078-0.063 0.156-0.095 0.232-0.015 0.038-0.032 0.076-0.046 0.115s-0.027 0.077-0.040 0.115-0.054 0.151-0.078 0.226c-0.022 0.075-0.044 0.15-0.066 0.224-0.011 0.037-0.022 0.073-0.032 0.109s-0.018 0.073-0.027 0.109-0.035 0.143-0.052 0.213c-0.014 0.070-0.027 0.139-0.040 0.207-0.006 0.034-0.013 0.067-0.019 0.101-0.003 0.017-0.006 0.033-0.009 0.049s-0.005 0.033-0.007 0.050c-0.009 0.065-0.018 0.13-0.027 0.192-0.004 0.031-0.009 0.062-0.013 0.093s-0.006 0.061-0.009 0.091-0.010 0.118-0.015 0.174c-0.005 0.056-0.011 0.111-0.012 0.165-0 0.009-0.001 0.017-0.001 0.025-0.537 0.017-0.967 0.458-0.967 0.999 0 0.008 0 0.017 0.001 0.025zM1.149 7.011c0.001-0.003 0.001-0.006 0.002-0.009 0.010-0.051 0.026-0.102 0.040-0.155s0.030-0.107 0.045-0.163c0.008-0.028 0.015-0.056 0.024-0.084s0.019-0.057 0.028-0.086 0.038-0.116 0.058-0.176c0.005-0.015 0.010-0.030 0.015-0.045s0.012-0.030 0.017-0.045 0.023-0.060 0.035-0.091 0.048-0.123 0.073-0.186c0.028-0.062 0.056-0.125 0.084-0.189 0.014-0.032 0.028-0.064 0.043-0.096s0.032-0.064 0.048-0.096 0.065-0.128 0.098-0.194c0.034-0.065 0.073-0.128 0.109-0.194 0.018-0.032 0.037-0.065 0.056-0.098s0.040-0.064 0.061-0.096c0.041-0.064 0.082-0.129 0.124-0.194 0.176-0.255 0.369-0.506 0.583-0.744 0.217-0.236 0.451-0.459 0.697-0.665 0.25-0.202 0.511-0.385 0.776-0.547 0.268-0.159 0.541-0.294 0.808-0.41 0.068-0.027 0.135-0.053 0.202-0.079 0.033-0.013 0.066-0.027 0.099-0.038s0.067-0.022 0.1-0.033 0.131-0.045 0.196-0.065c0.065-0.018 0.13-0.036 0.194-0.054 0.032-0.009 0.063-0.019 0.095-0.026s0.063-0.014 0.094-0.021 0.123-0.028 0.184-0.042c0.061-0.011 0.12-0.021 0.179-0.032 0.029-0.005 0.058-0.010 0.087-0.015 0.014-0.003 0.029-0.005 0.043-0.008s0.029-0.003 0.043-0.005c0.056-0.007 0.112-0.014 0.166-0.020 0.027-0.003 0.053-0.007 0.080-0.010s0.053-0.004 0.078-0.006 0.102-0.007 0.15-0.011c0.049-0.003 0.095-0.008 0.142-0.008 0.091-0.002 0.177-0.004 0.256-0.006 0.073 0.003 0.14 0.005 0.2 0.007 0.030 0.001 0.058 0.002 0.085 0.002 0.033 0.002 0.064 0.004 0.093 0.006 0.033 0.002 0.063 0.004 0.091 0.006 0.051 0.008 0.103 0.012 0.156 0.012 0.007 0 0.015-0 0.022-0.001 0.002 0 0.004 0 0.004 0v-0c0.487-0.012 0.887-0.372 0.962-0.84 0.008 0.002 0.017 0.004 0.025 0.006 0.051 0.010 0.102 0.026 0.155 0.040s0.107 0.030 0.163 0.045c0.028 0.008 0.056 0.015 0.084 0.024s0.057 0.019 0.086 0.028 0.116 0.038 0.176 0.058c0.015 0.005 0.030 0.010 0.045 0.015s0.030 0.012 0.045 0.017 0.060 0.023 0.091 0.035 0.123 0.048 0.186 0.073c0.062 0.028 0.125 0.056 0.189 0.084 0.032 0.014 0.064 0.028 0.096 0.043s0.064 0.032 0.096 0.048 0.128 0.065 0.194 0.098c0.065 0.034 0.129 0.073 0.194 0.109 0.032 0.018 0.065 0.037 0.098 0.056s0.064 0.040 0.096 0.061 0.129 0.082 0.194 0.124c0.255 0.176 0.506 0.369 0.744 0.583 0.236 0.217 0.459 0.451 0.665 0.697 0.202 0.25 0.385 0.511 0.547 0.776 0.159 0.268 0.294 0.541 0.41 0.808 0.027 0.068 0.053 0.135 0.079 0.202 0.013 0.033 0.027 0.066 0.038 0.099s0.022 0.067 0.033 0.1 0.045 0.131 0.065 0.196c0.018 0.065 0.036 0.13 0.054 0.194 0.009 0.032 0.019 0.063 0.026 0.095s0.014 0.063 0.021 0.094 0.028 0.123 0.042 0.184c0.011 0.061 0.021 0.12 0.032 0.179 0.005 0.029 0.010 0.058 0.015 0.087 0.003 0.014 0.005 0.029 0.008 0.043s0.003 0.029 0.005 0.043c0.007 0.056 0.014 0.112 0.020 0.166 0.003 0.027 0.007 0.053 0.010 0.080s0.004 0.053 0.006 0.078 0.007 0.102 0.011 0.15c0.003 0.049 0.008 0.095 0.008 0.142 0.002 0.091 0.004 0.177 0.006 0.256-0.003 0.073-0.005 0.14-0.007 0.2-0.001 0.030-0.002 0.058-0.002 0.085-0.002 0.033-0.004 0.064-0.006 0.093-0.002 0.033-0.004 0.063-0.006 0.091-0.008 0.051-0.012 0.103-0.012 0.156 0 0.007 0 0.015 0.001 0.022-0 0.002-0 0.004-0 0.004h0c0.012 0.481 0.363 0.877 0.823 0.959-0.001 0.005-0.002 0.009-0.003 0.014-0.010 0.051-0.025 0.102-0.040 0.155s-0.030 0.107-0.045 0.163c-0.008 0.028-0.015 0.056-0.024 0.084s-0.019 0.057-0.028 0.086-0.039 0.116-0.058 0.176c-0.005 0.015-0.010 0.030-0.015 0.045s-0.012 0.030-0.017 0.045-0.023 0.060-0.035 0.091-0.048 0.123-0.073 0.186c-0.028 0.062-0.056 0.125-0.084 0.189-0.014 0.032-0.028 0.064-0.043 0.096s-0.032 0.064-0.048 0.096-0.065 0.128-0.098 0.194c-0.034 0.065-0.073 0.129-0.109 0.194-0.018 0.032-0.037 0.065-0.056 0.098s-0.040 0.064-0.061 0.096-0.082 0.129-0.124 0.194c-0.176 0.255-0.369 0.506-0.583 0.744-0.217 0.236-0.451 0.459-0.697 0.665-0.25 0.202-0.511 0.385-0.776 0.547-0.268 0.159-0.541 0.294-0.808 0.41-0.068 0.027-0.135 0.053-0.202 0.079-0.033 0.013-0.066 0.027-0.099 0.038s-0.067 0.022-0.1 0.033-0.131 0.045-0.196 0.065c-0.065 0.018-0.13 0.036-0.194 0.054-0.032 0.009-0.063 0.019-0.095 0.026s-0.063 0.014-0.094 0.021-0.123 0.028-0.184 0.042c-0.061 0.011-0.12 0.021-0.179 0.032-0.029 0.005-0.058 0.010-0.087 0.015-0.014 0.003-0.028 0.005-0.043 0.008s-0.029 0.003-0.043 0.005c-0.056 0.007-0.112 0.014-0.166 0.020-0.027 0.003-0.053 0.007-0.080 0.010s-0.053 0.004-0.078 0.006-0.102 0.007-0.15 0.011c-0.049 0.003-0.095 0.008-0.142 0.008-0.091 0.002-0.177 0.004-0.256 0.006-0.073-0.003-0.14-0.005-0.2-0.007-0.030-0.001-0.058-0.002-0.085-0.002-0.033-0.002-0.064-0.004-0.093-0.006-0.033-0.002-0.063-0.004-0.091-0.006-0.051-0.008-0.103-0.012-0.156-0.012-0.007 0-0.015 0-0.022 0.001-0.002-0-0.003-0-0.003-0v0c-0.484 0.012-0.883 0.369-0.961 0.834-0.050-0.010-0.101-0.025-0.153-0.039s-0.107-0.030-0.163-0.045c-0.028-0.008-0.056-0.015-0.084-0.024s-0.057-0.019-0.086-0.028-0.116-0.039-0.176-0.058c-0.015-0.005-0.030-0.010-0.045-0.015s-0.030-0.012-0.045-0.017-0.060-0.023-0.091-0.035-0.123-0.048-0.186-0.073c-0.062-0.028-0.125-0.056-0.189-0.084-0.032-0.014-0.064-0.028-0.096-0.043s-0.064-0.032-0.096-0.048-0.128-0.065-0.194-0.098c-0.065-0.034-0.129-0.073-0.194-0.109-0.032-0.018-0.065-0.037-0.098-0.056s-0.064-0.040-0.096-0.061c-0.064-0.041-0.129-0.082-0.194-0.124-0.255-0.175-0.506-0.369-0.744-0.583-0.236-0.217-0.459-0.451-0.665-0.697-0.202-0.25-0.385-0.511-0.547-0.776-0.159-0.268-0.294-0.541-0.41-0.808-0.027-0.068-0.053-0.135-0.079-0.202-0.013-0.033-0.027-0.066-0.038-0.099s-0.022-0.067-0.033-0.1-0.045-0.131-0.065-0.196c-0.018-0.065-0.036-0.13-0.054-0.194-0.009-0.032-0.019-0.063-0.026-0.095s-0.014-0.063-0.021-0.094-0.028-0.123-0.042-0.184c-0.011-0.061-0.021-0.12-0.032-0.179-0.005-0.029-0.010-0.058-0.015-0.087-0.003-0.014-0.005-0.028-0.008-0.043s-0.003-0.029-0.005-0.043c-0.007-0.056-0.014-0.112-0.020-0.166-0.003-0.027-0.007-0.053-0.010-0.080s-0.004-0.053-0.006-0.078-0.007-0.101-0.011-0.15c-0.003-0.049-0.008-0.095-0.008-0.142-0.002-0.091-0.004-0.177-0.006-0.256 0.003-0.073 0.005-0.14 0.007-0.2 0.001-0.030 0.002-0.058 0.002-0.085 0.002-0.033 0.004-0.064 0.006-0.093 0.002-0.033 0.004-0.063 0.006-0.091 0.008-0.051 0.012-0.103 0.012-0.156 0-0.007-0-0.015-0.001-0.022 0-0.002 0-0.003 0-0.003h-0c-0.012-0.49-0.377-0.893-0.851-0.964z"></path><path class="[CURRENT_ICON_CLASS]-7" d="M16 6.5l-3.527-0.353 2.245-2.743-2.121-2.121-2.743 2.245-0.353-3.527h-3l-0.353 3.527-2.743-2.245-2.121 2.121 2.245 2.743-3.527 0.353v3l3.527 0.353-2.245 2.743 2.121 2.121 2.743-2.245 0.353 3.527h3l0.353-3.527 2.743 2.245 2.121-2.121-2.245-2.743 3.527-0.353v-3zM11 6.757v2.485l-1.757 1.757h-2.485l-1.757-1.757v-2.485l1.757-1.757h2.485l1.757 1.757z"></path><path class="[CURRENT_ICON_CLASS]-8" d="M13.657 2.343c-1.448-1.448-3.447-2.343-5.657-2.343-3.429 0-6.355 2.158-7.492 5.19l1.873 0.702c0.853-2.274 3.047-3.893 5.619-3.893 1.657 0 3.157 0.672 4.242 1.758l-2.242 2.242h6v-6l-2.343 2.343zM8 14c-1.657 0-3.157-0.672-4.242-1.758l2.242-2.242h-6v6l2.344-2.344c1.448 1.448 3.447 2.344 5.656 2.344 3.43 0 6.355-2.158 7.492-5.19l-1.873-0.702c-0.853 2.274-3.047 3.893-5.619 3.893z"></path><path class="[CURRENT_ICON_CLASS]-9" d="M8 3.25c-1.566 0-2.962 0.731-3.849 1.863l-1.2-0.9c1.161-1.496 2.992-2.464 5.048-2.464v-1.75l2.5 2.5-2.5 2.5v-1.75zM8 12.75c1.566 0 2.962-0.731 3.849-1.863l1.2 0.9c-1.161 1.496-2.992 2.464-5.048 2.464v1.75l-2.5-2.5 2.5-2.5v1.75zM3.15 8c0 1.568 0.78 2.961 1.98 3.827l-0.9 1.2c-1.564-1.139-2.58-2.968-2.58-5.026h-1.65l2.5-2.5 2.5 2.5h-1.85zM14.35 8h1.65l-2.5 2.5-2.5-2.5h1.85c0-1.568-0.78-2.961-1.98-3.827l0.9-1.2c1.564 1.139 2.58 2.968 2.58 5.026z"></path><path class="[CURRENT_ICON_CLASS]-10" d="M12.999 3.23v0 0zM13.032 8c1.631-1.56 2.423-3.087 1.896-4-0.301-0.521-0.99-0.77-1.929-0.77v0.75c0.659 0 1.137 0.148 1.28 0.395 0.113 0.195 0.050 0.496-0.023 0.713-0.139 0.417-0.442 0.917-0.876 1.444-0.263 0.32-0.567 0.643-0.904 0.963-0.465-0.402-0.982-0.801-1.544-1.188-0.055-0.679-0.142-1.327-0.257-1.93 0.878-0.26 1.675-0.397 2.323-0.397l0-0.75c-0 0-0 0-0 0-0.706 0-1.553 0.141-2.482 0.413-0.535-2.192-1.462-3.642-2.516-3.642s-1.981 1.45-2.516 3.642c-0.929-0.271-1.777-0.412-2.482-0.412-0.939 0-1.629 0.249-1.93 0.77-0.527 0.913 0.265 2.44 1.896 4-1.631 1.559-2.423 3.087-1.896 4 0.301 0.521 0.99 0.77 1.93 0.77 0.706 0 1.553-0.141 2.482-0.412 0.535 2.192 1.462 3.642 2.516 3.642s1.981-1.45 2.516-3.642c0.929 0.271 1.777 0.412 2.482 0.412 0.939 0 1.629-0.249 1.93-0.77 0.527-0.913-0.265-2.441-1.896-4zM11.915 8c-0.291 0.248-0.601 0.493-0.927 0.734 0.008-0.242 0.013-0.487 0.013-0.734s-0.004-0.492-0.013-0.734c0.327 0.241 0.637 0.486 0.927 0.734zM9.958 11.389c-0.36-0.128-0.728-0.274-1.098-0.435 0.213-0.113 0.426-0.232 0.64-0.355s0.424-0.25 0.63-0.378c-0.045 0.403-0.103 0.793-0.172 1.169zM9.125 9.949c-0.372 0.214-0.748 0.416-1.125 0.603-0.377-0.187-0.753-0.389-1.125-0.603-0.375-0.216-0.737-0.441-1.086-0.672-0.026-0.417-0.039-0.844-0.039-1.277s0.013-0.859 0.039-1.276c0.349-0.231 0.711-0.456 1.086-0.672 0.372-0.215 0.748-0.416 1.125-0.603 0.377 0.187 0.753 0.389 1.125 0.603 0.375 0.216 0.737 0.441 1.086 0.672 0.026 0.417 0.039 0.844 0.039 1.276s-0.013 0.859-0.039 1.277c-0.349 0.231-0.711 0.456-1.086 0.672zM5.87 10.22c0.205 0.128 0.415 0.254 0.63 0.378s0.427 0.242 0.64 0.355c-0.37 0.162-0.738 0.307-1.098 0.435-0.069-0.375-0.127-0.766-0.172-1.168zM5.013 8.734c-0.327-0.241-0.637-0.486-0.927-0.734 0.291-0.248 0.601-0.494 0.927-0.734-0.008 0.242-0.013 0.487-0.013 0.734s0.004 0.492 0.013 0.734zM6.042 4.612c0.36 0.128 0.728 0.274 1.098 0.435-0.213 0.113-0.426 0.232-0.64 0.355s-0.424 0.25-0.63 0.378c0.045-0.403 0.103-0.793 0.172-1.168zM9.5 5.402c-0.214-0.123-0.427-0.242-0.64-0.355 0.37-0.162 0.738-0.307 1.098-0.435 0.069 0.375 0.127 0.766 0.172 1.168-0.205-0.128-0.415-0.254-0.63-0.378zM6.581 2.607c0.24-0.639 0.521-1.151 0.813-1.48 0.152-0.172 0.381-0.376 0.607-0.376s0.454 0.205 0.607 0.376c0.292 0.329 0.573 0.841 0.813 1.48 0.146 0.388 0.273 0.812 0.382 1.265-0.58 0.202-1.185 0.45-1.801 0.743-0.616-0.292-1.221-0.541-1.801-0.743 0.109-0.453 0.237-0.877 0.382-1.265zM2.62 6.532c-0.434-0.527-0.736-1.026-0.876-1.444-0.073-0.218-0.135-0.518-0.023-0.713 0.143-0.247 0.621-0.395 1.28-0.395h0c0.648 0 1.445 0.137 2.323 0.397-0.115 0.603-0.202 1.251-0.257 1.93-0.561 0.387-1.079 0.787-1.544 1.188-0.338-0.321-0.641-0.643-0.904-0.963zM3.002 12.020c-0.659 0-1.137-0.148-1.28-0.395-0.113-0.195-0.050-0.496 0.023-0.713 0.139-0.417 0.442-0.917 0.876-1.444 0.263-0.32 0.567-0.643 0.904-0.963 0.465 0.402 0.982 0.801 1.544 1.188 0.055 0.679 0.142 1.327 0.257 1.93-0.878 0.26-1.675 0.397-2.323 0.397zM9.419 13.393c-0.24 0.639-0.521 1.151-0.813 1.48-0.152 0.172-0.381 0.376-0.607 0.376s-0.454-0.205-0.607-0.376c-0.292-0.329-0.573-0.841-0.813-1.48-0.146-0.388-0.273-0.812-0.382-1.265 0.58-0.202 1.185-0.45 1.801-0.743 0.616 0.292 1.221 0.541 1.801 0.743-0.109 0.453-0.236 0.877-0.382 1.265zM14.256 10.912c0.073 0.218 0.135 0.518 0.023 0.713-0.143 0.248-0.622 0.395-1.28 0.395-0.648 0-1.445-0.137-2.323-0.397 0.115-0.603 0.202-1.251 0.257-1.93 0.561-0.387 1.079-0.787 1.544-1.188 0.338 0.321 0.641 0.643 0.904 0.963 0.434 0.527 0.736 1.027 0.876 1.444zM6.75 8c0-0.69 0.56-1.25 1.25-1.25s1.25 0.56 1.25 1.25c0 0.69-0.56 1.25-1.25 1.25s-1.25-0.56-1.25-1.25z"></path><path class="[CURRENT_ICON_CLASS]-11" d="M7.282 8.718l-5-5-2.282 2.282v-6h6l-2.282 2.282 5 5zM8 0c4.418 0 8 3.582 8 8s-3.582 8-8 8c-4.418 0-8-3.582-8-8h2c0 3.314 2.686 6 6 6s6-2.686 6-6c0-3.314-2.686-6-6-6v-2z"></path></svg>',slideshow:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path class="[ICON_CLASS]-play-default" d="M15.28 8.277l-11.857 6.589q-0.205 0.116-0.353 0.027t-0.147-0.321v-13.143q0-0.232 0.147-0.321t0.353 0.027l11.857 6.589q0.205 0.116 0.205 0.277t-0.205 0.277z"></path><path class="[ICON_CLASS]-play-flat" d="M4.8 3.677l7.313 4.656-7.313 4.656v-9.313z"></path><path class="[ICON_CLASS]-pause-default" d="M14.86 1.714v12.571q0 0.232-0.17 0.402t-0.402 0.17h-4.571q-0.232 0-0.402-0.17t-0.17-0.402v-12.571q0-0.232 0.17-0.402t0.402-0.17h4.571q0.232 0 0.402 0.17t0.17 0.402zM6.841 1.714v12.571q0 0.232-0.17 0.402t-0.402 0.17h-4.571q-0.232 0-0.402-0.17t-0.17-0.402v-12.571q0-0.232 0.17-0.402t0.402-0.17h4.571q0.232 0 0.402 0.17t0.17 0.402z"></path><path class="[ICON_CLASS]-pause-flat" d="M9.344 3.677h2.656v9.313h-2.656v-9.313zM4 12.99v-9.313h2.656v9.313h-2.656z"></path></svg>',fullscreen:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path class="[ICON_CLASS]-maximize-default" d="M16 0v6l-2.16-2.16-3.313 3.313-1.679-1.679 3.313-3.313-2.16-2.16zM3.84 2.16l3.313 3.313-1.679 1.679-3.313-3.313-2.16 2.16v-6h6zM13.84 12.16l2.16-2.16v6h-6l2.16-2.16-3.313-3.313 1.679-1.679zM7.152 10.527l-3.313 3.313 2.16 2.16h-6v-6l2.16 2.16 3.313-3.313z"></path><path class="[ICON_CLASS]-maximize-flat" d="M11.333 1h2q0.828 0 1.414 0.586t0.586 1.414v2q0 0.276-0.195 0.471t-0.471 0.195-0.471-0.195-0.195-0.471v-2q0-0.276-0.195-0.471t-0.471-0.195h-2q-0.276 0-0.471-0.195t-0.195-0.471 0.195-0.471 0.471-0.195zM1.333 11q0.276 0 0.471 0.195t0.195 0.471v2q0 0.276 0.195 0.471t0.471 0.195h2q0.276 0 0.471 0.195t0.195 0.471-0.195 0.471-0.471 0.195h-2q-0.828 0-1.414-0.586t-0.586-1.414v-2q0-0.276 0.195-0.471t0.471-0.195zM2.667 1h2q0.276 0 0.471 0.195t0.195 0.471-0.195 0.471-0.471 0.195h-2q-0.276 0-0.471 0.195t-0.195 0.471v2q0 0.276-0.195 0.471t-0.471 0.195-0.471-0.195-0.195-0.471v-2q0-0.828 0.586-1.414t1.414-0.586zM14.667 11q0.276 0 0.471 0.195t0.195 0.471v2q0 0.828-0.586 1.414t-1.414 0.586h-2q-0.276 0-0.471-0.195t-0.195-0.471 0.195-0.471 0.471-0.195h2q0.276 0 0.471-0.195t0.195-0.471v-2q0-0.276 0.195-0.471t0.471-0.195z"></path><path class="[ICON_CLASS]-minimize-default" d="M1 9h6v6l-2.16-2.16-3.156 3.156-1.679-1.679 3.156-3.156zM12.84 11.16l3.156 3.156-1.679 1.679-3.156-3.156-2.16 2.16v-6h6zM15 7h-6v-6l2.16 2.16 3.156-3.156 1.679 1.679-3.156 3.156zM4.84 3.16l2.16-2.16v6h-6l2.16-2.16-3.156-3.156 1.679-1.679z"></path><path class="[ICON_CLASS]-minimize-flat" d="M11.333 1q0.276 0 0.471 0.195t0.195 0.471v2q0 0.276 0.195 0.471t0.471 0.195h2q0.276 0 0.471 0.195t0.195 0.471-0.195 0.471-0.471 0.195h-2q-0.828 0-1.414-0.586t-0.586-1.414v-2q0-0.276 0.195-0.471t0.471-0.195zM1.333 11h2q0.828 0 1.414 0.586t0.586 1.414v2q0 0.276-0.195 0.471t-0.471 0.195-0.471-0.195-0.195-0.471v-2q0-0.276-0.195-0.471t-0.471-0.195h-2q-0.276 0-0.471-0.195t-0.195-0.471 0.195-0.471 0.471-0.195zM4.667 1q0.276 0 0.471 0.195t0.195 0.471v2q0 0.828-0.586 1.414t-1.414 0.586h-2q-0.276 0-0.471-0.195t-0.195-0.471 0.195-0.471 0.471-0.195h2q0.276 0 0.471-0.195t0.195-0.471v-2q0-0.276 0.195-0.471t0.471-0.195zM12.667 11h2q0.276 0 0.471 0.195t0.195 0.471-0.195 0.471-0.471 0.195h-2q-0.276 0-0.471 0.195t-0.195 0.471v2q0 0.276-0.195 0.471t-0.471 0.195-0.471-0.195-0.195-0.471v-2q0-0.828 0.586-1.414t1.414-0.586z"></path></svg>',social:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M13.5 11c-0.706 0-1.342 0.293-1.797 0.763l-6.734-3.367c0.021-0.129 0.032-0.261 0.032-0.396s-0.011-0.267-0.032-0.396l6.734-3.367c0.455 0.47 1.091 0.763 1.797 0.763 1.381 0 2.5-1.119 2.5-2.5s-1.119-2.5-2.5-2.5-2.5 1.119-2.5 2.5c0 0.135 0.011 0.267 0.031 0.396l-6.734 3.367c-0.455-0.47-1.091-0.763-1.797-0.763-1.381 0-2.5 1.119-2.5 2.5s1.119 2.5 2.5 2.5c0.706 0 1.343-0.293 1.797-0.763l6.734 3.367c-0.021 0.129-0.031 0.261-0.031 0.396 0 1.381 1.119 2.5 2.5 2.5s2.5-1.119 2.5-2.5c0-1.381-1.119-2.5-2.5-2.5z"></path></svg>',buffer:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M0 12.448q0.176-0.24 0.504-0.408t0.784-0.32 0.648-0.248q0.304 0 0.536 0.072t0.536 0.24 0.4 0.2q0.752 0.336 4.16 1.904 0.304 0.064 0.568 0t0.632-0.28 0.384-0.232q0.32-0.144 1.224-0.552t1.4-0.632q0.064-0.032 0.664-0.336t0.968-0.384q0.208-0.032 0.44 0.016t0.376 0.12 0.368 0.208 0.288 0.168 0.248 0.096 0.296 0.128 0.176 0.176q0.048 0.064 0.064 0.224-0.16 0.208-0.496 0.384t-0.816 0.352-0.64 0.256q-0.688 0.32-2.056 0.984t-2.056 0.984q-0.112 0.048-0.336 0.184t-0.376 0.208-0.408 0.176-0.44 0.112-0.472-0.024l-4.224-1.968q-0.096-0.048-0.512-0.224t-0.824-0.352-0.856-0.384-0.744-0.376-0.344-0.264q-0.064-0.064-0.064-0.208zM0 8.16q0.176-0.24 0.504-0.4t0.8-0.32 0.664-0.24q0.304 0 0.544 0.072t0.552 0.24 0.408 0.216q0.672 0.304 2.024 0.928t2.040 0.944q0.304 0.080 0.592 0.008t0.624-0.272 0.4-0.232q1.088-0.512 2.56-1.152 0.176-0.080 0.504-0.264t0.616-0.312 0.576-0.176q0.256-0.048 0.504 0.016t0.6 0.272 0.368 0.208q0.080 0.048 0.248 0.104t0.288 0.128 0.184 0.168q0.048 0.080 0.064 0.224-0.16 0.224-0.504 0.408t-0.84 0.36-0.656 0.256q-0.768 0.368-2.168 1.040t-1.96 0.944q-0.112 0.048-0.416 0.224t-0.464 0.24-0.52 0.16-0.568 0q-3.424-1.616-4.16-1.952-0.096-0.048-0.704-0.304t-1.112-0.48-0.984-0.472-0.544-0.36q-0.064-0.064-0.064-0.224zM0 3.888q0.16-0.24 0.504-0.424t0.84-0.36 0.656-0.256l5.568-2.592q0.48 0 0.856 0.112t0.904 0.416 0.64 0.352q0.624 0.288 1.872 0.872t1.872 0.872q0.064 0.032 0.584 0.24t0.872 0.384 0.432 0.32q0.048 0.064 0.064 0.208-0.144 0.208-0.416 0.36t-0.696 0.304-0.552 0.216q-0.752 0.352-2.24 1.064t-2.224 1.064q-0.096 0.048-0.32 0.176t-0.368 0.2-0.4 0.168-0.432 0.096-0.448-0.016q-3.92-1.824-4.096-1.904-0.064-0.032-1.008-0.44t-1.632-0.744-0.768-0.48q-0.064-0.064-0.064-0.208z"></path></svg>',digg:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="18" height="16" viewBox="0 0 18 16"><path d="M-0.016 12.032v-5.952q0-0.208 0.208-0.208h2.816v-2.064q0-0.224 0.208-0.224h1.568v8.224q0 0.224-0.192 0.224h-4.608zM1.728 10.704h1.072q0.208 0 0.208-0.224v-3.296h-1.072q-0.208 0-0.208 0.224v3.296zM5.328 12.032v-5.952q0-0.208 0.208-0.208h1.568v5.936q0 0.224-0.192 0.224h-1.584zM5.328 4.912v-1.104q0-0.224 0.192-0.224h1.584v1.104q0 0.224-0.192 0.224h-1.584zM7.712 12.032v-5.952q0-0.208 0.208-0.208h4.608v8.064q0 0.208-0.208 0.208h-4.608l0.016-1.104q0-0.224 0.192-0.224h2.816v-0.784h-3.024zM9.472 10.704h1.072q0.192 0 0.192-0.224v-3.296h-1.072q-0.192 0-0.192 0.224v3.296zM13.136 13.040q0-0.224 0.208-0.224h2.816v-0.784h-3.024v-5.952q0-0.208 0.208-0.208h4.592v8.064q0 0.208-0.192 0.208h-4.608v-1.104zM14.88 10.704h1.072q0.208 0 0.208-0.224v-3.296h-1.072q-0.208 0-0.208 0.224v3.296z"></path></svg>',facebook:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="13" height="16" viewBox="0 0 13 16"><path d="M4.475 8.336v-3.056h2.464v-1.536q0-1.664 1.080-2.832t2.616-1.168h2.448v3.056h-2.448q-0.24 0-0.432 0.264t-0.192 0.648v1.568h3.072v3.056h-3.072v7.408h-3.072v-7.408h-2.464z"></path></svg>',linkedin:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="17" height="16" viewBox="0 0 17 16"><path d="M-0.080 1.686q0-0.799 0.559-1.319t1.455-0.52q0.879 0 1.423 0.512 0.559 0.528 0.559 1.375 0 0.767-0.543 1.279-0.559 0.528-1.471 0.528h-0.016q-0.879 0-1.423-0.528t-0.543-1.327zM0.128 15.673v-10.678h3.549v10.678h-3.549zM5.643 15.673h3.549v-5.963q0-0.559 0.128-0.863 0.224-0.543 0.679-0.919t1.143-0.376q1.79 0 1.79 2.414v5.707h3.549v-6.122q0-2.366-1.119-3.589t-2.957-1.223q-2.062 0-3.213 1.774v0.032h-0.016l0.016-0.032v-1.519h-3.549q0.032 0.512 0.032 3.181t-0.032 7.497z"></path></svg>',pinterest:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="13" height="16" viewBox="0 0 13 16"><path d="M0 5.792q0-1.008 0.424-2t1.216-1.84 2.080-1.376 2.856-0.528q2.544 0 4.176 1.568t1.632 3.696q0 2.736-1.384 4.52t-3.576 1.784q-0.72 0-1.352-0.336t-0.888-0.816l-0.64 2.528q-0.080 0.304-0.208 0.616t-0.28 0.6-0.304 0.544-0.304 0.48-0.264 0.376-0.208 0.264l-0.096 0.128q-0.048 0.064-0.128 0.048t-0.096-0.096q0-0.016-0.024-0.224t-0.048-0.44-0.048-0.6-0.016-0.712 0.048-0.76 0.12-0.768q0.176-0.752 1.184-5.008-0.128-0.256-0.208-0.616t-0.080-0.584l-0.016-0.24q0-1.024 0.52-1.704t1.256-0.68q0.592 0 0.92 0.392t0.328 0.984q0 0.368-0.136 0.904t-0.36 1.232-0.32 1.128q-0.16 0.72 0.28 1.248t1.176 0.528q1.264 0 2.088-1.432t0.824-3.464q0-1.552-1.008-2.536t-2.816-0.984q-2.016 0-3.272 1.296t-1.256 3.104q0 1.072 0.608 1.808 0.208 0.24 0.128 0.512-0.032 0.080-0.096 0.368t-0.096 0.368q-0.032 0.176-0.16 0.232t-0.288-0.008q-0.944-0.384-1.416-1.32t-0.472-2.184z"></path></svg>',reddit:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="19" height="16" viewBox="0 0 19 16"><path d="M0 7.696q0-0.992 0.792-1.696t1.8-0.704q0.992 0 1.68 0.576h0.080q2.144-1.312 5.36-1.312l0.080-0.064 1.12-4.272 3.872 0.576q0 0.016 0.032 0.016 0.016 0 0-0.016 0.032-0.016 0.184-0.248t0.232-0.296q0.544-0.512 1.312-0.512 0.784 0 1.32 0.52t0.536 1.304-0.536 1.344-1.32 0.56q-0.912 0-1.392-0.616t-0.48-1.544q-0.032 0.016-1.56-0.208t-1.752-0.272h-0.048q-0.032 0.032-0.264 0.856t-0.48 1.744-0.28 1.016v0.048l0.080 0.064q1.152 0 2.36 0.328t2.088 0.92l0.048 0.032q0.016-0.016 0.032-0.016t0.032-0.016q0.4-0.288 0.568-0.4t0.472-0.208 0.688-0.096q1.088 0 1.856 0.768t0.768 1.872q0 0.752-0.424 1.376t-1.112 0.96q0 3.12-4.16 4.848-0.656 0.288-0.896 0.368-0.512 0.16-1.456 0.304t-1.488 0.144q-1.92 0-3.696-0.56-0.032-0.032-1.152-0.608-1.52-0.816-2.44-1.856t-0.92-2.496h-0.080q-0.528-0.272-0.944-0.8l-0.144-0.192q-0.24-0.432-0.304-0.728t-0.064-0.808zM0.544 7.888q0 1.056 0.912 1.792 0.080-0.944 0.768-1.856t1.616-1.616q-0.592-0.416-1.312-0.416-0.784 0-1.384 0.648t-0.6 1.448zM2.176 10.224q0 0.864 0.496 1.664t1.272 1.368 1.64 0.952 1.68 0.544q1.2 0.224 2.336 0.224 1.968 0 3.728-0.632t2.96-1.96h-0.048q0.48-0.608 0.688-1.096t0.208-1.16q0-0.864-0.424-1.648t-1.112-1.344-1.472-0.968-1.6-0.616q-1.36-0.368-2.896-0.368-1.184 0-2.424 0.288t-2.4 0.864-1.896 1.592-0.736 2.296zM5.152 9.056q0-0.592 0.36-0.952t0.952-0.36 0.992 0.36 0.4 0.952q0 0.576-0.408 0.96t-0.984 0.384-0.944-0.384-0.368-0.96zM5.728 11.68h0.704q0.4 0.72 1.272 1.096t1.784 0.376q0.928 0 1.76-0.376t1.344-1.096h0.656q-0.4 0.992-1.488 1.536t-2.272 0.544q-1.152 0-2.264-0.552t-1.496-1.528zM11.104 9.056q0-0.608 0.368-0.96t0.976-0.352q0.544 0 0.928 0.384t0.384 0.928-0.384 0.944-0.928 0.4q-0.592 0-0.968-0.376t-0.376-0.968zM15.184 1.568q0 0.56 0.4 0.96t0.96 0.4q0.576 0 0.944-0.392t0.368-0.968q0-0.544-0.384-0.928t-0.928-0.384-0.952 0.392-0.408 0.92zM15.408 6.064q0.88 0.576 1.52 1.48t0.896 1.912q0.944-0.688 0.944-1.536 0-0.928-0.568-1.6t-1.48-0.672q-0.72 0-1.312 0.416z"></path></svg>',tumblr:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="10" height="16" viewBox="0 0 10 16"><path d="M0 6.304v-2.272q0.96-0.32 1.616-0.88 0.656-0.528 1.072-1.376 0.416-0.816 0.56-2.032h2.288v4.048h3.792v2.512h-3.792v4.096q0 1.376 0.144 1.792 0.144 0.384 0.544 0.624 0.544 0.32 1.216 0.32 1.232 0 2.416-0.784v2.512q-1.008 0.496-1.856 0.688-0.832 0.192-1.792 0.192-1.088 0-1.952-0.272-0.88-0.304-1.424-0.8-0.576-0.496-0.832-1.088-0.224-0.544-0.224-1.68v-5.6h-1.776z"></path></svg>',twitter:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="20" height="16" viewBox="0 0 20 16"><path d="M0 14.185q0.479 0.048 0.959 0.048 2.813 0 5.018-1.726-1.31-0.016-2.349-0.799t-1.422-1.998q0.32 0.064 0.751 0.064 0.559 0 1.071-0.144-1.406-0.272-2.325-1.382t-0.919-2.565v-0.048q0.847 0.479 1.838 0.495-0.831-0.543-1.318-1.43t-0.487-1.926q0-1.087 0.559-2.030 1.502 1.87 3.668 2.98t4.642 1.239q-0.112-0.527-0.112-0.927 0-1.662 1.183-2.845t2.861-1.183q1.742 0 2.94 1.278 1.39-0.288 2.557-0.991-0.447 1.454-1.758 2.237 1.167-0.144 2.301-0.639-0.767 1.199-1.998 2.093v0.527q0 1.614-0.471 3.236t-1.438 3.1-2.309 2.629-3.22 1.83-4.035 0.679q-3.34 0-6.185-1.806z"></path></svg>',email:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M15 2h-14c-0.55 0-1 0.45-1 1v10c0 0.55 0.45 1 1 1h14c0.55 0 1-0.45 1-1v-10c0-0.55-0.45-1-1-1zM14 4v0.719l-6 3.536-6-3.536v-0.719h12zM2 12v-5.54l6 3.536 6-3.536v5.54h-12z"></path></svg>',download:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M8 9l4-4h-3v-4h-2v4h-3zM11.636 7.364l-1.121 1.121 4.064 1.515-6.579 2.453-6.579-2.453 4.064-1.515-1.121-1.121-4.364 1.636v4l8 3 8-3v-4z"></path></svg>'}},this.getGroup=function(e){var o="default",t=n.extend(!0,{},this.registered.default);return"string"==typeof e&&this.registered.hasOwnProperty(e)&&n.extend(!0,t,this.registered[e]),"object"==typeof e&&(o="custom",n.extend(!0,t,this.registered.default,e)),{name:o,icons:t}},this.get=function(e,o){var t=this,o=t.getGroup(o),i="string"==typeof e&&o.icons.hasOwnProperty(e)?o.icons[e].replace(/\[ICON_CLASS]/g,t.className).replace(/\[CURRENT_ICON_CLASS]/g,t.className+"-"+e):null,e=[!1,e,o.name].map(function(e){return!1===e?t.className:t.className+"-"+e}).join(" ");return n(i).attr("class",e)},this},e.icons=new e.Icons}(jQuery,window.FooBox),function(s,d){d.Instance=function(e){this.id=null,"number"==typeof e?(this.id=e,d.instances[e-1]=this):this.id=d.instances.push(this),this.element=null,this.options=s.extend(!0,{},d.defaults),this.modal=new d.Modal(this),this.objects={},d.addons.load(this),d.handlers.load(this);var l=this;return this.raise=function(e,o){return d.raise(l,e,o)},this.init=function(e,o){l.element=d.isjQuery(e)?e:s(e),l.options=d.options.merge(l.options,o||{}),d.addons.call(l,"preinit",l.element,l.options),l.items.init(),0<l.items.array.length?(l.element.data("fbx_instance",l),l.options.containerCssClass&&l.element.addClass(l.options.containerCssClass),l.setup.bind(),l.modal.init(e,l.options),d.handlers.call(l,"init",l.element,l.options),l.raise("foobox.initialized"),d.isFn(l.options.initCallback)&&l.options.initCallback.call(l)):l.destroy()},this.reinit=function(e){l.options=d.options.merge(l.options,e||{}),l.items.init(!0),0<l.items.array.length?(l.setup.bind(),l.modal.reinit(l.options),d.handlers.call(l,"reinit",l.options),l.raise("foobox.reinitialized")):l.destroy()},this.destroy=function(){d.addons.call(l,"destroy"),d.handlers.call(l,"destroy"),l.items.destroy(),l.modal.destroy(),l.element.removeClass("fbx-instance fbx-item").data({fbx_instance:null,fbx_p_instance:null}),l.id==d.instances.length?d.instances.splice(l.id-1,1):d.instances[l.id-1]=null,l.raise("foobox.destroy")},this.setup={bind:function(){s(l.options.externalSelector).off("click.fooboxExternal").on("click.fooboxExternal",function(e){e.preventDefault();var e=s(this).data("foobox"),e=s(e),o=e.data("fbx_instance")||e.data("fbx_p_instance");return 0<e.length&&o instanceof d.Instance&&o.modal instanceof d.Modal&&o.modal.show(!0),!1})}},this.items={array:[],indexes:{prev:-1,current:0,next:1,direction:"*",set:function(e){var o=l.items.indexes.current,t=(e=(e=e||0)>l.items.array.length-1?0:e<0?l.items.array.length-1:e)-1,i=e+1;l.items.indexes.current=e,l.items.indexes.prev=t<0?l.items.array.length-1:t,l.items.indexes.next=i>l.items.array.length-1?0:i,l.items.indexes.direction=l.items.indexes._direction(o,e,l.items.array.length-1)},_direction:function(e,o,t){return 0==o&&e==t?">":o==t&&0==e?"<":e<o?">":o<e?"<":"*"}},new_array:function(e){var o,t,i=0;if(1==(e=e||!1)){if(0<l.items.array.length){for(var n=0;n<l.items.array.length;n++)o=l.items.array[n],d.isjQuery(o.element)?0==o.element.parents(":first").length&&(l.items.array.splice(n,1),--n):o.option||(l.items.array.splice(n,1),--n);for(var s=0;s<l.items.array.length;s++)o=l.items.array[s],d.isjQuery(o.element)?o.element.get(0).index=o.index=s:o.index=s}}else l.items.array=[];if(d.isArray(l.options.items))for(var a=0;a<l.options.items.length;a++)if(o=l.options.items[a],-1==l.items.indexOf(o))for(var r=0;r<l.objects.handlers.length;r++)if(l.objects.handlers[r].type==o.type){o.index=i,o.option=!0,o.handler=l.objects.handlers[r],o.handler.defaults(o),t=l.raise("foobox.parseItem",{element:null,item:o}),l.items.array.push(t.fb.item),i++;break}},init:function(e){l.items.new_array(e=e||!1);l.element.is(l.options.selector)&&!l.element.is(l.options.excludes)&&l.items.add(l.element)?l.element.off("click.item").on("click.item",l.items.clicked):((l.element.is(".foogallery")&&(e=l.element.data("__FooGallery__"))&&e.items&&0<(e=e.items.available(function(e){return!e.noLightbox&&!e.panelHide})).length?(e=s.map(e,function(e){return e.$anchor?e.$anchor.get(0):null}),s(e)):l.element.find(l.options.selector)).not(l.options.excludes).off("click.item").filter(function(){return l.items.add(this)}).on("click.item",l.items.clicked),l.element.on("click.item",".fbx-link",l.items.clicked)),l.items.rel()},destroy:function(){var e,o;for(l.element.off("click.item",".fbx-link",l.items.clicked),o=0;o<l.items.array.length;o++)e=l.items.array[o],d.isFn(e.destroy)&&e.destroy(),d.isjQuery(e.element)&&e.element.off("click.item").removeClass("fbx-link").data("fbx_p_instance",null);l.items.array=[]},rel:function(){var e=l.options.rel||l.element.attr("rel")||(l.items.first(function(e){return!!d.isjQuery(e.element)&&"string"==typeof e.element.attr("rel")})||{element:s()}).element.attr("rel");"string"==typeof e&&s('[rel="'+e+'"]').not(l.options.excludes).not(l.element).off("click.item").filter(function(){return l.items.add(this)}).on("click.item",l.items.clicked)},indexOf:function(e,o){var t;if(e)for(o=o||"url",t=0;t<l.items.array.length;t++)if(l.items.array[t][o]==e[o])return t;return-1},is:{first:function(e){return!(!l.items.array||0==l.items.array.length)&&l.items.array[0].index==e.index},last:function(e){return!(!l.items.array||0==l.items.array.length)&&l.items.array[l.items.array.length-1].index==e.index}},add:function(e){e=d.isjQuery(e)?e:s(e);var o,t,i=l.items.parse(e,l.items.array.length);return null!==i&&(o=e.get(0),-1!=(t=l.items.indexOf(i))?(i=l.items.array[t],o.index=i.index):o.index=i.index=l.items.array.push(i)-1,e.addClass("fbx-link").data("fbx_p_instance")instanceof d.Instance||e.data("fbx_p_instance",l),!0)},get:function(e){var o=null,e=(e=d.isjQuery(e)?e:s(e)).get(0).index;return o=e&&0<e&&e<=l.items.array.length-1?l.items.array[e]:o},parse:function(e,o){var t,i;e=d.isjQuery(e)?e:s(e);for(var n=0;n<l.objects.handlers.length;n++)if(l.objects.handlers[n].handles(e,l.element)){t=l.objects.handlers[n].parse(e),isNaN(o)||(t.index=o),i=l.raise("foobox.parseItem",{element:e,item:t});break}return void 0!==i&&i.fb.item?i.fb.item:null},error:function(e){var o,t,i,n;return l.items.array.length>e&&1==l.items.array[e].error?l.items.array[e]:(n=!1,null==(o=d.handlers.get(l,"html"))&&(o=new function(e){var n=this;return n.FooBox=e,n.type="error",n.handles=function(){return!1},n.hasChanged=function(){return!1},n.defaults=function(){},n.parse=function(){},n.load=function(e,o,t,i){try{o.empty().append(e.content),d.isFn(t)&&t(n.getSize(e))}catch(e){d.isFn(i)&&i(e)}},n.getSize=function(e){return new d.Size(e.width,e.height)},n}(l)),null!==l.options.error.match(/^#/i)&&0<s(l.options.error).length?(t=s(l.options.error),n=!0):t=s('<div class="fbx-error-msg" data-width="240" data-height="240"></div>').append(d.icons.get("error")).append(s("<p/>").text(l.options.error)),(i=new d.Item(o.type,t.get(0),o)).selector=1==n?l.options.error:null,i.index=e,i.error=!0,i.title=t.data("title")||null,i.description=t.data("description")||null,i.width=t.data("width")||240,i.height=t.data("height")||240,i.content=1==n?null:t,i.fullscreen=!0,i.handler=o,l.items.array[e]=i)},first:function(e){for(var o=null,t=0;t<l.items.array.length;t++)if(e(l.items.array[t])){o=l.items.array[t];break}return o},current:function(){return l.items.array[l.items.indexes.current]},prev:function(){return l.items.array[l.items.indexes.prev]},next:function(){return l.items.array[l.items.indexes.next]},multiple:function(){return 1<l.items.array.length},clicked:function(e){return e.preventDefault(),l.items.indexes.set(this.index),l.modal.show(!0),!1}},this}}(jQuery,window.FooBox),function(l,M){M.Modal=function(e){this.FooBox=e,this.element=null,this.loaderTimeout=new M.Timer,this._first=!1,this._busy=!1,this._closed=!1;var C=this;return this.init=function(e,o){C.setup.html(),C.setup.options(o),C.setup.bind()},this.reinit=function(e){C.setup.options(e)},this.destroy=function(){M.isjQuery(C.element)&&C.element.remove()},this.setup={html:function(){var e,o;M.isjQuery(C.element)||(C.element=l('<div class="fbx-modal"></div>'),C.element.append('<div class="fbx-inner-spacer"></div>'),(e=l('<div class="fbx-stage"></div>')).append('<div class="fbx-item-current"></div>'),e.append('<div class="fbx-item-next"></div>'),(o=l('<div class="fbx-inner fbx-inner-shadow"></div>')).append(e),o.append(l('<a class="fbx-prev fbx-btn-transition fbx-btn-shadow"></a>').append(M.icons.get("prev"))),o.append('<div class="fbx-credit"><a target="_blank" href=""><em></em><span> FooBox</span></a></div>'),o.append('<span class="fbx-count" />'),o.append(l('<a class="fbx-next fbx-btn-transition fbx-btn-shadow"></a>').append(M.icons.get("next"))),o.append(l('<a class="fbx-close fbx-btn-transition fbx-btn-shadow"></a>').append(M.icons.get("close"))),C.element.append(l('<div class="fbx-loader"></div>').append(M.icons.get("spinner"))),C.element.append(o),C.FooBox.raise("foobox.setupHtml"),l("body").append(C.element))},options:function(e){var o;C.element.removeClass().addClass("fbx-modal").addClass("fbx-"+C.FooBox.id).addClass(C.FooBox.element.data("style")||e.style).addClass(C.FooBox.element.data("theme")||e.theme).addClass(C.FooBox.element.data("modal-class")).addClass(e.modalClass).data("fbx_instance",C.FooBox),C.element.addClass(M.browser.css),e.affiliate.enabled?(C.element.find(".fbx-credit > a").attr("href",e.affiliate.url),C.element.find(".fbx-credit > a > em").text(e.affiliate.prefix)):C.element.find(".fbx-credit").remove(),o=e.showCount&&C.FooBox.items.multiple()?"":"none",C.element.find(".fbx-count").css("display",o),e.showButtons&&C.FooBox.items.multiple()||C.element.addClass("fbx-no-buttons"),C.FooBox.raise("foobox.setupOptions")},bind:function(){1==C.FooBox.options.closeOnOverlayClick&&C.element.off("click.foobox").on("click.foobox",function(e){1==C.FooBox.options.closeOnOverlayClick&&l(e.target).is(".fbx-modal")&&C.close()}),C.element.find(".fbx-close").off("click.foobox").on("click.foobox",function(e){e.preventDefault(),e.stopPropagation(),C.close()}).end().find(".fbx-prev").off("click.foobox").on("click.foobox",function(e){e.preventDefault(),e.stopPropagation(),l(this).hasClass("fbx-disabled")||C.prev()}).end().find(".fbx-next").off("click.foobox").on("click.foobox",function(e){e.preventDefault(),e.stopPropagation(),l(this).hasClass("fbx-disabled")||C.next()})}},this.prioritize=function(){1<M.instances.length&&C.element.nextAll(".fbx-modal:last").after(C.element)},this.preload=function(){var e;1==C.FooBox.options.preload&&((e=C.FooBox.items.prev())&&e.handler.preload(e),e=C.FooBox.items.next())&&e.handler.preload(e)},this.show=function(o){var t,i,e,n,s,a=C.FooBox.items.current();function r(e){C.loaderTimeout.stop(),C.element.removeClass("fbx-loading"),C._busy=!1,console.error(e),C.FooBox.raise("foobox.onError",{error:e}).isDefaultPrevented()||null!=C.FooBox.items.error(a.index)&&C.show(o)}a&&(o=o||!1,C._first=o,C._busy=!0,C._closed=!1,l("body").addClass("fbx-active"),C.FooBox.options.hideScrollbars&&l("html").addClass("fbx-no-scroll"),1==a.error?C.element.addClass("fbx-error"):C.element.removeClass("fbx-error"),C.element.hasClass("fbx-show")||(C.prioritize(),e=C.getMaxSize(),C.element.addClass("fbx-loading").find(".fbx-inner").css({width:e.width,height:e.height,"margin-top":e.marginTop,"margin-left":e.marginLeft})),t=C.element.find(".fbx-item-current"),(i=C.element.find(".fbx-item-next")).css({opacity:0,visibility:"hidden"}),C.element.find(".fbx-count").text(C.FooBox.options.countMessage.replace("%index",""+(C.FooBox.items.indexes.current+1)).replace("%total",""+C.FooBox.items.array.length)),C.FooBox.raise("foobox.beforeLoad",{item:a}).isDefaultPrevented()?C._busy=!1:(a.handler.hasChanged(a)&&(e=a.index,n=a.element.get(0),a=a.handler.parse(a.element),s=C.FooBox.raise("foobox.parseItem",{element:a.element,item:a}),n.index=s.fb.item.index=e,C.FooBox.items.array[e]=s.fb.item),C.preload(),C.loaderTimeout.start(function(){C._closed||C.element.addClass("fbx-loading")},C.FooBox.options.loaderTimeout),setTimeout(function(){C.checkForLoop(a),a.handler.load(a,i,function(e){1==C._closed?C._busy=!1:C.transitionOut(t,function(){t.find("video").each(function(){this.pause(),this.removeAttribute("src"),this.load()}),1==C._closed?C._busy=!1:C.resize(e,i,function(){1==C._closed?C._busy=!1:(C.loaderTimeout.stop(),i.css({opacity:"",visibility:""}),C.transitionIn(i,function(){1==C._closed?C._busy=!1:(i.add(t).toggleClass("fbx-item-next fbx-item-current"),t.empty(),C.element.hasClass("fbx-show")?(C.element.removeClass("fbx-loading"),C.FooBox.raise("foobox.afterLoad",{item:a}),C.triggerFooGalleryLayout(i),C._busy=!1):C.FooBox.raise("foobox.beforeShow",{item:a}).isDefaultPrevented()||(C.element.removeClass("fbx-loading").addClass("fbx-show"),C.FooBox.raise("foobox.afterShow",{item:a}),C.FooBox.raise("foobox.afterLoad",{item:a}),C.triggerFooGalleryLayout(i),C._busy=!1))},r))},r)},r)},r)},C.FooBox.options.loadDelay)))},this.triggerFooGalleryLayout=function(e){window.FooGallery&&e.find(".foogallery").each(function(){var e=l(this).data("__FooGallery__");e&&e.initialized&&e.layout()})},this.checkForLoop=function(e){1!=C.FooBox.options.loop&&(C.element.find(".fbx-prev, .fbx-next").removeClass("fbx-disabled"),C.FooBox.items.is.first(e)&&C.element.find(".fbx-prev").addClass("fbx-disabled"),C.FooBox.items.is.last(e))&&C.element.find(".fbx-next").addClass("fbx-disabled")},this.getMaxSize=function(){var e=C.element.find(".fbx-inner"),o=C.element.find(".fbx-inner-spacer"),t=parseInt(o.css("padding-top"),0),i=parseInt(o.css("padding-bottom"),0),n=parseInt(o.css("padding-left"),0),o=parseInt(o.css("padding-right"),0),s=parseInt(e.css("border-top-width"),0),a=parseInt(e.css("border-bottom-width"),0),r=parseInt(e.css("border-left-width"),0),l=parseInt(e.css("border-right-width"),0),e=parseInt(e.css("padding-left"),0),d=t+i+2*e+s+a,h=n+o+2*e+r+l,h=new M.Size(C.element.width()-h,C.element.height()-d);return h.marginTop=-(h.height/2+e+(a+s)/2+i/2-t/2),h.marginLeft=-(h.width/2+e+(l+r)/2+o/2-n/2),h},this.resize=function(e,o,t,i){try{var n,s,a,r,l,d,h,c,f,p,m,u,x,v,b,g,w,F,y,z,B;0===e.width||0===e.height?M.isFn(i)&&i("Invalid size supplied. Width = "+e.width+", Height = "+e.height):(n=C.FooBox.items.current(),s=new M.Size(e.width,e.height),a=C.element.find(".fbx-inner"),r=C.element.find(".fbx-inner-spacer"),l=parseInt(r.css("padding-top"),0),d=parseInt(r.css("padding-bottom"),0),h=parseInt(r.css("padding-left"),0),c=parseInt(r.css("padding-right"),0),f=parseInt(a.css("border-top-width"),0),p=parseInt(a.css("border-bottom-width"),0),m=parseInt(a.css("border-left-width"),0),u=parseInt(a.css("border-right-width"),0),v=l+d+2*(x=parseInt(a.css("padding-left"),0))+f+p,b=h+c+2*x+m+u,g=new M.Size(parseInt(a.css("width"),0),parseInt(a.css("height"),0)),F=(w=new M.Size(C.element.width()-b,C.element.height()-v)).width/e.width,z=(w.height<e.height*F&&(F=w.height/e.height),!0===C.FooBox.options.fitToScreen||1==n.proportion&&(w.height<e.height||w.width<e.width)?(e.height=Math.floor(e.height*F),e.width=Math.floor(e.width*F)):0==n.proportion&&(w.height<e.height&&(e.height=w.height),w.width<e.width)&&(e.width=w.width),e.height<100&&(e.height=100),e.width<100&&(e.width=100),-(e.height/2+x+(p+f)/2+d/2-l/2)),B=-(e.width/2+x+(u+m)/2+c/2-h/2),g.equalTo(e)?(a.css({height:e.height,width:e.width,"margin-top":z,"margin-left":B}),C.overflow(n,s,e,o),C.FooBox.raise("foobox.afterResize",{item:n,size:e}),M.isFn(t)&&t()):C.FooBox.raise("foobox.beforeResize",{item:n,size:e,offset:{top:z,left:B},error:i,success:t}).isDefaultPrevented()||(z=-(e.height/2+x+(p+f)/2+d/2-l/2),B=-(e.width/2+x+(u+m)/2+c/2-h/2),C.element.hasClass("fbx-show")?M.browser.supportsTransitions()?(y="all "+C.FooBox.options.resizeSpeed/1e3+"s ease-in-out",a.css({WebkitTransition:y,MozTransition:y,MsTransition:y,OTransition:y,transition:y}),a.css({height:e.height,width:e.width,"margin-top":z,"margin-left":B}),setTimeout(function(){a.css({WebkitTransition:"",MozTransition:"",MsTransition:"",OTransition:"",transition:""}),C.overflow(n,s,e,o),C.FooBox.raise("foobox.afterResize",{item:n,size:e}),M.isFn(t)&&t(e)},C.FooBox.options.resizeSpeed)):a.animate({height:e.height,width:e.width,"margin-top":z,"margin-left":B},C.FooBox.options.resizeSpeed,function(){C.overflow(n,s,e,o),C.FooBox.raise("foobox.afterResize",{item:n,size:e}),M.isFn(t)&&t(e)}):(a.css({height:e.height,width:e.width,"margin-top":z,"margin-left":B}),C.overflow(n,s,e,o),C.FooBox.raise("foobox.afterResize",{item:n,size:e}),M.isFn(t)&&t())))}catch(e){M.isFn(i)&&i(e)}},this.overflow=function(e,o,t,i){var n=i.find(".fbx-item");e.overflow&&(t.width<.8*o.width||t.height<.8*o.height)||e.overflow&&!e.proportion&&(t.width<o.width||t.height<o.height)||e.overflow&&"html"===e.type?("html"===e.type?(n.css({width:"100%",height:"auto",overflow:""}),i.css("overflow","auto")):(n.css({width:o.width,height:o.height,overflow:""}),i.css({"overflow-x":o.width<=t.width?"hidden":"","overflow-y":o.height<=t.height?"hidden":""})),C.FooBox.raise("foobox.showOverflow",{item:e,container:i})):(n.css({width:"",height:"",overflow:n.is("iframe")?"":"hidden"}),i.css({"overflow-x":"","overflow-y":"",overflow:"hidden"}),C.FooBox.raise("foobox.hideOverflow",{item:e,container:i}))},this.transitionOut=function(e,o,t){try{C.element.hasClass("fbx-show")?e.animate({opacity:0},e.is(":visible")?C.FooBox.options.transitionOutSpeed:0,function(){M.isFn(o)&&o()}):M.isFn(o)&&o()}catch(e){M.isFn(t)&&t(e)}},this.transitionIn=function(e,o,t){try{C.element.hasClass("fbx-show")?e.animate({opacity:1},C.FooBox.options.transitionInSpeed,function(){M.isFn(o)&&o()}):(e.css({opacity:1}),M.isFn(o)&&o())}catch(e){M.isFn(t)&&t(e)}},this.close=function(){C.FooBox.raise("foobox.beforeClose").isDefaultPrevented()||(C._closed=!0,C._busy=!1,C.loaderTimeout.stop(),C.element.removeClass("fbx-loading fbx-show"),l("body").removeClass("fbx-active"),C.FooBox.raise("foobox.close"),C.element.find(".fbx-item-current video, .fbx-item-next video").each(function(){this.pause(),this.removeAttribute("src"),this.load()}),C.element.find(".fbx-item-current, .fbx-item-next").empty(),l("html").removeClass("fbx-no-scroll"),C.FooBox.raise("foobox.afterClose"))},this.prev=function(e){if(1!=C._busy){if(C.FooBox.items.indexes.set(C.FooBox.items.indexes.prev),"string"==typeof e)for(var o=C.FooBox.items.current();o.type!=e;)C.FooBox.items.indexes.set(C.FooBox.items.indexes.prev),o=C.FooBox.items.current();C.show(!1),C.FooBox.raise("foobox.previous")}},this.next=function(e){if(1!=C._busy){if(C.FooBox.items.indexes.set(C.FooBox.items.indexes.next),"string"==typeof e)for(var o=C.FooBox.items.current();o.type!=e;)C.FooBox.items.indexes.set(C.FooBox.items.indexes.next),o=C.FooBox.items.current();C.show(!1),C.FooBox.raise("foobox.next")}},this}}(jQuery,window.FooBox),function(a,r){var e={images:{noRightClick:!1,attr:"href",overflow:!1,fullscreen:!0,showCaptions:!0,regex:/https?:\/\/.*?\/.*?\.(jpg|jpeg|png|gif|bmp|webp|svg)/i,maxWidth:-1,maxHeight:-1,findUrl:function(e,o){return o?o.data("image")?o.data("image"):"string"==typeof o.attr(e.options.images.attr)?r.qualifiedURL(o.attr(e.options.images.attr)):"":""}}};r.Item.prototype.image=null,r.Item.prototype.maxWidth=null,r.Item.prototype.maxHeight=null,r.ImageHandler=function(e){this.FooBox=e,this.type="image";var s=this;this.handles=function(e){var o=s.FooBox.options.images.findUrl(s.FooBox,e),o="string"==typeof o&&null!=o.match(s.FooBox.options.images.regex);return s.FooBox.raise("foobox.handlesImage",{element:e,handle:o}).fb.handle},this.defaults=function(e){e.fullscreen=e.fullscreen||s.FooBox.options.images.fullscreen,e.captions=e.captions||s.FooBox.options.images.showCaptions,e.social=e.social||!0,e.overflow=e.overflow||s.FooBox.options.images.overflow,e.proportion=e.proportion||!0,e.maxWidth=e.maxWidth||s.FooBox.options.images.maxWidth,e.maxHeight=e.maxHeight||s.FooBox.options.images.maxHeight},this.parse=function(e){var o=new r.Item(s.type,e,this);return s.defaults(o),o.url=s.FooBox.options.images.findUrl(s.FooBox,e)||null,o.width=r.Size.check(e.data("width")||o.width||null),o.height=r.Size.check(e.data("height")||o.height||null),o.fullscreen="boolean"==typeof e.data("fullscreen")?e.data("fullscreen"):o.fullscreen,o.overflow="boolean"==typeof e.data("overflow")?e.data("overflow"):o.overflow,o.proportion="boolean"==typeof e.data("proportion")?e.data("proportion"):o.proportion,o.maxWidth="number"==typeof e.data("maxWidth")?e.data("maxWidth"):o.maxWidth,o.maxHeight="number"==typeof e.data("maxHeight")?e.data("maxHeight"):o.maxHeight,o.image=null,o.image_url=o.url,o},this.load=function(o,t,i,n){try{var e=function(){var e=a(o.image).addClass("fbx-item fbx-item-image");s.FooBox.options.images.noRightClick&&e.on("contextmenu",function(e){return e.preventDefault(),!1}),t.empty().append(e),r.isFn(i)&&i(s.getSize(o))};o.image&&null!==o.image?e():(o.image=new Image,o.image.onload=function(){o.image.onload=o.image.onerror=null,o.width&&o.height||(o.height=o.image.height,o.width=o.image.width),e()},o.image.onerror=function(){o.image.onload=o.image.onerror=null,o.image=null,r.isFn(n)&&n("An error occurred attempting to load the image.")},o.image.src=o.url)}catch(e){r.isFn(n)&&n(e)}},this.preload=function(e){1!=e.preloaded&&((new Image).src=e.url,e.preloaded=!0)},this.getSize=function(e){var o;return null!=e.width&&null!=e.height?(0<e.maxWidth&&0<e.maxHeight&&(e.maxWidth<e.width||e.maxHeight<e.height)&&(e.width*=o=e.height<e.width?e.maxWidth/e.width:e.maxHeight/e.height,e.height*=o),new r.Size(e.width,e.height)):new r.Size(0,0)},this.hasChanged=function(e){var o;return!!r.isjQuery(e.element)&&(o=s.FooBox.options.images.findUrl(s.FooBox,e.element),e.url!=o)}},r.handlers.register(r.ImageHandler,e)}(jQuery,window.FooBox),function(o){o.Keyboard=function(e){this.FooBox=e;var i=this;this.preinit=function(e){i.handlers.unbind(!0),e.on({"foobox.initialized foobox.reinitialized":i.handlers.initialized,"foobox.setupHtml":i.handlers.setupHtml})},this.destroy=function(){i.handlers.unbind(!0)},this.handlers={unbind:function(e){(e=e||!1)&&i.FooBox.element.off({"foobox.initialized foobox.reinitialized":i.handlers.initialized,"foobox.setupHtml":i.handlers.setupHtml}),i.FooBox.element.off("foobox.afterLoad",i.handlers.afterLoad),o.isjQuery(i.FooBox.modal.element)&&i.FooBox.modal.element.off("keydown.foobox",i.handlers.onKeydown)},initialized:function(){i.handlers.unbind(),1==i.FooBox.options.keyboard.enabled&&(i.FooBox.element.on("foobox.afterLoad",i.handlers.afterLoad),o.isjQuery(i.FooBox.modal.element))&&i.FooBox.modal.element.on("keydown.foobox",i.handlers.onKeydown)},setupHtml:function(e){e.fb.modal.attr("tabindex",0)},afterLoad:function(e){e.fb.modal.trigger("focus")},onKeydown:function(e){var o=i.FooBox.modal,t=i.FooBox.options.keyboard;o.element.hasClass("fbx-show")&&(o.element.hasClass("fbx-fullscreen-mode")||27!==e.which?i.FooBox.items.multiple()&&37===e.which?o.prev():i.FooBox.items.multiple()&&39===e.which&&o.next():o.close(),1==t.preventDefault&&e.preventDefault(),1==t.stopPropagation&&e.stopPropagation(),i.FooBox.raise("foobox.keydown",{keyCode:e.which}))}}},o.addons.register(o.Keyboard,{keyboard:{enabled:!0,preventDefault:!1,stopPropagation:!1}})}((jQuery,window.FooBox)),function(r,l){l.BPInfo=function(e){var o,t=r(window),i=(this.width=t.width(),this.height=t.height(),this.orientation=this.width>this.height?"fbx-landscape":"fbx-portrait",null);if(l.isArray(e))for(var n=0;n<e.length;n++)if((o=e[n])&&o.width&&this.width<=o.width){i=o;break}this.breakpoint=null==i?"fbx-desktop":i.name},l.Responsive=function(e){this.FooBox=e,this.breakpoint={values:[],names:""},this.timers={resize:new l.Timer,ios:new l.Timer};var s=this,a=null;this.preinit=function(e){s.handlers.unbind(!0),e.on("foobox.initialized foobox.reinitialized",s.handlers.initialized)},this.destroy=function(){s.handlers.unbind(!0)},this.handlers={unbind:function(e){(e=e||!1)&&s.FooBox.element.off("foobox.initialized foobox.reinitialized",s.handlers.initialized),r(window).off("resize.foobox",s.handlers.resize),s.FooBox.element.off({"foobox.beforeShow":s.handlers.iosBeforeShow,"foobox.close":s.handlers.iosClose})},initialized:function(){s.handlers.unbind(),s.setup.breakpoints(),s.style(),r(window).on("resize.foobox",s.handlers.resize),l.browser.iOS12OrBelow&&(l.browser.isSafari||l.browser.isChrome)&&s.FooBox.element.on({"foobox.beforeShow":s.handlers.iosBeforeShow,"foobox.close":s.handlers.iosClose})},resize:function(){s.timers.resize.start(function(){s.style();var e,o,t=s.FooBox,i=s.FooBox.items.current();t.modal.element.has("fbx-show")&&null!=i&&(e=i.handler.getSize(i),o=t.modal.element.find(".fbx-item-current"),t.modal.resize(e,o,function(){t.modal.triggerFooGalleryLayout(o);var e=i.handler.getSize(i);o.height()!=e.height&&t.modal.resize(e,o,function(){t.modal.triggerFooGalleryLayout(o)})}))},s.FooBox.options.resizeTimeout)},iosBeforeShow:function(){s.timers.ios.start(s.handlers.ios,s.FooBox.options.iosInterval)},iosClose:function(){s.timers.ios.stop()},ios:function(){var e,o,t,i,n;s.FooBox.modal.element.hasClass("fbx-show")&&(o=window.orientation||0,e=window.innerHeight,i=t=0,n=(o=90===o||-90===o)?screen.availWidth:screen.availHeight,l.browser.isChrome?(t=n-(o?76:56),i=n-(o?0:20)):l.browser.isSafari&&(t=n-88,i=n-(o?0:19)),(null==a||!1===a)&&e<=t?(a=!0,s.iosRedraw()):(null==a||!0===a)&&i<=e&&(a=!1,s.iosRedraw())),s.timers.ios.start(s.handlers.ios,s.FooBox.options.iosInterval)}},this.setup={breakpoints:function(){for(var e in s.breakpoint.values=[],s.breakpoint.names="",s.FooBox.options.breakpoints)s.FooBox.options.breakpoints.hasOwnProperty(e)&&(s.breakpoint.values.push({name:s.fixName(e),width:s.FooBox.options.breakpoints[e]}),s.breakpoint.names+=s.fixName(e)+" ");s.breakpoint.values.sort(function(e,o){return e.width-o.width})}},this.iosRedraw=function(){window.scrollTo(0,document.body.scrollTop),r(window).trigger("resize")},this.fixName=function(e){return/^fbx-[a-zA-Z0-9]/.test(e)?e:"fbx-"+e},this.style=function(){var e=new l.BPInfo(s.breakpoint.values),o=s.FooBox.modal.element;o.removeClass(s.breakpoint.names).removeClass("fbx-desktop fbx-landscape fbx-portrait").addClass(e.breakpoint).addClass(e.orientation),!0===s.FooBox.options.hideNavOnMobile?o.addClass("fbx-no-nav"):o.removeClass("fbx-no-nav")}},l.Responsive.metaCheck=function(){var e=r("meta[name=viewport]"),o=e.attr("content");if(0<e.length&&"string"==typeof o){for(var t=o.split(","),i=!1,n=!1,s=0;s<t.length;s++){var a=l.trim(t[s]);"width"==a.substring(0,5)&&-1!==a.indexOf("device-width")?i=!0:"initial-scale"==a.substring(0,13)&&(n=!0)}i&&!n&&(t.push("initial-scale=1"),o=t.join(","),e.attr("content",o))}},l.addons.register(l.Responsive,{hideNavOnMobile:!1,resizeTimeout:300,breakpoints:{phone:812,tablet:1366},iosInterval:200}),l.Responsive.metaCheck()}(jQuery,window.FooBox),function(a,l){l.Item.prototype.captions=!1,l.Item.prototype.title=null,l.Item.prototype.description=null,l.Item.prototype.caption=null,l.Captions=function(e){this.FooBox=e,this.timers={hover:new l.Timer};var r=this;this.preinit=function(e){r.handlers.unbind(!0),e.on({"foobox.initialized foobox.reinitialized":r.handlers.initialized,"foobox.setupHtml":r.handlers.setupHtml,"foobox.setupOptions":r.handlers.setupOptions,"foobox.parseItem":r.handlers.parseItem,"foobox.onError":r.handlers.onError,"foobox.beforeClose":r.handlers.beforeClose})},this.destroy=function(){r.handlers.unbind(!0)},this.getDataValue=function(e,o,t){if("none"===t)return"";for(var i=null,n=0,s=o.length;n<s;n++){var a=e.data(o[n]);if("string"==typeof a){i=a;break}}return i=null===i?r.text(e,t):i},this.handlers={unbind:function(e){(e=e||!1)&&r.FooBox.element.off({"foobox.initialized foobox.reinitialized":r.handlers.initialized,"foobox.setupHtml":r.handlers.setupHtml,"foobox.setupOptions":r.handlers.setupOptions,"foobox.parseItem":r.handlers.parseItem,"foobox.onError":r.handlers.onError,"foobox.beforeClose":r.handlers.beforeClose}),r.FooBox.element.off({"foobox.beforeLoad":r.handlers.beforeLoad,"foobox.afterLoad":r.handlers.afterLoad}),r.FooBox.modal instanceof l.Modal&&l.isjQuery(r.FooBox.modal.element)&&r.FooBox.modal.element.off("mouseenter.captions mouseleave.captions").find(".fbx-item-current, .fbx-item-next").off("click.captions")},initialized:function(e){r.handlers.unbind(),!0===e.fb.options.captions.enabled&&(e.fb.instance.element.on({"foobox.beforeLoad":r.handlers.beforeLoad,"foobox.afterLoad":r.handlers.afterLoad,"foobox.beforeClose":r.handlers.beforeClose}),-1===e.fb.options.modalClass.indexOf("fbx-caption-toggle-only")&&e.fb.modal.find(".fbx-item-current, .fbx-item-next").on("click.captions",r.handlers.toggleCaptions),!0!==e.fb.options.captions.onlyShowOnHover||e.fb.modal.hasClass("fbx-phone")||e.fb.modal.on("mouseenter.captions",".fbx-inner:not(:has(.fbx-item-error))",r.handlers.mouseenter).on("mouseleave.captions",".fbx-inner:not(:has(.fbx-item-error))",r.handlers.mouseleave))},toggleCaptions:function(e){var o,t;(a(e.target).is("img")||a(e.target).is(".fbx-close-caption")||a(e.target).is(".fbx-open-caption"))&&(o=r.FooBox.items.current(),t=r.FooBox.modal.element,o.captions)&&!t.hasClass("fbx-error")&&(e.preventDefault(),t.find(".fbx-caption").is(".fbx-fade-caption, .fbx-slide-caption, .fbx-hide-caption")?(t.removeClass("fbx-captions-hidden"),r.show()):(t.addClass("fbx-captions-hidden"),r.hide()))},mouseenter:function(){r.timers.hover.start(function(){r.show()},r.FooBox.options.captions.hoverDelay)},mouseleave:function(){r.timers.hover.start(function(){r.hide()},r.FooBox.options.captions.hoverDelay)},setupHtml:function(e){var o=a("<div/>",{class:"fbx-caption"}),t=a("<a/>",{class:"fbx-open-caption",html:"&hellip;"}).on("click.captions",r.handlers.toggleCaptions);"string"==typeof e.fb.options.modalClass&&-1!=e.fb.options.modalClass.indexOf("fbx-sticky-caption")?e.fb.modal.append(o,t):(e.fb.modal.find(".fbx-stage").append(o),e.fb.modal.find(".fbx-inner").append(t))},setupOptions:function(e){e.fb.modal.find(".fbx-caption").addClass(r.animation())},beforeClose:function(e){1!=e.fb.options.captions.onlyShowOnHover&&e.fb.modal.find(".fbx-caption").addClass("fbx-hide-caption")},beforeLoad:function(e){1!=e.fb.options.captions.onlyShowOnHover&&e.fb.modal.find(".fbx-caption").addClass(r.animation())},afterLoad:function(e){var o=e.fb.item;!o||o.error||o.captionLoaded||(e.fb.instance.raise("foobox.alterCaption",{element:e.fb.element,item:o}),o.captionLoaded=!0),1==e.fb.options.captions.onlyShowOnHover?r.update():0==e.fb.options.captions.onlyShowOnClick&&r.show()},onError:function(e){e.fb.modal.find(".fbx-caption").addClass(r.animation())},parseItem:function(e){var o,t,i,n=e.fb.options.captions;function s(e){return n.html?l.safeParse(e):a("<div/>").text(e).html()}e.fb.item.captions&&0!=n.enabled&&(o="",i=null!=e.fb.element?(t=a(e.fb.element).data("titleSource")||a(e.fb.instance.element).data("titleSource")||n.titleSource,i=a(e.fb.element).data("descSource")||a(e.fb.instance.element).data("descSource")||n.descSource,t=r.getDataValue(e.fb.element,n.dataTitle,t),r.getDataValue(e.fb.element,n.dataDesc,i)):(t=e.fb.item.title,e.fb.item.description),t=(null==t||void 0===t?"":t+"").trim(),i=(null==i||void 0===i?"":i+"").trim(),t&&t===i&&(i=null),o="string"==typeof t&&0<t.length?'<div class="fbx-caption-title">'+s(t)+"</div>":"",o="string"==typeof i&&0<i.length?o+'<div class="fbx-caption-desc">'+s(i)+"</div>":o,e.fb.item.title=t,e.fb.item.description=i,e.fb.item.caption=o,e.fb.instance.raise("foobox.createCaption",{element:e.fb.element,item:e.fb.item}))}},this.text=function(e,o){var t;switch(o){case"find":t=l.trim(e.data("title")||e.attr("title")||e.find("img:first").data("title")||e.find("img:first").data("alt")||e.find("img:first").attr("title")||e.find("img:first").attr("alt"));break;case"image_find":t=l.trim(e.find("img:first").data("title")||e.find("img:first").data("alt")||e.find("img:first").attr("title")||e.find("img:first").attr("alt"));break;case"image":t=l.trim(e.find("img:first").data("title")||e.find("img:first").attr("title"));break;case"image_alt":t=l.trim(e.find("img:first").data("alt")||e.find("img:first").attr("alt"));break;case"anchor":t=l.trim(e.data("title")||e.attr("title"));break;default:t=null}return t=r.FooBox.options.captions.prettify?r.prettifier(t):t},this.animation=function(){switch(r.FooBox.options.captions.animation){case"fade":return"fbx-fade-caption";case"slide":return"fbx-slide-caption";default:return"fbx-hide-caption"}},this.hide=function(){var e=r.FooBox.items.current(),o=r.FooBox.modal.element.find(".fbx-caption");r.FooBox.options.captions.enabled&&e&&e.captions&&"string"==typeof e.caption&&0!=e.caption.length?(o.addClass(r.animation()),r.FooBox.raise("foobox.captionsHide",{item:e})):o.addClass("fbx-hide-caption")},this.show=function(){var e=r.FooBox,o=e.items.current(),t=e.modal.element.find(".fbx-caption");!e.options.captions.enabled||!o.captions||"string"!=typeof o.caption||0==o.caption.length||e.modal.element.hasClass("fbx-captions-hidden")||l.isjQuery(o.element)&&o.element.hasClass("no-captions")?t.addClass("fbx-hide-caption"):(r.update(),t.removeClass("fbx-fade-caption fbx-slide-caption fbx-hide-caption"),r.FooBox.raise("foobox.captionsShow",{item:o}))},this.update=function(){var e=r.FooBox.items.current(),o=r.FooBox.modal.element.find(".fbx-caption");o.html(e.caption).find('a[href^="#"]').filter(function(){var e=a(this).attr("href"),e=a(e),o=e.data("fbx_instance")||e.data("fbx_p_instance");return 0<e.length&&o instanceof l.Instance&&(a(this).data("hrefTarget",e.get(0)),!0)}).off("click.captions").on("click.captions",function(e){e.preventDefault();var e=a(this).data("hrefTarget"),o=a(e).data("fbx_instance")||a(e).data("fbx_p_instance");return o instanceof l.Instance&&(r.FooBox.modal.close(),o.items.indexes.set(e.index),o.modal.show()),!1}),a("<a/>",{class:"fbx-close-caption",html:"&times;"}).on("click.captions",r.handlers.toggleCaptions).prependTo(o)},this.prettifier=function(e){return"string"!=typeof e?null:(e=e.replace(/\s*-\d+/g,"").replace(/\s*_\d+/g,"").replace(/-/g," ").replace(/_/g," ")).replace(/\w\S*/g,function(e){return-1!=e.indexOf("#")?e:e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})}},l.addons.register(l.Captions,{captions:{html:!0,animation:"slide",enabled:!0,descSource:"find",hoverDelay:300,maxHeight:.4,onlyShowOnHover:!1,onlyShowOnClick:!1,overrideDesc:!1,overrideTitle:!1,prettify:!1,titleSource:"image_find",dataTitle:["captionTitle","title"],dataDesc:["captionDesc","description"]}})}(jQuery,window.FooBox),function(l,d){d.Wordpress=function(e){this.FooBox=e;var o=this;this.preinit=function(e){o.handlers.unbind(!0),e.on("foobox.createCaption",o.handlers.onCreateCaption)},this.destroy=function(){o.handlers.unbind(!0)},this.handlers={unbind:function(e){(e=e||!1)&&o.FooBox.element.off("foobox.createCaption",o.handlers.onCreateCaption)},onCreateCaption:function(e){var o=e.fb.options,t=e.fb.instance.element,i=e.fb.item.element,n=e.fb.item.title,s=e.fb.item.description;if(1==o.wordpress.enabled&&d.isjQuery(i)){var a=i.data("captionTitle")||i.data("title"),r=i.data("captionDesc")||i.data("description");if(t.hasClass("gallery"))!1===o.captions.overrideTitle&&(n=a||i.parents(".gallery-item:first").find(".wp-caption-text:first").html()||i.parents(".gallery-item:first").find(".gallery-caption:first").html()||n||""),!1===o.captions.overrideDesc&&(s=r||i.find("img").attr("alt")||s||"");else if(t.hasClass("wp-caption")||i.hasClass("wp-caption"))!1===o.captions.overrideTitle&&(n=a||i.find("img").attr("title")||i.parents(".wp-caption:first").find(".wp-caption-text:first").html()||n||""),!1===o.captions.overrideDesc&&(s=r||i.find("img").attr("alt")||s||"");else if(0<i.parents(".wp-caption:first").length)!1===o.captions.overrideTitle&&(n=a||i.parents(".wp-caption:first").find("img").attr("title")||i.parents(".wp-caption:first").find(".wp-caption-text:first").html()||n||""),!1===o.captions.overrideDesc&&(s=r||i.parents(".wp-caption:first").find("img").attr("alt")||s||"");else if(t.hasClass("tiled-gallery"))!1===o.captions.overrideTitle&&(n=a||i.parents(".tiled-gallery-item:first").find(".tiled-gallery-caption").html()||i.find("img").data("image-title")||i.find("img").attr("title")||n||""),!1===o.captions.overrideDesc&&(s=r||d.trim(i.find("img").data("image-description")).replace(/(^<p>)|(<\/p>$)/gi,"")||s||"");else{if(!t.hasClass("wp-block-gallery")&&!t.hasClass("wp-block-image"))return;!1===o.captions.overrideTitle&&(n=a||i.parents("figure:first").find("figcaption").html()||n||""),!1===o.captions.overrideDesc&&(s=r||s||"")}n=(n+="")||"",s=(s+="")||"",t=l("<div/>"),a=t.html(n).text(),i=t.html(s).text();d.trim(n)!==d.trim(s)&&a!==i||(s=null),o="string"==typeof n&&0<n.length?'<div class="fbx-caption-title">'+n+"</div>":"",o="string"==typeof s&&0<s.length?o+'<div class="fbx-caption-desc">'+s+"</div>":o,e.fb.item.title=n,e.fb.item.description=s,e.fb.item.caption=o}}}},d.addons.register(d.Wordpress,{wordpress:{enabled:!1}})}(jQuery,window.FooBox),function(u,x){x.Pan=function(e){this.FooBox=e;var t,i,n,s,a=this,r=!1,l=!1,d=null,h=null,c=null,f=null,p=null,m=0;this.preinit=function(e){a.handlers.unbind(!0),e.on({"foobox.initialized foobox.reinitialized":a.handlers.initialized})},this.destroy=function(){a.handlers.unbind(!0)},this.setOverview=function(){var e=parseInt(f.css("max-width")),o=parseInt(f.css("max-height")),e=e/d.width,o=o/d.height,o=(m=o<e?o:e,d.width*m),e=d.height*m;f.width(o).height(e).css("background-image","url("+d.url+")")},this.setViewport=function(){var e=c.width(),o=c.height(),e=e*m,o=o*m;p.width(e).height(o)},this.disableCaptionImageClick=function(){var e=a.FooBox.modal.element,o=x.objects.get("addons",a.FooBox,function(e){return e instanceof x.Captions});o&&e.find(".fbx-item-current, .fbx-item-next").off("click.captions",o.handlers.toggleCaptions)},this.enableCaptionImageClick=function(){var e=a.FooBox.modal.element,o=x.objects.get("addons",a.FooBox,function(e){return e instanceof x.Captions});o&&e.find(".fbx-item-current, .fbx-item-next").on("click.captions",o.handlers.toggleCaptions)},this.handlers={unbind:function(e){(e=e||!1)&&a.FooBox.element.off({"foobox.initialized foobox.reinitialized":a.handlers.initialized}),a.FooBox.element.off({"foobox.afterLoad":a.handlers.onAfterLoad,"foobox.showOverflow":a.handlers.onShowOverflow,"foobox.hideOverflow foobox.beforeLoad":a.handlers.onHideOverflow}),a.FooBox.modal instanceof x.Modal&&x.isjQuery(a.FooBox.modal.element)&&a.FooBox.modal.element.find(".fbx-stage").off({mousedown:a.handlers.onMouseDown,mousemove:a.handlers.onMouseMove,mouseup:a.handlers.onMouseUp}).removeClass("fbx-pannable fbx-panning")},initialized:function(e){a.handlers.unbind(),!0===e.fb.options.pan.enabled&&a.FooBox.element.on({"foobox.close":a.handlers.onMouseUp,"foobox.afterLoad":a.handlers.onAfterLoad,"foobox.showOverflow":a.handlers.onShowOverflow,"foobox.hideOverflow foobox.beforeLoad":a.handlers.onHideOverflow})},onAfterLoad:function(e){!0===r&&"image"==e.fb.item.handler.type&&(a.setOverview(),a.setViewport())},onShowOverflow:function(e){"image"==e.fb.item.handler.type&&(!0===r?(a.setOverview(),a.setViewport()):(r=!0,a.disableCaptionImageClick(),d=e.fb.item,c=a.FooBox.modal.element.addClass("fbx-pannable-item").find(".fbx-stage").on({mousedown:a.handlers.onMouseDown,mousemove:a.handlers.onMouseMove,"mouseup mouseleave":a.handlers.onMouseUp}).addClass("fbx-pannable"),h=e.fb.container,!0===e.fb.options.pan.showOverview&&(f=u("<div/>",{class:"fbx-pan-overview"}).addClass(e.fb.options.pan.position).on("click",a.handlers.onOverviewClick).appendTo(c),p=u("<div/>",{class:"fbx-pan-viewport"}).appendTo(f),h.on("scroll",a.handlers.onScroll),a.setOverview(),a.setViewport())))},onHideOverflow:function(e){!0===r&&(r=!1,a.enableCaptionImageClick(),!0===e.fb.options.pan.showOverview&&f.remove(),h.off("scroll",a.handlers.onScroll),c.off({mousedown:a.handlers.onMouseDown,mousemove:a.handlers.onMouseMove,"mouseup mouseleave":a.handlers.onMouseUp}).removeClass("fbx-pannable fbx-panning"),a.FooBox.modal.element.removeClass("fbx-pannable-item"))},onMouseDown:function(e){var o;!0===r&&(e.preventDefault(),c.addClass("fbx-panning"),o=h.get(0),l=!0,t=e.pageX,i=e.pageY,n=o.scrollLeft,s=o.scrollTop)},onMouseMove:function(e){var o;!0===l&&!0===r&&((o=h.get(0)).scrollLeft=n-(e.pageX-t),o.scrollTop=s-(e.pageY-i))},onMouseUp:function(){!0===r&&(l=!1,c.removeClass("fbx-panning"),s=n=i=t=0)},onScroll:function(){var e=h.get(0),o=e.scrollTop/d.height*100,e=e.scrollLeft/d.width*100;p.css({top:o+"%",left:e+"%"})},onOverviewClick:function(e){var o=u(this).offset(),t=(e.pageX-o.left)/m,e=(e.pageY-o.top)/m,o=t-h.width()/2,t=e-h.height()/2;h.animate({scrollTop:t,scrollLeft:o},300)}}},x.addons.register(x.Pan,{pan:{enabled:!0,showOverview:!0,position:"fbx-top-right"}})}(jQuery,window.FooBox),function(i){i.Swipe=function(e){this.FooBox=e,this.isMoving=!1;var o,t=this;this.preinit=function(e){t.handlers.unbind(!0),e.on("foobox.initialized foobox.reinitialized",t.handlers.initialized)},this.destroy=function(){t.handlers.unbind(!0)},this.handlers={unbind:function(e){(e=e||!1)&&t.FooBox.element.off("foobox.initialized foobox.reinitialized",t.handlers.initialized),t.FooBox.modal instanceof i.Modal&&i.isjQuery(t.FooBox.modal.element)&&t.FooBox.modal.element.off({touchstart:t.handlers.onTouchStart,touchmove:t.handlers.onTouchMove})},initialized:function(e){t.handlers.unbind(),!0===e.fb.options.swipe.enabled&&e.fb.modal.on("touchstart",t.handlers.onTouchStart)},onTouchStart:function(e){e=e.originalEvent.touches||e.touches;1==e.length&&t.FooBox.items.multiple()&&(o=e[0].pageX,t.isMoving=!0,t.FooBox.modal.element.on("touchmove",t.handlers.onTouchMove))},onTouchMove:function(e){t.isMoving&&(e=(e.originalEvent.touches||e.touches)[0].pageX,e=o-e,Math.abs(e)>=t.FooBox.options.swipe.min)&&(t.cancelTouch(),0<e?(t.FooBox.raise("foobox.swipeRight"),t.FooBox.modal.next()):(t.FooBox.raise("foobox.swipeLeft"),t.FooBox.modal.prev()))}},this.cancelTouch=function(){t.FooBox.modal.element.off("touchmove",t.handlers.onTouchMove),o=null,t.isMoving=!1}},i.addons.register(i.Swipe,{swipe:{enabled:!0,min:80}})}((jQuery,window.FooBox)),function(t,e,i){if(i){if(i.o&&i.customOptions&&t.extend(!0,i.o,i.customOptions),i.init=function(){if(t(".fbx-link").removeClass("fbx-link"),FooBox.isFn(i.pre))try{i.pre(t)}catch(e){console.error(e)}if(i.disableOthers&&(t("a.thickbox").removeClass("thickbox").unbind("click"),t("#TB_overlay, #TB_load, #TB_window").remove()),t.each(i.selectors,function(e,o){t(o).foobox(i.o)}),i.disableOthers&&t(".fbx-link").unbind(".prettyphoto").unbind(".fb"),FooBox.isFn(i.post))try{i.post(t)}catch(e){console.error(e)}},e.once=function(){var e=t("body");i.init(),t(document).trigger("foobox-after-init"),e.on("post-load",i.init)},i.ready?e.ready(e.once):t(e.once),FooBox.isFn(i.custom))try{i.custom(t)}catch(e){console.error(e)}}else console.log("No configuration for FooBox found.")}(jQuery,window.FooBox,window.FOOBOX);
// source --> https://www.eventconecta.com/wp-content/plugins/miguel-conectafiction/miguel-conectafiction.js?v=1.7&amp;ver=6.7.4 
var bloqueo_formulario=false;
var patron_email=[/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/,"Introduce un e-mail válido"];
var patron_numero=[/^([0-9.+€ -])+$/,"Introduce un número"];
var patron_usuario=[/^([a-z0-9_])+$/,"Sólo letras minúsculas, números y \"_\""];
var cargando='<i class="fa fa-cog fa-lg fa-spin"></i>';
var temporizador=null;
var sponsor_background=null;

jQuery(document).ready(function(){

	jQuery(window).resize(function(){
		regular_listados();
		situar_ventana();
		programa_cargar_situar();
		regular_botones_archivo();
		regular_botones_acreditaciones();
		cf_videollamada();
	});

	if(jQuery("input[name='zonaweb']").length)
	{
		setTimeout(function(){
			jQuery("input[name='zonaweb']").val("");
		},20000);
	}

	/*jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=asd",success:function(data){
		//alert(data);
	}});*/

	regular_listados();

	campos_focus_blur();

	admin_funciones();

	datepicker_espanol();

	regular_botones_archivo();

	regular_botones_acreditaciones();

	procesar_hash();

	jQuery(".cyp_menu").find("a[title='agenda']").unbind("click").click(function(){setTimeout(function(){procesar_hash();},500);});

	setTimeout(function(){subir_scroll();},500);

	if(jQuery("form[name='form_nueva_cuenta']").length)
	{
		jQuery("#crearcuenta_enviar_formulario").unbind("click").click(function(){crearcuenta_enviar_formulario(jQuery("form[name='form_nueva_cuenta']"));});
	}
	if(jQuery("form[name='form_nueva_cuenta_en']").length)
	{
		jQuery("#crearcuenta_enviar_formulario_en").unbind("click").click(function(){crearcuenta_enviar_formulario_en(jQuery("form[name='form_nueva_cuenta_en']"));});
	}

	if(jQuery("form[name='form_nueva_iniciarsesion']").length)
	{
		jQuery("#iniciarsesion_enviar_formulario").unbind("click").click(function(){conectamepro_iniciar_sesion(jQuery("form[name='form_nueva_iniciarsesion']"));});
	}
	if(jQuery("form[name='form_nueva_iniciarsesion_en']").length)
	{
		jQuery("#iniciarsesion_enviar_formulario_en").unbind("click").click(function(){conectamepro_iniciar_sesion_en(jQuery("form[name='form_nueva_iniciarsesion_en']"));});
	}

	if(jQuery("form[name='form_nueva_cerrarsesion']").length)
	{
		jQuery("#cerrarsesion_enviar_formulario").unbind("click").click(function(){conectamepro_cerrar_sesion(jQuery("form[name='form_nueva_cerrarsesion']"));});
	}
	if(jQuery("form[name='form_nueva_cerrarsesion_en']").length)
	{
		jQuery("#cerrarsesion_enviar_formulario_en").unbind("click").click(function(){conectamepro_cerrar_sesion_en(jQuery("form[name='form_nueva_cerrarsesion_en']"));});
	}
	if(jQuery("#cyp_cuenta_cerrar_sesion").length){
		jQuery("#cyp_cuenta_cerrar_sesion").unbind("click").click(function(){
			jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=conectamepro_cerrarsesion_cuenta",success:function(data){
				location.reload(true);
			}});
		});
	}

	if(jQuery(".solicitud_pago_botones").length)
	{
		jQuery(".solicitud_pago_boton_individual").unbind("click").click(function(){
			jQuery(".solicitud_pago_boton_individual").addClass("solicitud_pago_botones_hover");
			jQuery(".solicitud_pago_boton_multiple").removeClass("solicitud_pago_botones_hover");
			jQuery(".solicitud_pago_individual").show();
			jQuery(".solicitud_pago_multiple").hide();
		});
		jQuery(".solicitud_pago_boton_multiple").unbind("click").click(function(){
			jQuery(".solicitud_pago_boton_individual").removeClass("solicitud_pago_botones_hover");
			jQuery(".solicitud_pago_boton_multiple").addClass("solicitud_pago_botones_hover");
			jQuery(".solicitud_pago_individual").hide();
			jQuery(".solicitud_pago_multiple").show();
		});
	}

	if(jQuery("form[name='form_acreditaciones_solicitud_individual']").length)
	{
		jQuery("#solicitud_individual_enviar_formulario").unbind("click").click(function(){solicitud_pago_individual_enviar_formulario(jQuery("form[name='form_acreditaciones_solicitud_individual']"));});
	}

	if(jQuery("#solicitud_pago_multiple_boton_anadir").length)
	{
		jQuery("#solicitud_pago_multiple_boton_anadir").unbind("click").click(function(){solicitud_pago_multiple_anadir_acreditado();});
		jQuery("input[name='Aanadiracreditado']").on('keypress',function(e) {
		    if(e.which == 13) {
		        solicitud_pago_multiple_anadir_acreditado();
		        return false;
		    }
		});
	}

	if(jQuery("form[name='form_acreditaciones_solicitud_multiple']").length)
	{
		jQuery("#solicitud_multiple_enviar_formulario_guardar").unbind("click").click(function(){solicitud_pago_multiple_enviar_formulario(jQuery("form[name='form_acreditaciones_solicitud_multiple']"),"guardar");});
		jQuery("#solicitud_multiple_enviar_formulario_enviar").unbind("click").click(function(){solicitud_pago_multiple_enviar_formulario(jQuery("form[name='form_acreditaciones_solicitud_multiple']"),"confirmar");});
	}

	if(jQuery("form[name='form_nueva_acreditaciones']").length)
	{
		jQuery("select[name='Atipoacreditacion']").unbind("change").change(function(){
			if(jQuery(this).val()=="online_pack"){jQuery("#online_tarifa_empresa").css({display:"block"});}else{jQuery("#online_tarifa_empresa").css({display:"none"});}
		});
		jQuery("input[name='Atarifaempresa']").unbind("click").click(function(){
			if(jQuery(this).is(":checked")){jQuery("#online_tarifa_empresa_contenido").css({display:"block"});jQuery("input[name='Atarifaempresa_repren_empresa1']").val(jQuery("input[name='Aempresa']").val());}else{jQuery("#online_tarifa_empresa_contenido").css({display:"none"});}
		});
		jQuery("#acreditacion_representantes_anadir").unbind("click").click(function(){acreditarse_representantes_anadir();});
		if(jQuery("select[name='Atipoacreditacion']").val()=="online_pack"){jQuery("#online_tarifa_empresa").css({display:"block"});}
		if(jQuery("input[name='Atarifaempresa_repren_nombre1']").val()!=""){jQuery("input[name='Atarifaempresa']").click();}

		jQuery("#acreditacionesguardar_enviar_formulario").unbind("click").click(function(){acreditarse_enviar_formulario(jQuery("form[name='form_nueva_acreditaciones']"),"guardar");});
		jQuery("#acreditaciones_enviar_formulario").unbind("click").click(function(){acreditarse_enviar_formulario(jQuery("form[name='form_nueva_acreditaciones']"),"confirmar");});
		jQuery("#editaracreditaciones_enviar_formulario").unbind("click").click(function(){editaracreditarse_enviar_formulario(jQuery("form[name='form_nueva_acreditaciones']"));});
		jQuery("#editaracreditacionesmantener_enviar_formulario").unbind("click").click(function(){acreditarse_enviar_formulario(jQuery("form[name='form_nueva_acreditaciones']"),"mantener");});
	}
	if(jQuery("form[name='form_nueva_acreditaciones_en']").length)
	{
		jQuery("select[name='Atipoacreditacion']").unbind("change").change(function(){
			if(jQuery(this).val()=="online_pack"){jQuery("#online_tarifa_empresa").css({display:"block"});}else{jQuery("#online_tarifa_empresa").css({display:"none"});}
		});
		jQuery("input[name='Atarifaempresa']").unbind("click").click(function(){
			if(jQuery(this).is(":checked")){jQuery("#online_tarifa_empresa_contenido").css({display:"block"});jQuery("input[name='Atarifaempresa_repren_empresa1']").val(jQuery("input[name='Aempresa']").val());}else{jQuery("#online_tarifa_empresa_contenido").css({display:"none"});}
		});
		jQuery("#acreditacion_representantes_anadir").unbind("click").click(function(){acreditarse_representantes_anadir_en();});

		jQuery("#acreditacionesguardar_enviar_formulario_en").unbind("click").click(function(){acreditarse_enviar_formulario_en(jQuery("form[name='form_nueva_acreditaciones_en']"),"guardar");});
		jQuery("#acreditaciones_enviar_formulario_en").unbind("click").click(function(){acreditarse_enviar_formulario_en(jQuery("form[name='form_nueva_acreditaciones_en']"),"confirmar");});
		jQuery("#editaracreditaciones_enviar_formulario").unbind("click").click(function(){editaracreditarse_enviar_formulario_en(jQuery("form[name='form_nueva_acreditaciones']"));});
		jQuery("#editaracreditacionesmantener_enviar_formulario").unbind("click").click(function(){acreditarse_enviar_formulario_en(jQuery("form[name='form_nueva_acreditaciones_en']"),"mantener");});
	}
	if(jQuery(".form_acred_matchmaking_boton").length)
	{
		jQuery(".form_acred_matchmaking_boton").unbind("click").click(function(){
			if(jQuery(".form_acred_matchmaking").css("display")=="none")
			{
				var scroll = jQuery(window).scrollTop();
				jQuery(".form_acred_matchmaking").slideDown("normal");
				jQuery('html,body').animate({ scrollTop: scroll }, 'normal');
				jQuery(".form_acred_matchmaking_boton").find("i").removeClass("fa-angle-down");
				jQuery(".form_acred_matchmaking_boton").find("i").addClass("fa-angle-up");
			}else{
				jQuery(".form_acred_matchmaking").slideUp("normal");
				jQuery(".form_acred_matchmaking_boton").find("i").removeClass("fa-angle-up");
				jQuery(".form_acred_matchmaking_boton").find("i").addClass("fa-angle-down");
			}
		});
	}
	if(jQuery("#formulario_acreditacion_ver").length)
	{
		jQuery("#formulario_acreditacion_ver").unbind("click").click(function(){jQuery("#formulario_acreditacion").css({display:"inline-block"});});
	}

	if(jQuery("#presentarunproyecto_cargar_formulario").length)
	{
		jQuery("#presentarunproyecto_cargar_formulario").unbind("click").click(function(){presentarunproyecto_cargar_formulario(0);});
	}
	jQuery(".modificar_proyecto").each(function() 
	{
		jQuery(this).unbind("click").click(function(){
			presentarunproyecto_cargar_formulario(jQuery(this).attr("id"));
		});
	});
	jQuery(".ver_proyecto").each(function() 
	{
		jQuery(this).unbind("click").click(function(){
			presentarunproyecto_cargar_formulario(jQuery(this).attr("id"));
		});
	});
	if(jQuery("#presentarunproyecto_cargar_formulario_en").length)
	{
		jQuery("#presentarunproyecto_cargar_formulario_en").unbind("click").click(function(){presentarunproyecto_cargar_formulario_en(0);});
	}
	jQuery(".modificar_proyecto_en").each(function() 
	{
		jQuery(this).unbind("click").click(function(){
			presentarunproyecto_cargar_formulario_en(jQuery(this).attr("id"));
		});
	});
	jQuery(".ver_proyecto_en").each(function() 
	{
		jQuery(this).unbind("click").click(function(){
			presentarunproyecto_cargar_formulario_en(jQuery(this).attr("id"));
		});
	});

	jQuery("#cyp_boton_editar_agenda_descargar_front").unbind("click").click(function(){descargar_agenda_excel();});

	jQuery("#cyp_boton_editar_perfil_cerrar_sesion").unbind("click").click(function(){
		if(jQuery("#cerrarsesion_enviar_formulario").length){jQuery("#cerrarsesion_enviar_formulario").click();}
		if(jQuery("#cerrarsesion_enviar_formulario_en").length){jQuery("#cerrarsesion_enviar_formulario_en").click();}
	});

	if(jQuery("form[name='form_nueva_recuperarpass']").length)
	{
		jQuery("#recuperarpass_enviar_formulario").unbind("click").click(function(){recuperarpass_enviar(jQuery("form[name='form_nueva_recuperarpass']"));});
	}
	if(jQuery("form[name='form_nueva_recuperarpass_en']").length)
	{
		jQuery("#recuperarpass_enviar_formulario").unbind("click").click(function(){recuperarpass_enviar_en(jQuery("form[name='form_nueva_recuperarpass_en']"));});
	}

	if(jQuery("#descargar_csv_cuentas").length)
	{
		jQuery("#descargar_csv_cuentas").unbind("click").click(function(){descargar_csv_cuentas();});
	}
	if(jQuery("#descargar_csv_acreditaciones").length)
	{
		jQuery("#descargar_csv_acreditaciones").unbind("click").click(function(){descargar_csv_acreditaciones(jQuery(this).attr("tipo"));});
	}
	if(jQuery("#forzar_acreditaciones_todo").length)
	{
		jQuery("#forzar_acreditaciones_todo").unbind("click").click(function(){forzar_acreditaciones_todo();});
	}
	if(jQuery("#forzar_acreditaciones").length)
	{
		jQuery("#forzar_acreditaciones").unbind("click").click(function(){forzar_acreditaciones();});
	}
	if(jQuery("#descargar_csv_proyectos").length)
	{
		jQuery("#descargar_csv_proyectos").unbind("click").click(function(){descargar_csv_proyectos();});
	}
	if(jQuery("#descargar_csv_proyectos_digital").length)
	{
		jQuery("#descargar_csv_proyectos_digital").unbind("click").click(function(){descargar_csv_proyectos_digital();});
	}
	if(jQuery("#descargar_csv_pagos").length)
	{
		jQuery("#descargar_csv_pagos").unbind("click").click(function(){descargar_csv_pagos();});
	}
	if(jQuery("#descargar_csv_cuentasinvitados").length)
	{
		jQuery("#descargar_csv_cuentasinvitados").unbind("click").click(function(){descargar_csv_cuentasinvitados();});
	}
	/*if(jQuery("#descargar_csv_acreditacionesinvitados").length)
	{
		jQuery("#descargar_csv_acreditacionesinvitados").unbind("click").click(function(){descargar_csv_acreditacionesinvitados();});
	}*/
	if(jQuery("#descargar_csv_cuentasprensa").length)
	{
		jQuery("#descargar_csv_cuentasprensa").unbind("click").click(function(){descargar_csv_cuentasprensa();});
	}
	/*if(jQuery("#descargar_csv_acreditacionesprensa").length)
	{
		jQuery("#descargar_csv_acreditacionesprensa").unbind("click").click(function(){descargar_csv_acreditacionesprensa();});
	}*/
	if(jQuery("#descargar_csv_cuentasestudiantes").length)
	{
		jQuery("#descargar_csv_cuentasestudiantes").unbind("click").click(function(){descargar_csv_cuentasestudiantes();});
	}
	if(jQuery("#descargar_csv_cuentasvoluntarios").length)
	{
		jQuery("#descargar_csv_cuentasvoluntarios").unbind("click").click(function(){descargar_csv_cuentasvoluntarios();});
	}
	/*if(jQuery("#descargar_csv_acreditacionesestudiantes").length)
	{
		jQuery("#descargar_csv_acreditacionesestudiantes").unbind("click").click(function(){descargar_csv_acreditacionesestudiantes();});
	}
	if(jQuery("#descargar_csv_acreditacionesvoluntarios").length)
	{
		jQuery("#descargar_csv_acreditacionesvoluntarios").unbind("click").click(function(){descargar_csv_acreditacionesvoluntarios();});
	}*/
	if(jQuery("#descargar_csv_reuniones").length)
	{
		jQuery("#descargar_csv_reuniones").unbind("click").click(function(){descargar_csv_reuniones();});
	}

	if(jQuery("#cyp_acreditaciones_cond_pro").length)
	{
		jQuery("#cyp_acreditaciones_cond_pro").unbind("click").click(function(){jQuery(".cyp_acreditacion_2").css({"display":"none"});jQuery(".cyp_acreditacion_1").css({"display":"block"});jQuery("#cyp_acreditaciones_cond_pro").attr("class","cyp_acreditaciones_pestanas_2_nueva");jQuery("#cyp_acreditaciones_cond_prensa").attr("class","cyp_acreditaciones_pestanas_1_nueva");});

		jQuery("#cyp_acreditaciones_cond_prensa").unbind("click").click(function(){jQuery(".cyp_acreditacion_1").css({"display":"none"});jQuery(".cyp_acreditacion_2").css({"display":"block"});jQuery("#cyp_acreditaciones_cond_pro").attr("class","cyp_acreditaciones_pestanas_1_nueva");jQuery("#cyp_acreditaciones_cond_prensa").attr("class","cyp_acreditaciones_pestanas_2_nueva");});

		jQuery("#cyp_acreditaciones_cond_pro").click();
	}

	if(jQuery("#cyp_acreditaciones_estado").length)
	{
		jQuery("#cyp_acreditaciones_estado").unbind("click").click(function(){jQuery(".cyp_acreditacion_1").css({"display":"none"});jQuery(".cyp_acreditacion_2").css({"display":"none"});jQuery(".cyp_acreditacion_3").css({"display":"block"});jQuery("#cyp_acreditaciones_estado").attr("class","cyp_acreditaciones_pestanas_2_nueva");jQuery("#cyp_acreditaciones_condiciones").attr("class","cyp_acreditaciones_pestanas_1_nueva");});
	}
	if(jQuery("#cyp_acreditaciones_condiciones").length)
	{
		jQuery("#cyp_acreditaciones_condiciones").unbind("click").click(function(){jQuery(".cyp_acreditacion_1").css({"display":"block"});jQuery(".cyp_acreditacion_2").css({"display":"block"});jQuery(".cyp_acreditacion_3").css({"display":"none"});jQuery("#cyp_acreditaciones_estado").attr("class","cyp_acreditaciones_pestanas_1_nueva");jQuery("#cyp_acreditaciones_condiciones").attr("class","cyp_acreditaciones_pestanas_2_nueva");});

		if(jQuery(".cyp_menu_der_conecta2").length){jQuery(".cyp_acreditacion_1").css({"display":"none"});jQuery(".cyp_acreditacion_2").css({"display":"none"});jQuery(".cyp_acreditacion_3").css({"display":"block"});jQuery("#cyp_acreditaciones_estado").attr("class","cyp_acreditaciones_pestanas_2_nueva");jQuery("#cyp_acreditaciones_condiciones").attr("class","cyp_acreditaciones_pestanas_1_nueva");}else{jQuery(".cyp_acreditacion_1").css({"display":"block"});jQuery(".cyp_acreditacion_2").css({"display":"block"});jQuery(".cyp_acreditacion_3").css({"display":"none"});jQuery("#cyp_acreditaciones_estado").attr("class","cyp_acreditaciones_pestanas_1_nueva");jQuery("#cyp_acreditaciones_condiciones").attr("class","cyp_acreditaciones_pestanas_2_nueva");}
	}
	if(jQuery("#cyp_acreditaciones_estado_prensa").length)
	{
		jQuery("#cyp_acreditaciones_estado_prensa").unbind("click").click(function(){jQuery(".cyp_acreditacion_3").css({"display":"none"});jQuery(".cyp_acreditacion_4").css({"display":"none"});jQuery(".cyp_acreditacion_5").css({"display":"block"});jQuery("#cyp_acreditaciones_estado_prensa").attr("class","cyp_acreditaciones_pestanas_4_nueva");jQuery("#cyp_acreditaciones_condiciones_prensa").attr("class","cyp_acreditaciones_pestanas_3_nueva");});
	}
	if(jQuery("#cyp_acreditaciones_condiciones_prensa").length)
	{
		jQuery("#cyp_acreditaciones_condiciones_prensa").unbind("click").click(function(){jQuery(".cyp_acreditacion_3").css({"display":"block"});jQuery(".cyp_acreditacion_4").css({"display":"block"});jQuery(".cyp_acreditacion_5").css({"display":"none"});jQuery("#cyp_acreditaciones_estado_prensa").attr("class","cyp_acreditaciones_pestanas_3_nueva");jQuery("#cyp_acreditaciones_condiciones_prensa").attr("class","cyp_acreditaciones_pestanas_4_nueva");});

		if(jQuery(".cyp_menu_der_conecta2").length){jQuery(".cyp_acreditacion_3").css({"display":"none"});jQuery(".cyp_acreditacion_4").css({"display":"none"});jQuery(".cyp_acreditacion_5").css({"display":"block"});jQuery("#cyp_acreditaciones_estado_prensa").attr("class","cyp_acreditaciones_pestanas_4_nueva");jQuery("#cyp_acreditaciones_condiciones_prensa").attr("class","cyp_acreditaciones_pestanas_3_nueva");}else{jQuery(".cyp_acreditacion_3").css({"display":"block"});jQuery(".cyp_acreditacion_4").css({"display":"block"});jQuery(".cyp_acreditacion_5").css({"display":"none"});jQuery("#cyp_acreditaciones_estado_prensa").attr("class","cyp_acreditaciones_pestanas_3_nueva");jQuery("#cyp_acreditaciones_condiciones_prensa").attr("class","cyp_acreditaciones_pestanas_4_nueva");}
	}

	if(jQuery("form[name='form_nueva_acreditaciones_pago']").length)
	{
		jQuery("#acreditacionespagar_enviar_formulario").unbind("click").click(function(){acreditarse_pagar_enviar_formulario(jQuery("form[name='form_nueva_acreditaciones_pago']"),"paypal","");});
	}

	if(jQuery("#acreditacionespagar_enviar_formulario_transferencia").length)
	{
		jQuery("#acreditacionespagar_enviar_formulario_transferencia").unbind("click").click(function(){acreditarse_pagar_enviar_formulario(jQuery("form[name='form_nueva_acreditaciones_pago']"),"transferencia","");});
	}

	if(jQuery("form[name='form_nueva_acreditaciones_pago_bus']").length)
	{
		jQuery("#acreditacionespagar_enviar_formulario_bus").unbind("click").click(function(){acreditarse_pagar_enviar_formulario(jQuery("form[name='form_nueva_acreditaciones_pago_bus']"),"paypal","_bus");});
	}

	if(jQuery("#acreditacionespagar_enviar_formulario_transferencia_bus").length)
	{
		jQuery("#acreditacionespagar_enviar_formulario_transferencia_bus").unbind("click").click(function(){acreditarse_pagar_enviar_formulario(jQuery("form[name='form_nueva_acreditaciones_pago_bus']"),"transferencia","_bus");});
	}

	if(jQuery("form[name='form_nueva_acreditaciones_aceptar_seminario']").length)
	{
		jQuery("#acreditacionesaceptarseminario_enviar_formulario").unbind("click").click(function(){seminario_aceptar_enviar_formulario(jQuery("form[name='form_nueva_acreditaciones_aceptar_seminario']"));});
	}

	if(jQuery("form[name='form_nueva_acreditaciones_aceptar_reservabus']").length)
	{
		jQuery("#acreditacionesaceptarbus_enviar_formulario").unbind("click").click(function(){solicitarbus_aceptar_enviar_formulario(jQuery("form[name='form_nueva_acreditaciones_aceptar_reservabus']"));});
	}

	if(jQuery("form[name='form_nueva_acreditaciones_solicitar_bus']").length)
	{
		jQuery("#acreditacionessolicitarbus_enviar_formulario").unbind("click").click(function(){solicitarbus_solicitar_enviar_formulario(jQuery("form[name='form_nueva_acreditaciones_solicitar_bus']"));});
	}

	if(jQuery("form[name='form_nueva_acreditaciones_pago_ampliacion']").length)
	{
		jQuery("#acreditacionespagar_enviar_formulario_ampliacion").unbind("click").click(function(){acreditarse_pagar_enviar_formulario(jQuery("form[name='form_nueva_acreditaciones_pago_ampliacion']"),"paypal","_ampliacion");});
	}

	if(jQuery("#acreditacionespagar_enviar_formulario_transferencia_ampliacion").length)
	{
		jQuery("#acreditacionespagar_enviar_formulario_transferencia_ampliacion").unbind("click").click(function(){acreditarse_pagar_enviar_formulario(jQuery("form[name='form_nueva_acreditaciones_pago_ampliacion']"),"transferencia","_ampliacion");});
	}

	if(jQuery("#mostrar_landing").length)
	{
		jQuery("#fondo_ventana").css({display:"none",height:jQuery(document).outerHeight()+50+"px"}).fadeIn("normal",function(){
			jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=landing",success:function(data){
				jQuery("#ventana").html(data);
				situar_ventana();
			}});
		});
	}

	if(jQuery("form[name='form_editar_cuenta']").length)
	{
		jQuery("#editarperfil_enviar_formulario").unbind("click").click(function(){editarperfil_enviar_formulario(jQuery("form[name='form_editar_cuenta']"));});
	}

	if(jQuery("#cyp_editar_acreditacion_imagen_subir").length)
	{
		jQuery("#cyp_editar_acreditacion_imagen_subir").on('click', function(e){
	        e.preventDefault();
	        jQuery("#Efoto:hidden").trigger('click');
	    });
	    jQuery("input[name='Efoto']").change(function(){
	        editaracreditarse_imagen_enviar();
	    });
	}
	if(jQuery("form[name='form_editar_acreditaciones']").length)
	{
		jQuery("#editaracreditaciones_enviar_formulario").unbind("click").click(function(){editaracreditarse_datos_enviar(jQuery("form[name='form_editar_acreditaciones']"));});
	}
	if(jQuery("form[name='form_editar_acreditaciones_matchmaking']").length)
	{
		jQuery("#editaracreditacionesmatchmaking_enviar_formulario").unbind("click").click(function(){editaracreditarsematchmaking_datos_enviar(jQuery("form[name='form_editar_acreditaciones_matchmaking']"));});
	}
	if(jQuery("form[name='form_editar_bus']").length)
	{
		jQuery("#editarbus_enviar_formulario").unbind("click").click(function(){editarabus_datos_enviar(jQuery("form[name='form_editar_bus']"));});
	}
	if(jQuery("#cyp_boton_editar_perfil").length){jQuery("#cyp_boton_editar_perfil").unbind("click").click(function(){editaracreditarse_mostrar("acreditacion");});}
	if(jQuery("#cyp_boton_editar_matchmaking").length){jQuery("#cyp_boton_editar_matchmaking").unbind("click").click(function(){editaracreditarse_mostrar("acreditacionmatchmaking");});}
	if(jQuery("#cyp_boton_editar_seminario").length){jQuery("#cyp_boton_editar_seminario").unbind("click").click(function(){editaracreditarse_mostrar("seminario");});}
	if(jQuery("#cyp_boton_editar_solicitarbus").length){jQuery("#cyp_boton_editar_solicitarbus").unbind("click").click(function(){editaracreditarse_mostrar("solicitarbus");});}
	if(jQuery("#cyp_boton_editar_ampliaciones").length){jQuery("#cyp_boton_editar_ampliaciones").unbind("click").click(function(){editaracreditarse_mostrar("ampliaciones");});}
	if(jQuery("#cyp_boton_editar_bus").length){jQuery("#cyp_boton_editar_bus").unbind("click").click(function(){editaracreditarse_mostrar("bus");});}
	if(jQuery("#cyp_boton_editar_agenda").length){jQuery("#cyp_boton_editar_agenda").unbind("click").click(function(){editaracreditarse_mostrar("agenda");});}
	if(jQuery("#cyp_boton_editar_reuniones").length){jQuery("#cyp_boton_editar_reuniones").unbind("click").click(function(){editaracreditarse_mostrar("reuniones");});}
	if(jQuery("#cyp_boton_editar_mensajes").length){jQuery("#cyp_boton_editar_mensajes").unbind("click").click(function(){editaracreditarse_mostrar("mensajes");});}
	if(jQuery("#cyp_boton_editar_volver").length){jQuery("#cyp_boton_editar_volver").unbind("click").click(function(){editaracreditarse_mostrar("volver");});}

	if(jQuery("#cyp_boton_editar_miseventos").length){jQuery("#cyp_boton_editar_miseventos").unbind("click").click(function(){editaracreditarse_mostrar("miseventos");});}

	if(jQuery("#cyp_editar_perfil_anadir_proyecto").length){jQuery("#cyp_editar_perfil_anadir_proyecto").unbind("click").click(function(){editaracreditarse_anadir_proyecto();});}
	if(jQuery("#cyp_editar_perfil_anadir_idioma").length){jQuery("#cyp_editar_perfil_anadir_idioma").unbind("click").click(function(){editaracreditarse_anadir_idioma();});}
	if(jQuery("#cyp_editar_perfil_anadir_hueco").length){editaracreditarse_huecos_fecha_hora();jQuery("#cyp_editar_perfil_anadir_hueco").unbind("click").click(function(){editaracreditarse_anadir_hueco();});}
	if(jQuery("form[name='form_editar_acreditacionesreuniones']").length)
	{
		editaracreditarse_botones_eliminar();
		jQuery("#editaracreditacionesreuniones_enviar_formulario").unbind("click").click(function(){editaracreditarse_datosreuniones_enviar(jQuery("form[name='form_editar_acreditacionesreuniones']"));});
	}

	if(jQuery(".cyp_participantes_cargar").length){participantes_secciones("");}
	if(jQuery(".cyp_participantes_cargar").length){participantes_buscador("");}
	if(jQuery(".cyp_participantes_cargar").length){jQuery("input[name='participantes_buscador']").unbind("keyup").keyup(function(){participantes_buscador(jQuery(this).val());});}
	if(jQuery(".cyp_participantes_cargar").length){jQuery("select[name='cyp_participantes_filtropais']").unbind("change").change(function(){participantes_busqueda("participantes");});}
	if(jQuery(".cyp_participantes_cargar").length){jQuery("#descargar_parcicipantes_excel").unbind("click").click(function(){descargar_participantes_excel();});}
	if(jQuery(".cyp_participantes_cargar").length){participantes_botones();}
	if(jQuery(".cyp_participantes_cargar").length){participantes_botones_huecos();}

	if(jQuery("#descargar_parcicipantes_excel").length)
	{
		jQuery("#descargar_parcicipantes_excel").unbind("click").click(function(){descargar_participantes_excel();});
	}

	if(jQuery(".cyp_sponsors_cargar").length){sponsors_cargar();}

	if(jQuery("#contectafiction_programa").length){gestionarprograma_nueva();gestionarprograma_listar();}

	if(jQuery("#contectafiction_programa_cat").length){gestionarprogramacat_nueva();gestionarprogramacat_listar();}

	if(jQuery("#contectafiction_ponentespopups").length){gestionarponentespopups_nueva();gestionarponentespopups_listar();}

	if(jQuery("#contectafiction_archivo").length){gestionararchivo_nueva();gestionararchivo_listar();}

	if(jQuery("#contectafiction_sponsors").length){gestionarsponsors_nueva();gestionarsponsors_listar();}

	if(jQuery("#contectafiction_reunionessalas").length){gestionarreunionessalas_nueva();gestionarreunionessalas_listar();}

	if(jQuery("#contectafiction_proyectosseleccionados").length){gestionarproyectosseleccionados_nueva();gestionarproyectosseleccionados_listar();}

	if(jQuery("#contectafiction_scroller").length){gestionarscroller_nueva();}

	if(jQuery("#contectafiction_descuentos").length){gestionardescuentos_nueva();}

	if(jQuery("#contectafiction_insitu").length){gestionarinsitu_nueva();}

	if(jQuery("#contectafiction_textos").length){gestionartextos_nueva();}

	if(jQuery("#contectafiction_configuraciongeneral").length){configuraciongeneral_nueva();}

	if(jQuery(".cyp_programa_cargar").length){programa_botones();}

	if(jQuery(".cyp_programaabierto_cargar").length){programaabierto_cargar();}

	if(jQuery(".cyp_archivo_cargar").length){archivo_cargar();}

	if(jQuery(".cyp_participantesreunionespitchings_cargar").length){participantesreunionespitchings_buscador("");}
	if(jQuery(".cyp_participantesreunionespitchings_cargar").length){jQuery("input[name='participantes_buscador']").unbind("keyup").keyup(function(){participantesreunionespitchings_buscador(jQuery(this).val());});}
	if(jQuery(".cyp_participantesreunionespitchings_cargar").length){participantesreunionespitchings_botones();}
	//if(jQuery(".cyp_participantesreunionespitchings_cargar").length){participantesreunionespitchings_botones_huecos();}

	if(jQuery(".cyp_participantesprensa_cargar").length){participantesprensa_buscador("");}
	if(jQuery(".cyp_participantesprensa_cargar").length){jQuery("input[name='participantes_buscador']").unbind("keyup").keyup(function(){participantesprensa_buscador(jQuery(this).val());});}
	if(jQuery(".cyp_participantesprensa_cargar").length){participantesprensa_botones();}

	//cyp_agenda_check

	jQuery(".cyp_boton_descargar_factura").each(function() 
	{
		jQuery(this).unbind("click").click(function(){descargar_modelo_factura_pdf(jQuery(this).attr("idpago"),"factura");});
	});

	if(jQuery("#cyp_boton_descargar_eticket").length)
	{
		jQuery("#cyp_boton_descargar_eticket").unbind("click").click(function(){descargar_eticket();});
	}

	if(jQuery(".cyp_programa_dia_actual").length)
	{
		jQuery("a[fecha='"+jQuery(".cyp_programa_dia_actual").html()+"']").click();
	}

	if(jQuery("#cyp_boton_editar_agenda").length)
	{
		jQuery("#cyp_menu_logo").find("a").each(function() 
		{
			if(jQuery(this).attr("href").indexOf("#agenda")!=-1){jQuery(this).unbind("click").click(function(){editaracreditarse_mostrar("agenda");});}
		});
	}

	if(jQuery("#cyp_boton_editar_reuniones").length)
	{
		jQuery("#cyp_menu_logo").find("a").each(function() 
		{
			if(jQuery(this).attr("href").indexOf("#reuniones")!=-1){jQuery(this).unbind("click").click(function(){editaracreditarse_mostrar("reuniones");});}
		});
	}

	if(jQuery(".cyp_editar_perfil_boton_video_bienvenida").length)
	{
		video='<iframe width="560" height="315" src="https://www.youtube.com/embed/dKMDcZnyG68?autoplay=true" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>';
		if(window.location.href.indexOf('/en/')!=-1){titulo="WELCOME TO Conecta FICTION & ENTERTAINMENT!";}else{titulo="¡BIENVENIDO A Conecta FICTION & ENTERTAINMENT!";}

		setTimeout(function(){jQuery(".cyp_editar_perfil_boton_video_bienvenida").click();jQuery(".cyp_editar_perfil_boton_video_bienvenida_contenido").html(video);jQuery(".cyp_editar_perfil_boton_video_bienvenida_contenido").parent().parent().find(".popmake-title").css("font-size","20px").html(titulo);},2000);

		jQuery(".popmake-close").each(function() 
		{
			jQuery(this).unbind("click").click(function(){/*jQuery(this).parent().parent().remove();*/jQuery(this).parent().find("iframe").remove();});
		});
	}

	if(jQuery(".typeform-share").length)
	{
		setTimeout(function(){jQuery(".typeform-share").click();j},2000);
	}

	matchmaking_tags();

	mantener_sesion();
	cf_timers();
	cf_timers_streaming();
	cf_streaming_estadisticas();
	cf_bannerize_contabilizar_impresiones();
	cf_ponentes_popups();
});

function cf_bannerize_contabilizar_impresiones()
{
	jQuery(".bannerize_contabilizar_impresion").each(function(){
		jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=bannerize_contabilizar_impresion&group="+jQuery(this).attr("group"),success:function(data){}});
		jQuery(this).remove();
	});

	setTimeout(function(){cf_bannerize_contabilizar_impresiones();},5000);
}

function mantener_sesion()
{
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=mantener_sesion_abierta",success:function(data){
		if(data=="recargar"){location.reload(true);}
	}});

	//COMPROBAR REUNIONES
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=comprobar_notificaciones&url="+window.location.href,success:function(data){
		if(data!=""){
			if(!jQuery(".cf_notificaciones").length){jQuery("body").append("<div class='cf_notificaciones'></div>");}
			jQuery(".cf_notificaciones").html(data);
			jQuery(".cf_notificaciones").find(".cf_notificacion").each(function(){
				if(jQuery(this).find(".cf_notificacion_boton_iniciar_videollamada").length)
				{
					jQuery(this).find(".cf_notificacion_boton_iniciar_videollamada").unbind("click").click(function(){
						//console.log(jQuery(this).attr("tiempo_restante")+" "+jQuery(this).attr("duracion")+" "+jQuery(this).attr("mensaje"));

						if(jQuery(".cf_videollamada_fondo").length){jQuery(".cf_videollamada_fondo").remove();}
						jQuery("body").append("<div class='cf_videollamada_fondo'><div class='cf_videollamada_ventana'><div id='cf_videollamada_ventana_cont' class='cf_videollamada_ventana_cont'><div class='cf_videollamada_ventana_titulo'>"+jQuery(this).attr("mensaje")+" <span style='display:none' class='cf_time' cf_time='0'></span><i class='fa fa-times'></i></div><div class='cf_videollamada_ventana_codigo'></div></div></div></div>");
						jQuery(".cf_videollamada_ventana_titulo").find("i").unbind("click").click(function(){jQuery(".cf_videollamada_fondo").remove();});
						cf_videollamada();

						//var button = document.querySelector('#start');
						var container = document.querySelector('#cf_videollamada_ventana_cont');
						var api = null;

						//button.addEventListener('click', () => {
						    var domain = 'meet.systemli.org';//meet.jit.si
						    var options = {
						        'roomName': jQuery(this).attr("jitsi"),
						        'parentNode': container,
						        'width': '100%',
						        'height': '100%',
						        interfaceConfigOverwrite: { TOOLBAR_BUTTONS: ["microphone", "camera", "chat", "desktop", "filmstrip","settings","recording"]},
						    };
						    api = new JitsiMeetExternalAPI(domain, options);
						//});
						//jitsi.random-redirect.de
					});
				}
			});
		}else{
			if(jQuery(".cf_notificaciones").length){jQuery(".cf_notificaciones").remove();}
		}
	}});
	//FIN COMPROBAR REUNIONES

	setTimeout(function(){mantener_sesion();},60000);
}

function cf_timers()
{
	jQuery(".cf_time").each(function(){
		tiempo=parseInt(jQuery(this).attr("cf_time"));
		if(tiempo>0)
		{
			minutos=parseInt(tiempo/60);
			segundos=tiempo-(minutos*60);
			if(String(segundos).length==1){segundos="0"+String(segundos);}
			jQuery(this).html(minutos+":"+segundos);
			jQuery(this).attr("cf_time",parseInt(jQuery(this).attr("cf_time"))-1);
		}
		if(jQuery(this).parent().parent().find(".cf_notificacion_boton_iniciar_videollamada").length)
		{
			jQuery(this).parent().parent().find(".cf_notificacion_boton_iniciar_videollamada").attr("tiempo_restante",parseInt(jQuery(this).parent().parent().find(".cf_notificacion_boton_iniciar_videollamada").attr("tiempo_restante"))-1);
			if(parseInt(jQuery(this).parent().parent().find(".cf_notificacion_boton_iniciar_videollamada").attr("tiempo_restante"))<=0)
			{
				jQuery(".cf_videollamada_ventana_titulo").find(".cf_time").attr("cf_time",parseInt(jQuery(this).parent().parent().find(".cf_notificacion_boton_iniciar_videollamada").attr("duracion"))-parseInt(jQuery(this).parent().parent().find(".cf_notificacion_boton_iniciar_videollamada").attr("tiempo_restante"))*-1);
				jQuery(".cf_videollamada_ventana_titulo").find(".cf_time").css({display:"inline-block"});
			}
		}
	});

	setTimeout(function(){cf_timers();},1000);
}

function cf_timers_streaming()
{
	var control=false;

	if(jQuery(".cf_streaming_mktime_actual").length)
	{
		jQuery(".cf_streaming_mktime_actual").attr("valor",parseInt(jQuery(".cf_streaming_mktime_actual").attr("valor"))+1);

		var mktime_actual=parseInt(jQuery(".cf_streaming_mktime_actual").attr("valor"));

		jQuery(".cf_streaming_recarga").each(function(){
			var mktime_recarga=parseInt(jQuery(this).attr("valor"));

			if(mktime_actual==mktime_recarga || mktime_actual+1==mktime_recarga || mktime_actual-1==mktime_recarga)
			{
				setTimeout(function(){location.reload(true);},2000);
				control=true;
			}
		});
	}

	if(control==false){setTimeout(function(){cf_timers_streaming();},1000);}
}

function cf_streaming_estadisticas()
{
	if(jQuery(".cf_streaming_mktime_actual").length)
	{
		jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=streaming_estadisticas&stream="+jQuery(".cf_streaming_contenido").attr("valor")+"&sala="+jQuery(".cf_streaming_contenido").attr("sala"),success:function(data){}});
	}

	setTimeout(function(){cf_streaming_estadisticas();},60000);
}

function cf_videollamada()
{
	if(jQuery(".cf_videollamada_fondo").length)
	{
		jQuery(".cf_videollamada_fondo").css({height:jQuery("body").outerHeight()+"px"});
		jQuery(".cf_videollamada_ventana_cont").css({height:jQuery(window).outerHeight()-150+"px"});
	}
}

function procesar_hash()
{
	if(location.hash)
	{
		var hash = location.hash.substring(1);

		if(hash=="agenda" && jQuery(".cyp_editar_perfil_tipo").html()=="pro"){editaracreditarse_mostrar("agenda");}

		if(hash=="reuniones" && jQuery(".cyp_editar_perfil_tipo").html()=="pro"){editaracreditarse_mostrar("reuniones");}
		
		if(hash=="miseventos" && jQuery(".cyp_editar_perfil_tipo").html()=="pro"){editaracreditarse_mostrar("miseventos");}

		if(hash=="mensajes" && jQuery(".cyp_editar_perfil_tipo").html()=="pro"){editaracreditarse_mostrar("mensajes");}

		if(hash.indexOf("pr_")!=-1)
		{
			datos=hash.split("_");
			programa_cargar(datos[1]+"/"+datos[2]+"/"+datos[3]);
		}

		if(hash.indexOf("idp_")!=-1)
		{
			datos=hash.split("_");
			if(jQuery(".cyp_participantes_1_boton[idusuario='"+datos[1]+"']").length)
			{
				jQuery(".cyp_participantes_1_boton[idusuario='"+datos[1]+"']").click();
			}else{
				setTimeout(function(){procesar_hash();},1000);
			}
		}

		if(hash.indexOf("ids_")!=-1)
		{
			datos=hash.split("_");
			if(jQuery("a[idsponsor='"+datos[1]+"']").length)
			{
				jQuery("a[idsponsor='"+datos[1]+"']").click();
			}else{
				setTimeout(function(){procesar_hash();},1000);
			}
		}

		if(hash.indexOf("idac_")!=-1)
		{
			datos=hash.split("_");
			if(jQuery(".cyp_programa_cargar_horas").length)
			{
				programa_cargar_actividad(datos[1]);
			}else{
				setTimeout(function(){procesar_hash();},1000);
			}
		}
	}
}

function matchmaking_tags()
{
	jQuery(".cyp_acreditaciones_matchmaking").each(function(){
		jQuery(this).unbind("click").click(function(){
			if(jQuery(this).attr("class").indexOf("cyp_acreditaciones_matchmaking_check")==-1)
			{
				jQuery(this).addClass("cyp_acreditaciones_matchmaking_check");
			}else{
				jQuery(this).removeClass("cyp_acreditaciones_matchmaking_check");
			}
		});
	});
}

function bannerize_ocultar()
{
	jQuery(".wp_bannerize").each(function() 
	{
		jQuery(this).css({display:"none"});
	});
}

function bannerize_mostrar()
{
	jQuery(".wp_bannerize").each(function() 
	{
		jQuery(this).css({display:"inline-block"});
	});
}

function subir_scroll()
{
	window.scrollTo(0, 0);
}

function situar_ventana()
{
	if(jQuery("#ventana").html()!="")
	{
		jQuery("#fondo_ventana").css("height",jQuery(document).outerHeight());

		if(jQuery(window).outerWidth()>parseInt(jQuery("#ventana_contenido").css("max-width"))+5)
		{
			jQuery("#ventana_contenido").css("width",jQuery("#ventana_contenido").css("max-width"));
			jQuery("#ventana_contenido_cuerpo").css("width",jQuery("#ventana_contenido").outerWidth());
		}else{
			jQuery("#ventana_contenido").css("width",jQuery(window).outerWidth()-20);
			jQuery("#ventana_contenido_cuerpo").css("width",jQuery(window).outerWidth()-20);
		}
		if(jQuery(window).outerHeight()>parseInt(jQuery("#ventana_contenido").css("max-height")))
		{
			jQuery("#ventana_contenido").css("height",jQuery("#ventana_contenido").css("max-height"));
		}else{
			jQuery("#ventana_contenido").css("height",jQuery(window).outerHeight()-15);
		}

		jQuery("#ventana").css("top",(jQuery(window).outerHeight()-jQuery("#ventana_contenido").outerHeight())/2);

		jQuery("#ventana").fadeIn("normal");

		jQuery("#ventana_contenido_cerrar").unbind("click").click(function(){cerrar_ventana();});

		/*$("#ventana_contenido_inf_boton_cerrar").unbind("click").click(function(){cerrar_ventana();});

		alto=$("#ventana_contenido_cuerpo").innerHeight();
		$("#ventana_contenido_cuerpo").find(".ventana").css({display:"block",height:alto+"px",marginTop:"-5px"});
		$("#ventana_contenido_cuerpo").find(".ventana").find(".scroll").css({height:alto+"px"});

		campos_focus_blur();

		actualizar_scroll();*/
	}
}

function cerrar_ventana()
{
	jQuery("#ventana").fadeOut("normal",function(){
		jQuery("#ventana").html("");
		jQuery("#fondo_ventana").fadeOut("normal",function(){
			//desbloquear_scroll("ventana");
		});
	});
}

function datepicker_espanol()
{
	if(jQuery.datepicker)
	{
		jQuery.datepicker.regional['es'] = {
		closeText: 'Cerrar',
		prevText: '<Ant',
		nextText: 'Sig>',
		currentText: 'Hoy',
		monthNames: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre'],
		monthNamesShort: ['Ene','Feb','Mar','Abr', 'May','Jun','Jul','Ago','Sep', 'Oct','Nov','Dic'],
		dayNames: ['Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves', 'Viernes', 'Sábado'],
		dayNamesShort: ['Dom','Lun','Mar','Mié','Juv','Vie','Sáb'],
		dayNamesMin: ['Do','Lu','Ma','Mi','Ju','Vi','Sá'],
		weekHeader: 'Sm',
		dateFormat: 'dd/mm/yy',
		firstDay: 1,
		isRTL: false,
		showMonthAfterYear: false,
		yearSuffix: ''
		};
		jQuery.datepicker.setDefaults(jQuery.datepicker.regional['es']);
		jQuery(function () {
		jQuery("#fecha").datepicker();
		jQuery("#fecha2").datepicker();
		jQuery("#fecha3").datepicker();
		jQuery("#fecha4").datepicker();
		jQuery("#fecha_dl").datepicker();
		});
	}
}

function regular_botones_archivo()
{
	jQuery(".cyp_archivo_fecha_secciones_boton").find("div").each(function() 
	{
		/*if(jQuery(this).outerWidth()>jQuery(this).outerHeight())
		{
			width=jQuery(this).outerWidth();
			if(width>220){width=220;}
			jQuery(this).css("height",width+"px");
			jQuery(this).css("width",width+"px");
		}else{
			height=jQuery(this).outerHeight();
			if(height>220){height=220;}
			jQuery(this).css("width",height+"px");
			jQuery(this).css("height",height+"px");
		}*/

		width=jQuery(this).outerWidth();
		jQuery(this).css("height",width+"px");
	});
}

function regular_botones_acreditaciones()
{
	jQuery(".cyp_acreditaciones_pestanas").find("a").each(function() 
	{
		/*if(jQuery(this).outerWidth()>jQuery(this).outerHeight())
		{
			width=jQuery(this).outerWidth();
			if(width>220){width=220;}
			jQuery(this).css("height",width+"px");
			jQuery(this).css("width",width+"px");
		}else{
			height=jQuery(this).outerHeight();
			if(height>220){height=220;}
			jQuery(this).css("width",height+"px");
			jQuery(this).css("height",height+"px");
		}*/
		height=jQuery(this).outerWidth();
		//if(height>220){height=220;}
		//jQuery(this).css("width",height+"px");
		jQuery(this).css("height",height+"px");
	});
}

function regular_listados()
{
	jQuery(".listado_columna").each(function() 
	{
		jQuery(this).css("width","calc("+jQuery(this).attr("width")+" - 1px)").css("width","-moz-calc("+jQuery(this).attr("width")+" - 1px)").css("width","-webkit-calc("+jQuery(this).attr("width")+" - 1px)");
	});
	jQuery(".listado_celda").each(function() 
	{
		jQuery(this).css("width","calc("+jQuery(this).attr("width")+" - 1px)").css("width","-moz-calc("+jQuery(this).attr("width")+" - 1px)").css("width","-webkit-calc("+jQuery(this).attr("width")+" - 1px)");
	});
	jQuery(".listado_celda_hover").each(function() 
	{
		jQuery(this).css("width","calc("+jQuery(this).attr("width")+" - 1px)").css("width","-moz-calc("+jQuery(this).attr("width")+" - 1px)").css("width","-webkit-calc("+jQuery(this).attr("width")+" - 1px)");
	});
	jQuery(".listado_cat_hover").each(function() 
	{
		jQuery(this).css("width","calc("+jQuery(this).attr("width")+" - 1px)").css("width","-moz-calc("+jQuery(this).attr("width")+" - 1px)").css("width","-webkit-calc("+jQuery(this).attr("width")+" - 1px)");
	});
	jQuery(".listado_cat_sel").each(function() 
	{
		jQuery(this).css("width","calc("+jQuery(this).attr("width")+" - 1px)").css("width","-moz-calc("+jQuery(this).attr("width")+" - 1px)").css("width","-webkit-calc("+jQuery(this).attr("width")+" - 1px)");
	});
}

function campos_focus_blur()
{
	/*jQuery("input[type='file'],input[type='text'],input[type='password'],select,textarea").unbind("focus").focus(function(){if(jQuery(this).val()==jQuery("#campo_"+jQuery(this).attr("name")).html()){jQuery(this).val("");}if(jQuery(this).attr("name")!="cyp_buscador" && jQuery(this).attr("id")!="editor_post_html"){jQuery(this).animate({backgroundColor:'#dddddd',borderColor:"#191919"},"normal");}else{ajustar_buscador();}if(jQuery(this).attr("name").toLowerCase().indexOf("pass")>=0){jQuery(this).attr("type","password");}});
	jQuery("input[type='file'],input[type='text'],input[type='password'],select,textarea").unbind("blur").blur(function(){if(jQuery(this).val()==""){jQuery(this).val(jQuery("#campo_"+jQuery(this).attr("name")).html());}if(jQuery(this).attr("name")!="cyp_buscador"  && jQuery(this).attr("id")!="editor_post_html"){jQuery(this).animate({backgroundColor:'white'},"normal");}else{}if(jQuery(this).attr("name").toLowerCase().indexOf("pass")>=0 && jQuery(this).val()==jQuery("#campo_"+jQuery(this).attr("name")).html()){jQuery(this).attr("type","text");}});
	jQuery("input[type='checkbox']").unbind("click").click(function(){jQuery(this).parent().animate({backgroundColor:'transparent'});});

	jQuery("input").each(function(){
		if(jQuery(this).attr("name"))
		{
			//if(jQuery(this).attr("name").toLowerCase().indexOf("fecha")>=0){jQuery(this).datepicker("destroy");jQuery(this).datepicker();}
			//if(jQuery(this).attr("name").toLowerCase().indexOf("hora")>=0){jQuery(this).timepicker("destroy");jQuery(this).timepicker({hourText: 'Hora',minuteText: 'Minuto'});}
		}
	});*/

	jQuery(".patron").each(function() 
	{
		if(jQuery(this).html()=="numero")
		{
			datos=jQuery(this).attr("id").split("_");

			jQuery("input[name='"+datos[1]+"']").keyup(function () { 
			    this.value = this.value.replace(/[^0-9\.]/g,'');
			});
		}
	});
}

function formulario_error(formulario)
{
	bloqueo_formulario=true;

	jQuery("#error_"+formulario.find("input[type='submit']").attr("id")).html("campos obligatorios / mandatory fields");

	desp_left=formulario.find("input[type='submit']").offset().left-jQuery("#error_"+formulario.find("input[type='submit']").attr("id")).outerWidth()-5;
		
	jQuery("#error_"+formulario.find("input[type='submit']").attr("id")).css({top:(formulario.find("input[type='submit']").offset().top-jQuery(document).scrollTop())-((jQuery("#error_"+formulario.find("input[type='submit']").attr("id")).outerHeight()-formulario.find("input[type='submit']").outerHeight())/2),left:desp_left}).fadeIn("normal");
	setTimeout(function(){jQuery("#error_"+formulario.find("input[type='submit']").attr("id")).fadeOut("normal",function(){jQuery("#error_"+formulario.find("input[type='submit']").attr("id")).css({top:0,left:0});});bloqueo_formulario=false;},3000);
}

function formulario_error_patron(mensaje,formulario)
{
	bloqueo_formulario=true;

	jQuery("#patron_"+formulario.find("input[type='submit']").attr("id")).html(mensaje);

	desp_left=formulario.find("input[type='submit']").offset().left-jQuery("#patron_"+formulario.find("input[type='submit']").attr("id")).outerWidth()-5;
	
	jQuery("#patron_"+formulario.find("input[type='submit']").attr("id")).css({top:(formulario.find("input[type='submit']").offset().top-jQuery(document).scrollTop())-((jQuery("#patron_"+formulario.find("input[type='submit']").attr("id")).outerHeight()-formulario.find("input[type='submit']").outerHeight())/2),left:desp_left}).fadeIn("normal");
	setTimeout(function(){jQuery("#patron_"+formulario.find("input[type='submit']").attr("id")).fadeOut("normal",function(){jQuery("#patron_"+formulario.find("input[type='submit']").attr("id")).css({top:0,left:0});});bloqueo_formulario=false;},3000);
}

function formulario_patron(campo,formulario)
{
	var patron,mensaje,mensaje2;

	if(jQuery("#patron_"+campo.attr("name")).html()=="email"){patron=patron_email[0];mensaje=patron_email[1];mensaje2=jQuery("#patron_"+campo.attr("name")).html();}
	if(jQuery("#patron_"+campo.attr("name")).html()=="numero"){patron=patron_numero[0];mensaje=patron_numero[1];mensaje2=jQuery("#patron_"+campo.attr("name")).html();}
	if(jQuery("#patron_"+campo.attr("name")).html()=="usuario"){patron=patron_usuario[0];mensaje=patron_usuario[1];mensaje2=jQuery("#patron_"+campo.attr("name")).html();}

	if(!campo.val().match(patron))
	{
		jQuery(campo).css({borderColor:"#00beff"});

		formulario_error_patron(mensaje,formulario);

		return true;
	}else{
		return false;
	}
}

function formulario_aviso(formulario,campo)
{
	bloqueo_formulario=true;

	jQuery(campo).css({borderColor:"#ed8f03"});

	jQuery("#aviso_"+formulario.find("input[type='submit']").attr("id")).html(jQuery("#aviso_"+campo.attr("name")).html());

	desp_left=formulario.find("input[type='submit']").offset().left-jQuery("#aviso_"+formulario.find("input[type='submit']").attr("id")).outerWidth()-5;
	
	jQuery("#aviso_"+formulario.find("input[type='submit']").attr("id")).css({top:(formulario.find("input[type='submit']").offset().top-jQuery(document).scrollTop())-((jQuery("#aviso_"+formulario.find("input[type='submit']").attr("id")).outerHeight()-formulario.find("input[type='submit']").outerHeight())/2),left:desp_left}).fadeIn("normal");
	setTimeout(function(){jQuery("#aviso_"+formulario.find("input[type='submit']").attr("id")).fadeOut("normal",function(){jQuery("#aviso_"+formulario.find("input[type='submit']").attr("id")).css({top:0,left:0});});bloqueo_formulario=false;},3000);
}

function validar_formulario(formulario)
{
	var control=false;
	var error="";

	formulario.find(':input').each(function() 
	{
		if(jQuery(this)[0].tagName=="INPUT" || jQuery(this)[0].tagName=="PASSWORD" || jQuery(this)[0].tagName=="TEXTAREA")
		{
			if((jQuery(this).val()=="" || jQuery(this).val()==jQuery("#campo_"+jQuery(this).attr("name")).html()) && jQuery("#error_"+jQuery(this).attr("name")).length){control=true;jQuery(this).attr("style","border-color:#ff3334 !important");error="error";}else if(jQuery(this).val()=="" && jQuery("#error_"+jQuery(this).attr("name")).length){control=true;jQuery(this).attr("style","border-color:#ff3334 !important");error="error";}else if(jQuery("#patron_"+jQuery(this).attr("name")).length && control==false && jQuery("#error_"+jQuery(this).attr("name")).length){control=formulario_patron(jQuery(this),formulario);}
		}
		if(jQuery(this)[0].tagName=="SELECT")
		{
			if(jQuery(this).val()=="0" && jQuery("#error_"+jQuery(this).attr("name")).length){control=true;jQuery(this).attr("style","border-color:#ff3334 !important");error="error";}
		}
		if(jQuery(this).attr("type")=="checkbox")
		{
			if(!jQuery(this).is(':checked') && jQuery("#error_"+jQuery(this).attr("name")).length){control=true;jQuery(this).parent().css({background:"#ff3334"});error="error";}
		}
	});

	if(error=="error")
	{
		formulario_error(formulario);
	}

	if(control==false){return true;}else{return false;}
}

//CREAR CUENTA
function crearcuenta_enviar_formulario(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(jQuery("input[name='Ccont']").val()!=jQuery("input[name='Ccont2']").val() && validacion==true)
		{
			formulario_aviso(jQuery("form[name='form_nueva_cuenta']"),jQuery("input[name='Ccont']"));

			validacion=false;
		}

		var continentes_tags="";
		if(jQuery("#continentes_tags").length && control==false)
		{
			jQuery("#continentes_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				continentes_tags=continentes_tags+jQuery(this).attr("valor")+", ";
			});			
			if(continentes_tags==""){alert("Elige al menos una opción de \"Ubicación \"");control=true;}
		}

		var idiomas_tags="";
		if(jQuery("#idiomas_tags").length && control==false)
		{
			jQuery("#idiomas_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				idiomas_tags=idiomas_tags+jQuery(this).attr("valor")+", ";
			});			
			if(idiomas_tags==""){alert("Elige al menos una opción de \"Idiomas\"");control=true;}
		}

		var matchmaking_soy=continentes_tags+idiomas_tags;

		if(validacion==true && control==false)
		{
			jQuery("#boton_crearcuenta_enviar_formulario").html(cargando);
			jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=crearcuenta_comprobar_usuario&usuario="+jQuery("input[name='Cusuario']").val()+"",success:function(data){
				if(data=="error")
				{
					jQuery("form[name='form_nueva_cuenta']").attr("action","javascript://");
					jQuery("#boton_crearcuenta_enviar_formulario").html("<input id='crearcuenta_enviar_formulario' type='submit' class='boton' value='Crear Cuenta'>");
					setTimeout(function(){jQuery("#crearcuenta_enviar_formulario").unbind("click").click(function(){crearcuenta_enviar_formulario(jQuery("form[name='form_nueva_cuenta']"));});},0);
					formulario_aviso(jQuery("form[name='form_nueva_cuenta']"),jQuery("input[name='Cusuario']"));
					jQuery(".cyp_mensaje_email_registrado").html("Ya puede acreditarse <a href='https://www.eventconecta.com/conectame/'>iniciando sesión</a>");
				}else{
					jQuery("input[name='Amatchmakingsoy']").val(matchmaking_soy);
					jQuery("form[name='form_nueva_cuenta']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=crearcuenta_insertar");
					jQuery("form[name='form_nueva_cuenta']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
					jQuery("#submitinputcode").click();
				}
			}});
		}
	}
}

function crearcuenta_enviar_formulario_en(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(jQuery("input[name='Ccont']").val()!=jQuery("input[name='Ccont2']").val() && validacion==true)
		{
			formulario_aviso(jQuery("form[name='form_nueva_cuenta_en']"),jQuery("input[name='Ccont']"));

			validacion=false;
		}

		var continentes_tags="";
		if(jQuery("#continentes_tags").length && control==false)
		{
			jQuery("#continentes_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				continentes_tags=continentes_tags+jQuery(this).attr("valor")+", ";
			});			
			if(continentes_tags==""){alert("Choose at least one option in \"Location\"");control=true;}
		}

		var idiomas_tags="";
		if(jQuery("#idiomas_tags").length && control==false)
		{
			jQuery("#idiomas_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				idiomas_tags=idiomas_tags+jQuery(this).attr("valor")+", ";
			});			
			if(idiomas_tags==""){alert("Choose at least one option in \"Languages\"");control=true;}
		}

		var matchmaking_soy=continentes_tags+idiomas_tags;

		if(validacion==true && control==false)
		{
			jQuery("#boton_crearcuenta_enviar_formulario_en").html(cargando);
			jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=crearcuenta_comprobar_usuario&usuario="+jQuery("input[name='Cusuario']").val()+"",success:function(data){
				if(data=="error")
				{
					jQuery("form[name='form_nueva_cuenta_en']").attr("action","javascript://");
					jQuery("#boton_crearcuenta_enviar_formulario_en").html("<input id='crearcuenta_enviar_formulario_en' type='submit' class='boton' value='Create an Account'>");
					setTimeout(function(){jQuery("#crearcuenta_enviar_formulario_en").unbind("click").click(function(){crearcuenta_enviar_formulario_en(jQuery("form[name='form_nueva_cuenta_en']"));});},0);
					formulario_aviso(jQuery("form[name='form_nueva_cuenta_en']"),jQuery("input[name='Cusuario']"));
					jQuery(".cyp_mensaje_email_registrado").html("You can now <a href='https://www.eventconecta.com/en/connect-me/'>log in</a> to get your accreditation");
				}else{
					jQuery("input[name='Amatchmakingsoy']").val(matchmaking_soy);
					jQuery("form[name='form_nueva_cuenta_en']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=crearcuenta_insertar_en");
					jQuery("form[name='form_nueva_cuenta_en']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
					jQuery("#submitinputcode").click();
				}
			}});
		}
	}
}

function crearcuenta_enviar_formulario_estado(estado,tipo)
{
	if(estado=="ok")
	{
		jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=crearcuenta_mensaje&tipo="+tipo+"",success:function(data){
			jQuery(".formulario").html(data);
		}});
	}
}

function crearcuenta_enviar_formulario_estado_en(estado,tipo)
{
	if(estado=="ok")
	{
		jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=crearcuenta_mensaje_en&tipo="+tipo+"",success:function(data){
			jQuery(".formulario").html(data);
		}});
	}
}
//FIN CREAR CUENTA

//CONECTAME PRO
function conectamepro_iniciar_sesion(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(validacion==true && control==false)
		{
			jQuery("#boton_iniciarsesion_enviar_formulario").html(cargando);
			jQuery("form[name='form_nueva_iniciarsesion']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=conectamepro_iniciarsesion");
			jQuery("form[name='form_nueva_iniciarsesion']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}

function conectamepro_iniciar_sesion_en(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(validacion==true && control==false)
		{
			jQuery("#boton_iniciarsesion_enviar_formulario_en").html(cargando);
			jQuery("form[name='form_nueva_iniciarsesion_en']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=conectamepro_iniciarsesion");
			jQuery("form[name='form_nueva_iniciarsesion_en']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}

function conectamepro_iniciar_sesion_estado(estado)
{
	if(estado=="ok")
	{
		if(jQuery("#url_referer").length){conectamepro_iniciar_sesion_estado_referer(jQuery("#url_referer").html());}else{location.reload(true);}
	}else{
		jQuery("form[name='form_nueva_iniciarsesion']").attr("action","javascript://");
		jQuery("#boton_iniciarsesion_enviar_formulario").html("<input id='iniciarsesion_enviar_formulario' type='submit' class='boton' value='Iniciar Sesión'>");
		setTimeout(function(){jQuery("#iniciarsesion_enviar_formulario").unbind("click").click(function(){conectamepro_iniciar_sesion(jQuery("form[name='form_nueva_iniciarsesion']"));});},0);
		formulario_aviso(jQuery("form[name='form_nueva_iniciarsesion']"),jQuery("input[name='Iusuario']"));
	}
}

function conectamepro_iniciar_sesion_estado_en(estado)
{
	if(estado=="ok")
	{
		if(jQuery("#url_referer").length){conectamepro_iniciar_sesion_estado_referer(jQuery("#url_referer").html());}else{location.reload(true);}
	}else{
		jQuery("form[name='form_nueva_iniciarsesion_en']").attr("action","javascript://");
		jQuery("#boton_iniciarsesion_enviar_formulario_en").html("<input id='iniciarsesion_enviar_formulario_en' type='submit' class='boton' value='Log In'>");
		setTimeout(function(){jQuery("#iniciarsesion_enviar_formulario_en").unbind("click").click(function(){conectamepro_iniciar_sesion_en(jQuery("form[name='form_nueva_iniciarsesion_en']"));});},0);
		formulario_aviso(jQuery("form[name='form_nueva_iniciarsesion_en']"),jQuery("input[name='Iusuario']"));
	}
}

function conectamepro_iniciar_sesion_estado_referer(referer)
{
	if(referer=="http://www.eventconecta.com/archivo/" || referer=="http://www.eventconecta.com/en/archive/" || referer=="http://www.eventconecta.com/gl/arquivo/")
	{
		location.href=referer;
	}else{
		location.reload(true);
	}
}

function conectamepro_cerrar_sesion(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(validacion==true && control==false)
		{
			jQuery("#boton_cerrarsesion_enviar_formulario").html(cargando);
			jQuery("form[name='form_nueva_cerrarsesion']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=conectamepro_cerrarsesion");
			jQuery("form[name='form_nueva_cerrarsesion']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}

function conectamepro_cerrar_sesion_en(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(validacion==true && control==false)
		{
			jQuery("#boton_cerrarsesion_enviar_formulario_en").html(cargando);
			jQuery("form[name='form_nueva_cerrarsesion_en']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=conectamepro_cerrarsesion_en");
			jQuery("form[name='form_nueva_cerrarsesion_en']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}

function conectamepro_cerrar_sesion_estado(estado)
{
	if(estado=="ok")
	{
		location.reload(true);
	}
}

function conectamepro_cerrar_sesion_estado_en(estado)
{
	if(estado=="ok")
	{
		location.reload(true);
	}
}
//FIN CONECTAME PRO

//ACREDITARSE
function acreditarse_enviar_formulario(elem,tipo)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		/*if(jQuery("input[name='Aemail']").val()!=jQuery("input[name='Aemailconf']").val() && validacion==true)
		{
			formulario_aviso(jQuery("form[name='form_nueva_acreditaciones']"),jQuery("input[name='Aemail']"));

			validacion=false;
		}*/

		if(jQuery("select[name='Apais']").length)
		{
			if(jQuery("select[name='Apais']").val()=="SPAIN")
			{
				datos=jQuery("input[name='Aapellidos']").val().split(" ");

				if(datos.length<2)
				{
					//formulario_aviso(jQuery("form[name='form_nueva_acreditaciones']"),jQuery("input[name='Aapellidos']"));
					//control=true;
				}
			}
		}

		if(jQuery("input[name='Adocumento']").length)
		{
			if(jQuery("input[name='Adocumento']").val()!="")
			{
				extension=jQuery("input[name='Adocumento']").val().split(".");
				extension=extension[extension.length-1].toLowerCase();
				if(extension!="jpg" && extension!="jpeg" && extension!="pdf")
				{
					formulario_aviso(jQuery("form[name='form_nueva_acreditaciones']"),jQuery("input[name='Adocumento']"));
					control=true;
				}
			}
		}

		if(jQuery("input[name='Acurriculum']").length)
		{
			if(jQuery("input[name='Acurriculum']").val()!="")
			{
				extension=jQuery("input[name='Acurriculum']").val().split(".");
				extension=extension[extension.length-1].toLowerCase();
				if(extension!="doc" && extension!="docx" && extension!="pdf")
				{
					formulario_aviso(jQuery("form[name='form_nueva_acreditaciones']"),jQuery("input[name='Acurriculum']"));
					control=true;
				}
			}
		}

		if(jQuery("input[name='Afoto']").length)
		{
			if(jQuery("input[name='Afoto']").val()!="")
			{
				extension=jQuery("input[name='Afoto']").val().split(".");
				extension=extension[extension.length-1].toLowerCase();
				if(extension!="jpg" && extension!="jpeg")
				{
					formulario_aviso(jQuery("form[name='form_nueva_acreditaciones']"),jQuery("input[name='Afoto']"));
					control=true;
				}
			}
		}

		var perfil_acreditado_tags="";
		var perfil_acreditado_tags_texto="";
		if(jQuery("#perfil_acreditado_tags").length && control==false)
		{
			jQuery("#perfil_acreditado_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				perfil_acreditado_tags=perfil_acreditado_tags+jQuery(this).attr("valor")+", ";
				perfil_acreditado_tags_texto=perfil_acreditado_tags_texto+jQuery(this).html()+", ";
			});
			jQuery("input[name='Apuesto']").val(perfil_acreditado_tags_texto);
			//if(perfil_acreditado_tags==""){alert("Elige al menos una opción de \"Perfil del acreditado\"");control=true;}
		}

		var actividad_principal_tags="";
		var actividad_principal_tags_texto="";
		if(jQuery("#actividad_principal_tags").length && control==false)
		{
			jQuery("#actividad_principal_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				actividad_principal_tags=actividad_principal_tags+jQuery(this).attr("valor")+", ";
				actividad_principal_tags_texto=actividad_principal_tags_texto+jQuery(this).html()+", ";
			});
			jQuery("input[name='Aactividad']").val(actividad_principal_tags_texto);
			//if(actividad_principal_tags==""){alert("Elige al menos una opción de \"Actividad principal\"");control=true;}
		}

		var continentes_tags="";
		if(jQuery("#continentes_tags").length && control==false)
		{
			jQuery("#continentes_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				continentes_tags=continentes_tags+jQuery(this).attr("valor")+", ";
			});			
			if(continentes_tags==""){alert("Elige al menos una opción de \"Ubicación \"");control=true;}
		}

		var idiomas_tags="";
		if(jQuery("#idiomas_tags").length && control==false)
		{
			jQuery("#idiomas_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				idiomas_tags=idiomas_tags+jQuery(this).attr("valor")+", ";
			});			
			if(idiomas_tags==""){alert("Elige al menos una opción de \"Idiomas\"");control=true;}
		}

		var proyectos_formato_tags="";
		if(jQuery("#proyectos_formato_tags").length && control==false)
		{
			jQuery("#proyectos_formato_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				proyectos_formato_tags=proyectos_formato_tags+jQuery(this).attr("valor")+", ";
			});			
			//if(proyectos_formato_tags==""){alert("Elige al menos una opción de \"Mis proyectos - Formato\"");control=true;}
		}

		var proyectos_tono_tags="";
		if(jQuery("#proyectos_tono_tags").length && control==false)
		{
			jQuery("#proyectos_tono_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				proyectos_tono_tags=proyectos_tono_tags+jQuery(this).attr("valor")+", ";
			});			
			//if(proyectos_tono_tags==""){alert("Elige al menos una opción de \"Mis proyectos - Tono\"");control=true;}
		}

		var proyectos_genero_tags="";
		if(jQuery("#proyectos_genero_tags").length && control==false)
		{
			jQuery("#proyectos_genero_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				proyectos_genero_tags=proyectos_genero_tags+jQuery(this).attr("valor")+", ";
			});			
			//if(proyectos_genero_tags==""){alert("Elige al menos una opción de \"Mis proyectos - Género ficción\"");control=true;}
		}

		var proyectos_generoentretenimiento_tags="";
		if(jQuery("#proyectos_generoentretenimiento_tags").length && control==false)
		{
			jQuery("#proyectos_generoentretenimiento_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				proyectos_generoentretenimiento_tags=proyectos_generoentretenimiento_tags+jQuery(this).attr("valor")+", ";
			});			
			//if(proyectos_generoentretenimiento_tags==""){alert("Elige al menos una opción de \"Mis proyectos - Género entretenimiento\"");control=true;}
		}

		var vengo_conectafiction_tags="";
		if(jQuery("#vengo_conectafiction_tags").length && control==false)
		{
			jQuery("#vengo_conectafiction_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				vengo_conectafiction_tags=vengo_conectafiction_tags+jQuery(this).attr("valor")+", ";
			});			
			//if(vengo_conectafiction_tags==""){alert("Elige al menos una opción de \"Vengo a Conecta FICTION para\"");control=true;}
		}

		var perfil_acreditado_tags_busco="";
		if(jQuery("#perfil_acreditado_tags_busco").length && control==false)
		{
			jQuery("#perfil_acreditado_tags_busco").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				perfil_acreditado_tags_busco=perfil_acreditado_tags_busco+jQuery(this).attr("valor")+", ";
			});			
			//if(perfil_acreditado_tags_busco==""){alert("Elige al menos una opción de \"Busco acreditados que sean\"");control=true;}
		}

		var actividad_principal_tags_busco="";
		if(jQuery("#actividad_principal_tags_busco").length && control==false)
		{
			jQuery("#actividad_principal_tags_busco").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				actividad_principal_tags_busco=actividad_principal_tags_busco+jQuery(this).attr("valor")+", ";
			});			
			//if(actividad_principal_tags_busco==""){alert("Elige al menos una opción de \"Busco empresas que sean\"");control=true;}
		}

		var continente_tags_busco="";
		if(jQuery("#continente_tags_busco").length && control==false)
		{
			jQuery("#continente_tags_busco").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				continente_tags_busco=continente_tags_busco+jQuery(this).attr("valor")+", ";
			});			
			//if(continente_tags_busco==""){alert("Elige al menos una opción de \"Busco acreditados que sean de\"");control=true;}
		}

		var idioma_tags_busco="";
		if(jQuery("#idioma_tags_busco").length && control==false)
		{
			jQuery("#idioma_tags_busco").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				idioma_tags_busco=idioma_tags_busco+jQuery(this).attr("valor")+", ";
			});			
			//if(idioma_tags_busco==""){alert("Elige al menos una opción de \"Busco acreditados que hablen en\"");control=true;}
		}

		var proyectos_formato_tags_busco="";
		if(jQuery("#proyectos_formato_tags_busco").length && control==false)
		{
			jQuery("#proyectos_formato_tags_busco").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				proyectos_formato_tags_busco=proyectos_formato_tags_busco+jQuery(this).attr("valor")+", ";
			});			
			//if(proyectos_formato_tags_busco==""){alert("Elige al menos una opción de \"Tipo de proyectos que busco - Formato\"");control=true;}
		}

		var proyectos_tono_tags_busco="";
		if(jQuery("#proyectos_tono_tags_busco").length && control==false)
		{
			jQuery("#proyectos_tono_tags_busco").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				proyectos_tono_tags_busco=proyectos_tono_tags_busco+jQuery(this).attr("valor")+", ";
			});			
			//if(proyectos_tono_tags_busco==""){alert("Elige al menos una opción de \"Tipo de proyectos que busco - Tono\"");control=true;}
		}

		var proyectos_genero_tags_busco="";
		if(jQuery("#proyectos_genero_tags_busco").length && control==false)
		{
			jQuery("#proyectos_genero_tags_busco").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				proyectos_genero_tags_busco=proyectos_genero_tags_busco+jQuery(this).attr("valor")+", ";
			});			
			//if(proyectos_genero_tags_busco==""){alert("Elige al menos una opción de \"Tipo de proyectos que busco - Género ficción\"");control=true;}
		}

		var proyectos_generoentretenimiento_tags_busco="";
		if(jQuery("#proyectos_generoentretenimiento_tags_busco").length && control==false)
		{
			jQuery("#proyectos_generoentretenimiento_tags_busco").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				proyectos_generoentretenimiento_tags_busco=proyectos_generoentretenimiento_tags_busco+jQuery(this).attr("valor")+", ";
			});			
			//if(proyectos_generoentretenimiento_tags_busco==""){alert("Elige al menos una opción de \"Tipo de proyectos que busco - Género entretenimiento\"");control=true;}
		}

		var vengo_conectafiction_tags_busco="";
		if(jQuery("#vengo_conectafiction_tags_busco").length && control==false)
		{
			jQuery("#vengo_conectafiction_tags_busco").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				vengo_conectafiction_tags_busco=vengo_conectafiction_tags_busco+jQuery(this).attr("valor")+", ";
			});			
			//if(vengo_conectafiction_tags_busco==""){alert("Elige al menos una opción de \"Vengo a Conecta FICTION para conectar con acreditados que quieran\"");control=true;}
		}

		var matchmaking_soy=perfil_acreditado_tags+actividad_principal_tags+continentes_tags+idiomas_tags+proyectos_formato_tags+proyectos_tono_tags+proyectos_genero_tags+proyectos_generoentretenimiento_tags+vengo_conectafiction_tags;
		var matchmaking_busco=perfil_acreditado_tags_busco+actividad_principal_tags_busco+continente_tags_busco+idioma_tags_busco+proyectos_formato_tags_busco+proyectos_tono_tags_busco+proyectos_genero_tags_busco+proyectos_generoentretenimiento_tags_busco+vengo_conectafiction_tags_busco;

		if(validacion==true && control==false)
		{
			jQuery("#boton_acreditaciones_enviar_formulario").html(cargando);
			/*jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=acreditaciones_comprobar_email&email="+jQuery("input[name='Aemail']").val()+"",success:function(data){
				if(data=="error")
				{
					jQuery("form[name='form_nueva_acreditaciones']").attr("action","javascript://");
					jQuery("#boton_acreditaciones_enviar_formulario").html("<input id='acreditaciones_enviar_formulario' type='submit' class='boton' value='CONFIRMAR SU SOLICITUD' style='margin-bottom:10px'><input id='acreditacionesguardar_enviar_formulario' type='submit' class='boton' value='GUARDAR SUS DATOS'>");
					setTimeout(function(){jQuery("#acreditacionesguardar_enviar_formulario").unbind("click").click(function(){acreditarse_enviar_formulario(jQuery("form[name='form_nueva_acreditaciones']"),"guardar");});jQuery("#acreditaciones_enviar_formulario").unbind("click").click(function(){acreditarse_enviar_formulario(jQuery("form[name='form_nueva_acreditaciones']"),"confirmar");});},0);
					formulario_aviso(jQuery("form[name='form_nueva_acreditaciones']"),jQuery("input[name='aviso_Aemailconfl']"));
				}else{*/
					jQuery("form[name='form_nueva_acreditaciones']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=acreditaciones_insertar&tipo="+tipo+"&matchmaking_soy="+matchmaking_soy+"&matchmaking_busco="+matchmaking_busco+"");
					jQuery("form[name='form_nueva_acreditaciones']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
					jQuery("#submitinputcode").click();
				/*}
			}});*/
		}
	}
}

function acreditarse_enviar_formulario_en(elem,tipo)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		/*if(jQuery("input[name='Aemail']").val()!=jQuery("input[name='Aemailconf']").val() && validacion==true)
		{
			formulario_aviso(jQuery("form[name='form_nueva_acreditaciones_en']"),jQuery("input[name='Aemail']"));

			validacion=false;
		}*/

		if(jQuery("input[name='Afoto']").length)
		{
			if(jQuery("input[name='Afoto']").val()!="")
			{
			extension=jQuery("input[name='Afoto']").val().split(".");
			extension=extension[extension.length-1].toLowerCase();
			if(extension!="jpg" && extension!="jpeg")
			{
				formulario_aviso(jQuery("form[name='form_nueva_acreditaciones_en']"),jQuery("input[name='Afoto']"));
				control=true;
			}
			}
		}

		var perfil_acreditado_tags="";
		var perfil_acreditado_tags_texto="";
		if(jQuery("#perfil_acreditado_tags").length && control==false)
		{
			jQuery("#perfil_acreditado_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				perfil_acreditado_tags=perfil_acreditado_tags+jQuery(this).attr("valor")+", ";
				perfil_acreditado_tags_texto=perfil_acreditado_tags_texto+jQuery(this).html()+", ";
			});
			jQuery("input[name='Apuesto']").val(perfil_acreditado_tags_texto);
			//if(perfil_acreditado_tags==""){alert("Choose at least one option in \"Participant’s profile\"");control=true;}
		}
		
		var actividad_principal_tags="";
		var actividad_principal_tags_texto="";
		if(jQuery("#actividad_principal_tags").length && control==false)
		{
			jQuery("#actividad_principal_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				actividad_principal_tags=actividad_principal_tags+jQuery(this).attr("valor")+", ";
				actividad_principal_tags_texto=actividad_principal_tags_texto+jQuery(this).html()+", ";
			});
			jQuery("input[name='Aactividad']").val(actividad_principal_tags_texto);
			//if(actividad_principal_tags==""){alert("Choose at least one option in \"Primary business\"");control=true;}
		}

		var continentes_tags="";
		if(jQuery("#continentes_tags").length && control==false)
		{
			jQuery("#continentes_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				continentes_tags=continentes_tags+jQuery(this).attr("valor")+", ";
			});			
			if(continentes_tags==""){alert("Choose at least one option in \"Location\"");control=true;}
		}

		var idiomas_tags="";
		if(jQuery("#idiomas_tags").length && control==false)
		{
			jQuery("#idiomas_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				idiomas_tags=idiomas_tags+jQuery(this).attr("valor")+", ";
			});			
			if(idiomas_tags==""){alert("Choose at least one option in \"Languages\"");control=true;}
		}

		var proyectos_formato_tags="";
		if(jQuery("#proyectos_formato_tags").length && control==false)
		{
			jQuery("#proyectos_formato_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				proyectos_formato_tags=proyectos_formato_tags+jQuery(this).attr("valor")+", ";
			});			
			//if(proyectos_formato_tags==""){alert("Choose at least one option in \"My projects - Format\"");control=true;}
		}

		var proyectos_tono_tags="";
		if(jQuery("#proyectos_tono_tags").length && control==false)
		{
			jQuery("#proyectos_tono_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				proyectos_tono_tags=proyectos_tono_tags+jQuery(this).attr("valor")+", ";
			});			
			//if(proyectos_tono_tags==""){alert("Choose at least one option in \"My projects - Tone\"");control=true;}
		}

		var proyectos_genero_tags="";
		if(jQuery("#proyectos_genero_tags").length && control==false)
		{
			jQuery("#proyectos_genero_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				proyectos_genero_tags=proyectos_genero_tags+jQuery(this).attr("valor")+", ";
			});			
			//if(proyectos_genero_tags==""){alert("Choose at least one option in \"My projects - Genre fiction\"");control=true;}
		}

		var proyectos_generoentretenimiento_tags="";
		if(jQuery("#proyectos_generoentretenimiento_tags").length && control==false)
		{
			jQuery("#proyectos_generoentretenimiento_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				proyectos_generoentretenimiento_tags=proyectos_generoentretenimiento_tags+jQuery(this).attr("valor")+", ";
			});			
			//if(proyectos_generoentretenimiento_tags==""){alert("Choose at least one option in \"My projects - Genre entertainment\"");control=true;}
		}

		var vengo_conectafiction_tags="";
		if(jQuery("#vengo_conectafiction_tags").length && control==false)
		{
			jQuery("#vengo_conectafiction_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				vengo_conectafiction_tags=vengo_conectafiction_tags+jQuery(this).attr("valor")+", ";
			});			
			//if(vengo_conectafiction_tags==""){alert("Choose at least one option in \"I attend Conecta FICTION to\"");control=true;}
		}

		var perfil_acreditado_tags_busco="";
		if(jQuery("#perfil_acreditado_tags_busco").length && control==false)
		{
			jQuery("#perfil_acreditado_tags_busco").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				perfil_acreditado_tags_busco=perfil_acreditado_tags_busco+jQuery(this).attr("valor")+", ";
			});			
			//if(perfil_acreditado_tags_busco==""){alert("Choose at least one option in \"I look for participants who are\"");control=true;}
		}

		var actividad_principal_tags_busco="";
		if(jQuery("#actividad_principal_tags_busco").length && control==false)
		{
			jQuery("#actividad_principal_tags_busco").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				actividad_principal_tags_busco=actividad_principal_tags_busco+jQuery(this).attr("valor")+", ";
			});			
			//if(actividad_principal_tags_busco==""){alert("Choose at least one option in \"I look for companies who are\"");control=true;}
		}

		var continente_tags_busco="";
		if(jQuery("#continente_tags_busco").length && control==false)
		{
			jQuery("#continente_tags_busco").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				continente_tags_busco=continente_tags_busco+jQuery(this).attr("valor")+", ";
			});			
			//if(continente_tags_busco==""){alert("Choose at least one option in \"I look for participants who come from\"");control=true;}
		}

		var idioma_tags_busco="";
		if(jQuery("#idioma_tags_busco").length && control==false)
		{
			jQuery("#idioma_tags_busco").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				idioma_tags_busco=idioma_tags_busco+jQuery(this).attr("valor")+", ";
			});			
			//if(idioma_tags_busco==""){alert("Choose at least one option in \"I look for participants who speak\"");control=true;}
		}

		var proyectos_formato_tags_busco="";
		if(jQuery("#proyectos_formato_tags_busco").length && control==false)
		{
			jQuery("#proyectos_formato_tags_busco").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				proyectos_formato_tags_busco=proyectos_formato_tags_busco+jQuery(this).attr("valor")+", ";
			});			
			//if(proyectos_formato_tags_busco==""){alert("Choose at least one option in \"I look for projects which are - Format\"");control=true;}
		}

		var proyectos_tono_tags_busco="";
		if(jQuery("#proyectos_tono_tags_busco").length && control==false)
		{
			jQuery("#proyectos_tono_tags_busco").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				proyectos_tono_tags_busco=proyectos_tono_tags_busco+jQuery(this).attr("valor")+", ";
			});			
			//if(proyectos_tono_tags_busco==""){alert("Choose at least one option in \"I look for projects which are - Tone\"");control=true;}
		}

		var proyectos_genero_tags_busco="";
		if(jQuery("#proyectos_genero_tags_busco").length && control==false)
		{
			jQuery("#proyectos_genero_tags_busco").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				proyectos_genero_tags_busco=proyectos_genero_tags_busco+jQuery(this).attr("valor")+", ";
			});			
			//if(proyectos_genero_tags_busco==""){alert("Choose at least one option in \"I look for projects which are - Genre fiction\"");control=true;}
		}

		var proyectos_generoentretenimiento_tags_busco="";
		if(jQuery("#proyectos_generoentretenimiento_tags_busco").length && control==false)
		{
			jQuery("#proyectos_generoentretenimiento_tags_busco").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				proyectos_generoentretenimiento_tags_busco=proyectos_generoentretenimiento_tags_busco+jQuery(this).attr("valor")+", ";
			});			
			//if(proyectos_generoentretenimiento_tags_busco==""){alert("Choose at least one option in \"I look for projects which are - Genre entertainment\"");control=true;}
		}

		var vengo_conectafiction_tags_busco="";
		if(jQuery("#vengo_conectafiction_tags_busco").length && control==false)
		{
			jQuery("#vengo_conectafiction_tags_busco").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				vengo_conectafiction_tags_busco=vengo_conectafiction_tags_busco+jQuery(this).attr("valor")+", ";
			});			
			//if(vengo_conectafiction_tags_busco==""){alert("Choose at least one option in \"In Conecta FICTION, I look for participants who want to\"");control=true;}
		}

		var matchmaking_soy=perfil_acreditado_tags+actividad_principal_tags+continentes_tags+idiomas_tags+proyectos_formato_tags+proyectos_tono_tags+proyectos_genero_tags+proyectos_generoentretenimiento_tags+vengo_conectafiction_tags;
		var matchmaking_busco=perfil_acreditado_tags_busco+actividad_principal_tags_busco+continente_tags_busco+idioma_tags_busco+proyectos_formato_tags_busco+proyectos_tono_tags_busco+proyectos_genero_tags_busco+proyectos_generoentretenimiento_tags_busco+vengo_conectafiction_tags_busco;

		if(validacion==true && control==false)
		{
			jQuery("#boton_acreditaciones_enviar_formulario_en").html(cargando);
			/*jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=acreditaciones_comprobar_email&email="+jQuery("input[name='Aemail']").val()+"",success:function(data){
				if(data=="error")
				{
					jQuery("form[name='form_nueva_acreditaciones_en']").attr("action","javascript://");
					jQuery("#boton_acreditaciones_enviar_formulario_en").html("<input id='acreditaciones_enviar_formulario_en' type='submit' class='boton' value='CONFIRMAR SU SOLICITUD' style='margin-bottom:10px'><input id='acreditacionesguardar_enviar_formulario_en' type='submit' class='boton' value='GUARDAR SUS DATOS'>");
					setTimeout(function(){jQuery("#acreditacionesguardar_enviar_formulario_en").unbind("click").click(function(){acreditarse_enviar_formulario_en(jQuery("form[name='form_nueva_acreditaciones_en']"),"guardar");});jQuery("#acreditaciones_enviar_formulario_en").unbind("click").click(function(){acreditarse_enviar_formulario(jQuery("form[name='form_nueva_acreditaciones_en']"),"confirmar");});},0);
					formulario_aviso(jQuery("form[name='form_nueva_acreditaciones_en']"),jQuery("input[name='aviso_Aemailconfl']"));
				}else{*/
					jQuery("form[name='form_nueva_acreditaciones_en']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=acreditaciones_insertar&tipo="+tipo+"&matchmaking_soy="+matchmaking_soy+"&matchmaking_busco="+matchmaking_busco+"");
					jQuery("form[name='form_nueva_acreditaciones_en']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
					jQuery("#submitinputcode").click();
				/*}
			}});*/
		}
	}
}

function acreditarse_representantes_anadir()
{
	var num=1;

	jQuery(".cont_num_representantes").each(function() 
	{
		num++;
	});

	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=acreditaciones_representantes_anadir&num="+num+"&empresa="+jQuery("input[name='Aempresa']").val()+"",success:function(data){
		jQuery("#online_tarifa_empresa_contenido_personas").append(data);
		jQuery(".quitar_representante").each(function() 
		{
			jQuery(this).unbind("click").click(function(){jQuery("#representante_"+jQuery(this).attr("id")).remove();});
		});
	}});
}

function acreditarse_representantes_anadir_en()
{
	var num=1;

	jQuery(".cont_num_representantes").each(function() 
	{
		num++;
	});

	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=acreditaciones_representantes_anadir_en&num="+num+"&empresa="+jQuery("input[name='Aempresa']").val()+"",success:function(data){
		jQuery("#online_tarifa_empresa_contenido_personas").append(data);
		jQuery(".quitar_representante").each(function() 
		{
			jQuery(this).unbind("click").click(function(){jQuery("#representante_"+jQuery(this).attr("id")).remove();});
		});
	}});
}

function acreditarse_enviar_formulario_estado(estado)
{
	if(estado=="ok")
	{
		location.reload(true);
	}
	if(estado=="confirmada")
	{
		if(jQuery("form[name='form_nueva_acreditaciones']").length)
		{
			if(jQuery(".cyp_acreditacion_5").length)
			{
				jQuery(".cyp_acreditacion_5").html("<div class='crearcuenta_mensaje'>Muchas gracias por solicitar una acreditación para Conecta FICTION & ENTERTAINMENT.<br/><br/>Estamos valorando su solicitud y una vez aceptada,<br/><br/>le enviaremos un email con toda la información.</div>");
			}else{
				jQuery(".cyp_acreditacion_3").html("<div class='crearcuenta_mensaje'>Muchas gracias por solicitar una acreditación para Conecta FICTION & ENTERTAINMENT.<br/><br/>Estamos valorando su solicitud y una vez aceptada,<br/><br/>le enviaremos un email con toda la información.</div>");
			}
		}else{
			if(jQuery(".cyp_acreditacion_5").length)
			{
				jQuery(".cyp_acreditacion_5").html("<div class='crearcuenta_mensaje'>Thank you for applying for an accreditation for Conecta FICTION & ENTERTAINMENT.<br/><br/>We are evaluating your application and once approved,<br/><br/>we will send you an email with all the information.</div>");
			}else{
				jQuery(".cyp_acreditacion_3").html("<div class='crearcuenta_mensaje'>Thank you for applying for an accreditation for Conecta FICTION & ENTERTAINMENT.<br/><br/>We are evaluating your application and once approved,<br/><br/>we will send you an email with all the information.</div>");
			}
		}
	}
}
//FIN ACREDITARSE

//PRESENTAR UN PROYECTO
function presentarunproyecto_cargar_formulario(idproyecto)
{
	jQuery(".contenido_proyectos").each(function() 
	{
		jQuery(this).css({display:"none"}).html("");
	});
	jQuery("#presentarunproyecto_cargar_formulario_contenido").html("");

	if(idproyecto==0){jQuery("#presentarunproyecto_cargar_formulario_contenido").html(cargando);}else{jQuery("#proyecto_"+idproyecto).css({display:"block"}).html(cargando);}

	tipo=jQuery("#presentarunproyecto_cargar_formulario_contenido").attr("tipo");
	if(idproyecto!=0){tipo=jQuery("#proyecto_"+idproyecto).attr("tipo");}

	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=presentarunproyecto_cargar_formulario&idproyecto="+idproyecto+"&tipo="+tipo+"",success:function(data){
		datos=data.split("(*)");

		if(datos[1]==0){jQuery("#presentarunproyecto_cargar_formulario_contenido").html(datos[0]);}else{jQuery("#proyecto_"+datos[1]).css({display:"block"}).html(datos[0]);}

		jQuery("#proyectos_autores_anadir").unbind("click").click(function(){presentarunproyecto_autores_anadir();});
		jQuery("#proyectos_equipoartistico_anadir").unbind("click").click(function(){presentarunproyecto_equipoartistico_anadir();});
		jQuery("#proyectos_coproductores_anadir").unbind("click").click(function(){presentarunproyecto_coproductores_anadir();});
		jQuery("#proyectos_television_anadir").unbind("click").click(function(){presentarunproyecto_televisiones_anadir();});
		jQuery("#proyectos_organismos_anadir").unbind("click").click(function(){presentarunproyecto_organismos_anadir();});

		jQuery("#proyectosguardar_enviar_formulario").unbind("click").click(function(){presentarunproyecto_enviar_formulario(jQuery("form[name='form_nueva_proyecto']"),"guardar");});
		jQuery("#proyectos_enviar_formulario").unbind("click").click(function(){presentarunproyecto_enviar_formulario(jQuery("form[name='form_nueva_proyecto']"),"enviar");});

		campos_focus_blur();
	}});
}

function presentarunproyecto_cargar_formulario_en(idproyecto)
{
	jQuery(".contenido_proyectos").each(function() 
	{
		jQuery(this).css({display:"none"}).html("");
	});
	jQuery("#presentarunproyecto_cargar_formulario_contenido").html("");

	if(idproyecto==0){jQuery("#presentarunproyecto_cargar_formulario_contenido").html(cargando);}else{jQuery("#proyecto_"+idproyecto).css({display:"block"}).html(cargando);}

	tipo=jQuery("#presentarunproyecto_cargar_formulario_contenido").attr("tipo");
	if(idproyecto!=0){tipo=jQuery("#proyecto_"+idproyecto).attr("tipo");}

	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=presentarunproyecto_cargar_formulario_en&idproyecto="+idproyecto+"&tipo="+tipo+"",success:function(data){
		datos=data.split("(*)");

		if(datos[1]==0){jQuery("#presentarunproyecto_cargar_formulario_contenido").html(datos[0]);}else{jQuery("#proyecto_"+datos[1]).css({display:"block"}).html(datos[0]);}

		jQuery("#proyectos_autores_anadir_en").unbind("click").click(function(){presentarunproyecto_autores_anadir_en();});
		jQuery("#proyectos_equipoartistico_anadir_en").unbind("click").click(function(){presentarunproyecto_equipoartistico_anadir_en();});
		jQuery("#proyectos_coproductores_anadir_en").unbind("click").click(function(){presentarunproyecto_coproductores_anadir_en();});
		jQuery("#proyectos_television_anadir_en").unbind("click").click(function(){presentarunproyecto_televisiones_anadir_en();});
		jQuery("#proyectos_organismos_anadir_en").unbind("click").click(function(){presentarunproyecto_organismos_anadir_en();});

		jQuery("#proyectosguardar_enviar_formulario").unbind("click").click(function(){presentarunproyecto_enviar_formulario(jQuery("form[name='form_nueva_proyecto']"),"guardar");});
		jQuery("#proyectos_enviar_formulario").unbind("click").click(function(){presentarunproyecto_enviar_formulario(jQuery("form[name='form_nueva_proyecto']"),"enviar");});

		campos_focus_blur();
	}});
}

function presentarunproyecto_autores_anadir()
{
	var num=1;

	jQuery(".cont_num_autores").each(function() 
	{
		num++;
	});

	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=presentarunproyecto_autores_anadir&num="+num+"",success:function(data){
		jQuery("#proyectos_autores").append(data);
		jQuery(".quitar_autor").each(function() 
		{
			jQuery(this).unbind("click").click(function(){jQuery("#autor_"+jQuery(this).attr("id")).remove();});
		});
	}});
}

function presentarunproyecto_autores_anadir_en()
{
	var num=1;

	jQuery(".cont_num_autores").each(function() 
	{
		num++;
	});

	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=presentarunproyecto_autores_anadir_en&num="+num+"",success:function(data){
		jQuery("#proyectos_autores").append(data);
		jQuery(".quitar_autor").each(function() 
		{
			jQuery(this).unbind("click").click(function(){jQuery("#autor_"+jQuery(this).attr("id")).remove();});
		});
	}});
}

function presentarunproyecto_equipoartistico_anadir()
{
	var num=1;

	jQuery(".cont_num_equipoartistico").each(function() 
	{
		num++;
	});

	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=presentarunproyecto_artista_anadir&num="+num+"&tipo="+jQuery("input[name='Ptipo']").val()+"",success:function(data){
		jQuery("#proyectos_equipoartistico").append(data);
		jQuery(".quitar_artista").each(function() 
		{
			jQuery(this).unbind("click").click(function(){jQuery("#artista_"+jQuery(this).attr("id")).remove();});
		});
	}});
}

function presentarunproyecto_equipoartistico_anadir_en()
{
	var num=1;

	jQuery(".cont_num_equipoartistico").each(function() 
	{
		num++;
	});

	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=presentarunproyecto_artista_anadir_en&num="+num+"&tipo="+jQuery("input[name='Ptipo']").val()+"",success:function(data){
		jQuery("#proyectos_equipoartistico").append(data);
		jQuery(".quitar_artista").each(function() 
		{
			jQuery(this).unbind("click").click(function(){jQuery("#artista_"+jQuery(this).attr("id")).remove();});
		});
	}});
}

function presentarunproyecto_coproductores_anadir()
{
	var num=1;

	jQuery(".cont_num_coproductores").each(function() 
	{
		num++;
	});

	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=presentarunproyecto_coproductor_anadir&num="+num+"",success:function(data){
		jQuery("#proyectos_coproductores").append(data);
		jQuery(".quitar_coproductor").each(function() 
		{
			jQuery(this).unbind("click").click(function(){jQuery("#coproductor_"+jQuery(this).attr("id")).remove();});
		});
	}});
}

function presentarunproyecto_coproductores_anadir_en()
{
	var num=1;

	jQuery(".cont_num_coproductores").each(function() 
	{
		num++;
	});

	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=presentarunproyecto_coproductor_anadir_en&num="+num+"",success:function(data){
		jQuery("#proyectos_coproductores").append(data);
		jQuery(".quitar_coproductor").each(function() 
		{
			jQuery(this).unbind("click").click(function(){jQuery("#coproductor_"+jQuery(this).attr("id")).remove();});
		});
	}});
}

function presentarunproyecto_televisiones_anadir()
{
	var num=1;

	jQuery(".cont_num_television").each(function() 
	{
		num++;
	});

	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=presentarunproyecto_television_anadir&num="+num+"",success:function(data){
		jQuery("#proyectos_televisiones").append(data);
		jQuery(".quitar_tv").each(function() 
		{
			jQuery(this).unbind("click").click(function(){jQuery("#tv_"+jQuery(this).attr("id")).remove();});
		});
	}});
}

function presentarunproyecto_televisiones_anadir_en()
{
	var num=1;

	jQuery(".cont_num_television").each(function() 
	{
		num++;
	});

	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=presentarunproyecto_television_anadir_en&num="+num+"",success:function(data){
		jQuery("#proyectos_televisiones").append(data);
		jQuery(".quitar_tv").each(function() 
		{
			jQuery(this).unbind("click").click(function(){jQuery("#tv_"+jQuery(this).attr("id")).remove();});
		});
	}});
}

function presentarunproyecto_organismos_anadir()
{
	var num=1;

	jQuery(".cont_num_organismo").each(function() 
	{
		num++;
	});

	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=presentarunproyecto_organismo_anadir&num="+num+"",success:function(data){
		jQuery("#proyectos_organismos").append(data);
		jQuery(".quitar_organismo").each(function() 
		{
			jQuery(this).unbind("click").click(function(){jQuery("#organismo_"+jQuery(this).attr("id")).remove();});
		});
	}});
}

function presentarunproyecto_organismos_anadir_en()
{
	var num=1;

	jQuery(".cont_num_organismo").each(function() 
	{
		num++;
	});

	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=presentarunproyecto_organismo_anadir_en&num="+num+"",success:function(data){
		jQuery("#proyectos_organismos").append(data);
		jQuery(".quitar_organismo").each(function() 
		{
			jQuery(this).unbind("click").click(function(){jQuery("#organismo_"+jQuery(this).attr("id")).remove();});
		});
	}});
}

function presentarunproyecto_enviar_formulario(elem,tipo)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		if(jQuery("input[name='Psector']").length)
		{
			var Psector="";

			jQuery("input[type='checkbox']").each(function()
			{
				if(String(jQuery(this).attr("name")).indexOf('sector')!=-1 && jQuery(this).is(":checked"))
				{
					Psector=Psector+jQuery(this).val()+" - ";
				}
			});

			jQuery("input[name='Psector']").val(Psector);
		}

		if(jQuery("input[name='Pods']").length)
		{
			var Pods="";

			jQuery("input[type='checkbox']").each(function()
			{
				if(String(jQuery(this).attr("name")).indexOf('ods')!=-1 && jQuery(this).is(":checked"))
				{
					Pods=Pods+jQuery(this).val()+" - ";
				}
			});

			jQuery("input[name='Pods']").val(Pods);
		}

		if(jQuery("input[name='Pfuente']").length)
		{
			var Pfuente="";

			jQuery("input[type='checkbox']").each(function()
			{
				if(String(jQuery(this).attr("name")).indexOf('fuente')!=-1 && jQuery(this).is(":checked"))
				{
					Pfuente=Pfuente+jQuery(this).val()+" - ";
				}
			});

			jQuery("input[name='Pfuente']").val(Pfuente);
		}

		if(tipo=="enviar")
		{
			validacion=validar_formulario(elem);

			if(jQuery("input[name='Ptipo']").val()=="startups" || jQuery("input[name='Ptipo']").val()=="youngminds")
			{
				if(Psector==""){alert("Elige al menos una opción de \"Sector\"");validacion=false;}
				if(Pods==""){alert("Elige al menos una opción de \"¿Contribuyes a alguno de los siguientes ODS?\"");validacion=false;}
				if(Pfuente==""){alert("Elige al menos una opción de \"Fuente de ingresos\"");validacion=false;}
			}
		}

		if((validacion==true && control==false) || tipo=="guardar")
		{
			jQuery("#boton_proyectos_enviar_formulario").html(cargando);

			if(jQuery("input[name='Ptipo']").val()=="startups" || jQuery("input[name='Ptipo']").val()=="youngminds")
			{
				jQuery("form[name='form_nueva_proyecto']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=presentarunproyectodigital_insertar&tipo="+tipo+"");
			}else{
				jQuery("form[name='form_nueva_proyecto']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=presentarunproyecto_insertar&tipo="+tipo+"");
			}
				
			jQuery("form[name='form_nueva_proyecto']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}

function presentarunproyecto_enviar_formulario_estado(estado)
{
	if(estado=="ok")
	{
		location.reload(true);
	}
}
//FIN PRESENTAR UN PROYECTO

//ADMIN FUNCIONES
function admin_funciones()
{
	jQuery(".cyp_acreditaciones_pda").each(function() 
	{
		jQuery(this).unbind("change").change(function(){admin_acreditaciones_pda(jQuery(this).attr("name"),jQuery(this).val());});
	});

	jQuery(".cyp_acreditaciones_estado").each(function() 
	{
		jQuery(this).unbind("change").change(function(){admin_acreditaciones_estado(jQuery(this).attr("name"),jQuery(this).val());});
	});

	jQuery(".cyp_acreditaciones_tipo").each(function() 
	{
		jQuery(this).unbind("change").change(function(){admin_acreditaciones_tipo(jQuery(this).attr("name"),jQuery(this).val());});
	});

	jQuery(".cyp_acreditaciones_tipo2").each(function() 
	{
		jQuery(this).unbind("change").change(function(){admin_acreditaciones_tipo2(jQuery(this).attr("name"),jQuery(this).val());});
	});

	jQuery(".cyp_acreditaciones_tipoacreditacion").each(function() 
	{
		jQuery(this).unbind("change").change(function(){admin_acreditaciones_tipoacred(jQuery(this).attr("name"),jQuery(this).val());});
	});

	jQuery(".cyp_acreditaciones_tipoacreditacionextra").each(function() 
	{
		jQuery(this).unbind("change").change(function(){admin_acreditaciones_tipoacredextra(jQuery(this).attr("name"),jQuery(this).val());});
	});

	jQuery(".cyp_acreditaciones_seminario").each(function() 
	{
		jQuery(this).unbind("change").change(function(){admin_acreditaciones_seminario(jQuery(this).attr("name"),jQuery(this).val());});
	});

	jQuery(".cyp_acreditaciones_conectameet").each(function() 
	{
		jQuery(this).unbind("change").change(function(){admin_acreditaciones_conectameet(jQuery(this).attr("name"),jQuery(this).val());});
	});

	jQuery(".cyp_acreditaciones_conectameet2").each(function() 
	{
		jQuery(this).unbind("change").change(function(){admin_acreditaciones_conectameet2(jQuery(this).attr("name"),jQuery(this).val());});
	});

	jQuery(".cyp_acreditaciones_bus").each(function() 
	{
		jQuery(this).unbind("change").change(function(){admin_acreditaciones_bus(jQuery(this).attr("name"),jQuery(this).val());});
	});

	jQuery(".cyp_acreditaciones_ver").each(function() 
	{
		if(jQuery(this).html()=="Ver Info.")
		{
			jQuery(this).unbind("click").click(function(){admin_acreditaciones_ver(jQuery(this).attr("id"));});
		}
	});

	jQuery(".cyp_proyectos_ver").each(function() 
	{
		if(jQuery(this).html()=="Ver Info.")
		{
			jQuery(this).unbind("click").click(function(){admin_proyectos_ver(jQuery(this).attr("id"));});
		}
	});

	jQuery(".cyp_proyectos_digital_ver").each(function() 
	{
		if(jQuery(this).html()=="Ver Info.")
		{
			jQuery(this).unbind("click").click(function(){admin_proyectos_digital_ver(jQuery(this).attr("id"));});
		}
	});

	jQuery(".cyp_pagosfacturas_ver").each(function() 
	{
		if(jQuery(this).html()=="Ver Info.")
		{
			jQuery(this).unbind("click").click(function(){admin_pagosfacturas_ver(jQuery(this).attr("id"));});
		}
	});
}

function admin_funciones_cerrar()
{
	jQuery(".cyp_panel2").fadeOut("normal",function(){
		jQuery(".cyp_panel").animate({"width": "100%"},"normal").animate({"width": "-=20px"},"normal");
	});
}

function admin_acreditaciones_pda(idacreditacion,estado)
{
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=admin_acreditaciones_pda&idacreditacion="+idacreditacion+"&estado="+estado+"",success:function(data){
		location.reload(true);
	}});
}

function admin_acreditaciones_estado(idacreditacion,estado)
{
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=admin_acreditaciones_estado&idacreditacion="+idacreditacion+"&estado="+estado+"",success:function(data){
		location.reload(true);
	}});
}

function admin_acreditaciones_tipo(idacreditacion,tipo)
{
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=admin_acreditaciones_tipo&idacreditacion="+idacreditacion+"&tipo="+tipo+"",success:function(data){
		location.reload(true);
	}});
}

function admin_acreditaciones_tipo2(idacreditacion,tipo)
{
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=admin_acreditaciones_tipo2&idacreditacion="+idacreditacion+"&tipo="+tipo+"",success:function(data){
		location.reload(true);
	}});
}

function admin_acreditaciones_tipoacred(idacreditacion,tipo)
{
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=admin_acreditaciones_tipoacred&idacreditacion="+idacreditacion+"&tipo="+tipo+"",success:function(data){
		location.reload(true);
	}});
}

function admin_acreditaciones_tipoacredextra(idacreditacion,tipo)
{
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=admin_acreditaciones_tipoacredextra&idacreditacion="+idacreditacion+"&tipo="+tipo+"",success:function(data){
		location.reload(true);
	}});
}

function admin_acreditaciones_seminario(idacreditacion,tipo)
{
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=admin_acreditaciones_seminario&idacreditacion="+idacreditacion+"&tipo="+tipo+"",success:function(data){
		location.reload(true);
	}});
}

function admin_acreditaciones_conectameet(idacreditacion,tipo)
{
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=admin_acreditaciones_conectameet&idacreditacion="+idacreditacion+"&tipo="+tipo+"",success:function(data){
		location.reload(true);
	}});
}

function admin_acreditaciones_conectameet2(idacreditacion,tipo)
{
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=admin_acreditaciones_conectameet2&idacreditacion="+idacreditacion+"&tipo="+tipo+"",success:function(data){
		location.reload(true);
	}});
}

function admin_acreditaciones_ver(idacreditacion)
{
	jQuery(".cyp_panel2").fadeOut("normal",function(){
		jQuery(".cyp_panel").animate({width:'50%'},"normal",function(){
			jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=admin_acreditaciones_ver&idacreditacion="+idacreditacion+"",success:function(data){
				jQuery(".cyp_panel2").html(data);
				jQuery(".cyp_panel2").css({width:jQuery(".cyp_panel").outerWidth()-50+"px",height:jQuery(window).outerHeight()-110+"px"}).fadeIn("normal");
				jQuery(".cyp_panel2_cerrar_boton").unbind("click").click(function(){admin_funciones_cerrar();});

				jQuery("#acreditaciones_wp_enviar_formulario").unbind("click").click(function(){admin_acreditaciones_guardar();});
			}});
		});
	});
}

function admin_acreditaciones_guardar()
{
	jQuery("#boton_acreditaciones_wp_enviar_formulario").html("guardando...");

	jQuery("form[name='form_modif_acreditaciones_wp']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=admin_acreditaciones_guardar");
	jQuery("form[name='form_modif_acreditaciones_wp']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
	jQuery("#submitinputcode").click();
}

function admin_acreditaciones_guardar_estado(estado)
{
	jQuery("#boton_acreditaciones_wp_enviar_formulario").html("OK");
	setTimeout(function(){admin_acreditaciones_ver(estado);},2000);
}

function admin_proyectos_ver(idproyecto)
{
	jQuery(".cyp_panel2").fadeOut("normal",function(){
		jQuery(".cyp_panel").animate({width:'50%'},"normal",function(){
			jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=admin_proyectos_ver&idproyecto="+idproyecto+"",success:function(data){
				jQuery(".cyp_panel2").html(data);
				jQuery(".cyp_panel2").css({width:jQuery(".cyp_panel").outerWidth()-50+"px",height:jQuery(window).outerHeight()-110+"px"}).fadeIn("normal");
				jQuery(".cyp_panel2_cerrar_boton").unbind("click").click(function(){admin_funciones_cerrar();});
				jQuery("#descargar_csv_proyectos_individual").unbind("click").click(function(){descargar_csv_proyectos_individual(jQuery("#descargar_csv_proyectos_individual").parent().attr("proyecto"));});
			}});
		});
	});
}

function admin_proyectos_digital_ver(idproyecto)
{
	jQuery(".cyp_panel2").fadeOut("normal",function(){
		jQuery(".cyp_panel").animate({width:'50%'},"normal",function(){
			jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=admin_proyectos_digital_ver&idproyecto="+idproyecto+"",success:function(data){
				jQuery(".cyp_panel2").html(data);
				jQuery(".cyp_panel2").css({width:jQuery(".cyp_panel").outerWidth()-50+"px",height:jQuery(window).outerHeight()-110+"px"}).fadeIn("normal");
				jQuery(".cyp_panel2_cerrar_boton").unbind("click").click(function(){admin_funciones_cerrar();});
				//jQuery("#descargar_csv_proyectos_individual").unbind("click").click(function(){descargar_csv_proyectos_individual(jQuery("#descargar_csv_proyectos_individual").parent().attr("proyecto"));});
			}});
		});
	});
}

function admin_pagosfacturas_ver(idpagofactura)
{
	jQuery(".cyp_panel2").fadeOut("normal",function(){
		jQuery(".cyp_panel").animate({width:'50%'},"normal",function(){
			jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=admin_pagosfacturas_ver&idpagofactura="+idpagofactura+"",success:function(data){
				jQuery(".cyp_panel2").html(data);
				jQuery(".cyp_panel2").css({width:jQuery(".cyp_panel").outerWidth()-50+"px",height:jQuery(window).outerHeight()-110+"px"}).fadeIn("normal");
				jQuery(".cyp_panel2_cerrar_boton").unbind("click").click(function(){admin_funciones_cerrar();});

				if(jQuery("#descargar_modelo_factura_submit").length)
				{
					jQuery("#descargar_modelo_factura_submit").unbind("click").click(function(){descargar_modelo_factura(jQuery(this).parent().attr("idpagofactura"),"factura");});

					jQuery("#descargar_modelo_factura_pdf_submit").unbind("click").click(function(){descargar_modelo_factura_pdf(jQuery(this).parent().attr("idpagofactura"),"factura");});

					jQuery("#crear_modelo_abono_pdf_submit").unbind("click").click(function(){crear_modelo_abono_pdf(jQuery(this).parent().attr("idpagofactura"));});

					jQuery("#descargar_modelo_abono_excel_submit").unbind("click").click(function(){descargar_modelo_factura(jQuery(this).parent().attr("idpagofactura"),"abono");});

					jQuery("#descargar_modelo_abono_pdf_submit").unbind("click").click(function(){descargar_modelo_factura_pdf(jQuery(this).parent().attr("idpagofactura"),"abono");});

					jQuery("#descargar_modelo_factura2_pdf_submit").unbind("click").click(function(){descargar_modelo_factura_pdf(jQuery(this).parent().attr("idpagofactura"),"factura");});
				}
				if(jQuery("#crear_generar_factura").length)
				{
					jQuery("#crear_generar_factura_submit").unbind("click").click(function(){crear_generar_factura(jQuery(this).parent().attr("idpagofactura"));});
				}
				if(jQuery("#eliminar_generar_factura").length)
				{
					jQuery("#eliminar_generar_factura_submit").unbind("click").click(function(){eliminar_generar_factura(jQuery(this).parent().attr("idpagofactura"));});
				}

				jQuery("#pagos_wp_enviar_formulario").unbind("click").click(function(){admin_pagos_guardar();});
			}});
		});
	});
}

function admin_pagos_guardar()
{
	jQuery("#boton_pagos_wp_enviar_formulario").html("guardando...");

	jQuery("form[name='form_modif_pagos_wp']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=admin_pagos_guardar");
	jQuery("form[name='form_modif_pagos_wp']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
	jQuery("#submitinputcode").click();
}

function admin_pagos_guardar_estado(estado)
{
	jQuery("#boton_pagos_wp_enviar_formulario").html("OK");
	setTimeout(function(){admin_pagosfacturas_ver(estado);},2000);
}

//FIN ADMIN FUNCIONES

//RECUPERAR CONTRASEÑA
function recuperarpass_enviar(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(validacion==true && control==false)
		{
			jQuery("#boton_recuperarpass_enviar_formulario").html(cargando);
			jQuery("form[name='form_nueva_recuperarpass']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=recuperarpass");
			jQuery("form[name='form_nueva_recuperarpass']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}

function recuperarpass_enviar_en(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(validacion==true && control==false)
		{
			jQuery("#boton_recuperarpass_enviar_formulario").html(cargando);
			jQuery("form[name='form_nueva_recuperarpass_en']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=recuperarpass_en");
			jQuery("form[name='form_nueva_recuperarpass_en']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}

function recuperarpass_enviar_estado(estado)
{
	if(estado=="ok")
	{
		jQuery("#boton_recuperarpass_enviar_formulario").html("Hemos enviado un correo a la dirección indicada");
	}else{
		jQuery("form[name='form_nueva_recuperarpass']").attr("action","javascript://");
		jQuery("#boton_recuperarpass_enviar_formulario").html("<input id='recuperarpass_enviar_formulario' type='submit' class='boton3' value='Recuperar Contraseña'>");
		setTimeout(function(){jQuery("#recuperarpass_enviar_formulario").unbind("click").click(function(){recuperarpass_enviar(jQuery("form[name='form_nueva_recuperarpass']"));});},0);
		formulario_aviso(jQuery("form[name='form_nueva_recuperarpass']"),jQuery("input[name='Rusuario']"));
	}
}

function recuperarpass_enviar_estado_en(estado)
{
	if(estado=="ok")
	{
		jQuery("#boton_recuperarpass_enviar_formulario").html("We have sent an email to the indicated address");
	}else{
		jQuery("form[name='form_nueva_iniciarsesion_en']").attr("action","javascript://");
		jQuery("#boton_recuperarpass_enviar_formulario").html("<input id='recuperarpass_enviar_formulario' type='submit' class='boton3' value='Recover Password'>");
		setTimeout(function(){jQuery("#recuperarpass_enviar_formulario").unbind("click").click(function(){recuperarpass_enviar_en(jQuery("form[name='form_nueva_recuperarpass_en']"));});},0);
		formulario_aviso(jQuery("form[name='form_nueva_recuperarpass_en']"),jQuery("input[name='Rusuario']"));
	}
}
//FIN RECUPERAR CONTRASEÑA

//DESCARGAR CSV CUENTAS
function descargar_csv_cuentas()
{
	jQuery("#descargar_csv_cuentas_cont").html("Generando archivo CSV...");
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=descargar_csv_cuentas",success:function(data){
		document.location = data;
		setTimeout(function(){jQuery("#descargar_csv_cuentas_cont").html("<input id='descargar_csv_cuentas' type='submit' class='boton' value='Descargar listado en CSV'>");jQuery("#descargar_csv_cuentas").unbind("click").click(function(){descargar_csv_cuentas();});},2000);
	}});
}
//FIN DESCARGAR CSV CUENTAS

//FORZAR ACREDITACIONES
function forzar_acreditaciones_todo()
{
	jQuery(".listado_fila_hover").each(function() 
	{
		if(!jQuery(this).find("input[type='checkbox']").is(":checked"))
		{
			jQuery(this).find("input[type='checkbox']").prop('checked', true);
		}
	});
}

function forzar_acreditaciones()
{
	var acreditaciones_ids="";

	jQuery(".listado_fila_hover").each(function() 
	{
		if(jQuery(this).find("input[type='checkbox']").is(":checked"))
		{
			acreditaciones_ids+=jQuery(this).find("input[type='checkbox']").val()+",";
		}
	});

	if(acreditaciones_ids!="")
	{
		jQuery("#forzar_acreditaciones_cont").html("Forzando acreditaciones...");
		jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=forzar_acreditaciones&acreditaciones_ids="+acreditaciones_ids+"",success:function(data){
			jQuery("#forzar_acreditaciones_cont").html("Acreditaciones forzadas correctamente...");
			setTimeout(function(){location.reload(true);},2000);
		}});
	}else{
		alert("Debes seleccionar al menos un acreditado");
	}
}
//FIN FORZAR ACREDITACIONES

//DESCARGAR CSV ACREDITACIONES
function descargar_csv_acreditaciones(tipo)
{
	jQuery("#descargar_csv_acreditaciones_cont").html("Generando archivo CSV...");
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=descargar_csv_acreditaciones&tipo="+tipo+"",success:function(data){
		document.location = data;
		setTimeout(function(){jQuery("#descargar_csv_acreditaciones_cont").html("<input id='descargar_csv_acreditaciones' tipo='"+tipo+"' type='submit' class='boton' value='Descargar listado en CSV'>");jQuery("#descargar_csv_acreditaciones").unbind("click").click(function(){descargar_csv_acreditaciones(jQuery(this).attr("tipo"));});},2000);
	}});
}
//FIN DESCARGAR CSV ACREDITACIONES

//DESCARGAR CSV REUNIONES
function descargar_csv_reuniones()
{
	jQuery("#descargar_csv_reuniones_cont").html("Generando archivo CSV...");
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=descargar_csv_reuniones",success:function(data){
		document.location = data;
		setTimeout(function(){jQuery("#descargar_csv_reuniones_cont").html("<input id='descargar_csv_reuniones' type='submit' class='boton' value='Descargar listado en CSV'>");jQuery("#descargar_csv_reuniones").unbind("click").click(function(){descargar_csv_reuniones();});},2000);
	}});
}
//FIN DESCARGAR CSV REUNIONES

//DESCARGAR CSV PROYECTOS
function descargar_csv_proyectos()
{
	tipo=jQuery("#descargar_csv_proyectos").parent().attr("tipo");

	jQuery("#descargar_csv_proyectos_cont").html("Generando archivo CSV...");
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=descargar_csv_proyectos&tipo="+tipo+"",success:function(data){
		document.location = data;
		setTimeout(function(){jQuery("#descargar_csv_proyectos_cont").html("<input id='descargar_csv_proyectos' type='submit' class='boton' value='Descargar listado en CSV'>");jQuery("#descargar_csv_proyectos").unbind("click").click(function(){descargar_csv_proyectos(jQuery(this).parent().attr("tipo"));});},2000);
	}});
}

function descargar_csv_proyectos_individual(proyecto)
{
	jQuery("#descargar_csv_proyectos_cont_individual").html("Generando archivo CSV...");
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=descargar_csv_proyectos&proyecto="+proyecto+"",success:function(data){
		document.location = data;
		setTimeout(function(){jQuery("#descargar_csv_proyectos_cont_individual").html("<input id='descargar_csv_proyectos_individual' type='submit' class='boton' value='Descargar proyecto en CSV'>");jQuery("#descargar_csv_proyectos_individual").unbind("click").click(function(){descargar_csv_proyectos_individual(jQuery(this).parent().attr("proyecto"));});},2000);
	}});
}

function descargar_csv_proyectos_digital()
{
	tipo=jQuery("#descargar_csv_proyectos_digital").parent().attr("tipo");

	jQuery("#descargar_csv_proyectos_cont").html("Generando archivo CSV...");
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=descargar_csv_proyectos_digital&tipo="+tipo+"",success:function(data){
		document.location = data;
		setTimeout(function(){jQuery("#descargar_csv_proyectos_cont").html("<input id='descargar_csv_proyectos_digital' type='submit' class='boton' value='Descargar listado en CSV'>");jQuery("#descargar_csv_proyectos_digital").unbind("click").click(function(){descargar_csv_proyectos_digital(jQuery(this).parent().attr("tipo"));});},2000);
	}});
}
//FIN DESCARGAR CSV PROYECTOS

//DESCARGAR CSV PAGOS
function descargar_csv_pagos()
{
	jQuery("#descargar_csv_pagos_cont").html("Generando archivo CSV...");
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=descargar_csv_pagos",success:function(data){
		document.location = data;
		setTimeout(function(){jQuery("#descargar_csv_pagos_cont").html("<input id='descargar_csv_pagos' type='submit' class='boton' value='Descargar listado de Pagos en CSV'>");jQuery("#descargar_csv_pagos").unbind("click").click(function(){descargar_csv_pagos();});},2000);
	}});
}
//FIN DESCARGAR CSV PAGOS

//DESCARGAR MODELO DE FACTURA
function descargar_modelo_factura(idpagofactura,tipo)
{
	//jQuery("#descargar_modelo_factura").html("Generando modelo de factura...");
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=descargar_modelo_factura&idpagofactura="+idpagofactura+"&tipo="+tipo+"",success:function(data){
		dat=data.split("(*)");
		document.location = dat[0];
		//setTimeout(function(){jQuery("#descargar_modelo_factura").html("<input id='descargar_modelo_factura_submit' type='submit' class='boton' style='float:left' value='Descargar Modelo de Factura'>");jQuery("#descargar_modelo_factura_submit").unbind("click").click(function(){descargar_modelo_factura(jQuery(this).parent().attr("idpagofactura"));});},2000);
	}});
}

function descargar_modelo_factura_pdf(idpagofactura,tipo)
{
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=descargar_modelo_factura&idpagofactura="+idpagofactura+"&tipo="+tipo+"",success:function(data){
		dat=data.split("(*)");

		fileName=dat[2];

		if (!window.ActiveXObject) {
	        var save = document.createElement('a');
	        save.href = dat[1];
	        save.target = '_blank';
	        save.download = fileName;

	        var evt = new MouseEvent('click', {
	            'view': window,
	            'bubbles': true,
	            'cancelable': false
	        });
	        save.dispatchEvent(evt);

	        (window.URL || window.webkitURL).revokeObjectURL(save.href);
	    }else if ( !! window.ActiveXObject && document.execCommand)     {
	        var _window = window.open(dat[1], '_blank');
	        _window.document.close();
	        _window.document.execCommand('SaveAs', true, fileName || dat[1])
	        _window.close();
	    }
		//document.location = dat[1];
	}});
}

function crear_modelo_abono_pdf(idpagofactura)
{
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=crear_modelo_abono&idpagofactura="+idpagofactura+"",success:function(data){
		admin_pagosfacturas_ver(data);
	}});
}

function crear_generar_factura(idpagofactura)
{
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=crear_generar_factura&idpagofactura="+idpagofactura+"",success:function(data){
		admin_pagosfacturas_ver(data);
	}});
}

function eliminar_generar_factura(idpagofactura)
{
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=eliminar_generar_factura&idpagofactura="+idpagofactura+"",success:function(data){
		setTimeout(function(){location.reload(true);},20);
	}});
}
//FIN DESCARGAR MODELO DE FACTURA

//DESCARGAR CSV CUENTAS INVITADOS
function descargar_csv_cuentasinvitados()
{
	jQuery("#descargar_csv_cuentas_cont").html("Generando archivo CSV...");
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=descargar_csv_cuentasinvitados",success:function(data){
		document.location = data;
		setTimeout(function(){jQuery("#descargar_csv_cuentas_cont").html("<input id='descargar_csv_cuentasinvitados' type='submit' class='boton' value='Descargar listado en CSV'>");jQuery("#descargar_csv_cuentasinvitados").unbind("click").click(function(){descargar_csv_cuentasinvitados();});},2000);
	}});
}
//FIN DESCARGAR CSV CUENTAS INVITADOS

//DESCARGAR CSV ACREDITACIONES INVITADOS
/*function descargar_csv_acreditacionesinvitados()
{
	jQuery("#descargar_csv_acreditaciones_cont").html("Generando archivo CSV...");
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=descargar_csv_acreditacionesinvitados",success:function(data){
		document.location = data;
		setTimeout(function(){jQuery("#descargar_csv_acreditaciones_cont").html("<input id='descargar_csv_acreditacionesinvitados' type='submit' class='boton' value='Descargar listado en CSV'>");jQuery("#descargar_csv_acreditacionesinvitados").unbind("click").click(function(){descargar_csv_acreditacionesinvitados();});},2000);
	}});
}*/
//FIN DESCARGAR CSV ACREDITACIONES INVITADOS

//DESCARGAR CSV CUENTAS PRENSA
function descargar_csv_cuentasprensa()
{
	jQuery("#descargar_csv_cuentas_cont").html("Generando archivo CSV...");
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=descargar_csv_cuentasprensa",success:function(data){
		document.location = data;
		setTimeout(function(){jQuery("#descargar_csv_cuentas_cont").html("<input id='descargar_csv_cuentasprensa' type='submit' class='boton' value='Descargar listado en CSV'>");jQuery("#descargar_csv_cuentasprensa").unbind("click").click(function(){descargar_csv_cuentasprensa();});},2000);
	}});
}
//FIN DESCARGAR CSV CUENTAS PRENSA

//DESCARGAR CSV ACREDITACIONES PRENSA
/*function descargar_csv_acreditacionesprensa()
{
	jQuery("#descargar_csv_acreditaciones_cont").html("Generando archivo CSV...");
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=descargar_csv_acreditacionesprensa",success:function(data){
		document.location = data;
		setTimeout(function(){jQuery("#descargar_csv_acreditaciones_cont").html("<input id='descargar_csv_acreditacionesprensa' type='submit' class='boton' value='Descargar listado en CSV'>");jQuery("#descargar_csv_acreditacionesprensa").unbind("click").click(function(){descargar_csv_acreditacionesprensa();});},2000);
	}});
}*/
//FIN DESCARGAR CSV ACREDITACIONES PRENSA

//DESCARGAR CSV CUENTAS ESTUDIANTES
function descargar_csv_cuentasestudiantes()
{
	jQuery("#descargar_csv_cuentas_cont").html("Generando archivo CSV...");
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=descargar_csv_cuentasestudiantes",success:function(data){
		document.location = data;
		setTimeout(function(){jQuery("#descargar_csv_cuentas_cont").html("<input id='descargar_csv_cuentasestudiantes' type='submit' class='boton' value='Descargar listado en CSV'>");jQuery("#descargar_csv_cuentasestudiantes").unbind("click").click(function(){descargar_csv_cuentasestudiantes();});},2000);
	}});
}
//FIN DESCARGAR CSV CUENTAS ESTUDIANTES

//DESCARGAR CSV ACREDITACIONES ESTUDIANTES
/*function descargar_csv_acreditacionesestudiantes()
{
	jQuery("#descargar_csv_acreditaciones_cont").html("Generando archivo CSV...");
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=descargar_csv_acreditacionesestudiantes",success:function(data){
		document.location = data;
		setTimeout(function(){jQuery("#descargar_csv_acreditaciones_cont").html("<input id='descargar_csv_acreditacionesestudiantes' type='submit' class='boton' value='Descargar listado en CSV'>");jQuery("#descargar_csv_acreditacionesestudiantes").unbind("click").click(function(){descargar_csv_acreditacionesestudiantes();});},2000);
	}});
}*/
//FIN DESCARGAR CSV ACREDITACIONES ESTUDIANTES

//DESCARGAR CSV CUENTAS VOLUNTARIOS
function descargar_csv_cuentasvoluntarios()
{
	jQuery("#descargar_csv_cuentas_cont").html("Generando archivo CSV...");
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=descargar_csv_cuentasvoluntarios",success:function(data){
		document.location = data;
		setTimeout(function(){jQuery("#descargar_csv_cuentas_cont").html("<input id='descargar_csv_cuentasvoluntarios' type='submit' class='boton' value='Descargar listado en CSV'>");jQuery("#descargar_csv_cuentasvoluntarios").unbind("click").click(function(){descargar_csv_cuentasvoluntarios();});},2000);
	}});
}
//FIN DESCARGAR CSV CUENTAS VOLUNTARIOS

//DESCARGAR CSV ACREDITACIONES VOLUNTARIOS
/*function descargar_csv_acreditacionesvoluntarios()
{
	jQuery("#descargar_csv_acreditaciones_cont").html("Generando archivo CSV...");
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=descargar_csv_acreditacionesvoluntarios",success:function(data){
		document.location = data;
		setTimeout(function(){jQuery("#descargar_csv_acreditaciones_cont").html("<input id='descargar_csv_acreditacionesvoluntarios' type='submit' class='boton' value='Descargar listado en CSV'>");jQuery("#descargar_csv_acreditacionesvoluntarios").unbind("click").click(function(){descargar_csv_acreditacionesvoluntarios();});},2000);
	}});
}*/
//FIN DESCARGAR CSV ACREDITACIONES VOLUNTARIOS

//ACREDITARSE PAGAR
function acreditarse_pagar_enviar_formulario(elem,metodo,variante)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(validacion==true && control==false)
		{
			elem.find("input[name='Aformapago']").val(metodo);

			if(metodo=="paypal"){jQuery("#boton_acreditacionespagar_enviar_formulario"+variante).html(cargando);}else{jQuery("#boton_acreditacionespagar_enviar_formulario_transferencia"+variante).html(cargando);}

			jQuery("form[name='form_nueva_acreditaciones_pago"+variante+"']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=acreditaciones_pagar&metodo="+metodo+"&variante="+variante+"");
			jQuery("form[name='form_nueva_acreditaciones_pago"+variante+"']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}

/*function acreditarse_enviar_formulario_en(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(jQuery("input[name='Afoto']").val()!="")
		{
		extension=jQuery("input[name='Afoto']").val().split(".");
		extension=extension[extension.length-1].toLowerCase();
		if(extension!="jpg" && extension!="jpeg")
		{
			formulario_aviso(jQuery("form[name='form_nueva_acreditaciones_en']"),jQuery("input[name='Afoto']"));
			control=true;
		}
		}

		if(validacion==true && control==false)
		{
			jQuery("#boton_acreditaciones_enviar_formulario_en").html(cargando);

			jQuery("form[name='form_nueva_acreditaciones_en']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=acreditaciones_insertar&tipo="+tipo+"");
			jQuery("form[name='form_nueva_acreditaciones_en']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}*/

function acreditarse_pagar_enviar_formulario_estado(estado,variante)
{
	if(estado=="transferencia")
	{
		jQuery("#boton_acreditacionespagar_enviar_formulario_transferencia"+variante).html("OK");
		setTimeout(function(){
			jQuery("form[name='form_nueva_acreditaciones_pago"+variante+"']").css({display:"none"});
			jQuery(".cyp_ventana_datos_bancarios"+variante).css({display:"block"});
		},2000);
	}else{
		jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=acreditaciones_paypal&codigo="+estado+"&ingles="+jQuery("input[name='Aidioma']").val()+"",success:function(data){
			jQuery("#formulario_acreditacion_pago_paypal").html(data);

			jQuery("#pasarela_paypal_ir").submit();
		}});
	}
}
//FIN ACREDITARSE PAGAR

//EDITAR CUENTA
function editarperfil_enviar_formulario(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(jQuery("input[name='Ccont']").val()!=jQuery("input[name='Ccont2']").val() && validacion==true)
		{
			formulario_aviso(jQuery("form[name='form_editar_cuenta']"),jQuery("input[name='Ccont']"));

			validacion=false;
		}

		if(validacion==true && control==false)
		{
			jQuery("#boton_editarperfil_enviar_formulario").html(cargando);
			jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=editarcuenta_comprobar_usuario&usuario="+jQuery("input[name='Cusuario']").val()+"",success:function(data){
				if(data=="error")
				{
					jQuery("form[name='form_editar_cuenta']").attr("action","javascript://");
					jQuery("#boton_editarperfil_enviar_formulario").html("<input id='editarperfil_enviar_formulario' type='submit' class='boton3' value='Editar Perfil'>");
					setTimeout(function(){jQuery("#editarperfil_enviar_formulario").unbind("click").click(function(){editarperfil_enviar_formulario(jQuery("form[name='form_editar_cuenta']"));});},0);
					formulario_aviso(jQuery("form[name='form_editar_cuenta']"),jQuery("input[name='Cusuario']"));
				}else{
					jQuery("form[name='form_editar_cuenta']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=editarcuenta_insertar");
					jQuery("form[name='form_editar_cuenta']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
					jQuery("#submitinputcode").click();
				}
			}});
		}
	}
}
/*
function editarperfil_enviar_formulario_en(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(jQuery("input[name='Ccont']").val()!=jQuery("input[name='Ccont2']").val() && validacion==true)
		{
			formulario_aviso(jQuery("form[name='form_nueva_cuenta_en']"),jQuery("input[name='Ccont']"));

			validacion=false;
		}

		if(validacion==true && control==false)
		{
			jQuery("#boton_crearcuenta_enviar_formulario_en").html(cargando);
			jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=crearcuenta_comprobar_usuario&usuario="+jQuery("input[name='Cusuario']").val()+"",success:function(data){
				if(data=="error")
				{
					jQuery("form[name='form_nueva_cuenta_en']").attr("action","javascript://");
					jQuery("#boton_crearcuenta_enviar_formulario_en").html("<input id='crearcuenta_enviar_formulario_en' type='submit' class='boton' value='Create an Account'>");
					setTimeout(function(){jQuery("#crearcuenta_enviar_formulario_en").unbind("click").click(function(){crearcuenta_enviar_formulario_en(jQuery("form[name='form_nueva_cuenta_en']"));});},0);
					formulario_aviso(jQuery("form[name='form_nueva_cuenta_en']"),jQuery("input[name='Cusuario']"));
				}else{
					jQuery("form[name='form_nueva_cuenta_en']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=crearcuenta_insertar_en");
					jQuery("form[name='form_nueva_cuenta_en']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
					jQuery("#submitinputcode").click();
				}
			}});
		}
	}
}
*/
function editarperfil_enviar_formulario_estado(estado)
{
	if(estado=="ok")
	{
		jQuery("#boton_editarperfil_enviar_formulario").html("perfil editado correctamente");
	}
}
/*
function editarperfil_enviar_formulario_estado_en(estado)
{
	if(estado=="ok")
	{
		jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=crearcuenta_mensaje_en",success:function(data){
			jQuery(".formulario").html(data);
		}});
	}
}*/
//FIN EDITAR CUENTA

//EDITAR ACREDITARSE
function editaracreditarse_enviar_formulario(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(jQuery("input[name='Afoto']").val()!="")
		{
		extension=jQuery("input[name='Afoto']").val().split(".");
		extension=extension[extension.length-1].toLowerCase();
		if(extension!="jpg" && extension!="jpeg")
		{
			formulario_aviso(jQuery("form[name='form_nueva_acreditaciones']"),jQuery("input[name='Afoto']"));
			control=true;
		}
		}

		if(validacion==true && control==false)
		{
			jQuery("#boton_acreditaciones_enviar_formulario").html(cargando);
			jQuery("form[name='form_nueva_acreditaciones']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=editaracreditaciones_insertar&idioma=es");
			jQuery("form[name='form_nueva_acreditaciones']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}
/*
function editaracreditarse_enviar_formulario_en(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(jQuery("input[name='Afoto']").val()!="")
		{
		extension=jQuery("input[name='Afoto']").val().split(".");
		extension=extension[extension.length-1].toLowerCase();
		if(extension!="jpg" && extension!="jpeg")
		{
			formulario_aviso(jQuery("form[name='form_nueva_acreditaciones_en']"),jQuery("input[name='Afoto']"));
			control=true;
		}
		}

		if(validacion==true && control==false)
		{
			jQuery("#boton_acreditaciones_enviar_formulario_en").html(cargando);

					jQuery("form[name='form_nueva_acreditaciones_en']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=acreditaciones_insertar&tipo="+tipo+"");
					jQuery("form[name='form_nueva_acreditaciones_en']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
					jQuery("#submitinputcode").click();
				}
			}});
		}
	}
}*/

function editaracreditarse_enviar_formulario_estado(estado)
{
	if(estado=="es")
	{
		jQuery("#boton_acreditaciones_enviar_formulario").html("acreditación editada correctamente");
		setTimeout(function(){location.reload(true);},2000);
	}
}
//FIN EDITAR ACREDITARSE

//EDITAR ACREDITARSE
function editaracreditarse_mostrar(opcion)
{
	bannerize_ocultar();

	jQuery("#cyp_boton_editar_volver").css({display:"none"});
	jQuery(".cyp_editar_perfil").css({display:"none"});
	jQuery(".cyp_editar_seminario").css({display:"none"});
	jQuery(".cyp_editar_solicitarbus").css({display:"none"});
	jQuery(".cyp_editar_bus").css({display:"none"});
	jQuery(".cyp_editar_ampliaciones").css({display:"none"});
	jQuery(".cyp_editar_agenda").css({display:"none"});
	jQuery(".cyp_editar_acreditacion").css({display:"none"});
	jQuery(".cyp_editar_acreditacion_matchmaking").css({display:"none"});
	jQuery(".cyp_editar_reuniones").css({display:"none"});
	jQuery(".cyp_editar_mensajes").css({display:"none"});

	jQuery(".cyp_editar_acreditacion_miseventos").css({display:"none"});

	jQuery("#mi_perfil_subtitulo").html("");

	if(opcion=="volver")
	{
		jQuery(".cyp_editar_perfil").css({display:"block"});

		if(jQuery(".cyp_editar_perfil_idioma").html()=="es"){jQuery(".cyp_cf3_header").find("h1").find("em").html("MI PERFIL");}
		if(jQuery(".cyp_editar_perfil_idioma").html()=="en"){jQuery(".cyp_cf3_header").find("h1").find("em").html("MY PROFILE");}
	}

	if(opcion=="acreditacion"){jQuery("#cyp_boton_editar_volver").css({display:"block"});jQuery(".cyp_editar_acreditacion").css({display:"block"});}
	if(opcion=="acreditacionmatchmaking"){jQuery("#cyp_boton_editar_volver").css({display:"block"});jQuery(".cyp_editar_acreditacion_matchmaking").css({display:"block"});}
	if(opcion=="seminario"){jQuery("#cyp_boton_editar_volver").css({display:"block"});jQuery(".cyp_editar_seminario").css({display:"block"});}
	if(opcion=="solicitarbus"){jQuery("#cyp_boton_editar_volver").css({display:"block"});jQuery(".cyp_editar_solicitarbus").css({display:"block"});}
	if(opcion=="bus"){jQuery("#cyp_boton_editar_volver").css({display:"block"});jQuery(".cyp_editar_bus").css({display:"block"});}
	if(opcion=="ampliaciones"){jQuery("#cyp_boton_editar_volver").css({display:"block"});jQuery(".cyp_editar_ampliaciones").css({display:"block"});editarampliaciones_opciones();}
	if(opcion=="agenda"){jQuery("#cyp_boton_editar_volver").css({display:"block"});jQuery(".cyp_editar_agenda").css({display:"block"});editaragendadias_cargar_reuniones();}
	if(opcion=="reuniones"){jQuery("#cyp_boton_editar_volver").css({display:"block"});jQuery(".cyp_editar_reuniones").css({display:"block"});editaracreditarse_cargar_reuniones();}
	if(opcion=="mensajes"){jQuery("#cyp_boton_editar_volver").css({display:"block"});jQuery(".cyp_editar_mensajes").css({display:"block"});editaracreditarse_cargar_mensajes();}

	if(opcion=="miseventos"){jQuery("#cyp_boton_editar_volver").css({display:"block"});jQuery(".cyp_editar_acreditacion_miseventos").css({display:"block"});}

	if(jQuery(".cyp_editar_perfil_idioma").html()=="es" && opcion=="agenda"){jQuery(".cyp_cf3_header").find("h1").find("em").html("MI AGENDA");}
	if(jQuery(".cyp_editar_perfil_idioma").html()=="en" && opcion=="agenda"){jQuery(".cyp_cf3_header").find("h1").find("em").html("MY AGENDA");}
	
	if(jQuery(".cyp_editar_perfil_idioma").html()=="es" && opcion=="miseventos"){jQuery(".cyp_cf3_header").find("h1").find("em").html("MIS EVENTOS");}
	if(jQuery(".cyp_editar_perfil_idioma").html()=="en" && opcion=="miseventos"){jQuery(".cyp_cf3_header").find("h1").find("em").html("MY EVENTS");}
	
	if(jQuery(".cyp_editar_perfil_idioma").html()=="gl" && opcion=="agenda"){jQuery(".cyp_cf3_header").find("h1").find("em").html("A Miña Axenda");}

	if(jQuery(".cyp_editar_perfil_idioma").html()=="es" && opcion=="reuniones"){jQuery(".cyp_cf3_header").find("h1").find("em").html("MIS REUNIONES");}
	if(jQuery(".cyp_editar_perfil_idioma").html()=="en" && opcion=="reuniones"){jQuery(".cyp_cf3_header").find("h1").find("em").html("MY MEETINGS");}
	if(jQuery(".cyp_editar_perfil_idioma").html()=="gl" && opcion=="reuniones"){jQuery(".cyp_cf3_header").find("h1").find("em").html("As Miñas Reunións");}
}

function editaragendadias_cargar_reuniones()
{
	jQuery(".cyp_editar_agenda").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=agendadias_cargar&idioma="+jQuery(".cyp_editar_perfil_idioma").html()+"",success:function(data){
		jQuery(".cyp_editar_agenda").html(data);
		jQuery(".cyp_programa_fechas").find("a").each(function() 
		{
			jQuery(this).unbind("click").click(function(){
				editaragenda_cargar_reuniones(jQuery(this).attr("fecha"));
			});
		});

		if(jQuery(".cyp_agenda_dia_actual").length)
		{
			jQuery("a").each(function() 
			{
				if(jQuery(this).html().indexOf(jQuery(".cyp_agenda_dia_actual").html())!=-1){jQuery(this).click();}
			});
		}

		editaragenda_cargar_reuniones();
	}});
}

function editaragenda_cargar_reuniones(fecha)
{
	if(fecha)
	{
		jQuery(".cyp_programa_fechas").find("a").each(function() 
		{
			//jQuery(this).attr("class","cyp_programa_fechas_boton2");
			//if(jQuery(this).attr("fecha")==fecha){jQuery(this).attr("class","cyp_programa_fechas_boton1");}
			jQuery(this).removeClass("cyp_dia_fecha_hover");
			if(jQuery(this).attr("fecha")==fecha){jQuery(this).addClass("cyp_dia_fecha_hover");}
		});
	}

	fecha="";

	jQuery(".cyp_programa_fechas").find("a").each(function() 
	{
		if(jQuery(this).attr("class").indexOf("cyp_dia_fecha_hover")!=-1){fecha=jQuery(this).attr("fecha");}
	});

	jQuery(".cyp_programa_cargar_dia").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=agenda_cargar&idioma="+jQuery(".cyp_editar_perfil_idioma").html()+"&fecha="+fecha+"",success:function(data){
		jQuery(".cyp_programa_cargar_dia").html(data);

		jQuery(".cyp_editar_agenda_dia_programa_evento").each(function() 
		{
			jQuery(this).find("a").unbind("click").click(function(){
				jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=programa_agenda&fechahora="+jQuery(this).attr("fechahora")+"&sala="+jQuery(this).attr("sala")+"&accion=eliminar",success:function(data){
					editaragenda_cargar_reuniones(jQuery("a[class='cyp_dia_fecha_hover']").attr("fecha"));
				}});
			});
		});

		jQuery("#descargar_agenda_excel").unbind("click").click(function(){descargar_agenda_excel();});
		if(jQuery("#cyp_reuniones_1234").length){jQuery("#cyp_reuniones_1234").unbind("click").click(function(){editaracreditarse_mostrar("reuniones");});}
	}});
}

function editaracreditarse_cargar_mensajes()
{
	jQuery(".cyp_editar_mensajes").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=acreditaciones_cargar_mensajes&idioma="+jQuery(".cyp_editar_perfil_idioma").html()+"",success:function(data){
		jQuery(".cyp_editar_mensajes").html(data);

		jQuery(".cyp_editar_mensajes_izq_elem").each(function() 
		{
			jQuery(this).unbind("click").click(function(){
				jQuery(".cyp_editar_mensajes_izq_elem").each(function() 
				{
					jQuery(this).removeClass("cyp_editar_mensajes_izq_elem_hover");
				});
				jQuery(this).addClass("cyp_editar_mensajes_izq_elem_hover");
				jQuery(this).find("i").remove();
				jQuery(".cyp_editar_mensajes_der_enviar").css({display:"block"});

				editaracreditarse_cargar_mensajes_cargar(jQuery(this).attr("idusuario"));
			});
		});

		jQuery("#insertar_participantes_enviar_mensaje_enviar_formulario").unbind("click").click(function(){editaracreditarse_cargar_mensajes_enviar(jQuery("form[name='form_conversacion_enviar_mensaje']"));});

		jQuery("#cyp_boton_editar_volver").unbind("click").click(function(){editaracreditarse_mostrar("volver");});
	}});

	editaracreditarse_cargar_mensajes_comprobar_mensajes();
}

function editaracreditarse_cargar_mensajes_comprobar_mensajes()
{
	if(jQuery(".cyp_mensaje_enviar_idusuario").length)
	{
		editaracreditarse_cargar_mensajes_cargar(jQuery(".cyp_mensaje_enviar_idusuario").html());
	}

	setTimeout(function(){editaracreditarse_cargar_mensajes_comprobar_mensajes();},60000);
}

function editaracreditarse_cargar_mensajes_cargar(idusuario)
{
	jQuery(".cyp_editar_mensajes_der").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=acreditaciones_cargar_mensajes_conversacion&idioma="+jQuery(".cyp_editar_perfil_idioma").html()+"&idusuario="+idusuario+"",success:function(data){
		jQuery(".cyp_editar_mensajes_der").html(data);
		jQuery(".cyp_editar_mensajes_der").scrollTop(jQuery(".cyp_editar_mensajes_der")[0].scrollHeight);
	}});
}

function editaracreditarse_cargar_mensajes_enviar(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(validacion==true && control==false && jQuery("input[name='Mmensaje']").val()!="")
		{
			jQuery("form[name='form_conversacion_enviar_mensaje']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=acreditaciones_cargar_mensajes_insertar_mensaje&idusuario="+jQuery(".cyp_mensaje_enviar_idusuario").html()+"");
			jQuery("form[name='form_conversacion_enviar_mensaje']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
			setTimeout(function(){jQuery("form[name='form_conversacion_enviar_mensaje']").attr("action","javascript://");jQuery("input[name='Mmensaje']").val("");},1000);
		}
	}
}

function editaracreditarse_cargar_mensajes_enviar_estado(estado)
{
	editaracreditarse_cargar_mensajes_cargar(jQuery(".cyp_mensaje_enviar_idusuario").html());
}

function editaracreditarse_cargar_reuniones()
{
	jQuery(".cyp_editar_reuniones").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=acreditaciones_cargar_reuniones&idioma="+jQuery(".cyp_editar_perfil_idioma").html()+"",success:function(data){
		jQuery(".cyp_editar_reuniones").html(data);
		jQuery(".cyp_programa_fechas").find("a").each(function() 
		{
			jQuery(this).unbind("click").click(function(){
				editaracreditarse_cargar_reuniones_fecha(jQuery(this).attr("fecha"));
			});
		});

		if(jQuery(".cyp_reuniones_dia_actual").length)
		{
			jQuery("a").each(function() 
			{
				if(jQuery(this).html()==jQuery(".cyp_reuniones_dia_actual").html()){jQuery(this).click();}
			});
		}

		editaracreditarse_cargar_reuniones_fecha();
	}});
}

function editaracreditarse_cargar_reuniones_fecha(fecha)
{
	if(fecha)
	{
		jQuery(".cyp_programa_fechas").find("a").each(function() 
		{
			//jQuery(this).attr("class","cyp_programa_fechas_boton2");
			//if(jQuery(this).attr("fecha")==fecha){jQuery(this).attr("class","cyp_programa_fechas_boton1");}
			jQuery(this).removeClass("cyp_dia_fecha_hover");
			if(jQuery(this).attr("fecha")==fecha){jQuery(this).addClass("cyp_dia_fecha_hover");}
		});
	}

	fecha="";

	jQuery(".cyp_editar_reuniones").find(".cyp_programa_fechas").find("a").each(function() 
	{
		if(jQuery(this).attr("class").indexOf("cyp_dia_fecha_hover")!=-1){fecha=jQuery(this).attr("fecha");}
	});

	jQuery(".cyp_reuniones_cargar_dia").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=acreditaciones_cargar_reuniones_fecha&idioma="+jQuery(".cyp_editar_perfil_idioma").html()+"&fecha="+fecha+"",success:function(data){
		jQuery(".cyp_reuniones_cargar_dia").html(data);

		jQuery(".cyp_editar_perfil_botones_boton2").each(function() 
		{
			jQuery(this).unbind("click").click(function(){
				editaracreditarse_reuniones_aceptar_rechazar(jQuery(this).attr("idreunion"),jQuery(this).attr("estado"),jQuery(this).attr("accion"));
			});
		});
		editaracreditarse_cargar_activar_desactivar();

		jQuery("#descargar_agenda_excel").unbind("click").click(function(){descargar_agenda_excel();});

		jQuery("#cyp_boton_editar_agenda_aux").unbind("click").click(function(){editaracreditarse_mostrar("agenda");});
	}});
}

function editaracreditarse_cargar_activar_desactivar()
{
	jQuery(".cyp_editar_reuniones_libre").each(function() 
	{
		jQuery(this).unbind("click").click(function(){
			editaracreditarse_cargar_activar_desactivar_accion(jQuery(this).attr("idreunion"),"desactivar");
		});
	});
	jQuery(".cyp_editar_reuniones_desactivado").each(function() 
	{
		jQuery(this).unbind("click").click(function(){
			editaracreditarse_cargar_activar_desactivar_accion(jQuery(this).attr("idreunion"),"activar");
		});
	});
}

function editaracreditarse_cargar_activar_desactivar_accion(idreunion,accion)
{
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=editaracreditarse_cargar_activar_desactivar&idreunion="+idreunion+"&accion="+accion+"",success:function(data){}});

	if(accion=="desactivar")
	{
		jQuery("div[idreunion='"+idreunion+"']").attr("class",jQuery("div[idreunion='"+idreunion+"']").attr("class").replace("cyp_editar_reuniones_libre","cyp_editar_reuniones_desactivado"));
	}else{
		jQuery("div[idreunion='"+idreunion+"']").attr("class",jQuery("div[idreunion='"+idreunion+"']").attr("class").replace("cyp_editar_reuniones_desactivado","cyp_editar_reuniones_libre"));
	}

	editaracreditarse_cargar_activar_desactivar();
}

function editaracreditarse_reuniones_aceptar_rechazar(idsolicitud,estado,accion)
{
	if(accion=="cancelar")
	{
		jQuery("a[idreunion='"+idsolicitud+"']").attr("accion","connfirmar");
		jQuery("textarea[name='textarea_"+idsolicitud+"']").css("display","block");
	}else{
		jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=editaracreditarse_reuniones_aceptar_rechazar&idsolicitud="+idsolicitud+"&estado="+estado+"&mensaje="+jQuery("textarea[name='textarea_"+idsolicitud+"']").val()+"",success:function(data){
			editaracreditarse_cargar_reuniones_fecha(jQuery(".cyp_editar_reuniones").find(".cyp_programa_fechas").find(".cyp_programa_fechas_boton1").attr("fecha"));	
		}});
	}
}

function editaracreditarse_imagen_enviar()
{
	if(jQuery("input[name='Efoto']").val()!="")
	{
		extension=jQuery("input[name='Efoto']").val().split(".");
		extension=extension[extension.length-1].toLowerCase();
		if(extension!="jpg" && extension!="jpeg")
		{
			alert("El formato debe ser JPG");
		}else{
			jQuery("form[name='form_editar_acreditaciones_imagen']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=acreditaciones_editar_imagen");
			jQuery("form[name='form_editar_acreditaciones_imagen']").append("<button id='submitinputcode2' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode2").click();
		}
	}
}

function editaracreditarse_imagen_formulario_estado(imagen)
{
	jQuery(".cyp_editar_perfil_img").find("img").attr("src",imagen);
}

function editaracreditarse_datos_enviar(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(validacion==true && control==false)
		{
			jQuery("#boton_acreditaciones_enviar_formulario").html(cargando);

			jQuery("form[name='form_editar_acreditaciones']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=acreditaciones_editar_datos");
			jQuery("form[name='form_editar_acreditaciones']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}

function editaracreditarse_datos_formulario_estado(estado)
{
	if(estado=="ok")
	{
		jQuery("#boton_acreditaciones_enviar_formulario").html("OK");
		setTimeout(function(){location.reload(true);},2000);
	}
}

function editaracreditarsematchmaking_datos_enviar(elem)
{
	var validacion=false;var control=false;

		var perfil_acreditado_tags="";
		var perfil_acreditado_tags_texto="";
		if(jQuery("#perfil_acreditado_tags").length && control==false)
		{
			jQuery("#perfil_acreditado_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				perfil_acreditado_tags=perfil_acreditado_tags+jQuery(this).attr("valor")+", ";
				perfil_acreditado_tags_texto=perfil_acreditado_tags_texto+jQuery(this).html()+", ";
			});
			jQuery("input[name='Apuesto']").val(perfil_acreditado_tags_texto);
			//if(perfil_acreditado_tags==""){alert("Elige al menos una opción de \"Perfil del acreditado\"\nChoose at least one option in \"Participant’s profile\"");control=true;}
		}

		var actividad_principal_tags="";
		var actividad_principal_tags_texto="";
		if(jQuery("#actividad_principal_tags").length && control==false)
		{
			jQuery("#actividad_principal_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				actividad_principal_tags=actividad_principal_tags+jQuery(this).attr("valor")+", ";
				actividad_principal_tags_texto=actividad_principal_tags_texto+jQuery(this).html()+", ";
			});
			jQuery("input[name='Aactividad']").val(actividad_principal_tags_texto);
			//if(actividad_principal_tags==""){alert("Elige al menos una opción de \"Actividad principal\"\nChoose at least one option in \"Primary business\"");control=true;}
		}

		var continentes_tags="";
		if(jQuery("#continentes_tags").length && control==false)
		{
			jQuery("#continentes_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				continentes_tags=continentes_tags+jQuery(this).attr("valor")+", ";
			});			
			//if(continentes_tags==""){alert("Elige al menos una opción de \"Ubicación \"\nChoose at least one option in \"Location\"");control=true;}
		}

		var idiomas_tags="";
		if(jQuery("#idiomas_tags").length && control==false)
		{
			jQuery("#idiomas_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				idiomas_tags=idiomas_tags+jQuery(this).attr("valor")+", ";
			});			
			//if(idiomas_tags==""){alert("Elige al menos una opción de \"Idiomas\"\nChoose at least one option in \"Languages\"");control=true;}
		}

		var proyectos_formato_tags="";
		if(jQuery("#proyectos_formato_tags").length && control==false)
		{
			jQuery("#proyectos_formato_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				proyectos_formato_tags=proyectos_formato_tags+jQuery(this).attr("valor")+", ";
			});			
			//if(proyectos_formato_tags==""){alert("Elige al menos una opción de \"Mis proyectos - Formato\"\nChoose at least one option in \"My projects - Format\"");control=true;}
		}

		var proyectos_tono_tags="";
		if(jQuery("#proyectos_tono_tags").length && control==false)
		{
			jQuery("#proyectos_tono_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				proyectos_tono_tags=proyectos_tono_tags+jQuery(this).attr("valor")+", ";
			});			
			//if(proyectos_tono_tags==""){alert("Elige al menos una opción de \"Mis proyectos - Tono\"\nChoose at least one option in \"My projects - Tone\"");control=true;}
		}

		var proyectos_genero_tags="";
		if(jQuery("#proyectos_genero_tags").length && control==false)
		{
			jQuery("#proyectos_genero_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				proyectos_genero_tags=proyectos_genero_tags+jQuery(this).attr("valor")+", ";
			});			
			//if(proyectos_genero_tags==""){alert("Elige al menos una opción de \"Mis proyectos - Género ficción\"\nChoose at least one option in \"My projects - Genre fiction\"");control=true;}
		}

		var proyectos_generoentretenimiento_tags="";
		if(jQuery("#proyectos_generoentretenimiento_tags").length && control==false)
		{
			jQuery("#proyectos_generoentretenimiento_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				proyectos_generoentretenimiento_tags=proyectos_generoentretenimiento_tags+jQuery(this).attr("valor")+", ";
			});			
			//if(proyectos_genero_tags==""){alert("Elige al menos una opción de \"Mis proyectos - Género entretenimiento\"\nChoose at least one option in \"My projects - Genre entertainment\"");control=true;}
		}

		var vengo_conectafiction_tags="";
		if(jQuery("#vengo_conectafiction_tags").length && control==false)
		{
			jQuery("#vengo_conectafiction_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				vengo_conectafiction_tags=vengo_conectafiction_tags+jQuery(this).attr("valor")+", ";
			});			
			//if(vengo_conectafiction_tags==""){alert("Elige al menos una opción de \"Vengo a Conecta FICTION para\"\nChoose at least one option in \"I attend Conecta FICTION to\"");control=true;}
		}

		var perfil_acreditado_tags_busco="";
		if(jQuery("#perfil_acreditado_tags_busco").length && control==false)
		{
			jQuery("#perfil_acreditado_tags_busco").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				perfil_acreditado_tags_busco=perfil_acreditado_tags_busco+jQuery(this).attr("valor")+", ";
			});			
			//if(perfil_acreditado_tags_busco==""){alert("Elige al menos una opción de \"Busco acreditados que sean\"\nChoose at least one option in \"I look for participants who are\"");control=true;}
		}

		var actividad_principal_tags_busco="";
		if(jQuery("#actividad_principal_tags_busco").length && control==false)
		{
			jQuery("#actividad_principal_tags_busco").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				actividad_principal_tags_busco=actividad_principal_tags_busco+jQuery(this).attr("valor")+", ";
			});			
			//if(actividad_principal_tags_busco==""){alert("Elige al menos una opción de \"Busco empresas que sean\"\nChoose at least one option in \"I look for companies who are\"");control=true;}
		}

		var continente_tags_busco="";
		if(jQuery("#continente_tags_busco").length && control==false)
		{
			jQuery("#continente_tags_busco").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				continente_tags_busco=continente_tags_busco+jQuery(this).attr("valor")+", ";
			});			
			//if(continente_tags_busco==""){alert("Elige al menos una opción de \"Busco acreditados que sean de\"\nChoose at least one option in \"I look for participants who come from\"");control=true;}
		}

		var idioma_tags_busco="";
		if(jQuery("#idioma_tags_busco").length && control==false)
		{
			jQuery("#idioma_tags_busco").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				idioma_tags_busco=idioma_tags_busco+jQuery(this).attr("valor")+", ";
			});			
			//if(idioma_tags_busco==""){alert("Elige al menos una opción de \"Busco acreditados que hablen en\"\nChoose at least one option in \"I look for participants who speak\"");control=true;}
		}

		var proyectos_formato_tags_busco="";
		if(jQuery("#proyectos_formato_tags_busco").length && control==false)
		{
			jQuery("#proyectos_formato_tags_busco").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				proyectos_formato_tags_busco=proyectos_formato_tags_busco+jQuery(this).attr("valor")+", ";
			});			
			//if(proyectos_formato_tags_busco==""){alert("Elige al menos una opción de \"Tipo de proyectos que busco - Formato\"\nChoose at least one option in \"I look for projects which are - Format\"");control=true;}
		}

		var proyectos_tono_tags_busco="";
		if(jQuery("#proyectos_tono_tags_busco").length && control==false)
		{
			jQuery("#proyectos_tono_tags_busco").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				proyectos_tono_tags_busco=proyectos_tono_tags_busco+jQuery(this).attr("valor")+", ";
			});			
			//if(proyectos_tono_tags_busco==""){alert("Elige al menos una opción de \"Tipo de proyectos que busco - Tono\"\nChoose at least one option in \"I look for projects which are - Tone\"");control=true;}
		}

		var proyectos_genero_tags_busco="";
		if(jQuery("#proyectos_genero_tags_busco").length && control==false)
		{
			jQuery("#proyectos_genero_tags_busco").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				proyectos_genero_tags_busco=proyectos_genero_tags_busco+jQuery(this).attr("valor")+", ";
			});			
			//if(proyectos_genero_tags_busco==""){alert("Elige al menos una opción de \"Tipo de proyectos que busco - Género ficción\"\nChoose at least one option in \"I look for projects which are - Genre fiction\"");control=true;}
		}

		var proyectos_generoentretenimiento_tags_busco="";
		if(jQuery("#proyectos_generoentretenimiento_tags_busco").length && control==false)
		{
			jQuery("#proyectos_generoentretenimiento_tags_busco").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				proyectos_generoentretenimiento_tags_busco=proyectos_generoentretenimiento_tags_busco+jQuery(this).attr("valor")+", ";
			});			
			//if(proyectos_genero_tags_busco==""){alert("Elige al menos una opción de \"Tipo de proyectos que busco - Género entretenimiento\"\nChoose at least one option in \"I look for projects which are - Genre entertainment\"");control=true;}
		}

		var vengo_conectafiction_tags_busco="";
		if(jQuery("#vengo_conectafiction_tags_busco").length && control==false)
		{
			jQuery("#vengo_conectafiction_tags_busco").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				vengo_conectafiction_tags_busco=vengo_conectafiction_tags_busco+jQuery(this).attr("valor")+", ";
			});			
			//if(vengo_conectafiction_tags_busco==""){alert("Elige al menos una opción de \"Vengo a Conecta FICTION para conectar con acreditados que quieran\"\nChoose at least one option in \"In Conecta FICTION, I look for participants who want to\"");control=true;}
		}

		var matchmaking_soy=perfil_acreditado_tags+actividad_principal_tags+continentes_tags+idiomas_tags+proyectos_formato_tags+proyectos_tono_tags+proyectos_genero_tags+proyectos_generoentretenimiento_tags+vengo_conectafiction_tags;
		var matchmaking_busco=perfil_acreditado_tags_busco+actividad_principal_tags_busco+continente_tags_busco+idioma_tags_busco+proyectos_formato_tags_busco+proyectos_tono_tags_busco+proyectos_genero_tags_busco+proyectos_generoentretenimiento_tags_busco+vengo_conectafiction_tags_busco;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(1==1)//if(validacion==true && control==false)
		{
			jQuery("#boton_acreditacionesmatchmaking_enviar_formulario").html(cargando);

			jQuery("form[name='form_editar_acreditaciones_matchmaking']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=acreditacionesmatchmaking_editar_datos&matchmaking_soy="+matchmaking_soy+"&matchmaking_busco="+matchmaking_busco+"");
			jQuery("form[name='form_editar_acreditaciones_matchmaking']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}

function editaracreditarsematchmaking_datos_formulario_estado(estado)
{
	if(estado=="ok")
	{
		jQuery("#boton_acreditacionesmatchmaking_enviar_formulario").html("OK");
		setTimeout(function(){location.reload(true);},2000);
	}
}

function editarabus_datos_enviar(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(validacion==true && control==false)
		{
			jQuery("#boton_editarbus_enviar_formulario").html(cargando);

			jQuery("form[name='form_editar_bus']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=bus_editar_datos");
			jQuery("form[name='form_editar_bus']").append("<button id='submitinputcode5' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode5").click();
		}
	}
}

function editarabus_datos_formulario_estado(estado)
{
	if(estado=="ok")
	{
		jQuery("#boton_editarbus_enviar_formulario").html("OK");
		setTimeout(function(){location.reload(true);},2000);
	}
}

function editaracreditarse_anadir_proyecto()
{
	cont=1;

	jQuery(".Rproyecto").each(function() 
	{
		cont++;
	});

	if(jQuery("#cyp_editar_perfil_anadir_proyecto").html().indexOf("proyecto")===-1)
	{
		jQuery(".cyp_editar_perfil_proyectos").append("<div style='float:left;width:100%'><textarea class='Rproyecto' name='Rproyecto"+cont+"' placeholder='Add a project (title and text)'></textarea><a indice='proyecto_"+cont+"' class='cyp_editar_eliminar_fila' href='javascript://'>X</a></div>");
	}else{
		jQuery(".cyp_editar_perfil_proyectos").append("<div style='float:left;width:100%'><textarea class='Rproyecto' name='Rproyecto"+cont+"' placeholder='Añade un proyecto (título y texto)'></textarea><a indice='proyecto_"+cont+"' class='cyp_editar_eliminar_fila' href='javascript://'>X</a></div>");
	}

	if(cont>=3){jQuery("#cyp_editar_perfil_anadir_proyecto").remove();}

	editaracreditarse_botones_eliminar();
}

function editaracreditarse_anadir_idioma()
{
	cont=1;

	jQuery(".Ridioma").each(function() 
	{
		cont++;
	});

	if(jQuery("#cyp_editar_perfil_anadir_idioma").html().indexOf("idioma")===-1)
	{
		jQuery(".cyp_editar_perfil_idiomas").append("<select class='Ridioma' name='Ridioma"+cont+"'><option value=''>Add a language</option><option value='Spanish'>Spanish</option><option value='English'>English</option></select><a indice='idioma_"+cont+"' class='cyp_editar_eliminar_fila' href='javascript://'>X</a>");
	}else{
		jQuery(".cyp_editar_perfil_idiomas").append("<select class='Ridioma' name='Ridioma"+cont+"'><option value=''>Añade un idioma</option><option value='Español'>Español</option><option value='Inglés'>Inglés</option></select><a indice='idioma_"+cont+"' class='cyp_editar_eliminar_fila' href='javascript://'>X</a>");
	}

	if(cont>=3){jQuery("#cyp_editar_perfil_anadir_idioma").remove();}

	editaracreditarse_botones_eliminar();
}

function editaracreditarse_anadir_hueco()
{
	cont=1;

	jQuery(".Rfecha").each(function() 
	{
		cont++;
	});

	if(jQuery("#cyp_editar_perfil_anadir_hueco").html().indexOf("hueco")===-1)
	{
		jQuery(".cyp_editar_perfil_huecos").append("<input type='text' class='Rfecha' name='Rfecha"+cont+"' placeholder='Date' style='float:left;width:calc(32% - 12px);width:-moz-calc(32% - 12px);width:-webkit-calc(32% - 12px)' />");
		jQuery(".cyp_editar_perfil_huecos").append("<input type='text' class='Rhorainicio' name='Rhorainicio"+cont+"' placeholder='Start hour' style='float:left;width:calc(32% - 12px);width:-moz-calc(32% - 12px);width:-webkit-calc(32% - 12px);margin-left:2%;margin-right:2%' />");
		jQuery(".cyp_editar_perfil_huecos").append("<input type='text' class='Rhorafin' name='Rhorafin"+cont+"' placeholder='Finish hour' style='float:left;width:calc(32% - 12px);width:-moz-calc(32% - 12px);width:-webkit-calc(32% - 12px);' /><a indice='hueco_"+cont+"' class='cyp_editar_eliminar_fila' href='javascript://'>X</a>");
	}else{
		jQuery(".cyp_editar_perfil_huecos").append("<input type='text' class='Rfecha' name='Rfecha"+cont+"' placeholder='Fecha' style='float:left;width:calc(32% - 12px);width:-moz-calc(32% - 12px);width:-webkit-calc(32% - 12px)' />");
		jQuery(".cyp_editar_perfil_huecos").append("<input type='text' class='Rhorainicio' name='Rhorainicio"+cont+"' placeholder='Hora de inicio' style='float:left;width:calc(32% - 12px);width:-moz-calc(32% - 12px);width:-webkit-calc(32% - 12px);margin-left:2%;margin-right:2%' />");
		jQuery(".cyp_editar_perfil_huecos").append("<input type='text' class='Rhorafin' name='Rhorafin"+cont+"' placeholder='Hora de fin' style='float:left;width:calc(32% - 12px);width:-moz-calc(32% - 12px);width:-webkit-calc(32% - 12px);' /><a indice='hueco_"+cont+"' class='cyp_editar_eliminar_fila' href='javascript://'>X</a>");
	}

	jQuery("input[name='Rfecha"+cont+"']").datepicker();
	jQuery("input[name='Rhorainicio"+cont+"']").timepicker({timeFormat:'H:i'});
	jQuery("input[name='Rhorafin"+cont+"']").timepicker({timeFormat:'H:i'});

	editaracreditarse_botones_eliminar();
}

function editaracreditarse_huecos_fecha_hora()
{
	cont=1;

	jQuery(".Rfecha").each(function() 
	{
		jQuery("input[name='Rfecha"+cont+"']").datepicker();
		jQuery("input[name='Rhorainicio"+cont+"']").timepicker({timeFormat:'H:i'});
		jQuery("input[name='Rhorafin"+cont+"']").timepicker({timeFormat:'H:i'});

		cont++;
	});
}

function editaracreditarse_botones_eliminar()
{
	jQuery(".cyp_editar_eliminar_fila").each(function() 
	{
		jQuery(this).unbind("click").click(function(){
			datos=jQuery(this).attr("indice").split("_");
			if(datos[0]=="proyecto"){jQuery("textarea[name='Rproyecto"+datos[1]+"']").remove();jQuery(this).remove();}
			if(datos[0]=="idioma"){jQuery("select[name='Ridioma"+datos[1]+"']").remove();jQuery(this).remove();}
			if(datos[0]=="hueco"){jQuery("input[name='Rfecha"+datos[1]+"']").remove();jQuery("input[name='Rhorainicio"+datos[1]+"']").remove();jQuery("input[name='Rhorafin"+datos[1]+"']").remove();jQuery(this).remove();}
		});
	});
}

function editaracreditarse_datosreuniones_enviar(elem)
{
	jQuery("#boton_editaracreditacionesreuniones_enviar_formulario").html(cargando);

	jQuery("form[name='form_editar_acreditacionesreuniones']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=acreditacionesreuniones_editar_datos");
	jQuery("form[name='form_editar_acreditacionesreuniones']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
	jQuery("#submitinputcode").click();
}

function editaracreditarse_datosreuniones_formulario_estado(estado)
{
	if(estado=="ok")
	{
		jQuery("#boton_editaracreditacionesreuniones_enviar_formulario").html("OK");
		setTimeout(function(){location.reload(true);},2000);
	}
}

function descargar_agenda_excel()
{
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=descargar_agenda_excel&idioma="+jQuery(".cyp_editar_perfil_idioma").html()+"",success:function(data){
		document.location = data;
	}});
}
//FIN EDITAR ACREDITARSE

//PARTICIPANTES
function participantes_secciones()
{
	jQuery(".cf_participantes_botones").find("a").each(function() 
	{
		jQuery(this).unbind("click").click(function(){
			jQuery(".cf_participantes_botones").find("a").each(function(){jQuery(this).removeClass("cf_participantes_botones_a_hover");});
			if(jQuery(this).attr("opcion")=="participantes")
			{
				jQuery(this).addClass("cf_participantes_botones_a_hover");
				jQuery(".cf_participantes_buscador").css({display:"inline-block"});
				participantes_busqueda(jQuery(this).attr("opcion"));
			}
			if(jQuery(this).attr("opcion")=="matchmaking")
			{
				jQuery(this).addClass("cf_participantes_botones_a_hover");
				jQuery(".cf_participantes_buscador").css({display:"none"});
				participantes_busqueda(jQuery(this).attr("opcion"));
			}
		});
	});
}

function participantes_buscador(busqueda)
{
	clearTimeout(temporizador);
	if(busqueda==""){temporizador=setTimeout(function(){participantes_busqueda("participantes");},1000);}else if(busqueda.length>2){temporizador=setTimeout(function(){participantes_busqueda("participantes");},1000);}
	jQuery("#cyp_boton_participantes_volver").unbind("click").click(function(){jQuery("input[name='participantes_buscador']").val("");participantes_busqueda("participantes");});
}

function participantes_busqueda(seccion)
{
	if(jQuery("input[name='participantes_buscador']").val().length>2){jQuery("#cyp_boton_participantes_volver").css({display:"block"});}else{jQuery("#cyp_boton_participantes_volver").css({display:"none"});}
	jQuery(".cyp_participantes_cargar").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=participantes_buscador&busqueda="+jQuery("input[name='participantes_buscador']").val()+"&pais="+jQuery("select[name='cyp_participantes_filtropais']").val()+"&idioma="+jQuery(".cyp_participantes_idioma").html()+"&seccion="+seccion+"",success:function(data){
		jQuery(".cyp_participantes_cargar").html(data);
		participantes_botones();
	}});
}

function participantes_botones()
{
	jQuery(".cyp_participantes_1_boton_perfil").each(function() 
	{
		jQuery(this).unbind("click").click(function(){
			participantes_ficha(jQuery(this).attr("idusuario"));
		});
	});
	jQuery(".cyp_participantes_2_boton_perfil").each(function() 
	{
		jQuery(this).unbind("click").click(function(){
			participantes_ficha(jQuery(this).attr("idusuario"));
		});
	});
	jQuery(".cyp_participantes_1_boton").each(function() 
	{
		jQuery(this).unbind("click").click(function(){
			participantes_solicitar_reunion(jQuery(this).attr("idusuario"));
		});
	});
	jQuery(".cyp_participantes_2_boton").each(function() 
	{
		jQuery(this).unbind("click").click(function(){
			participantes_solicitar_reunion(jQuery(this).attr("idusuario"));
		});
	});
	jQuery(".cyp_cf_popup_mensaje").each(function() 
	{
		jQuery(this).unbind("click").click(function(){
			participantes_enviar_mensaje(jQuery(this).attr("idusuario"));
		});
	});
	jQuery(".cyp_participante_cf3_favorito").each(function() 
	{
		jQuery(this).unbind("click").click(function(){
			if(jQuery(this).find("i").attr("class")=="fa fa-star-o")
			{
				jQuery(this).find("i").attr("class","fa fa-star");
				participantes_boton_favorito(jQuery(this).attr("idusuario"),"add");
			}else{
				jQuery(this).find("i").attr("class","fa fa-star-o");
				participantes_boton_favorito(jQuery(this).attr("idusuario"),"remove");
			}
		});
	});
}

function participantes_boton_favorito(idusuario,accion)
{
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=participantes_favoritos&idusuario="+idusuario+"&accion="+accion+"",success:function(data){}});
}

function participantes_enviar_mensaje(idusuario)
{
	if(jQuery(".cyp_cf_popup_mensaje_form").length)
	{
		jQuery(".cyp_cf_popup_mensaje_form").html("");
		jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=participantes_enviar_mensaje&idusuario="+idusuario+"&idioma="+jQuery(".cyp_participantes_idioma").html()+"",success:function(data){
			jQuery(".cyp_cf_popup_mensaje_form").html(data);
			jQuery("#insertar_participantes_enviar_mensaje_enviar_formulario").unbind("click").click(function(){participantes_enviar_mensaje_enviar_formulario(jQuery("form[name='form_participantes_enviar_mensaje']"));});
		}});
	}
}

function participantes_enviar_mensaje_enviar_formulario(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(validacion==true && control==false)
		{
			jQuery("#boton_insertar_participantes_enviar_mensaje_enviar_formulario").html(cargando);
			jQuery("form[name='form_participantes_enviar_mensaje']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=participantes_insertar_mensaje");
			jQuery("form[name='form_participantes_enviar_mensaje']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}

function participantes_enviar_mensaje_enviar_formulario_formulario_estado(estado)
{
	jQuery("#boton_insertar_participantes_enviar_mensaje_enviar_formulario").html(estado);
}

function participantes_ficha(idusuario)
{
	jQuery(".cyp_participantes_cargar").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=participantes_ficha&idusuario="+idusuario+"&idioma="+jQuery(".cyp_participantes_idioma").html()+"",success:function(data){
		jQuery(".cyp_participantes_cargar").html(data);
		jQuery("#cyp_boton_editar_volver").unbind("click").click(function(){
			jQuery(".cf_participantes_botones").find("a").each(function() 
			{
				if(jQuery(this).attr("class")=="cf_participantes_botones_a_hover"){participantes_busqueda(jQuery(this).attr("opcion"));}
			});
		});
		jQuery("#cyp_boton_editar_solicitarreunion").unbind("click").click(function(){participantes_solicitar_reunion(jQuery(this).attr("idusuario"));});
		participantes_botones_huecos();
	}});
}

function participantes_solicitar_reunion(idusuario)
{
	jQuery(".cyp_participantes_cargar").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=participantes_solicitar_reunion&idusuario="+idusuario+"&idioma="+jQuery(".cyp_participantes_idioma").html()+"",success:function(data){
		jQuery(".cyp_participantes_cargar").html(data);
		jQuery("#cyp_boton_editar_volver").unbind("click").click(function(){
			jQuery(".cf_participantes_botones").find("a").each(function() 
			{
				if(jQuery(this).attr("class")=="cf_participantes_botones_a_hover"){participantes_busqueda(jQuery(this).attr("opcion"));}
			});
		});
		participantes_botones();

		set_bxslider();

		jQuery(".cyp_programa_fechas").find("a").each(function() 
		{
			jQuery(this).unbind("click").click(function(){
				participantes_solicitar_reunion_cargar_dia(jQuery(this).attr("idusuario"),jQuery(this).attr("fecha"));
			});
		});

		jQuery(".cyp_dia_fecha_hover").click();
	}});
}

function participantes_solicitar_reunion_cargar_dia(idusuario,fecha)
{
	if(fecha)
	{
		jQuery(".cyp_programa_fechas").find("a").each(function() 
		{
			jQuery(this).removeClass("cyp_dia_fecha_hover");
			if(jQuery(this).attr("fecha")==fecha){jQuery(this).addClass("cyp_dia_fecha_hover");}
		});
	}

	fecha="";

	jQuery(".cyp_programa_fechas").find("a").each(function() 
	{
		if(jQuery(this).attr("class").indexOf("cyp_dia_fecha_hover")!=-1){fecha=jQuery(this).attr("fecha");}
	});

	jQuery(".participantes_solicitar_reunion_cargar_dia").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=participantes_solicitar_reunion_cargar_dia&idusuario="+idusuario+"&fecha="+fecha+"&idioma="+jQuery(".cyp_participantes_idioma").html()+"",success:function(data){
		jQuery(".participantes_solicitar_reunion_cargar_dia").html(data);
		participantes_solicitar_reunion_botones();
		jQuery("#solicitarreunion_enviar_formulario").unbind("click").click(function(){
			if(jQuery(".cyp_editar_reuniones_idreuniones").html()=="" || jQuery("#solicitarreunion_textarea").val()=="" || jQuery("#solicitarreunion_sala").val()=="0")
			{
				alert("Selecciona un slot, escribe el motivo de la reunión y elige una sala / Select a slot, write the meeting reason and choose a room");
			}else{
				cont=0;
				control=false;
				datos=jQuery(".cyp_editar_reuniones_idreuniones").html().split(",");

				for(i=0;i<datos.length;i++)
				{
					if(datos[i]!="")
					{
						if(cont==0)
						{
							cont+=parseInt(datos[i].substr(2, 4));
						}else{
							cont+=parseInt(30);
							if(parseInt(String(cont).substr(2, 2))==60){cont+=parseInt(40);}
							if(cont!=parseInt(datos[i].substr(2, 4))){control=true;}
						}
					}
				}

				if(control==false)
				{
					//&sala="+jQuery(".cyp_editar_reuniones_sala").html()+"
					jQuery("#boton_solicitarreunion_enviar_formulario").html(cargando);
					jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=participantes_solicitar_reunion_insertar&idusuario="+jQuery(".cyp_editar_reuniones_idacreditado").html()+"&idreuniones="+jQuery(".cyp_editar_reuniones_idreuniones").html()+"&motivo="+jQuery("#solicitarreunion_textarea").val()+"&sala="+jQuery("#solicitarreunion_sala").val()+"&modo="+jQuery("#solicitarreunion_modo").val()+"",success:function(data){
						jQuery("#boton_solicitarreunion_enviar_formulario").html(data);
						jQuery(".cyp_editar_reuniones_columna_izq_horas_izq").each(function() 
						{
							jQuery(this).unbind("click");
						});
						jQuery(".cyp_editar_reuniones_columna_izq_horas_der").each(function() 
						{
							jQuery(this).unbind("click");
						});
						setTimeout(function(){participantes_solicitar_reunion(jQuery("#cyp_solicitar_reunion_usuario_id").html());},2000);
					}});
				}else{
					alert("Los slots deben ser consecutivos / The slots must be consecutive");
				}
			}
		});
		participantes_botones();
	}});
}

function participantes_botones_huecos()
{
	jQuery(".cyp_editar_perfil_huecos_hueco_boton").each(function() 
	{
		jQuery(this).unbind("click").click(function(){
			jQuery("form[name='form_solicitud_"+jQuery(this).attr("idsolicitud")+"']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=participantes_solicitud_enviar&idsolicitud="+jQuery(this).attr("idsolicitud")+"");
			jQuery("form[name='form_solicitud_"+jQuery(this).attr("idsolicitud")+"']").append("<button id='submitinputcode"+jQuery(this).attr("idsolicitud")+"' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode"+jQuery(this).attr("idsolicitud")+"").click();
			jQuery(this).parent().html("OK");
		});
	});
}

function participantes_solicitar_reunion_botones()
{
	jQuery(".cyp_editar_reuniones_columna_izq_horas_izq").each(function() 
	{
		jQuery(this).unbind("click").click(function(){
			participantes_solicitar_reunion2(jQuery(this).attr("idreunion"));
		});
	});
	jQuery(".cyp_editar_reuniones_columna_izq_horas_der").each(function() 
	{
		jQuery(this).unbind("click").click(function(){
			participantes_solicitar_reunion2(jQuery(this).attr("idreunion"));
		});
	});
}

function participantes_solicitar_reunion2(idreunion)
{
	idreuniones="";
	reuniones=jQuery(".cyp_editar_reuniones_idreuniones").html().split(",");

	if(jQuery("div[idreunion='"+idreunion+"']").attr("class").indexOf("cyp_editar_reuniones_libre")!==-1 || jQuery("div[idreunion='"+idreunion+"']").attr("class").indexOf("cyp_editar_reuniones_seleccion")!==-1)
	{
		if(jQuery("div[idreunion='"+idreunion+"']").attr("class").indexOf("cyp_editar_reuniones_libre")!==-1)
		{
			control=true;

			/*for(k=0;k<reuniones.length;k++)
			{
				var chunks = [];
				for (var i = 0, charsLength = reuniones[k].length; i < charsLength; i += 2) {
				    chunks.push(reuniones[k].substring(i, i + 2));
				}
				var chunks2 = [];
				for (var i = 0, charsLength = idreunion.length; i < charsLength; i += 2) {
				    chunks2.push(idreunion.substring(i, i + 2));
				}

				if(chunks[0]!=chunks2[0]){control=false;}
			}*/

			if(control==true){jQuery("div[idreunion='"+idreunion+"']").attr("class",jQuery("div[idreunion='"+idreunion+"']").attr("class").replace("cyp_editar_reuniones_libre", "cyp_editar_reuniones_seleccion"));}
		}else{
			jQuery("div[idreunion='"+idreunion+"']").attr("class",jQuery("div[idreunion='"+idreunion+"']").attr("class").replace("cyp_editar_reuniones_seleccion", "cyp_editar_reuniones_libre"));
		}
	}

	/*jQuery(".cyp_editar_reuniones_columna_izq_horas_izq").each(function() 
	{
		if(jQuery(this).attr("class").indexOf("cyp_editar_reuniones_seleccion")!==-1){idreuniones=idreuniones+jQuery(this).attr("idreunion")+",";}
	});
	jQuery(".cyp_editar_reuniones_columna_izq_horas_der").each(function() 
	{
		if(jQuery(this).attr("class").indexOf("cyp_editar_reuniones_seleccion")!==-1){idreuniones=idreuniones+jQuery(this).attr("idreunion")+",";}
	});*/

	jQuery(".cyp_editar_reuniones_columna_izq_horas").each(function() 
	{
		jQuery(this).find("div").each(function() 
		{
			if(jQuery(this).attr("class").indexOf("cyp_editar_reuniones_seleccion")!==-1){idreuniones=idreuniones+jQuery(this).attr("idreunion")+",";}
		});
	});

	jQuery(".cyp_editar_reuniones_idreuniones").html(idreuniones);

	participantes_solicitar_reunion_botones();
}

function descargar_participantes_excel()
{
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=descargar_participantes_excel",success:function(data){
		document.location = data;
	}});
}
//FIN PARTICIPANTES

//SPONSORS
function sponsors_cargar()
{
	jQuery(".cyp_sponsors_cargar").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=sponsors_cargar&idioma="+jQuery(".cyp_sponsors_idioma").html()+"",success:function(data){
		jQuery(".cyp_sponsors_cargar").html(data);
		jQuery(".sponsor_boton").each(function() 
		{
			jQuery(this).unbind("click").click(function(){
				sponsors_ficha(jQuery(this).attr("idsponsor"));
				window.location.hash='ids_'+jQuery(this).attr("idsponsor");
			});
		});
	}});
}

function sponsors_ficha(idsponsor)
{
	jQuery(".cyp_sponsors_cargar").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=sponsors_ficha&idsponsor="+idsponsor+"&idioma="+jQuery(".cyp_sponsors_idioma").html()+"",success:function(data){
		jQuery(".cyp_sponsors_cargar").html(data);
		sponsor_background=jQuery(".cyp_cf3_header").find("section").css("background-image");
		jQuery(".cyp_cf3_header").find(".et_pb_fullwidth_header_container").css("display","none");
		jQuery(".cyp_cf3_header").find("section").css("background-image","url("+jQuery(".cf_sponsor_background").find("img").attr("src")+")");
		jQuery(".cyp_boton_editar_volver").each(function() 
		{
			jQuery(this).unbind("click").click(function(){
				sponsors_cargar();
				jQuery(".cyp_cf3_header").find("section").css("background-image",sponsor_background);
				jQuery(".cyp_cf3_header").find(".et_pb_fullwidth_header_container").css("display","inline-block");
			});
		});
		jQuery(".cf_sponsor_video_boton").each(function() 
		{
			if(jQuery(this).parent().find("iframe").length)
			{
				jQuery(this).unbind("click").click(function(){
					jQuery(this).parent().find("iframe").css({display:"inline-block"});
					jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=sponsors_estadisticas&tipo=video&datos="+jQuery(this).attr("datos")+"&idsponsor="+jQuery(".cf_sponsor_id").html(),success:function(data){}});
					jQuery(this).remove();
				});
			}
		});
		jQuery(".cf_sponsor_banner").unbind("click").click(function(){
			jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=sponsors_estadisticas&tipo=banner&datos=banner&idsponsor="+jQuery(".cf_sponsor_id").html(),success:function(data){}});
		});
	}});
}
//FIN SPONSORS

//GESTIONAR PROGRAMA
function gestionarprograma_nueva()
{
	jQuery("#nueva_modificar").fadeOut("normal",function(){
	jQuery("#nueva_modificar").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionarprograma_nueva",success:function(data){
		jQuery("#nueva_modificar").html(data);
		jQuery("#insertar_programa_enviar_formulario").unbind("click").click(function(){gestionarprograma_insertar_enviar_formulario(jQuery("form[name='form_nueva_programa']"));});
		jQuery("input[name='Efecha']").datepicker();
		jQuery("input[name='Ehorainicio']").timepicker({timeFormat:'HH:mm', interval: 30});
		jQuery("input[name='Ehorafin']").timepicker({timeFormat:'HH:mm', interval: 30});
		jQuery("#nueva_modificar").fadeIn("normal");
		campos_focus_blur();
		regular_listados();
	}});
	});
}

function gestionarprograma_modificar(id)
{
	jQuery("#nueva_modificar").fadeOut("normal",function(){
	jQuery("#nueva_modificar").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionarprograma_modificar&id="+id+"",success:function(data){
		jQuery("#nueva_modificar").html(data);
		jQuery("#modificar_programa_enviar_formulario").unbind("click").click(function(){gestionarprograma_modificar_enviar_formulario(jQuery("form[name='form_modificar_programa']"));});
		jQuery("input[name='Efecha']").datepicker();
		jQuery("input[name='Ehorainicio']").timepicker({timeFormat:'HH:mm', interval: 30});
		jQuery("input[name='Ehorafin']").timepicker({timeFormat:'HH:mm', interval: 30});
		jQuery("#nueva_modificar").fadeIn("normal");
		campos_focus_blur();
		regular_listados();
	}});
	});
}

function gestionarprograma_insertar_enviar_formulario(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(validacion==true && control==false)
		{
			jQuery("#boton_insertar_programa_enviar_formulario").html(cargando);
			jQuery("form[name='form_nueva_programa']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=gestionarprograma_insertar");
			jQuery("form[name='form_nueva_programa']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}

function gestionarprograma_insertar_enviar_formulario_estado(estado)
{
	if(estado=="ok")
	{
		jQuery("#boton_insertar_programa_enviar_formulario").html("evento insertado correctamente");
		setTimeout(function(){gestionarprograma_nueva();gestionarprograma_listar();},2000);
	}
}

function gestionarprograma_listar()
{
	jQuery("#listado").fadeOut("normal",function(){
	jQuery("#listado").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionarprograma_listar",success:function(data){
		jQuery("#listado").html(data);
		jQuery("#listado").find(".listado_celda_hover").each(function() 
		{
			if(jQuery(this).html()=="modificar")
			{	
				jQuery(this).unbind("click").click(function(){gestionarprograma_modificar(jQuery(this).attr("id"));});
			}
			if(jQuery(this).html()=="eliminar")
			{	
				jQuery(this).unbind("click").click(function(){if(confirm("¿Estás seguro/a?")==true){gestionarprograma_eliminar(jQuery(this).attr("id"));}});
			}
		});
		jQuery("#listado").fadeIn("normal");
		campos_focus_blur();
		regular_listados();
	}});
	});
}

function gestionarprograma_modificar_enviar_formulario(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(validacion==true && control==false)
		{
			jQuery("#boton_modificar_programa_enviar_formulario").html(cargando);
			jQuery("form[name='form_modificar_programa']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=gestionarprograma_modif");
			jQuery("form[name='form_modificar_programa']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}

function gestionarprograma_modificar_enviar_formulario_estado(estado)
{
	if(estado=="ok")
	{
		jQuery("#boton_modificar_programa_enviar_formulario").html("evento modificado correctamente");
		setTimeout(function(){gestionarprograma_nueva();gestionarprograma_listar();},2000);
	}
}

function gestionarprograma_eliminar(id)
{
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionarprograma_eliminar&id="+id+"",success:function(data){
		gestionarprograma_nueva();gestionarprograma_listar();
	}});
}
//FIN GESTIONAR PROGRAMA

//GESTIONAR PROGRAMA CATEGORÍAS
function gestionarprogramacat_nueva()
{
	jQuery("#nueva_modificar").fadeOut("normal",function(){
	jQuery("#nueva_modificar").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionarprogramacat_nueva",success:function(data){
		jQuery("#nueva_modificar").html(data);
		jQuery("#insertar_programacat_enviar_formulario").unbind("click").click(function(){gestionarprogramacat_insertar_enviar_formulario(jQuery("form[name='form_nueva_programa_cat']"));});
		jQuery("#nueva_modificar").fadeIn("normal");
		campos_focus_blur();
		regular_listados();
	}});
	});
}

function gestionarprogramacat_modificar(id)
{
	jQuery("#nueva_modificar").fadeOut("normal",function(){
	jQuery("#nueva_modificar").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionarprogramacat_modificar&id="+id+"",success:function(data){
		jQuery("#nueva_modificar").html(data);
		jQuery("#modificar_programacat_enviar_formulario").unbind("click").click(function(){gestionarprogramacat_modificar_enviar_formulario(jQuery("form[name='form_modificar_programacat']"));});
		jQuery("#nueva_modificar").fadeIn("normal");
		campos_focus_blur();
		regular_listados();
	}});
	});
}

function gestionarprogramacat_insertar_enviar_formulario(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(validacion==true && control==false)
		{
			jQuery("#boton_insertar_programacat_enviar_formulario").html(cargando);
			jQuery("form[name='form_nueva_programa_cat']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=gestionarprogramacat_insertar");
			jQuery("form[name='form_nueva_programa_cat']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}

function gestionarprogramacat_insertar_enviar_formulario_estado(estado)
{
	if(estado=="ok")
	{
		jQuery("#boton_insertar_programacat_enviar_formulario").html("categoría insertada correctamente");
		setTimeout(function(){gestionarprogramacat_nueva();gestionarprogramacat_listar();},2000);
	}
}

function gestionarprogramacat_listar()
{
	jQuery("#listado").fadeOut("normal",function(){
	jQuery("#listado").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionarprogramacat_listar",success:function(data){
		jQuery("#listado").html(data);
		jQuery("#listado").find(".listado_celda_hover").each(function() 
		{
			if(jQuery(this).html()=="modificar")
			{	
				jQuery(this).unbind("click").click(function(){gestionarprogramacat_modificar(jQuery(this).attr("id"));});
			}
			if(jQuery(this).html()=="eliminar")
			{	
				jQuery(this).unbind("click").click(function(){if(confirm("¿Estás seguro/a?")==true){gestionarprogramacat_eliminar(jQuery(this).attr("id"));}});
			}
		});
		jQuery("#listado").fadeIn("normal");
		campos_focus_blur();
		regular_listados();
	}});
	});
}

function gestionarprogramacat_modificar_enviar_formulario(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(validacion==true && control==false)
		{
			jQuery("#boton_modificar_programacat_enviar_formulario").html(cargando);
			jQuery("form[name='form_modificar_programacat']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=gestionarprogramacat_modif");
			jQuery("form[name='form_modificar_programacat']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}

function gestionarprogramacat_modificar_enviar_formulario_estado(estado)
{
	if(estado=="ok")
	{
		jQuery("#boton_modificar_programacat_enviar_formulario").html("categoría modificada correctamente");
		setTimeout(function(){gestionarprogramacat_nueva();gestionarprogramacat_listar();},2000);
	}
}

function gestionarprogramacat_eliminar(id)
{
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionarprogramacat_eliminar&id="+id+"",success:function(data){
		gestionarprogramacat_nueva();gestionarprogramacat_listar();
	}});
}
//FIN GESTIONAR PROGRAMA CATEGORÍAS

//GESTIONAR ARCHIVO
function gestionararchivo_nueva()
{
	jQuery("#nueva_modificar").fadeOut("normal",function(){
	jQuery("#nueva_modificar").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionararchivo_nueva",success:function(data){
		jQuery("#nueva_modificar").html(data);
		jQuery("#insertar_archivo_enviar_formulario").unbind("click").click(function(){gestionararchivo_insertar_enviar_formulario(jQuery("form[name='form_nueva_archivo']"));});
		jQuery("input[name='Efecha']").datepicker();
		jQuery("input[name='Ehora']").timepicker({timeFormat:'HH:mm', interval: 15});
		jQuery("select[name='Etipo']").unbind("change").change(function(){
			jQuery("#elemento_imagen").css({display:"none"});
			jQuery("#elemento_pildora").css({display:"none"});
			jQuery("#elemento_video").css({display:"none"});
			jQuery("#elemento_archivo").css({display:"none"});
			jQuery("#elemento_proyecto").css({display:"none"});
			jQuery("#elemento_catalogo").css({display:"none"});
			if(jQuery(this).val()=="imagen"){jQuery("#elemento_imagen").css({display:"block"});}
			if(jQuery(this).val()=="pildora"){jQuery("#elemento_pildora").css({display:"block"});}
			if(jQuery(this).val()=="video"){jQuery("#elemento_video").css({display:"block"});}
			if(jQuery(this).val()=="archivo"){jQuery("#elemento_archivo").css({display:"block"});}
			if(jQuery(this).val()=="proyecto"){jQuery("#elemento_proyecto").css({display:"block"});}
			if(jQuery(this).val()=="catalogo"){jQuery("#elemento_catalogo").css({display:"block"});}
		});
		jQuery("#nueva_modificar").fadeIn("normal");
		campos_focus_blur();
		regular_listados();
	}});
	});
}

function gestionararchivo_modificar(id)
{
	jQuery("#nueva_modificar").fadeOut("normal",function(){
	jQuery("#nueva_modificar").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionararchivo_modificar&id="+id+"",success:function(data){
		jQuery("#nueva_modificar").html(data);
		jQuery("#modificar_archivo_enviar_formulario").unbind("click").click(function(){gestionararchivo_modificar_enviar_formulario(jQuery("form[name='form_modificar_archivo']"));});
		jQuery("input[name='Efecha']").datepicker();
		jQuery("input[name='Ehora']").timepicker({timeFormat:'HH:mm', interval: 15});
		jQuery("select[name='Etipo']").unbind("change").change(function(){
			jQuery("#elemento_imagen").css({display:"none"});
			jQuery("#elemento_pildora").css({display:"none"});
			jQuery("#elemento_video").css({display:"none"});
			jQuery("#elemento_archivo").css({display:"none"});
			jQuery("#elemento_proyecto").css({display:"none"});
			jQuery("#elemento_catalogo").css({display:"none"});
			if(jQuery(this).val()=="imagen"){jQuery("#elemento_imagen").css({display:"block"});}
			if(jQuery(this).val()=="pildora"){jQuery("#elemento_pildora").css({display:"block"});}
			if(jQuery(this).val()=="video"){jQuery("#elemento_video").css({display:"block"});}
			if(jQuery(this).val()=="archivo"){jQuery("#elemento_archivo").css({display:"block"});}
			if(jQuery(this).val()=="proyecto"){jQuery("#elemento_proyecto").css({display:"block"});}
			if(jQuery(this).val()=="catalogo"){jQuery("#elemento_catalogo").css({display:"block"});}
		});
		jQuery("#nueva_modificar").fadeIn("normal");
		campos_focus_blur();
		regular_listados();
	}});
	});
}

function gestionararchivo_insertar_enviar_formulario(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(jQuery("input[name='Eimagenfoto']").val()!="")
		{
		extension=jQuery("input[name='Eimagenfoto']").val().split(".");
		extension=extension[extension.length-1].toLowerCase();
		if(extension!="jpg" && extension!="jpeg")
		{
			alert("La imagen debe ser en formato JPG");
			control=true;
		}
		}

		if(validacion==true && control==false)
		{
			jQuery("#boton_insertar_archivo_enviar_formulario").html("enviando...");
			jQuery("form[name='form_nueva_archivo']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=gestionararchivo_insertar");
			jQuery("form[name='form_nueva_archivo']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}

function gestionararchivo_insertar_enviar_formulario_estado(estado)
{
	if(estado=="ok")
	{
		jQuery("#boton_insertar_archivo_enviar_formulario").html("elemento insertado correctamente");
		setTimeout(function(){gestionararchivo_nueva();gestionararchivo_listar();},2000);
	}
}

function gestionararchivo_listar()
{
	jQuery("#listado").fadeOut("normal",function(){
	jQuery("#listado").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionararchivo_listar",success:function(data){
		jQuery("#listado").html(data);
		jQuery("#listado").find(".listado_celda_hover").each(function() 
		{
			if(jQuery(this).html()=="modificar")
			{	
				jQuery(this).unbind("click").click(function(){gestionararchivo_modificar(jQuery(this).attr("id"));});
			}
			if(jQuery(this).html()=="eliminar")
			{	
				jQuery(this).unbind("click").click(function(){if(confirm("¿Estás seguro/a?")==true){gestionararchivo_eliminar(jQuery(this).attr("id"));}});
			}
		});
		jQuery("#listado").fadeIn("normal");
		campos_focus_blur();
		regular_listados();
	}});
	});
}

function gestionararchivo_modificar_enviar_formulario(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(jQuery("input[name='Eimagenfoto']").val()!="")
		{
		extension=jQuery("input[name='Eimagenfoto']").val().split(".");
		extension=extension[extension.length-1].toLowerCase();
		if(extension!="jpg" && extension!="jpeg")
		{
			alert("La imagen debe ser en formato JPG");
			control=true;
		}
		}

		if(validacion==true && control==false)
		{
			jQuery("#boton_modificar_archivo_enviar_formulario").html("enviando...");
			jQuery("form[name='form_modificar_archivo']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=gestionararchivo_modif");
			jQuery("form[name='form_modificar_archivo']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}

function gestionararchivo_modificar_enviar_formulario_estado(estado)
{
	if(estado=="ok")
	{
		jQuery("#boton_modificar_archivo_enviar_formulario").html("elemento modificado correctamente");
		setTimeout(function(){gestionararchivo_nueva();gestionararchivo_listar();},2000);
	}
}

function gestionararchivo_eliminar(id)
{
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionararchivo_eliminar&id="+id+"",success:function(data){
		gestionararchivo_nueva();gestionararchivo_listar();
	}});
}
//FIN GESTIONAR ARCHIVO

//GESTIONAR SCROLLER
function gestionarscroller_nueva()
{
	jQuery("#nueva_modificar").fadeOut("normal",function(){
	jQuery("#nueva_modificar").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionarscroller_nueva",success:function(data){
		jQuery("#nueva_modificar").html(data);
		jQuery("#modificar_scroller_enviar_formulario").unbind("click").click(function(){gestionarscroller_modificar_enviar_formulario(jQuery("form[name='form_modificar_scroller']"));});
		jQuery("#nueva_modificar").fadeIn("normal");
		campos_focus_blur();
		regular_listados();
	}});
	});
}

function gestionarscroller_modificar_enviar_formulario(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(validacion==true && control==false)
		{
			jQuery("#boton_modificar_scroller_enviar_formulario").html(cargando);
			jQuery("form[name='form_modificar_scroller']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=gestionarscroller_modif");
			jQuery("form[name='form_modificar_scroller']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}

function gestionarscroller_modificar_enviar_formulario_estado(estado)
{
	if(estado=="ok")
	{
		jQuery("#boton_modificar_scroller_enviar_formulario").html("scroller modificado correctamente");
		setTimeout(function(){gestionarscroller_nueva();},2000);
	}
}
//FIN GESTIONAR SCROLLER

//PROGRAMA
function programa_botones()
{
	jQuery(".cyp_programa_fechas").find("a").each(function() 
	{
		jQuery(this).unbind("click").click(function(){
			programa_cargar(jQuery(this).attr("fecha"));
		});
	});

	programa_cargar();
}

function programa_cargar(fecha)
{
	if(fecha)
	{
		jQuery(".cyp_programa_fechas").find("a").each(function() 
		{
			/*if(jQuery(this).attr("class"))
			{
				jQuery(this).attr("class","cyp_programa_fechas_boton2");
				if(jQuery(this).attr("fecha")==fecha){jQuery(this).attr("class","cyp_programa_fechas_boton1");}
			}*/
			jQuery(this).removeClass("cyp_dia_fecha_hover");
			if(jQuery(this).attr("fecha")==fecha){jQuery(this).addClass("cyp_dia_fecha_hover");}
		});

		if(jQuery(".cyp_programa_tipo").html()=="prensa")
		{
			jQuery(".cyp_programa_fechas").find("a").each(function() 
			{
				//jQuery(this).attr("class","cyp_programa_fechas_boton4");
				//if(jQuery(this).attr("fecha")==fecha){jQuery(this).attr("class","cyp_programa_fechas_boton3");}
				jQuery(this).removeClass("cyp_dia_fecha_hover2");
				if(jQuery(this).attr("fecha")==fecha){jQuery(this).addClass("cyp_dia_fecha_hover2");}
			});
		}
	}

	fecha="";

	jQuery(".cyp_programa_fechas").find("a").each(function() 
	{
		if(jQuery(this).attr("class").indexOf("cyp_dia_fecha_hover")!=-1 || jQuery(this).attr("class").indexOf("cyp_dia_fecha_hover2")!=-1){fecha=jQuery(this).attr("fecha");}
	});

	jQuery(".cyp_programa_cargar").html("<div style='float:left;width:100%;margin-top:30px;margin-bottom:30px'>"+cargando+"</div>");
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=programa_cargar&fecha="+fecha+"&idioma="+jQuery(".cyp_programa_idioma").html()+"&tipo="+jQuery(".cyp_programa_tipo").html()+"",success:function(data){
		jQuery(".cyp_programa_cargar").html(data);
		programa_cargar_situar();
		jQuery(".cyp_programa_evento").find("a[class='cyp_programa_evento_anadir']").each(function() 
		{
			jQuery(this).unbind("click").click(function(){
				if(jQuery(this).parent().find("i[class='fa fa-user']").css("display")=="none"){jQuery(this).parent().find("i[class='fa fa-user']").css("display","block");accion="insertar";}else{jQuery(this).parent().find("i[class='fa fa-user']").css("display","none");accion="eliminar";}
				jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=programa_agenda&fechahora="+jQuery(this).parent().attr("fechahora2")+"&sala="+jQuery(this).parent().attr("sala2")+"&accion="+accion+"",success:function(data){}});
			});
		});
		jQuery(".cyp_programa_evento").find("a[class='cyp_programa_evento_actividad']").each(function() 
		{
			jQuery(this).unbind("click").click(function(){
				window.location.hash = 'idac_'+jQuery(this).attr("idac");
				programa_cargar_actividad(jQuery(this).attr("idac"));
			});
		});
		jQuery("#descargar_agenda_excel").unbind("click").click(function(){descargar_agenda_excel();});

		if(typeof cyp_scroll!=='undefined'){cyp_scroll.reloadSlider();}
		if(jQuery("#cyp_fechas_scroll_container").length){jQuery("#cyp_fechas_scroll_container").attr("style","margin-top:30px");}
	}});
}

function programa_cargar_actividad(idprograma)
{
	//if(jQuery(".cyp_programa_dia_actual").length){jQuery(".cyp_programa_dia_actual").remove();}
	if(jQuery(".cyp_programa_texto_abierto").length){jQuery(".cyp_programa_texto_abierto").css({display:"none"});}
	//if(jQuery("#cyp_fechas_scroll_container").length){jQuery("#cyp_fechas_scroll_container").css({display:"none"});}
	if(jQuery("#cyp_fechas_scroll_container").length){jQuery("#cyp_fechas_scroll_container").attr("style","height: 0px !important;margin: 0px !important;overflow: hidden !important;padding: 0px !important;border: 0px !important;");}
	if(jQuery("#cyp_programa_instrucciones").length){jQuery("#cyp_programa_instrucciones").css({display:"none"});}
	jQuery(".cyp_programa_cargar").html("<div style='float:left;width:100%;margin-top:30px;margin-bottom:30px'>"+cargando+"</div>");
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=programa_cargar_actividad&idprograma="+idprograma+"&idioma="+jQuery(".cyp_programa_idioma").html()+"",success:function(data){
		jQuery(".cyp_programa_cargar").html(data);
		jQuery(".cf_actividad_video_boton").each(function() 
		{
			if(jQuery(this).parent().find("iframe").length)
			{
				jQuery(this).unbind("click").click(function(){
					jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=actividad_estadisticas&tipo=video&datos="+jQuery(this).attr("datos")+"&idprograma="+jQuery(".cf_actividad_id").html(),success:function(data){}});
					jQuery(this).remove();
				});
			}
		});
		jQuery(".cyp_boton_editar_volver").each(function() 
		{
			jQuery(this).unbind("click").click(function(){
				programa_cargar();
				if(jQuery(".cyp_programa_texto_abierto").length){jQuery(".cyp_programa_texto_abierto").css({display:"inline-block"});}
				if(jQuery("#cyp_fechas_scroll_container").length){jQuery("#cyp_fechas_scroll_container").css({display:"block"});}
				if(jQuery("#cyp_programa_instrucciones").length){jQuery("#cyp_programa_instrucciones").css({display:"inline-block"});}
				bannerize_mostrar();
			});
		});
		jQuery(".cf_actividad_banner").unbind("click").click(function(){
			jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=actividad_estadisticas&tipo=banner&datos=banner&idprograma="+jQuery(".cf_actividad_id").html(),success:function(data){}});
		});
		bannerize_ocultar();
	}});
}

function programa_cargar_situar()
{
	jQuery(".cyp_programa_evento").each(function() 
	{
		num=0;
		border=2;

		hora1=parseInt(jQuery(this).attr("fechahora2").substr(2,2));
		minuto1=parseInt(jQuery(this).attr("fechahora2").substr(4,2));
		hora2=parseInt(jQuery(this).attr("fechahorafin2").substr(2,2));
		minuto2=parseInt(jQuery(this).attr("fechahorafin2").substr(4,2));
		if(hora2==0){hora2=24;}

		control=false;

		while(control==false && num<=50)
		{
			num++;

			if(hora1==hora2 && minuto1==minuto2){control=true;}

			//if(minuto1==30){minuto1=0;if(hora1<hora2){hora1++;}}else{minuto1=30;}
			control2=false;
			if(minuto1==0 && control2==false){minuto1=30;control2=true;}
			//if(minuto1==15 && control2==false){minuto1=30;control2=true;}
			//if(minuto1==30 && control2==false){minuto1=45;control2=true;}
			if(minuto1==30 && control2==false){minuto1=0;control2=true;if(hora1<hora2){hora1++;}}
		}

		num--;

		if(hora2==24){num++;}

		altura=jQuery("div[fechahora='"+jQuery(this).attr("fechahora2")+"'][sala='"+jQuery(this).attr("sala2")+"']").outerHeight()-2;

		altura=altura*num+(border*(num-1));

		//if(jQuery("#cyp_programa_download").length){desp=134;}else{desp=parseInt(jQuery("#cyp_programa_instrucciones").outerHeight());}

		desp=parseInt(jQuery("div[fechahora='"+jQuery(this).attr("fechahora2")+"'][sala='"+jQuery(this).attr("sala2")+"']").offset().top-jQuery(".cyp_programa_cargar").offset().top);

		//jQuery("#programa_leyenda_altura").outerHeight()

		//if(jQuery("#cyp_programa_instrucciones").length && jQuery("#cyp_programa_download").length){desp+=62;}//else{desp-=40;}

		jQuery(this).css({top:desp+"px",left:jQuery("div[sala='"+jQuery(this).attr("sala2")+"']").offset().left-jQuery(".cyp_programa_cargar").offset().left+"px",width:jQuery("div[fechahora='"+jQuery(this).attr("fechahora2")+"'][sala='"+jQuery(this).attr("sala2")+"']").outerWidth()-1+"px",height:altura+"px",lineHeight:altura+"px"});
	});
}

function programaabierto_cargar()
{
	/*if(fecha)
	{
		jQuery(".cyp_programa_fechas").find("a").each(function() 
		{
			jQuery(this).attr("class","cyp_programa_fechas_boton2");
			if(jQuery(this).attr("fecha")==fecha){jQuery(this).attr("class","cyp_programa_fechas_boton1");}
		});
	}

	fecha="";

	jQuery(".cyp_programa_fechas").find("a").each(function() 
	{
		if(jQuery(this).attr("class")=="cyp_programa_fechas_boton1"){fecha=jQuery(this).attr("fecha");}
	});*/

	jQuery(".cyp_programaabierto_cargar").html("<div style='float:left;width:100%;margin-top:30px;margin-bottom:30px'>"+cargando+"</div>");
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=programaabierto_cargar&idioma="+jQuery(".cyp_programa_idioma").html()+"&tipo="+jQuery(".cyp_programa_tipo").html()+"",success:function(data){
		jQuery(".cyp_programaabierto_cargar").html(data);
		/*programa_cargar_situar();
		jQuery(".cyp_programa_evento").find("a").each(function() 
		{
			jQuery(this).unbind("click").click(function(){
				if(jQuery(this).parent().find("i").css("display")=="none"){jQuery(this).parent().find("i").css("display","block");accion="insertar";}else{jQuery(this).parent().find("i").css("display","none");accion="eliminar";}
				jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=programa_agenda&fechahora="+jQuery(this).parent().attr("fechahora2")+"&sala="+jQuery(this).parent().attr("sala2")+"&accion="+accion+"",success:function(data){}});
			});
		});*/
	}});
}
//FIN PROGRAMA

//ARCHIVO
function archivo_cargar()
{
	jQuery(".cyp_archivo_cargar").html("<div style='float:left;width:100%;margin-top:30px;margin-bottom:30px'>"+cargando+"</div>");
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=archivo_cargar&idioma="+jQuery(".cyp_archivo_idioma").html()+"",success:function(data){
		jQuery(".cyp_archivo_cargar").html(data);
		
		jQuery(".cyp_archivos_fechas_boton").each(function() 
		{
			jQuery(this).unbind("click").click(function(){
				archivo_cargar_fecha(jQuery(this).attr("datos"));
			});
		});
	}});
}

function archivo_cargar_fecha(fecha)
{
	jQuery(".cyp_archivo_cargar").html("<div style='float:left;width:100%;margin-top:30px;margin-bottom:30px'>"+cargando+"</div>");
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=archivo_cargar_fecha&idioma="+jQuery(".cyp_archivo_idioma").html()+"&fecha="+fecha+"",success:function(data){
		jQuery(".cyp_archivo_cargar").html(data);
		
		jQuery(".cyp_archivo_fecha_secciones_boton").each(function() 
		{
			jQuery(this).unbind("click").click(function(){
				if(jQuery(this).attr("tipo").indexOf("video")!=-1 || jQuery(this).attr("tipo").indexOf("proyecto")!=-1 || jQuery(this).attr("tipo").indexOf("catalogo")!=-1)
				{
					archivo_cargar_fecha_boton(jQuery(this).attr("tipo"),"");
				}else{
					archivo_cargar_fecha_botones(jQuery(this).attr("tipo"));
				}
			});
		});

		if(jQuery("#cyp_boton_editar_volver").length){jQuery("#cyp_boton_editar_volver").unbind("click").click(function(){archivo_cargar();});}
		if(jQuery("#cyp_boton_editar_volver2").length){jQuery("#cyp_boton_editar_volver2").unbind("click").click(function(){archivo_cargar();});}

		if(jQuery("#cyp_archivo_titulo").length){jQuery("#cyp_archivo_titulo").html(jQuery("#cyp_archivo_fecha_secciones_titulo").html());}

		regular_botones_archivo();
	}});
}

function archivo_cargar_fecha_botones(boton)
{
	jQuery(".cyp_archivo_cargar").html("<div style='float:left;width:100%;margin-top:30px;margin-bottom:30px'>"+cargando+"</div>");
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=archivo_cargar_seccion_botones&idioma="+jQuery(".cyp_archivo_idioma").html()+"&boton="+boton+"",success:function(data){
		jQuery(".cyp_archivo_cargar").html(data);
		
		jQuery(".cyp_archivo_fecha_secciones_boton").each(function() 
		{
			jQuery(this).unbind("click").click(function(){
				archivo_cargar_fecha_boton(jQuery(this).attr("tipo"),"");
			});
		});

		jQuery("#cyp_boton_editar_volver").unbind("click").click(function(){archivo_cargar_fecha(jQuery(this).attr("fecha"));});
		jQuery("#cyp_boton_editar_volver2").unbind("click").click(function(){archivo_cargar_fecha(jQuery(this).attr("fecha"));});

		regular_botones_archivo();
	}});
}

function archivo_cargar_fecha_boton(boton,pag)
{
	jQuery(".cyp_archivo_cargar").html("<div style='float:left;width:100%;margin-top:30px;margin-bottom:30px'>"+cargando+"</div>");
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=archivo_cargar_seccion&idioma="+jQuery(".cyp_archivo_idioma").html()+"&boton="+boton+"&pag="+pag+"",success:function(data){
		jQuery(".cyp_archivo_cargar").html(data);

		jQuery('.foobox').foobox();

		jQuery("#cyp_boton_editar_volver").unbind("click").click(function(){
			if(jQuery(this).attr("fecha").indexOf("video")!=-1 || jQuery(this).attr("fecha").indexOf("proyecto")!=-1 || jQuery(this).attr("fecha").indexOf("catalogo")!=-1)
			{
				dat=jQuery(this).attr("fecha").split("(*)");
				archivo_cargar_fecha(dat[1]);
			}else{
				archivo_cargar_fecha_botones(jQuery(this).attr("fecha"));
			}
		});

		jQuery("#cyp_boton_editar_volver2").unbind("click").click(function(){
			if(jQuery(this).attr("fecha").indexOf("video")!=-1 || jQuery(this).attr("fecha").indexOf("proyecto")!=-1|| jQuery(this).attr("fecha").indexOf("catalogo")!=-1)
			{
				dat=jQuery(this).attr("fecha").split("(*)");
				archivo_cargar_fecha(dat[1]);
			}else{
				archivo_cargar_fecha_botones(jQuery(this).attr("fecha"));
			}
		});

		jQuery(".cyp_archivo_paginas").find("a").each(function() 
		{
			jQuery(this).unbind("click").click(function(){
				archivo_cargar_fecha_boton(jQuery(this).attr("tipo"),jQuery(this).attr("pag"));
			});
		});

		regular_botones_archivo();
	}});
}
//FIN ARCHIVO

//PARTICIPANTES REUNIONES PITCHINGS
function participantesreunionespitchings_buscador(busqueda)
{
	clearTimeout(temporizador);
	if(busqueda==""){temporizador=setTimeout(function(){participantesreunionespitchings_busqueda();},1000);}else if(busqueda.length>2){temporizador=setTimeout(function(){participantesreunionespitchings_busqueda();},1000);}
	jQuery("#cyp_boton_participantes_volver").unbind("click").click(function(){jQuery("input[name='participantes_buscador']").val("");participantesreunionespitchings_busqueda();});
}

function participantesreunionespitchings_busqueda()
{
	if(jQuery("input[name='participantes_buscador']").val().length>2){jQuery("#cyp_boton_participantes_volver").css({display:"block"});}else{jQuery("#cyp_boton_participantes_volver").css({display:"none"});}
	jQuery(".cyp_participantesreunionespitchings_cargar").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=participantesreunionespitchings_buscador&busqueda="+jQuery("input[name='participantes_buscador']").val()+"&idioma="+jQuery(".cyp_participantes_idioma").html()+"",success:function(data){
		jQuery(".cyp_participantesreunionespitchings_cargar").html(data);
		participantesreunionespitchings_botones();
	}});
}

function participantesreunionespitchings_botones()
{
	jQuery(".cyp_participantes_1_boton_perfil").each(function() 
	{
		jQuery(this).unbind("click").click(function(){
			participantesreunionespitchings_ficha(jQuery(this).attr("idusuario"));
		});
	});
	jQuery(".cyp_participantes_2_boton_perfil").each(function() 
	{
		jQuery(this).unbind("click").click(function(){
			participantesreunionespitchings_ficha(jQuery(this).attr("idusuario"));
		});
	});
	jQuery(".cyp_participantes_1_boton").each(function() 
	{
		jQuery(this).unbind("click").click(function(){
			participantesreunionespitchings_solicitar_reunion(jQuery(this).attr("idusuario"));
		});
	});
	jQuery(".cyp_participantes_2_boton").each(function() 
	{
		jQuery(this).unbind("click").click(function(){
			participantesreunionespitchings_solicitar_reunion(jQuery(this).attr("idusuario"));
		});
	});
}

function participantesreunionespitchings_ficha(idusuario)
{
	jQuery(".cyp_participantesreunionespitchings_cargar").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=participantes_ficha&idusuario="+idusuario+"&idioma="+jQuery(".cyp_participantes_idioma").html()+"",success:function(data){
		jQuery(".cyp_participantesreunionespitchings_cargar").html(data);
		jQuery("#cyp_boton_editar_volver").unbind("click").click(function(){participantesreunionespitchings_busqueda();});
		//participantes_botones_huecos();
		jQuery("#cyp_boton_editar_solicitarreunion").unbind("click").click(function(){participantesreunionespitchings_solicitar_reunion(jQuery(this).attr("idusuario"));});
	}});
}

function participantesreunionespitchings_solicitar_reunion(idusuario)
{
	jQuery(".cyp_participantesreunionespitchings_cargar").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=participantesreunionespitchings_solicitar_reunion&idusuario="+idusuario+"&idioma="+jQuery(".cyp_participantes_idioma").html()+"",success:function(data){
		jQuery(".cyp_participantesreunionespitchings_cargar").html(data);
		jQuery("#cyp_boton_editar_volver").unbind("click").click(function(){participantesreunionespitchings_busqueda();});
		participantesreunionespitchings_solicitar_reunion_botones();
		jQuery("#solicitarreunion_enviar_formulario").unbind("click").click(function(){
			if(jQuery(".cyp_editar_reuniones_idreuniones").html()=="" || jQuery("#solicitarreunion_textarea").val()=="" || jQuery("#solicitarreunion_sala").val()=="0")
			{
				alert("Selecciona un slot, escribe el motivo de la reunión y elige una sala / Select a slot, write the meeting reason and choose a room");
			}else{
				cont=0;
				control=false;
				datos=jQuery(".cyp_editar_reuniones_idreuniones").html().split(",");

				for(i=0;i<datos.length;i++)
				{
					if(datos[i]!="")
					{
						if(cont==0)
						{
							cont+=parseInt(datos[i].substr(2, 4));
						}else{
							cont+=parseInt(30);
							if(parseInt(String(cont).substr(2, 2))==60){cont+=parseInt(40);}
							if(cont!=parseInt(datos[i].substr(2, 4))){control=true;}
						}
					}
				}

				if(control==false)
				{
					jQuery("#boton_solicitarreunion_enviar_formulario").html(cargando);
					jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=participantes_solicitar_reunion_insertar&idusuario="+jQuery(".cyp_editar_reuniones_idacreditado").html()+"&idreuniones="+jQuery(".cyp_editar_reuniones_idreuniones").html()+"&motivo="+jQuery("#solicitarreunion_textarea").val()+"&sala="+jQuery("#solicitarreunion_sala").val()+"",success:function(data){
						jQuery("#boton_solicitarreunion_enviar_formulario").html(data);
						jQuery(".cyp_editar_reuniones_columna_izq_horas_izq").each(function() 
						{
							jQuery(this).unbind("click");
						});
						jQuery(".cyp_editar_reuniones_columna_izq_horas_der").each(function() 
						{
							jQuery(this).unbind("click");
						});
						setTimeout(function(){participantesreunionespitchings_solicitar_reunion(jQuery("#cyp_solicitar_reunion_usuario_id").html());},2000);
					}});
				}else{
					alert("Los slots deben ser consecutivos / The slots must be consecutive");
				}
			}
		});
	}});
}
/*
function participantesreunionespitchings_botones_huecos()
{
	jQuery(".cyp_editar_perfil_huecos_hueco_boton").each(function() 
	{
		jQuery(this).unbind("click").click(function(){
			jQuery("form[name='form_solicitud_"+jQuery(this).attr("idsolicitud")+"']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=participantes_solicitud_enviar&idsolicitud="+jQuery(this).attr("idsolicitud")+"");
			jQuery("form[name='form_solicitud_"+jQuery(this).attr("idsolicitud")+"']").append("<button id='submitinputcode"+jQuery(this).attr("idsolicitud")+"' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode"+jQuery(this).attr("idsolicitud")+"").click();
			jQuery(this).parent().html("OK");
		});
	});
}
*/
function participantesreunionespitchings_solicitar_reunion_botones()
{
	jQuery(".cyp_editar_reuniones_columna_izq_horas_izq").each(function() 
	{
		jQuery(this).unbind("click").click(function(){
			participantesreunionespitchings_solicitar_reunion2(jQuery(this).attr("idreunion"));
		});
	});
	jQuery(".cyp_editar_reuniones_columna_izq_horas_der").each(function() 
	{
		jQuery(this).unbind("click").click(function(){
			participantesreunionespitchings_solicitar_reunion2(jQuery(this).attr("idreunion"));
		});
	});
}

function participantesreunionespitchings_solicitar_reunion2(idreunion)
{
	idreuniones="";
	reuniones=jQuery(".cyp_editar_reuniones_idreuniones").html().split(",");

	if(jQuery("div[idreunion='"+idreunion+"']").attr("class").indexOf("cyp_editar_reuniones_libre")!==-1 || jQuery("div[idreunion='"+idreunion+"']").attr("class").indexOf("cyp_editar_reuniones_seleccion")!==-1)
	{
		if(jQuery("div[idreunion='"+idreunion+"']").attr("class").indexOf("cyp_editar_reuniones_libre")!==-1)
		{
			control=true;

			if(control==true){jQuery("div[idreunion='"+idreunion+"']").attr("class",jQuery("div[idreunion='"+idreunion+"']").attr("class").replace("cyp_editar_reuniones_libre", "cyp_editar_reuniones_seleccion"));}
		}else{
			jQuery("div[idreunion='"+idreunion+"']").attr("class",jQuery("div[idreunion='"+idreunion+"']").attr("class").replace("cyp_editar_reuniones_seleccion", "cyp_editar_reuniones_libre"));
		}
	}

	/*jQuery(".cyp_editar_reuniones_columna_izq_horas_izq").each(function() 
	{
		if(jQuery(this).attr("class").indexOf("cyp_editar_reuniones_seleccion")!==-1){idreuniones=idreuniones+jQuery(this).attr("idreunion")+",";}
	});
	jQuery(".cyp_editar_reuniones_columna_izq_horas_der").each(function() 
	{
		if(jQuery(this).attr("class").indexOf("cyp_editar_reuniones_seleccion")!==-1){idreuniones=idreuniones+jQuery(this).attr("idreunion")+",";}
	});*/

	jQuery(".cyp_editar_reuniones_columna_izq_horas").each(function() 
	{
		jQuery(this).find("div").each(function() 
		{
			if(jQuery(this).attr("class").indexOf("cyp_editar_reuniones_seleccion")!==-1){idreuniones=idreuniones+jQuery(this).attr("idreunion")+",";}
		});
	});

	jQuery(".cyp_editar_reuniones_idreuniones").html(idreuniones);

	participantesreunionespitchings_solicitar_reunion_botones();
}
//FIN PARTICIPANTES REUNIONES PITCHINGS

//PARTICIPANTES PRENSA
function participantesprensa_buscador(busqueda)
{
	clearTimeout(temporizador);
	if(busqueda==""){temporizador=setTimeout(function(){participantesprensa_busqueda();},1000);}else if(busqueda.length>2){temporizador=setTimeout(function(){participantesprensa_busqueda();},1000);}
	jQuery("#cyp_boton_participantes_volver").unbind("click").click(function(){jQuery("input[name='participantes_buscador']").val("");participantesprensa_busqueda();});
}

function participantesprensa_busqueda()
{
	if(jQuery("input[name='participantes_buscador']").val().length>2){jQuery("#cyp_boton_participantes_volver").css({display:"block"});}else{jQuery("#cyp_boton_participantes_volver").css({display:"none"});}
	jQuery(".cyp_participantesprensa_cargar").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=participantesprensa_buscador&busqueda="+jQuery("input[name='participantes_buscador']").val()+"&idioma="+jQuery(".cyp_participantes_idioma").html()+"",success:function(data){
		jQuery(".cyp_participantesprensa_cargar").html(data);
		participantesprensa_botones();
	}});
}

function participantesprensa_botones()
{
	jQuery(".cyp_participantes_1_boton_perfil").each(function() 
	{
		jQuery(this).unbind("click").click(function(){
			participantesprensa_ficha(jQuery(this).attr("idusuario"));
		});
	});
	jQuery(".cyp_participantes_2_boton_perfil").each(function() 
	{
		jQuery(this).unbind("click").click(function(){
			participantesprensa_ficha(jQuery(this).attr("idusuario"));
		});
	});
	/*jQuery(".cyp_participantes_1_boton").each(function() 
	{
		jQuery(this).unbind("click").click(function(){
			participantesreunionespitchings_solicitar_reunion(jQuery(this).attr("idusuario"));
		});
	});
	jQuery(".cyp_participantes_2_boton").each(function() 
	{
		jQuery(this).unbind("click").click(function(){
			participantesreunionespitchings_solicitar_reunion(jQuery(this).attr("idusuario"));
		});
	});*/
}

function participantesprensa_ficha(idusuario)
{
	jQuery(".cyp_participantesprensa_cargar").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=participantesprensa_ficha&idusuario="+idusuario+"&idioma="+jQuery(".cyp_participantes_idioma").html()+"",success:function(data){
		jQuery(".cyp_participantesprensa_cargar").html(data);
		jQuery("#cyp_boton_editar_volver").unbind("click").click(function(){participantesprensa_busqueda();});
		//participantes_botones_huecos();
	}});
}
//FIN PARTICIPANTES PRENSA

//DESCUENTOS
function gestionardescuentos_nueva()
{
	jQuery("#nueva_modificar").fadeOut("normal",function(){
	jQuery("#nueva_modificar").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionardescuentos_pro_email",success:function(data){
		jQuery("#nueva_modificar").html(data);
		if(jQuery("input[name='Bemail']").length){jQuery("input[name='Bemail']").unbind("keyup").keyup(function(){gestionardescuentos_nueva_mostrar(jQuery(this).val());});}
		jQuery("#nueva_modificar").fadeIn("normal");
		campos_focus_blur();
		regular_listados();
	}});
	});
}

function gestionardescuentos_nueva_mostrar(email)
{
	clearTimeout(temporizador);
	if(email!="")
	{
		temporizador=setTimeout(function(){
			jQuery("#nueva_modificar_2").fadeOut("normal",function(){
			jQuery("#nueva_modificar_2").html(cargando);
			jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionardescuentos_pro&email="+jQuery("input[name='Bemail']").val()+"",success:function(data){
				jQuery("#nueva_modificar_2").html(data);
				jQuery("#insertar_descuentospro_enviar_formulario").unbind("click").click(function(){gestionardescuentos_nueva_insertar_enviar_formulario(jQuery("form[name='form_nueva_descuentospro']"));});
				jQuery("#nueva_modificar_2").fadeIn("normal");
				campos_focus_blur();
				regular_listados();
			}});
			});
		},1000);
	}
}

function gestionardescuentos_nueva_insertar_enviar_formulario(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(validacion==true && control==false)
		{
			jQuery("input[name='Cusuario']").val(jQuery("input[name='Bemail']").val());

			jQuery("#boton_insertar_descuentospro_enviar_formulario").html(cargando);
			/*jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=crearcuenta_comprobar_usuario&usuario="+jQuery("input[name='Cusuario']").val()+"",success:function(data){
				if(data=="error")
				{
					jQuery("form[name='form_nueva_descuentospro']").attr("action","javascript://");
					jQuery("#boton_insertar_descuentospro_enviar_formulario").html("<input id='insertar_descuentospro_enviar_formulario' type='submit' class='boton' value='Crear Cuenta y Enviar Descuento'>");
					setTimeout(function(){jQuery("#insertar_descuentospro_enviar_formulario").unbind("click").click(function(){gestionardescuentos_nueva_insertar_enviar_formulario(jQuery("form[name='form_nueva_descuentospro']"));});},0);
					formulario_aviso(jQuery("form[name='form_nueva_descuentospro']"),jQuery("input[name='Cusuario']"));
				}else{*/
					jQuery("form[name='form_nueva_descuentospro']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=gestionardescuentos_pro_insertar");
					jQuery("form[name='form_nueva_descuentospro']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
					jQuery("#submitinputcode").click();
				/*}
			}});*/
		}
	}
}

function gestionardescuentos_nueva_insertar_enviar_formulario_estado(estado)
{
	if(estado=="ok")
	{
		jQuery("#boton_insertar_descuentospro_enviar_formulario").html("descuento enviado correctamente");
		setTimeout(function(){gestionardescuentos_nueva();jQuery("#nueva_modificar_2").fadeOut("normal");},2000);
	}
}
//FIN DESCUENTOS

//REUNIONES SALAS
function gestionarreunionessalas_nueva()
{
	jQuery("#nueva_modificar").fadeOut("normal",function(){
	jQuery("#nueva_modificar").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionarreunionessalas_nueva",success:function(data){
		jQuery("#nueva_modificar").html(data);
		jQuery("#insertar_reunionessalas_enviar_formulario").unbind("click").click(function(){gestionarreunionessalas_insertar_enviar_formulario(jQuery("form[name='form_nueva_reunionessalas']"));});
		jQuery("#nueva_modificar").fadeIn("normal");
		campos_focus_blur();
		regular_listados();
	}});
	});
}

function gestionarreunionessalas_modificar(id)
{
	jQuery("#nueva_modificar").fadeOut("normal",function(){
	jQuery("#nueva_modificar").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionarreunionessalas_modificar&id="+id+"",success:function(data){
		jQuery("#nueva_modificar").html(data);
		jQuery("#modificar_reunionessalas_enviar_formulario").unbind("click").click(function(){gestionarreunionessalas_modificar_enviar_formulario(jQuery("form[name='form_modificar_reunionessalas']"));});
		jQuery("#nueva_modificar").fadeIn("normal");
		campos_focus_blur();
		regular_listados();
	}});
	});
}

function gestionarreunionessalas_insertar_enviar_formulario(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(validacion==true && control==false)
		{
			jQuery("#boton_insertar_reunionessalas_enviar_formulario").html("enviando...");
			jQuery("form[name='form_nueva_reunionessalas']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=gestionarreunionessalas_insertar");
			jQuery("form[name='form_nueva_reunionessalas']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}

function gestionarreunionessalas_insertar_enviar_formulario_estado(estado)
{
	if(estado=="ok")
	{
		jQuery("#boton_insertar_reunionessalas_enviar_formulario").html("sala insertada correctamente");
		setTimeout(function(){gestionarreunionessalas_nueva();gestionarreunionessalas_listar();},2000);
	}
}

function gestionarreunionessalas_listar()
{
	jQuery("#listado").fadeOut("normal",function(){
	jQuery("#listado").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionarreunionessalas_listar",success:function(data){
		jQuery("#listado").html(data);
		jQuery("#listado").find(".listado_celda_hover").each(function() 
		{
			if(jQuery(this).html()=="modificar")
			{	
				jQuery(this).unbind("click").click(function(){gestionarreunionessalas_modificar(jQuery(this).attr("id"));});
			}
			if(jQuery(this).html()=="eliminar")
			{	
				jQuery(this).unbind("click").click(function(){if(confirm("¿Estás seguro/a?")==true){gestionarreunionessalas_eliminar(jQuery(this).attr("id"));}});
			}
		});
		jQuery("#listado").fadeIn("normal");
		campos_focus_blur();
		regular_listados();
	}});
	});
}

function gestionarreunionessalas_modificar_enviar_formulario(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(validacion==true && control==false)
		{
			jQuery("#boton_modificar_reunionessalas_enviar_formulario").html("enviando...");
			jQuery("form[name='form_modificar_reunionessalas']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=gestionarreunionessalas_modif");
			jQuery("form[name='form_modificar_reunionessalas']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}

function gestionarreunionessalas_modificar_enviar_formulario_estado(estado)
{
	if(estado=="ok")
	{
		jQuery("#boton_modificar_reunionessalas_enviar_formulario").html("sala modificada correctamente");
		setTimeout(function(){gestionarreunionessalas_nueva();gestionarreunionessalas_listar();},2000);
	}
}

function gestionarreunionessalas_eliminar(id)
{
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionarreunionessalas_eliminar&id="+id+"",success:function(data){
		gestionarreunionessalas_nueva();gestionarreunionessalas_listar();
	}});
}
//FIN REUNIONES SALAS

//PROYECTOS SELECCIONADOS
function gestionarproyectosseleccionados_nueva()
{
	jQuery("#nueva_modificar").fadeOut("normal",function(){
	jQuery("#nueva_modificar").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionarproyectosseleccionados_nueva",success:function(data){
		jQuery("#nueva_modificar").html(data);
		jQuery("#insertar_proyectosseleccionados_enviar_formulario").unbind("click").click(function(){gestionarproyectosseleccionados_insertar_enviar_formulario(jQuery("form[name='form_nueva_proyectosseleccionados']"));});
		jQuery("#nueva_modificar").fadeIn("normal");
		campos_focus_blur();
		regular_listados();
	}});
	});
}

function gestionarproyectosseleccionados_modificar(id)
{
	jQuery("#nueva_modificar").fadeOut("normal",function(){
	jQuery("#nueva_modificar").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionarproyectosseleccionados_modificar&id="+id+"",success:function(data){
		jQuery("#nueva_modificar").html(data);
		jQuery("#modificar_proyectosseleccionados_enviar_formulario").unbind("click").click(function(){gestionarproyectosseleccionados_modificar_enviar_formulario(jQuery("form[name='form_modificar_proyectosseleccionados']"));});
		jQuery("#nueva_modificar").fadeIn("normal");
		campos_focus_blur();
		regular_listados();
	}});
	});
}

function gestionarproyectosseleccionados_insertar_enviar_formulario(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(jQuery("input[name='Pimagen']").length)
		{
			if(jQuery("input[name='Pimagen']").val()!="")
			{
				extension=jQuery("input[name='Pimagen']").val().split(".");
				extension=extension[extension.length-1].toLowerCase();
				if(extension!="jpg" && extension!="jpeg")
				{
					formulario_aviso(jQuery("form[name='form_nueva_proyectosseleccionados']"),jQuery("input[name='Pimagen']"));
					control=true;
				}
			}
		}

		if(jQuery("input[name='Pvideoimagen']").length)
		{
			if(jQuery("input[name='Pvideoimagen']").val()!="")
			{
				extension=jQuery("input[name='Pvideoimagen']").val().split(".");
				extension=extension[extension.length-1].toLowerCase();
				if(extension!="jpg" && extension!="jpeg")
				{
					formulario_aviso(jQuery("form[name='form_nueva_proyectosseleccionados']"),jQuery("input[name='Pvideoimagen']"));
					control=true;
				}
			}
		}

		if(validacion==true && control==false)
		{
			jQuery("#boton_insertar_proyectosseleccionados_enviar_formulario").html("enviando...");
			jQuery("form[name='form_nueva_proyectosseleccionados']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=gestionarproyectosseleccionados_insertar");
			jQuery("form[name='form_nueva_proyectosseleccionados']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}

function gestionarproyectosseleccionados_insertar_enviar_formulario_estado(estado)
{
	if(estado=="ok")
	{
		jQuery("#boton_insertar_proyectosseleccionados_enviar_formulario").html("proyecto insertado correctamente");
		setTimeout(function(){gestionarproyectosseleccionados_nueva();gestionarproyectosseleccionados_listar();},2000);
	}
}

function gestionarproyectosseleccionados_listar()
{
	jQuery("#listado").fadeOut("normal",function(){
	jQuery("#listado").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionarproyectosseleccionados_listar",success:function(data){
		jQuery("#listado").html(data);
		jQuery("#listado").find(".listado_celda_hover").each(function() 
		{
			if(jQuery(this).html()=="modificar")
			{	
				jQuery(this).unbind("click").click(function(){gestionarproyectosseleccionados_modificar(jQuery(this).attr("id"));});
			}
			if(jQuery(this).html()=="eliminar")
			{	
				jQuery(this).unbind("click").click(function(){if(confirm("¿Estás seguro/a?")==true){gestionarproyectosseleccionados_eliminar(jQuery(this).attr("id"));}});
			}
		});
		jQuery("#listado").fadeIn("normal");
		campos_focus_blur();
		regular_listados();
	}});
	});
}

function gestionarproyectosseleccionados_modificar_enviar_formulario(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(validacion==true && control==false)
		{
			jQuery("#boton_modificar_proyectosseleccionados_enviar_formulario").html("enviando...");
			jQuery("form[name='form_modificar_proyectosseleccionados']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=gestionarproyectosseleccionados_modif");
			jQuery("form[name='form_modificar_proyectosseleccionados']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}

function gestionarproyectosseleccionados_modificar_enviar_formulario_estado(estado)
{
	if(estado=="ok")
	{
		jQuery("#boton_modificar_proyectosseleccionados_enviar_formulario").html("proyecto modificado correctamente");
		setTimeout(function(){gestionarproyectosseleccionados_nueva();gestionarproyectosseleccionados_listar();},2000);
	}
}

function gestionarproyectosseleccionados_eliminar(id)
{
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionarproyectosseleccionados_eliminar&id="+id+"",success:function(data){
		gestionarproyectosseleccionados_nueva();gestionarproyectosseleccionados_listar();
	}});
}
//FIN PROYECTOS SELECCIONADOS

//SEMINARIO ACEPTAR
function seminario_aceptar_enviar_formulario(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(validacion==true && control==false)
		{
			jQuery("#boton_acreditacionesaceptarseminario_enviar_formulario").html(cargando);

			jQuery("form[name='form_nueva_acreditaciones_aceptar_seminario']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=seminario_aceptar");
			jQuery("form[name='form_nueva_acreditaciones_aceptar_seminario']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}

function seminario_aceptar_enviar_formulario_estado(estado)
{
	if(estado=="ok")
	{
		jQuery("#formulario_acreditacion_pago").css({display:"none"});
		jQuery(".conectamepro_mensaje3").css({display:"inline-block"});
	}
}
//FIN SEMINARIO ACEPTAR

//SOLICITAR BUS
function solicitarbus_solicitar_enviar_formulario(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(validacion==true && control==false)
		{
			jQuery("#boton_acreditacionessolicitarbus_enviar_formulario").html(cargando);

			jQuery("form[name='form_nueva_acreditaciones_solicitar_bus']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=solicitarbus_solicitar");
			jQuery("form[name='form_nueva_acreditaciones_solicitar_bus']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}

function solicitarbus_solicitar_enviar_formulario_estado(estado)
{
	if(estado=="ok")
	{
		jQuery("form[name='form_nueva_acreditaciones_solicitar_bus']").css({display:"none"});
		jQuery(".conectamepro_mensaje3").css({display:"inline-block"});
	}
}

function solicitarbus_aceptar_enviar_formulario(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(validacion==true && control==false)
		{
			jQuery("#boton_acreditacionesaceptarbus_enviar_formulario").html(cargando);

			jQuery("form[name='form_nueva_acreditaciones_aceptar_reservabus']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=solicitarbus_aceptar");
			jQuery("form[name='form_nueva_acreditaciones_aceptar_reservabus']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}

function solicitarbus_aceptar_enviar_formulario_estado(estado)
{
	if(estado=="ok")
	{
		jQuery("form[name='form_nueva_acreditaciones_aceptar_reservabus']").css({display:"none"});
		jQuery(".conectamepro_mensaje3").css({display:"inline-block"});
	}
}
//FIN SOLICITAR BUS

function descargar_eticket()
{
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=descargar_eticket",success:function(data){
		//dat=data.split("(*)");

		fileName="EventConecta_Accreditation.pdf"

		if (!window.ActiveXObject) {
	        var save = document.createElement('a');
	        save.href = data;
	        save.target = '_blank';
	        save.download = fileName;

	        var evt = new MouseEvent('click', {
	            'view': window,
	            'bubbles': true,
	            'cancelable': false
	        });
	        save.dispatchEvent(evt);

	        (window.URL || window.webkitURL).revokeObjectURL(save.href);
	    }else if ( !! window.ActiveXObject && document.execCommand)     {
	        var _window = window.open(data, '_blank');
	        _window.document.close();
	        _window.document.execCommand('SaveAs', true, fileName || data)
	        _window.close();
	    }
		//document.location = dat[1];
	}});
}

//IN SITU
function gestionarinsitu_nueva()
{
	jQuery("#nueva_modificar").fadeOut("normal",function(){
	jQuery("#nueva_modificar").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionarinsitu_email",success:function(data){
		jQuery("#nueva_modificar").html(data);
		if(jQuery("input[name='Bemail']").length){jQuery("input[name='Bemail']").unbind("keyup").keyup(function(){gestionarinsitu_nueva_mostrar(jQuery(this).val());});}
		jQuery("#nueva_modificar").fadeIn("normal");
		campos_focus_blur();
		regular_listados();
	}});
	});
}

function gestionarinsitu_nueva_mostrar(email)
{
	clearTimeout(temporizador);
	if(email!="")
	{
		temporizador=setTimeout(function(){
			jQuery("#nueva_modificar_2").fadeOut("normal",function(){
			jQuery("#nueva_modificar_2").html(cargando);
			jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionarinsitu_email_buscar&email="+jQuery("input[name='Bemail']").val()+"",success:function(data){
				jQuery("#nueva_modificar_2").html(data);
				jQuery("#insitu_forzar_acreditacion_boton").unbind("click").click(function(){gestionarinsitu_forzar_acreditacion(jQuery(this).attr("idusuario"));});
				jQuery("#insitu_regenerar_qr_boton").unbind("click").click(function(){gestionarinsitu_regenerar_qr(jQuery(this).attr("idusuario"));});
				jQuery("#insitu_descargar_plantilla_boton").unbind("click").click(function(){gestionarinsitu_imprenta(jQuery(this).attr("idusuario"));});
				jQuery("#nueva_modificar_2").fadeIn("normal");
				campos_focus_blur();
				regular_listados();
			}});
			});
		},1000);
	}
}

function gestionarinsitu_forzar_acreditacion(idusuario)
{
	jQuery(".cyp_insitu_forzar_acreditacion").html(cargando);

	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionarinsitu_forzar_acreditacion&idusuario="+idusuario+"",success:function(data){
		if(data=="ok")
		{
			jQuery(".cyp_insitu_forzar_acreditacion").html("Acreditación forzada correctamente");
		}else{
			jQuery(".cyp_insitu_forzar_acreditacion").html("Error al forzar la acreditación");
		}
	}});
}

function gestionarinsitu_regenerar_qr(idusuario)
{
	jQuery(".cyp_insitu_regenerar_qr").html(cargando);

	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionarinsitu_regenerar_qr&idusuario="+idusuario+"",success:function(data){
		jQuery(".cyp_insitu_regenerar_qr").html("QR regenerado correctamente. Puedes descargar la plantilla con el nuevo QR.");
	}});
}

function gestionarinsitu_imprenta(idusuario)
{
	jQuery(".cyp_insitu_descargar_plantilla").html(cargando);

	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionarinsitu_generar_plantilla&idusuario="+idusuario+"",success:function(data){
		jQuery(".cyp_insitu_descargar_plantilla").html("Plantilla generada correctamente.");

		//fileName="Plantilla_InSitu.jpg";
		fileName="Plantilla_InSitu.pdf";

		if (!window.ActiveXObject) {
	        var save = document.createElement('a');
	        save.href = data;
	        save.target = '_blank';
	        save.download = fileName;

	        var evt = new MouseEvent('click', {
	            'view': window,
	            'bubbles': true,
	            'cancelable': false
	        });
	        save.dispatchEvent(evt);

	        (window.URL || window.webkitURL).revokeObjectURL(save.href);
	    }else if ( !! window.ActiveXObject && document.execCommand)     {
	        var _window = window.open(data, '_blank');
	        _window.document.close();
	        _window.document.execCommand('SaveAs', true, fileName || data)
	        _window.close();
	    }
	}});
}
//FIN IN SITU

//TEXTOS
function gestionartextos_nueva()
{
	jQuery("select[name='contectafiction_textos_select']").change(function(){
	    var url = document.location.href+"&seccion="+jQuery(this).val();
      	document.location = url;
	});

	jQuery("#modificar_cyp_editor_textos_enviar_formulario").unbind("click").click(function(){gestionartextos_insertar_enviar_formulario(jQuery("form[name='form_cyp_editor_textos']"));});
}

function gestionartextos_insertar_enviar_formulario(elem)
{
	jQuery("#boton_modificar_cyp_editor_textos_enviar_formulario").html("guardando...");
	jQuery("form[name='form_cyp_editor_textos']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=gestionartextos_guardar");
	jQuery("form[name='form_cyp_editor_textos']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
	jQuery("#submitinputcode").click();
}

function gestionartextos_insertar_enviar_formulario_estado(estado)
{
	if(estado=="ok")
	{
		jQuery("#boton_modificar_cyp_editor_textos_enviar_formulario").html("OK");
		setTimeout(function(){location.reload(true);},1000);
	}
}
//FIN TEXTOS

//CONFIGURACIÓN GENERAL
function configuraciongeneral_nueva()
{
	jQuery("select[name='contectafiction_configuracion_select']").change(function(){
	    var url = document.location.href+"&seccion="+jQuery(this).val();
      	document.location = url;
	});

	jQuery("#modificar_cyp_editor_configuracion_enviar_formulario").unbind("click").click(function(){configuraciongeneral_insertar_enviar_formulario(jQuery("form[name='form_cyp_editor_configuraciongeneral']"));});
}

function configuraciongeneral_insertar_enviar_formulario(elem)
{
	jQuery("form[name='form_cyp_editor_configuraciongeneral']").find('input[type="checkbox"]').each(function(){
		if(!jQuery(this).prop('checked'))
		{
			 jQuery(this).after('<input type="hidden" name="'+jQuery(this).attr('name')+'" value="off">');
		}
	});

	jQuery("#boton_modificar_cyp_editor_configuracion_enviar_formulario").html("guardando...");
	jQuery("form[name='form_cyp_editor_configuraciongeneral']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=configuraciongeneral_guardar");
	jQuery("form[name='form_cyp_editor_configuraciongeneral']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
	jQuery("#submitinputcode").click();
}

function configuraciongeneral_insertar_enviar_formulario_estado(estado)
{
	if(estado=="ok")
	{
		jQuery("#boton_modificar_cyp_editor_configuracion_enviar_formulario").html("OK");
		setTimeout(function(){location.reload(true);},1000);
	}
}
//FIN CONFIGURACIÓN GENERAL

//GESTIONAR SPONSORS
function gestionarsponsors_nueva()
{
	jQuery("#insertar_sponsor_enviar_formulario").unbind("click").click(function(){gestionarsponsors_insertar_enviar_formulario(jQuery("form[name='form_nueva_sponsor']"));});
}

function gestionarsponsors_insertar_enviar_formulario(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(jQuery("input[name='Sbackground']").val()!="")
		{
		extension=jQuery("input[name='Sbackground']").val().split(".");
		extension=extension[extension.length-1].toLowerCase();
		if(extension!="jpg" && extension!="jpeg"  && extension!="png")
		{
			alert("La imagen debe ser en formato JPG o PNG");
			control=true;
		}
		}

		if(jQuery("input[name='Slogo']").val()!="")
		{
		extension=jQuery("input[name='Slogo']").val().split(".");
		extension=extension[extension.length-1].toLowerCase();
		if(extension!="jpg" && extension!="jpeg"  && extension!="png")
		{
			alert("La imagen debe ser en formato JPG o PNG");
			control=true;
		}
		}

		if(jQuery("input[name='Sbanner']").val()!="")
		{
		extension=jQuery("input[name='Sbanner']").val().split(".");
		extension=extension[extension.length-1].toLowerCase();
		if(extension!="jpg" && extension!="jpeg"  && extension!="png" && extension!="gif")
		{
			alert("La imagen debe ser en formato JPG, PNG o GIF");
			control=true;
		}
		}

		if(jQuery("input[name='Svideoprincipal_imagen']").val()!="")
		{
		extension=jQuery("input[name='Svideoprincipal_imagen']").val().split(".");
		extension=extension[extension.length-1].toLowerCase();
		if(extension!="jpg" && extension!="jpeg"  && extension!="png")
		{
			alert("La imagen debe ser en formato JPG o PNG");
			control=true;
		}
		}

		if(jQuery("input[name='Svideo1_imagen']").val()!="")
		{
		extension=jQuery("input[name='Svideo1_imagen']").val().split(".");
		extension=extension[extension.length-1].toLowerCase();
		if(extension!="jpg" && extension!="jpeg"  && extension!="png")
		{
			alert("La imagen debe ser en formato JPG o PNG");
			control=true;
		}
		}

		if(jQuery("input[name='Svideo2_imagen']").val()!="")
		{
		extension=jQuery("input[name='Svideo2_imagen']").val().split(".");
		extension=extension[extension.length-1].toLowerCase();
		if(extension!="jpg" && extension!="jpeg"  && extension!="png")
		{
			alert("La imagen debe ser en formato JPG o PNG");
			control=true;
		}
		}

		if(jQuery("input[name='Svideo3_imagen']").val()!="")
		{
		extension=jQuery("input[name='Svideo3_imagen']").val().split(".");
		extension=extension[extension.length-1].toLowerCase();
		if(extension!="jpg" && extension!="jpeg"  && extension!="png")
		{
			alert("La imagen debe ser en formato JPG o PNG");
			control=true;
		}
		}

		if(jQuery("input[name='Svideo4_imagen']").val()!="")
		{
		extension=jQuery("input[name='Svideo4_imagen']").val().split(".");
		extension=extension[extension.length-1].toLowerCase();
		if(extension!="jpg" && extension!="jpeg"  && extension!="png")
		{
			alert("La imagen debe ser en formato JPG o PNG");
			control=true;
		}
		}

		if(jQuery("input[name='Svideo5_imagen']").val()!="")
		{
		extension=jQuery("input[name='Svideo5_imagen']").val().split(".");
		extension=extension[extension.length-1].toLowerCase();
		if(extension!="jpg" && extension!="jpeg"  && extension!="png")
		{
			alert("La imagen debe ser en formato JPG o PNG");
			control=true;
		}
		}

		if(jQuery("input[name='Svideo6_imagen']").val()!="")
		{
		extension=jQuery("input[name='Svideo6_imagen']").val().split(".");
		extension=extension[extension.length-1].toLowerCase();
		if(extension!="jpg" && extension!="jpeg"  && extension!="png")
		{
			alert("La imagen debe ser en formato JPG o PNG");
			control=true;
		}
		}

		if(validacion==true && control==false)
		{
			jQuery("#boton_insertar_sponsor_enviar_formulario").html("enviando...");
			jQuery("form[name='form_nueva_sponsor']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=gestionarsponsors_insertar");
			jQuery("form[name='form_nueva_sponsor']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}

function gestionarsponsors_insertar_enviar_formulario_estado(estado)
{
	if(estado=="ok")
	{
		jQuery("#boton_insertar_sponsor_enviar_formulario").html("sponsor insertado correctamente");
		location.href="https://www.eventconecta.com/wp-admin/admin.php?page=contectafiction_sponsors";
	}
}

function gestionarsponsors_listar()
{
	jQuery("#listado").fadeOut("normal",function(){
	jQuery("#listado").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionarsponsors_listar",success:function(data){
		jQuery("#listado").html(data);
		jQuery("#listado").find(".listado_celda_hover").each(function() 
		{
			if(jQuery(this).html()=="eliminar")
			{	
				jQuery(this).unbind("click").click(function(){if(confirm("¿Estás seguro/a?")==true){gestionarsponsors_eliminar(jQuery(this).attr("id"));}});
			}
		});
		jQuery("#listado").fadeIn("normal");
		campos_focus_blur();
		regular_listados();
	}});
	});
}

function gestionarsponsors_eliminar(id)
{
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionarsponsors_eliminar&id="+id+"",success:function(data){
		location.href="https://www.eventconecta.com/wp-admin/admin.php?page=contectafiction_sponsors";
	}});
}
//FIN GESTIONAR SPONSORS

//GESTIONAR PONENTES POPUPS
function gestionarponentespopups_nueva()
{
	jQuery("#nueva_modificar").fadeOut("normal",function(){
	jQuery("#nueva_modificar").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionarponentespopups_nueva",success:function(data){
		jQuery("#nueva_modificar").html(data);
		jQuery("#insertar_ponentespopups_enviar_formulario").unbind("click").click(function(){gestionarponentespopups_insertar_enviar_formulario(jQuery("form[name='form_nueva_ponentespopups']"));});
		jQuery("#nueva_modificar").fadeIn("normal");
		campos_focus_blur();
		regular_listados();
	}});
	});
}

function gestionarponentespopups_modificar(id)
{
	jQuery("#nueva_modificar").fadeOut("normal",function(){
	jQuery("#nueva_modificar").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionarponentespopups_modificar&id="+id+"",success:function(data){
		jQuery("#nueva_modificar").html(data);
		jQuery("#modificar_ponentespopups_enviar_formulario").unbind("click").click(function(){gestionarponentespopups_modificar_enviar_formulario(jQuery("form[name='form_modificar_ponentespopups']"));});
		jQuery("#nueva_modificar").fadeIn("normal");
		campos_focus_blur();
		regular_listados();
	}});
	});
}

function gestionarponentespopups_insertar_enviar_formulario(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(validacion==true && control==false)
		{
			jQuery("#boton_insertar_ponentespopups_enviar_formulario").html(cargando);
			jQuery("form[name='form_nueva_ponentespopups']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=gestionarponentespopups_insertar");
			jQuery("form[name='form_nueva_ponentespopups']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}

function gestionarponentespopups_insertar_enviar_formulario_estado(estado)
{
	if(estado=="ok")
	{
		jQuery("#boton_insertar_ponentespopups_enviar_formulario").html("popup insertado correctamente");
		setTimeout(function(){gestionarponentespopups_nueva();gestionarponentespopups_listar();},2000);
	}
}

function gestionarponentespopups_listar()
{
	jQuery("#listado").fadeOut("normal",function(){
	jQuery("#listado").html(cargando);
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionarponentespopups_listar",success:function(data){
		jQuery("#listado").html(data);
		jQuery("#listado").find(".listado_celda_hover").each(function() 
		{
			if(jQuery(this).html()=="modificar")
			{	
				jQuery(this).unbind("click").click(function(){gestionarponentespopups_modificar(jQuery(this).attr("id"));});
			}
			if(jQuery(this).html()=="eliminar")
			{	
				jQuery(this).unbind("click").click(function(){if(confirm("¿Estás seguro/a?")==true){gestionarponentespopups_eliminar(jQuery(this).attr("id"));}});
			}
		});
		jQuery("#listado").fadeIn("normal");
		campos_focus_blur();
		regular_listados();
	}});
	});
}

function gestionarponentespopups_modificar_enviar_formulario(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		if(validacion==true && control==false)
		{
			jQuery("#boton_modificar_ponentespopups_enviar_formulario").html(cargando);
			jQuery("form[name='form_modificar_ponentespopups']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=gestionarponentespopups_modif");
			jQuery("form[name='form_modificar_ponentespopups']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}

function gestionarponentespopups_modificar_enviar_formulario_estado(estado)
{
	if(estado=="ok")
	{
		jQuery("#boton_modificar_ponentespopups_enviar_formulario").html("popup modificado correctamente");
		setTimeout(function(){gestionarponentespopups_nueva();gestionarponentespopups_listar();},2000);
	}
}

function gestionarponentespopups_eliminar(id)
{
	jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=gestionarponentespopups_eliminar&id="+id+"",success:function(data){
		gestionarponentespopups_nueva();gestionarponentespopups_listar();
	}});
}
//FIN GESTIONAR PONENTES POPUPS

function cf_ponentes_popups()
{
	jQuery(".et_pb_text_inner").each(function()
	{
		if(String(jQuery(this).html()).indexOf('pop_')!=-1)
		{
			datos=String(jQuery(this).html()).match(/pop_[^\s<]+/);
			popup=datos[0];

			//console.log(popup);

			jQuery(this).html(String(jQuery(this).html()).replace(popup,""));

			if(String(window.location.href).indexOf('/en/')!=-1){boton_texto="View more";}else{boton_texto="Ver más";}

			jQuery(this).parent().parent().find(".et_pb_text").append('<a href="javascript://" idpopup="'+popup+'" class="cf_ponente_popup"><i class="fa fa-plus"></i>'+boton_texto+'</a>');
		}
	});

	jQuery(".slick-slide").each(function()
	{
		if(String(jQuery(this).html()).indexOf('pop_')!=-1)
		{
			datos=String(jQuery(this).html()).match(/pop_[^\s<]+/);
			popup=datos[0];

			//console.log(popup);

			jQuery(this).html(String(jQuery(this).html()).replace(popup,""));

			if(String(window.location.href).indexOf('/en/')!=-1){boton_texto="View more";}else{boton_texto="Ver más";}

			jQuery(this).find(".slide-img").append('<a href="javascript://" idpopup="'+popup+'" class="cf_ponente_popup"><i class="fa fa-plus"></i>'+boton_texto+'</a>');
		}
	});

	jQuery(".cf_ponente_popup").each(function()
	{
		jQuery(this).unbind("click").click(function(){
			
			cf_ponentes_popups_abrir(jQuery(this).attr("idpopup"));
		});
	});

	cf_ponentes_popups_programa();
}

function cf_ponentes_popups_programa()
{
	var control=false;

	jQuery(".popup_content").each(function()
	{
		if(String(jQuery(this).html()).indexOf('pop_')!=-1 && String(jQuery(this).html()).indexOf('cf_ponente_popup')==-1)
		{
			datos=String(jQuery(this).html()).match(/pop_[^\s<]+/g);

			for(i=0;i<datos.length;i++)
			{
				popup=datos[i];

				//console.log(popup);

				if(String(window.location.href).indexOf('/en/')!=-1){boton_texto="View more";}else{boton_texto="Ver más";}

				popup_enlace='<a href="javascript://" idpopup="'+popup+'" class="cf_ponente_popup" style="display: inline-block !important;position: relative;top: 0px;left: 0px;background: white !important;color: black !important;padding: 2px 5px !important;font-size: 14px !important;"><i class="fa fa-plus" style="color:black !important;font-size: 14px !important;"></i>'+boton_texto+'</a>';

				jQuery(this).html(String(jQuery(this).html()).replace(popup,popup_enlace));
			}

			control=true;
		}
	});

	if(control==true)
	{
		jQuery(".cf_ponente_popup").each(function()
		{
			jQuery(this).unbind("click").click(function(){
				
				cf_ponentes_popups_abrir(jQuery(this).attr("idpopup"));
			});
		});
	}

	setTimeout(function(){cf_ponentes_popups_programa();},500);
}

function cf_ponentes_popups_abrir(idpopup)
{
			if(!jQuery("#cf_ponente_popup_cont").length)
			{
				jQuery("body").append('<div id="cf_ponente_popup_cont" style="display:none;"></div>');
			}

			jQuery("#cf_ponente_popup_cont").html(cargando);

			//var imagen="";
			//imagen=jQuery(this).parent().parent().find("img").attr("src");
			//console.log(imagen);

			jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"POST",data:"opcion=cf_ponente_popup_cont&idpopup="+idpopup+"&url="+window.location.href+"",success:function(data){
				jQuery("#cf_ponente_popup_cont").html(data);

				jQuery(window).trigger('resize');
			}});

				const jQuerydialog = jQuery("#cf_ponente_popup_cont").dialog({
			    autoOpen: false,
			    modal: true,
			    closeText: "X",
			    width: "80%",
			    //maxWidth: "700px",
			    resizable: false,
			    draggable: false,
			    buttons: false,
			    position: { my: "center", at: "center", of: window }
			  });

			  jQuerydialog.dialog("open");

			  // 🔹 Cerrar al hacer clic en el fondo (overlay)
			  jQuery(document).on("click", ".ui-widget-overlay", function() {
			    jQuerydialog.dialog("close");
			  });

			  // 🔹 Mantener centrado al redimensionar la ventana
			  jQuery(window).on("resize", function() {
			    jQuerydialog.dialog("option", "position", { my: "center", at: "center", of: window });
			  });
}

//AMPLIACIONES
function editarampliaciones_opciones()
{
	jQuery(".cyp_check_opcion").each(function() 
	{
		jQuery(this).unbind("click").click(function(){
			var precio=0;
			var tipo_pago="ampliacion, ";

			jQuery(".cyp_check_opcion").each(function() 
			{
				if(jQuery(this).attr("name").indexOf("ampliacion_hybrid")!=-1){jQuery(this).prop('checked', true);}
			});

			jQuery(".cyp_check_opcion").each(function() 
			{
				if(jQuery(this).is(":checked"))
				{
					precio+=parseFloat(jQuery(this).attr("precio"));

					tipo_pago=tipo_pago+jQuery(this).attr("name")+", ";
				}
			});

			precio=precio.toFixed(2);

			jQuery(".form_ampliaciones_precio").each(function() 
			{
				jQuery(this).html(precio);
			});

			jQuery("input[name='Atipopago']").val(tipo_pago);
		});
	});

	if(jQuery("#cyp_ampliaciones_opciones_continuar").length)
	{
		jQuery("#cyp_ampliaciones_opciones_continuar").unbind("click").click(function(){
			var control=false;

			jQuery(".cyp_check_opcion").each(function() 
			{
				if(jQuery(this).is(":checked"))
				{
					control=true;
				}
			});

			if(control==false)
			{
				alert("Debes seleccionar al menos una opción / You must select at least one option");
			}else{
				jQuery("#cyp_ampliaciones_opciones").hide();
				jQuery("#formulario_acreditacion_pago_ampliaciones").show().css("display","inline-block");
			}
		});
	}
}
//FIN AMPLIACIONES

//SOLICITUD DE PAGO
function solicitud_pago_individual_enviar_formulario(elem)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		validacion=validar_formulario(elem);

		var continentes_tags="";
		if(jQuery("#continentes_tags").length && control==false)
		{
			jQuery("#continentes_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				continentes_tags=continentes_tags+jQuery(this).attr("valor")+", ";
			});			
			if(continentes_tags==""){alert("Elige al menos una opción de \"Ubicación \"");control=true;}
		}

		var idiomas_tags="";
		if(jQuery("#idiomas_tags").length && control==false)
		{
			jQuery("#idiomas_tags").find(".cyp_acreditaciones_matchmaking_check").each(function(){
				idiomas_tags=idiomas_tags+jQuery(this).attr("valor")+", ";
			});			
			if(idiomas_tags==""){alert("Elige al menos una opción de \"Idiomas\"");control=true;}
		}

		var matchmaking_soy=continentes_tags+idiomas_tags;

		if(validacion==true && control==false)
		{
			jQuery("#boton_solicitud_individual_enviar_formulario").html(cargando);
			jQuery("input[name='Amatchmakingsoy']").val(matchmaking_soy);
			jQuery("form[name='form_acreditaciones_solicitud_individual']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=solicitud_pago_insertar&tipo=individual");
			jQuery("form[name='form_acreditaciones_solicitud_individual']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}

function solicitud_pago_individual_enviar_formulario_estado(estado)
{
	if(estado=="ok")
	{
		jQuery("#boton_solicitud_individual_enviar_formulario").html("OK");
		location.reload(true);
	}
}

function solicitud_pago_multiple_anadir_acreditado()
{
	if(jQuery("input[name='Aanadiracreditado']").val()!="")
	{
		jQuery(".solicitud_pago_multiple_acreditados_error").hide();

		var email=jQuery("input[name='Aanadiracreditado']").val();
		jQuery("input[name='Aanadiracreditado']").val("");

		jQuery.ajax({url:"/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php",type:"GET",data:"opcion=solicitud_pago_comprobar_email&idioma="+jQuery(".idioma").html()+"&email="+email+"",success:function(data){
			if(String(data).indexOf("ok(*)")!=-1)
			{
				dat=data.split("(*)");

				var num=0;

				jQuery(".solicitud_pago_multiple_acreditados").find(".solicitud_pago_multiple_acred").each(function() 
				{
					num++;
				});

				num++;

				var datos="<div class='solicitud_pago_multiple_acred'>"+String(jQuery(".solicitud_multiple_plantilla").html()).replaceAll("[num]",num).replaceAll("[email]",dat[1])+"</div>";

				jQuery(".solicitud_pago_multiple_acreditados").append(datos);

				jQuery("input[name='Aemailacreditado"+num+"']").val(dat[1]);

				jQuery(".ventana_pie_multiple").show();
			}else{
				jQuery(".solicitud_pago_multiple_acreditados_error").html(data).show();
			}
		}});
	}
}

function solicitud_pago_multiple_enviar_formulario(elem,accion)
{
	var validacion=false;var control=false;

	if(bloqueo_formulario==false)
	{
		if(accion=="confirmar")
		{
			validacion=validar_formulario(elem);
		}else{
			validacion=true;
		}

		if(validacion==true && control==false)
		{
			jQuery("#boton_solicitud_multiple_enviar_formulario_enviar").html(cargando);
			jQuery("form[name='form_acreditaciones_solicitud_multiple']").attr("action","/wp-content/plugins/miguel-conectafiction/miguel-conectafiction-funciones.php?opcion=solicitud_pago_insertar&tipo=multiple&accion="+accion+"");
			jQuery("form[name='form_acreditaciones_solicitud_multiple']").append("<button id='submitinputcode' type='submit' style='display:none'></button>");
			jQuery("#submitinputcode").click();
		}
	}
}

function solicitud_pago_multiple_enviar_formulario_estado(estado)
{
	if(estado=="ok")
	{
		jQuery("#boton_solicitud_multiple_enviar_formulario_enviar").html("OK");
		location.reload(true);
	}
}
//FIN SOLICITUD DE PAGO;