$(document).ready(function(){
	$(".AuthorizeNetSeal img").attr("src","http://store.biblesoft.com/images/authorize.gif");						   
						   
	$(function(){

				$('ul.jd_menu_vertical').jdMenu({onShow: loadMenu, onHide: unloadMenu, offset: 1, onAnimate: onAnimate});
			});

			function onAnimate(show) {
				//$(this).fadeIn('slow').show();
				if (show) {
					$(this)
						.css('visibility', 'hidden').show()
							.css('width', $(this).innerWidth())
						.hide().css('visibility', 'visible')
					.fadeIn('fast');
				} else {
					$(this).fadeOut('fast');
				}
			}

			var MENU_COUNTER = 1;
			function loadMenu() {
				if (this.id == 'dynamicMenu') {
					$('> ul > li', this).remove();
			
					var ul = $('<ul></ul>');
					var t = MENU_COUNTER + 10;
					for (; MENU_COUNTER < t; MENU_COUNTER++) {
						$('> ul', this).append('<li>Item ' + MENU_COUNTER + '</li>');
					}
				}
			}

			function unloadMenu() {
				if (MENU_COUNTER >= 30) {
					MENU_COUNTER = 1;
				}
			}

			// We're passed a UL
			function onHideCheckMenu() {
				return !$(this).parent().is('.LOCKED');
			}

			// We're passed a LI
			function onClickMenu() {
				$(this).toggleClass('LOCKED');
				return true;
			}
			
			
			
			//RSR Page expand/collapse regions
			$("#rsrRegions h3").css({"cursor":"pointer", "background-repeat":"no-repeat","background-position":"right","background-image":"url(http://www.biblesoft.com/new/rsr/reps/images/plus.gif)"}).attr({"Title":"Click to expand"});
			
			$("#rsrRegions h3").next("ul").slideUp();
			$("#rsrRegions h3").click(function(){
								
								$(this).next("ul").slideToggle("fast",function(){
											
											//after slide check visibility and change indicator accordingly
											if($(this).is(":hidden")){
												
												$(this).prev("h3").css({"background-image":"url(http://www.biblesoft.com/new/rsr/reps/images/plus.gif)"}).attr({"Title":"Click to expand"});
											}
											else{
											
												$(this).prev("h3").css({"background-image":"url(http://www.biblesoft.com/new/rsr/reps/images/minus.gif)"}).attr({"Title":"Click to collapse"});
											}
																			   });	
								
											   
											   });
});

function OpenNewWindow(url, width, height) 
{ 
	window.open(url, null, 
	  'top=10,left=10,menubar=0,resizable=1,scrollbars=1,width=' + width + ',height=' + height) 
} 
function OpenNewWindow_Title(url,title,width,height) 
{ 
	window.open(url, title, 
	  'top=10,left=10,menubar=0,resizable=1,scrollbars=1,width=' + width + ',height=' + height,'outerWidth=' + width) 
} 