// JavaScript Document
jQuery.preloadImages = function()
{
  for(var i = 0; i<arguments.length; i++)
  {
    jQuery("<img>").attr("src", arguments[i]);
  }
}

jQuery(document).ready(function($) {

$.preloadImages("/images/style/blog_f2.jpg", "/images/style/contact_f2.jpg",
"/images/style/faqs_f2.jpg", "/images/style/home_f2.jpg", "/images/style/links_f2.jpg", "/images/style/new_client_register_f2.jpg","/images/style/new_notary_register_f2.jpg", "/images/style/references_f2.jpg" );

$('img#home').hover(function() {
	$(this).attr("src","/images/style/home_f2.jpg");
		}, function() {
	$(this).attr("src","/images/style/home.jpg");
});
$('img#blog').hover(function() {
	$(this).attr("src","/images/style/blog_f2.jpg");
		}, function() {
	$(this).attr("src","/images/style/blog.jpg");
});
$('img#faqs').hover(function() {
	$(this).attr("src","/images/style/faqs_f2.jpg");
		}, function() {
	$(this).attr("src","/images/style/faqs.jpg");
});
$('img#references').hover(function() {
	$(this).attr("src","/images/style/references_f2.jpg");
		}, function() {
	$(this).attr("src","/images/style/references.jpg");
});
$('img#links').hover(function() {
	$(this).attr("src","/images/style/links_f2.jpg");
		}, function() {
	$(this).attr("src","/images/style/links.jpg");
});
$('img#contact').hover(function() {
	$(this).attr("src","/images/style/contact_f2.jpg");
		}, function() {
	$(this).attr("src","/images/style/contact.jpg");
});
$('img#newnotreg').hover(function() {
	$(this).attr("src","/images/style/new_notary_register_f2.jpg");
		}, function() {
	$(this).attr("src","/images/style/new_notary_register.jpg");
});
$('img#newclientreg').hover(function() {
	$(this).attr("src","/images/style/new_client_register_f2.jpg");
		}, function() {
	$(this).attr("src","/images/style/new_client_register.jpg");
});
});




// Andy Langton's show/hide/mini-accordion - updated 18/03/2009
// Latest version @ http://andylangton.co.uk/jquery-show-hide

// this tells jquery to run the function below once the DOM is ready
jQuery(document).ready(function($) {

// choose text for the show/hide link - can contain HTML (e.g. an image)
var showText='View';
var hideText='Hide';
// append show/hide links to the element directly preceding the element with a class of "toggle"
$('.toggle').prev().append(' (<a href="#" class="toggleLink">'+showText+'</a>)');
// hide all of the elements with a class of 'toggle'
$('.toggle').hide();
// capture clicks on the toggle links
$('a.toggleLink').click(function() {
// change the link depending on whether the element is shown or hidden
$(this).html ($(this).html()==hideText ? showText : hideText);
// toggle the display - uncomment the next line for a basic "accordion" style
$('.toggle').hide();$('a.toggleLink').html(showText);
$(this).parent().next('.toggle').toggle('slow');
// return false so any link destination is not followed
return false;
});

if($('#id_reqpwd')){$('#id_reqpwd').click(function(){
   var un=$('#uname'),e=$('#id_email');
   var regex = /^((\"[^\"\f\n\r\t\v\b]+\")|([\w\!\#\$\%\&'\*\+\-\~\/\^\`\|\{\}]+(\.[\w\!\#\$\%\&'\*\+\-\~\/\^\`\|\{\}]+)*))@((\[(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))\])|(((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9]))\.((25[0-5])|(2[0-4][0-9])|([0-1]?[0-9]?[0-9])))|((([A-Za-z0-9\-])+\.)+[A-Za-z\-]+))$/;
   if(e.val()){$('#message1').hide();}
   if(!e.val()){un.attr('style',"color:red;"); $('#message1').show(); alert($('#message1').html());}
   else{$('#message1').hide(); if(!regex.test(e.val())){un.attr('style',"color:red;");$('#message2').show();alert($('#message2').html());}
   else{ $('#message1').hide();$('#message2').hide(); un.attr('style',"");
     if(!$('#te').is(':checked')&&!$('#tn').is(':checked')){$('#message3').show();alert($('#message3').html());}
     else{$('#forgotPwdFrm').submit();}
   }}
});
}


});
