if($.browser.mozilla||$.browser.opera){document.removeEventListener("DOMContentLoaded",$.ready,false);document.addEventListener("DOMContentLoaded",function(){$.ready()},false)}$.event.remove(window,"load",$.ready);$.event.add( window,"load",function(){$.ready()});$.extend({includeStates:{},include:function(url,callback,dependency){if(typeof callback!='function'&&!dependency){dependency=callback;callback=null}url=url.replace('\n','');$.includeStates[url]=false;var script=document.createElement('script');script.type='text/javascript';script.onload=function(){$.includeStates[url]=true;if(callback)callback.call(script)};script.onreadystatechange=function(){if(this.readyState!="complete"&&this.readyState!="loaded")return;$.includeStates[url]=true;if(callback)callback.call(script)};script.src=url;if(dependency){if(dependency.constructor!=Array)dependency=[dependency];setTimeout(function(){var valid=true;$.each(dependency,function(k,v){if(!v()){valid=false;return false}});if(valid)document.getElementsByTagName('head')[0].appendChild(script);else setTimeout(arguments.callee,10)},10)}else document.getElementsByTagName('head')[0].appendChild(script);return function(){return $.includeStates[url]}},readyOld:$.ready,ready:function(){if($.isReady) return;imReady=true;$.each($.includeStates,function(url,state){if(!state)return imReady=false});if(imReady){$.readyOld.apply($,arguments)}else{setTimeout(arguments.callee,10)}}}); $(function(){ //if($('#contact-form').length)$.include('js/forms.js') if($('.jqTransform').length)$.include('js/jquery.jqtransform.js') }) $(document).ready(function($){ $('ul.sf-menu li').hover(function(){ $(this).addClass('activeli'); $('> a', this).addClass('activea'); var width=$(this).width(); $('ul.subnav', this).show(); var liwidth = $('ul.subnav', this).width(); $('ul.subnav li', this).css("min-width",liwidth); var parentw = $(this).width(); $('ul.subnav li a', this).css("min-width",parentw); }, function(){ $('ul.subnav', this).hide(); $(this).removeClass('activeli'); $('> a', this).removeClass('activea'); }); $("div.servicestab").click(function(){ //get the url from href attribute and launch the url window.location=$(this).attr("rel"); return false; }); }); function areaOnFocus(element, inputText) { if(element.value == inputText) { element.value=''; } } $(window).load(function() { $('#slider').nivoSlider({ effect: 'fade', // Specify sets like: 'fold,fade,sliceDown' animSpeed: 1000, // Slide transition speed startSlide: 0, // Set starting Slide (0 index) directionNav: true, // Next & Prev navigation directionNavHide: false, // Only show on hover controlNav: false, // 1,2,3... navigation keyboardNav: true, // Use left & right arrows pauseOnHover: true, // Stop animation while hovering manualAdvance: false, // Force manual transitions captionOpacity: 0.8, // Universal caption opacity prevText: 'Prev', // Prev directionNav text nextText: 'Next', // Next directionNav text randomStart: false, // Start on a random slide pauseTime: 3000 }); }); function checkform(){ var error =''; if($('#userfname').val()==''){ error = error + '
Please enter your full name'; } if($('#userfemail').val()==''){ error = error + '
Please enter your email address'; } if($("#userfemail").val()!='' && !isValidEmailAddress($("#userfemail").val())) { error = error + "
Please enter correct email address"; } if(error !=''){ $.msgbox('

Errors detected on the Form
'+error+'

', { type : 'error', buttons : [ {type: "submit", value: "Okay"} ] }); } else { $.ajax({ url: "inc/submitforms.php?form=signup", type: $("#signupuser").attr( 'method' ), data: $("#signupuser").serialize(), success: function(data) { if(data == 'userexists') { $.msgbox('

Your email is already registered on our site.
Please use your email to login to access Verve Notes.

', { type : 'info', buttons : [ {type: "submit", value: "Okay"} ] }); } if(data == 'uservalid') { $.msgbox('

Thank for registering with Verve
We have now sent a confirmation email to your registered email address.
You can now access Verve notes with your email address

', { type : 'info', buttons : [ {type: "submit", value: "Okay"} ] }, function(result) { if (result) { window.location='verve-notes.php'; } }); } }, error: function(){ alert("You have encountered an error - Please refresh you browser and start again"); } }); } } function checklogin(){ var error =''; if($('#useremail').val()==''){ error = error + '
Please enter your login username/email address'; } if($("#useremail").val()!='' && !isValidEmailAddress($("#useremail").val())) { error = error + "
Please enter correct email address"; } if($('#urltogoto').val()!=''){ var redirect = 'verve-notes-content.php?'+$('#urltogoto').val(); } else { var redirect = 'verve-notes.php'; } if(error !=''){ $.msgbox('

Errors detected on the Form
'+error+'

', { type : 'error', buttons : [ {type: "submit", value: "Okay"} ] }); } else { $.ajax({ url: "inc/submitforms.php?form=login", type: $("#loginuser").attr( 'method' ), data: $("#loginuser").serialize(), success: function(data) { if(data == 'success') { window.location=redirect; } if(data == 'notfound') { $.msgbox('

Username not found.
Please signup to receive access to locked notes

', { type : 'info', buttons : [ {type: "submit", value: "Okay"} ] }); } if(data == 'resetpassword') { window.location='verve-change-your-password.php'; } //alert(data); }, error: function(){ alert("You have encountered an error - Please refresh you browser and start again"); } }); } } function isValidEmailAddress(emailAddress) { var pattern = new RegExp(/^(("[\w-+\s]+")|([\w-+]+(?:\.[\w-+]+)*)|("[\w-+\s]+")([\w-+]+(?:\.[\w-+]+)*))(@((?:[\w-+]+\.)*\w[\w-+]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][\d]\.|1[\d]{2}\.|[\d]{1,2}\.))((25[0-5]|2[0-4][\d]|1[\d]{2}|[\d]{1,2})\.){2}(25[0-5]|2[0-4][\d]|1[\d]{2}|[\d]{1,2})\]?$)/i); return pattern.test(emailAddress); } function pwreset(){ var error =''; if($('#oldpassword').val()==''){ error = error + '
Please enter your current password'; } if($("#newpassword").val()=='') { error = error + "
Please enter new password"; } if($('#confirmpassword').val()==''){ error = error + '
Please enter confirm password'; } if($("#newpassword").val()!=$('#confirmpassword').val()) { error = error + "
New password and confirm password should match"; } if(error !=''){ $.msgbox('

Errors detected on the Form
'+error+'

', { type : 'error', buttons : [ {type: "submit", value: "Okay"} ] }); } else { $.ajax({ url: "inc/submitforms.php?form=changepassword", type: $("#passwordreset").attr( 'method' ), data: $("#passwordreset").serialize(), success: function(data) { if(data == 'success') { window.location='verve-notes.php'; } if(data == 'incorrectpass') { $.msgbox('

Incorrect old password. Please try again.

', { type : 'info', buttons : [ {type: "submit", value: "Okay"} ] }); } }, error: function(){ alert("You have encountered an error - Please refresh you browser and start again"); } }); } } function emailpassword(){ var error =''; if($('#email').val()==''){ error = error + '
Please enter your registered email address'; } if($("#email").val()!='' && !isValidEmailAddress($("#email").val())) { error = error + "
Please enter correct email address"; } if(error !=''){ $.msgbox('

Errors detected on the Form
'+error+'

', { type : 'error', buttons : [ {type: "submit", value: "Okay"} ] }); } else { $.ajax({ url: "inc/submitforms.php?form=forgotpass", type: $("#forgotpassword").attr( 'method' ), data: $("#forgotpassword").serialize(), success: function(data) { if(data == 'success') { $.msgbox('

We have confirmed your identity and an auto generated password is sent your registered email address.

', { type : 'info', buttons : [ {type: "submit", value: "Okay"} ] }, function(result) { if (result) { window.location='verve-notes.php'; } }); } if(data == 'nouser') { $.msgbox('

Email does not exists with us.
Please try again or you can sign up with a new email address.

', { type : 'info', buttons : [ {type: "submit", value: "Okay"} ] }); } }, error: function(){ alert("You have encountered an error - Please refresh you browser and start again"); } }); } }