function url(){return "http://www.windmill-farm.co.uk/";}function template(){return "template/twenty-twelve/";}$(document).ready(function(){$('.new-window').attr('target','_blank');$('iframe').attr({'frameborder':'0','scrolling':'no','allowtransparency':'false'});$('.clickable').click(function(){window.location=$(this).attr('data-href')});$("a.fancybox").fancybox({openEffect:'elastic',openEasing:'easeOutBack',closeEffect:'elastic',closeEasing:'easeInBack',helpers:{title:{type:'outside'},buttons:{},thumbs:{width:50,height:50}}})});function setCookie(c_name,value,expiredays){var exdate=new Date();exdate.setDate(exdate.getDate()+expiredays);document.cookie=c_name+"="+escape(value)+((expiredays==null)?"":";expires="+exdate.toUTCString())}function getCookie(c_name){if(document.cookie.length>0){c_start=document.cookie.indexOf(c_name+"=");if(c_start!=-1){c_start=c_start+c_name.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1)c_end=document.cookie.length;return unescape(document.cookie.substring(c_start,c_end))}}return""}shortcut.add("Ctrl+Alt+M",function(){$.fancybox({'type':'iframe','href':url()+'libraries/jquery/snk/index.html','width':443,'height':450,'modal':false,'hideOnOverlayClick':false,'centerOnScroll':true,'padding':0,})});function updateMainMenu(){$.get(url()+'xcms-core/includes/interface/ajax-menu.php?main-menu',function(data){$('#main-menu').replaceWith(data)})}function updateSubMenu(){$.get(url()+'xcms-core/includes/interface/ajax-menu.php?sub-menu',function(data){$('#sub-menu-items').replaceWith(data)})}function updateCanvas(){$.get(url()+'xcms-core/includes/interface/ajax-page.php',function(data){$('#canvas').replaceWith(data)})}$(document).ready(function(){var box1="<div id=\"login-dialogue\" title=\"Login to Content Management System\">"+"<div style=\"margin-left:auto; margin-right:auto\">"+"<p><label for=\"Username\">Username:</label>"+"<input type=\"text\" id=\"username\" name=\"username\" style=\"width:270px;\" />"+"<label for=\"password\">Password:</label>"+"<input type=\"password\" id=\"password\" name=\"password\" style=\"width:270px;\" />"+"<div style=\"text-align:right;font-size:10px;\"><a id=\"launch-password\" href=\"javascript:;\">forgotton your password?</a></div>"+"<div id=\"login-error-container\" class=\"ui-state-error ui-corner-all\" style=\"display:none;padding:10px;margin-top:20px;\">"+"<span class=\"ui-icon ui-icon-alert\" style=\"float: left; margin-right: .3em;\"></span>"+"<strong>Error:</strong> <span id=\"login-error-message\"></span></div>"+"</p></div></div>";var box2="<div id=\"password-reset-dialogue\" title=\"Reset Your Password\">"+"<div style=\"margin-left:auto; margin-right:auto\" id=\"password-reset-form\">"+"<p><label for=\"userResetUsername\">Username:</label>"+"<input type=\"text\" id=\"userResetUsername\" name=\"userResetUsername\" style=\"width:270px;\" />"+"<div style=\"font-size:10px;line-height:12px;margin-top:5px;\">"+"Please enter your username. Your new password will be sent to your registered e-mail address.</div>"+"<div id=\"pass-reset-error-container\" class=\"ui-state-error ui-corner-all\" style=\"display: none; padding: 10px; margin-top: 20px;\">"+"<span class=\"ui-icon ui-icon-alert\" style=\"float: left; margin-right: .3em;\"></span>"+"<strong>Error:</strong> <span id=\"pass-reset-error-message\"></span></div>"+"</p></div></div>";shortcut.add("Ctrl+Alt+E",function(){login()});$('body').append(box1);$('body').append(box2);$('#launch-password').click(function(){$("#login-dialogue").dialog('close');$("#password-reset-dialogue").dialog('open')});$("#login-dialogue").dialog({modal:true,dragable:true,autoOpen:false,resizable:false,buttons:{'Login':function(){processLogin()},Cancel:function(){$(this).dialog('destroy');shortcut.add("Ctrl+Alt+E",function(){login()})}}});$("#password-reset-dialogue").dialog({modal:true,dragable:true,autoOpen:false,resizable:false,buttons:{'Send Password':function(){$(this).dialog({buttons:{"Ok":function(){$(this).dialog('close')}}});$.post(url()+'xcms-core/editor/includes/login-logout/reset-password.php',{email:$('#userResetUsername').val()},function(data){$('#password-reset-form').html('Your new password has been sent to your registered e-mail address');shortcut.add("Ctrl+Alt+E",function(){login()})})},Cancel:function(){$(this).dialog('close');shortcut.add("Ctrl+Alt+E",function(){login()})}}})});function login(){shortcut.remove("Ctrl+Alt+E");$('#error').hide();$.getScript(url()+'xcms-core/editor/js/process-login-logout.js',function(){$("#login-dialogue").dialog('open')})}
// Press Ctrl+Alt+M for snake (Shhh... It's a secret)...
