$('html').addClass('json');


		Cufon.replace('h1, .purple h3, .poptitle h2, .poptitle .date', { fontFamily: 'Frutiger LT Std', textShadow: '#333 0px -1px' })
		Cufon.replace('.blue h3, .green h3', { fontFamily: 'Frutiger LT Std', textShadow: '#777 0px -1px' })
		Cufon.replace('.calendar .day, .yearplanner h3', { fontFamily: 'Frutiger LT Std', textShadow: '#fff 0px 1px' })
		Cufon.replace('.calendar .green .day, .calendar .purple .day, .calendar .blue .day', { fontFamily: 'Frutiger LT Std', textShadow: '#666 0px -1px' })
		Cufon.replace('.mainlist h4 b, .picgallery h3', { fontFamily: 'Frutiger LT Std', textShadow: '#000 0px -1px' })
		Cufon.replace('.maintext h2, #slidedeck h2, .caption2', { fontFamily: 'Frutiger LT Std Rm', textShadow: '#fff 0px 1px' })
		Cufon.replace('.mainlist h4 em, .yearplanner a, .caption1', { fontFamily: 'Frutiger LT Std Rm', textShadow: '#000 0px -1px' })
		Cufon.replace('.resourcesButton', { fontFamily: 'Frutiger LT Std Rm', textShadow: '#333 0px -1px' })
		Cufon.replace('.cfmain h2, .cfmain h3', { fontFamily: 'Frutiger LT Std Rm', textShadow: '#630523 0px -1px' })
		
		$(document).ready(function(){
			if ($('body').attr('class').indexOf('nocufon')==-1){
				Cufon.replace('.newsticker a, .newsticker span', { fontFamily: 'Frutiger LT Std Rm', textShadow: '#000 0px -1px' })
			}
		});

var to = null;

var citrusCMS = {
		
	load : function() {
		citrusCMS.coreFunctions();
		citrusCMS.customSelect();
		citrusCMS.sizeChanger();
		if ($('#innerheader')[0]){citrusCMS.slideSwitch();}
		citrusCMS.matchHeight();
		citrusCMS.pictureGallery();
	},
	
		coreFunctions : function(){
			
		$('.slidepanel').hrzAccordion();
	
		$('.openWindow').click(function() {if (pageTracker) {pageTracker._trackPageview('/outbound/'+this.href.replace('http://',''));} window.open(this.href); return false});
		
		$('.openPop').click(function(){
				var left = Math.floor((screen.availWidth - 800) / 2);
				var top = Math.floor((screen.availHeight - 600) / 2);
				window.open($(this).attr('href'), 'newwindow', 'scrollbars=no, status=yes, left='+left+', top='+top+', width=850, height=600'); return false;
			});
	
		$('.textform').focus(function() {
			if(this.nodeName != 'SELECT'){
				$('#' + this.id).attr('class', 'textformfocus');
				if (this.value.substr(this.value.length-3,3) == '...') {this.value=''; }
						}
			});
		$('.textform').blur(function(){$('#' + this.id).attr('class', 'textform');});
		
		$('.scrollable').scrollable({ vertical: true });
		
		
		submitSignup();
		
		function submitSignup() {
		$('#signupform').submit(function(){
			$('#signupform').ajaxStart(function() {
			  $('#signuptext').html('<p><img src="/_img/layup/loader2.gif" alt="" width="220" height="19" style="margin-left: -8px;" /></p><p>Your request is being processed</p>');
			});	
			
					$.post('/content/ajax/emailsignup.asp', $('#signupform').serialize(), function(data){
						 $('#slidepanelHandle4').addClass('handleSelected'); 
						 $('#slidepanelContent4').attr('rel', 'slidepanelContainerSelected').css('opacity', '1').width(564);
						 $('#signuptext').html(data);
						submitSignup();
					});
				
			return false;							 
		});
		}
		
		
		$('.openpop').click(function(){
					getURL = $(this).attr('href');
				
			$.get('/content/ajax/popup.asp','url='+$(this).attr('href'),function(data){
				$('#showpopup').html(data);						 
					citrusCMS.showpop();
					citrusCMS.toolboxFunctions();
					if ($('#facebooklike')[0]){$('#facebooklike').attr('src','http://www.facebook.com/plugins/like.php?app_id=120738482974&href='+ encodeURIComponent(pageURL) + encodeURIComponent(getURL) +'&send=true&layout=standard&width=450&show_faces=true&action=like&colorscheme=light&font&height=80');}
				});	
			return false;
		 });
		
		if ($('.popoverlay')[0]){citrusCMS.showpop();window.location = '#showpopup';}
		 
		 $('.opencf').click(function(){
			$('.cfoverlay').css({ height: $(document).height()});
			$('.cfoverlay').show();
			$('.cfcontent').fadeIn(300);
			$('.cfcontent').css({ top: $(window).scrollTop()+ 'px' });
			
			$(document).unbind('keydown.fb').bind('keydown.fb', function(e) {
					if (e.keyCode == 27) {
						$('.cfoverlay').fadeOut(200);
						$('.cfcontent').fadeOut(200);
					};
			 });
			return false;
		 });
		 
		 $('.cfcontent .close').click(function(){
			$('.cfoverlay').fadeOut(200);
			$('.cfcontent').fadeOut(200);
			return false;
		 });
		
		$('#topnavi li a, .coursesectors li a, .adspace a, .share a, .leftcol .top a, .resourcesButton, #filtersearch button, .applyonline, .applyonline2, .courseshowreel, .facilityshowreel, #signupform button, #cmsForm button, .pagebuts a, #courseFinderform button, .cfmain h3 a').css('opacity', '1.0');
		
		$('#topnavi li a, .coursesectors li a').hover(
			function () {
				$(this).stop().animate({ opacity: '0.65' }, 150, function() { });
			}, 
			function () {
				$(this).stop().animate({ opacity: '1.0' }, 150, function() { });
			}
		);
		
		$('.adspace a, .share a, .cfmain h3 a').hover(
			function () {
				$(this).stop().animate({ opacity: '0.8' }, 150, function() { });
			}, 
			function () {
				$(this).stop().animate({ opacity: '1.0' }, 150, function() { });
			}
		);
		
		$('.leftcol .top a, .resourcesButton, #filtersearch button, .applyonline, .applyonline2, .courseshowreel, .facilityshowreel, #signupform button, #cmsForm button, .pagebuts a, #courseFinderform button').hover(
			function () {
				$(this).stop().animate({ opacity: '0.9' }, 150, function() { });
			}, 
			function () {
				$(this).stop().animate({ opacity: '1.0' }, 150, function() { });
			}
		);
		
		
		$('#slidepanelContent2 .mainlist li div').click(function(){
				window.location = $(this).children('a').attr('href');										
		});
		
		citrusCMS.mediaPlayers();
		citrusCMS.toolboxFunctions();
	},
	
	
	mediaPlayers : function() {
		$('.playVid').fancybox({
			'autoScale'     	: false,
			'width'				:853,
			'height'			:510,
			'type'				: 'iframe'
		});
		$('.playVid').click(function(){
			$('#fancybox-wrap').addClass('playvideo');							 
		});
		
		$('.playPod').fancybox({
			'autoScale'     	: false,
			'width'				:498,
			'height'			:134,
			'type'				: 'iframe'
		});
	$('.playPod').click(function(){
			$('#fancybox-wrap').removeClass('playvideo');							 
		});
	},
	
	toolboxFunctions : function(){
		$('.printWindow').click(function() {window.print()});
		$('.bookmarkCourse').click(function(){if (document.all){window.external.AddFavorite(document.location, this.title);}else if(window.sidebar){window.sidebar.addPanel(this.title, document.location, "")}; return false;});
	},
	
	
	showpop : function(){
			$('.popoverlay').css({ height: $(document).height()});
			var forcepopup = 0;
			$('.popoverlay').removeClass('displayfolder'); $('.popcontent').removeClass('displayfolder');
			if ($('#showpopoverlay').attr('class')=='popoverlay forcepopoverlay') {forcepopup = 1;}
			window.location = '#showpopup';
			$('#holder').addClass('noprint');
			$('.popoverlay').show();
			$('.popcontent').fadeIn(300);
			//$('.popcontent').css({ top: $(window).scrollTop()+ 'px' });
			$(document).unbind('keydown.fb').bind('keydown.fb', function(e) {
					if (e.keyCode == 27) {
					$('.popoverlay').fadeOut(200);
					$('.popcontent').fadeOut(200);
					};
			 });
			
				 $('.popcontent .close').click(function(){
					$('.popoverlay').fadeOut(200);
					$('.popcontent').fadeOut(200);
					$('#holder').removeClass('noprint');
					if (forcepopup ==0){return false;}
				 });	
				 Cufon.refresh();
				 pagebuts()
				 citrusCMS.pictureGallery();
						
					function pagebuts(){
						if ($('.popuppagingbuts')[0]){
						$('.popuppagingbuts').click(function(){
								$.get('/content/ajax/popup.asp','popup=1&url='+$(this).attr('href'),function(data){$('#showpopup').html(data);citrusCMS.showpop();citrusCMS.toolboxFunctions();});	
									return false;		  
								});
							}
						}
			},
					
					
	matchHeight : function() {
	
	if ($('.matchheight')[0]){
		$('.matchheight > .first').each(function(){
				
				h1 = $('a', this).height();
				
				innerh1 = $('a', this).innerHeight();
				h2 = $(this).next().children(0).height();
				
				innerh2 = $(this).next().children(0).innerHeight();
			
				h3 = $(this).next().next().children(0).height();
				innerh3 = $(this).next().next().children(0).innerHeight();
			
				
				if (h1 >= h2 && h1 >= h3){
						setHeight = h1; 
				} else if (h2 >= h1 && h2 >= h3) {
						setHeight = h2; 
					} else {
						setHeight = h3;
					}
					
				$('a',this).css('height', setHeight);
				$(this).next().children(0).css('height', setHeight);
				$(this).next().next().children(0).css('height', setHeight);
			});
		}
		
		
	},
	
	pictureGallery : function(){
		if ($('.picgallery')[0]  && !$('.counter')[0]) {
		// HIDE THE ALL ITEMS AND THEN ONLY SHOW THE FIRST ONE
		$('.picgallery ul li').hide();
		$('.picgallery ul li:first-child').show();
		
		// ADD THE LEFT AND RIGHT CONTROLS TO THE CONTAINER
		$('.picgallery .controls').append('<a class="left">Left</a><a class="right">Right</a>');
	
		// ASSIGN A SEQUENTIAL CLASS TO EACH LIST ITEM, IE 1, 2, 3 ,4
		$('.picgallery ul li').each(function(number) {
			number = number+1;
			$(this).addClass('item' + number);
		}); 
		
		// SET CURRENT POSITION TO ITEM 1
		currentItem = 1;
		maximumItems = $('.picgallery ul li').size();
		
		// ADD THE COUNTER TO THE CONTAINER
		$('.picgallery .controls').append('<div class="counter"><span class="gallerycurrent">' + currentItem +'</span><span>of</span><span class="total">' + maximumItems + '</span>');
	
		
		// CLICK FUNCTION FOR THE RIGHT BUTTON
		$('.picgallery a.right').click(function() {
			$('.picgallery ul li.item'+currentItem).fadeOut();
			if(currentItem == maximumItems) {
				currentItem = 1;
			}else{
				currentItem = currentItem+1;
			};
			$('span.gallerycurrent').text(currentItem);
			$('.picgallery ul li.item'+currentItem).fadeIn();
		});
		
		// CLICK FUNCTION FOR THE LEFT BUTTON
		$('.picgallery a.left').click(function() {
			$('.picgallery ul li.item'+currentItem).fadeOut();
			if(currentItem == 1) {
				currentItem = maximumItems;
			}else{
				currentItem = currentItem-1;
			};
			$('span.gallerycurrent').text(currentItem);
			$('.picgallery ul li.item'+currentItem).fadeIn();
		});
		}
	},
	
	slideSwitch : function(){$('#thumbs').galleriffic();},
	
	carousel : function() {
		
	var autoscrolling = true;

		$('#header').infiniteCarousel().mouseover(function () {
			autoscrolling = false;
		}).mouseout(function () {
			autoscrolling = true;
		});
		
		setInterval(function () {
			if (autoscrolling) {
				$('#header').trigger('next');
			}
		}, 4400);
	},
	
	resourceLibrary : function() {
		$('a.resourcesButton').click(function() {
				if($(this).next().is(':visible')) {
					$('div.resourcesContent').slideUp('normal');
					$('.resources a.on').removeClass('on');
				} else {
					$('div.resourcesContent').slideUp('normal');	
					$(this).next().slideDown('normal');
					$('.resources a.on').removeClass('on');
					$(this).removeClass('on').addClass('on');
				}
				return false;
			});
			
	},
	
	
		librarySearch : function() {
		$('#filterlibrary').keyup(function(){
				$.get('/content/ajax/librarysearch.asp',$('#filtersearch').serialize(),function(data){
				
				$('a.resourcesButton').each(function(){
					$('.resources a.on').removeClass('on');
					$(this).next().slideUp('normal');
				});
				
				
				if ($('#resourcesresults')[0]){	
					$('#resourcesresults').html(data.replace('<li id="resourcesresults">','').replace('</li>',''));
				} else {
					$(data).insertBefore($('.resources').children(':eq(0)'));
					$(this).addClass('on');
				}
				
				$('#resourcesresults a.resourcesButton').click(function(){
						if($(this).next().is(':visible')) {
							$('div.resourcesContent').slideUp('normal');
							$('.resources a.on').removeClass('on');
						} else {
							$('div.resourcesContent').slideUp('normal');	
							$(this).next().slideDown('normal');
							$('.resources a.on').removeClass('on');
							$(this).removeClass('on').addClass('on');
						}						  
				});
				
				Cufon.refresh();
				citrusCMS.mediaPlayers();
				
				});
		});
	},
	
	
		governorslibrarySearch : function() {
		$('#filterlibrary').keyup(function(){
				$.get('/content/ajax/governorslibrarysearch.asp',$('#filtersearch').serialize(),function(data){
				
				$('a.resourcesButton').each(function(){
					$('.resources a.on').removeClass('on');
					$(this).next().slideUp('normal');
				});
				
				if ($('#resourcesresults')[0]){	
					$('#resourcesresults').html(data.replace('<li id="resourcesresults">','').replace('</li>',''));
				} else {
					$(data).insertBefore($('.resources').children(':eq(0)'));
					$(this).addClass('on');
				}
				
				$('#resourcesresults a.resourcesButton').click(function(){
						if($(this).next().is(':visible')) {
							$('div.resourcesContent').slideUp('normal');
							$('.resources a.on').removeClass('on');
						} else {
							$('div.resourcesContent').slideUp('normal');	
							$(this).next().slideDown('normal');
							$('.resources a.on').removeClass('on');
							$(this).removeClass('on').addClass('on');
						}						  
				});
				
				Cufon.refresh();
				
				});
		});
	},
	
	courseSearch : function() {
		$('#filterlibrary').keyup(function(){
		$.get('/content/ajax/courselistsearch.asp',$('#filtersearch').serialize(),function(data){
				
				$('a.resourcesButton').each(function(){
					$('.resources a.on').removeClass('on');
					$(this).next().slideUp('normal');
				});
				
				if ($('#showresults')[0]){$('#showresults').remove();}
				if ($('#resourcesresults')[0]){	
					$('#resourcesresults').html(data.replace('<li id="resourcesresults">','').replace('</li>',''));
				} else {
					$(data).insertBefore($('.resources').children(':eq(0)'));
					$(this).addClass('on');
				}
				
				$('#resourcesresults a.resourcesButton').click(function(){
						if($(this).next().is(':visible')) {
							$('div.resourcesContent').slideUp('normal');
							$('.resources a.on').removeClass('on');
						} else {
							$('div.resourcesContent').slideUp('normal');	
							$(this).next().slideDown('normal');
							$('.resources a.on').removeClass('on');
							$(this).removeClass('on').addClass('on');
						}						  
				});
				
				Cufon.refresh();
				
				});
		});
		
	},
	
	
	customSelect : function(){
		
	function getselectors() {		
			
		$('select.selectbox').css('display','none');
		$('.customselect').css('display','block');
				
		$('.selectdropdown li').hover(function () {
				$(this).stop().css({'background-color' : '#ffffff'});}, function () { $(this).stop().css({'background-color' : '#ededed'});
		});	
		
			$('.customselect').each(function(){
					
						var currentSel = $(this);
						var currentValue = $(currentSel).prev().find('option:selected').attr('value');
						
						currentText = $(currentSel).prev().find('option:selected').text();
						$(currentSel).find('.button').text(currentText);
						
						
						$(currentSel).find('.button').click(function(){
						
							if( $(this).next().css('display') == 'none' ) {
								
								$('.selectdropdown').fadeOut({queue: false, duration: 100});
								$(this).next().slideDown(200);
								$(this).addClass('selected');
								
									$(currentSel).find('li').click(function(){
										newValue = $(this).attr('class');
										newText = $(this).text();
										$(currentSel).prev().attr('value', newValue);
										$(this).parent().parent().prev().text(newText);
										$(this).parent().parent().fadeOut(100);
										if ($(this).prev()[0]) {
											$(currentSel).find('li:first-child').show();
										} else {
											$(currentSel).find('li:first-child').hide();
										}
										
										
									});
							
							
								$(document.window || 'body').click( function() {
									if( $(currentSel).find('.selectdropdown').css('display') == 'block' ) {
										$(currentSel).find('.selectdropdown').fadeOut({queue: false, duration: 100});
										$(currentSel).find('.button').removeClass('selected');
									}
								});
								
								$('.selectdropdown li').hover(function () {
									$(this).stop().css({'background-color' : '#ffffff'});}, function () { 
									$(this).stop().css({'background-color' : '#edeff1'});
								});
								
							} else {
								
								$(this).next().css('display','none');
								$(this).removeClass('selected');
								
							}
							
							return false;
						});
					});
			
			}
		
		getselectors();
		
				$('#listoption1').children('div').children('ul').children('li').click(function(){
				$.get('/content/ajax/coursefinder.asp', 'option1=' + $(this).attr('class'), function(data) {
							$('#showoption2').html(data);	
							getselectors();
							option2();
							$.get('/content/ajax/coursemodes.asp', '', function(data) {$('#showoption3').html(data);getselectors();});	
					});
			});
			
		
					function option2() {
					$('#listoption2').children('div').children('ul').children('li').click(function(){
							$.get('/content/ajax/coursefinder.asp', 'cfoption1=' + $('#option1').attr('value') + '&option2=' + $(this).attr('class'), function(data) {
										$('#showoption3').html(data);		
										getselectors();
								});
							});
					}
		
		option2();
	},
	
		
courseTabs : function() {
	if ($('#tabs')) {	
		$('#tabs > li').click(function() {
		$('#tabs > li > a').each(function(){$(this).removeClass('on');})
		$('#tabmain > div').each(function(){$(this).attr('class','taboff');})
			$(this).children().addClass('on'); 
			$('#'+$(this).children().attr('id').replace('t', '')).attr('class','tabon'); 
			return false;
		});	
	}
	},
	
	
	courseListSearch : function(){
		$('#filtersearch').submit(function(){
			$.get('/content/ajax/courselist.asp','filterlibrary='+$('#filterlibrary').attr('value') + '&category='+$('#category').attr('value'),function(data){$('.maintext').html(data); citrusCMS.coreFunctions();});
		return false;
		});
	},
	
	
			cookie : function(name,value,options) {
		if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;}var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}expires='; expires='+date.toUTCString();}var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}return cookieValue;}
	},
	
	sizeChanger : function() {
		//load cookie for css switcher
	var cookie = citrusCMS.cookie('style');
	var title = cookie ? cookie : getPreferredStyleSheet();
	setActiveStyleSheet(title);
		
		//show correct size on navi
		if (cookie){
		cookiestr = cookie.toString().replace(' Screen Style','');
	
		if ($('#' + cookiestr)){
			$('#' + cookiestr).attr('class', 'on');
		}else{
			$('#Default').attr('class', 'on');
		}
		
		}else{
			$('#Default').attr('class', 'on');
		}
		
		//textchange navi
		$('#tools > ul > li > a').click(function(){
				$('#tools > ul > li > a').each(function(){$(this).removeClass('on');});
				$(this).attr('class', 'on');
				setActiveStyleSheet($(this).attr('id')); 
				Cufon.refresh();
				
				
					if ($('.matchheight')[0]){ //reforce the heights for the new text size
							$('.matchheight > .first').each(function(){
								innerh1 = 20;
									$('a', this).children(':not(img)').each(function(){
										innerh1 += $(this).height();				   
									});
								innerh2 = 20;
									$(this).next().children(0).children(':not(img)').each(function(){
										innerh2 += $(this).height();				   
									});
								innerh3 = 20;
									$(this).next().next().children(0).children(':not(img)').each(function(){
										innerh3 += $(this).height();				   
									});
				
							
							IE6 = ((window.XMLHttpRequest == undefined) && (ActiveXObject != undefined)) ? true : false;
							if (IE6) { //IE6 adds far too much height so reduce it
								innerh1 = innerh1 - ((innerh1 * 30)/ 100);	
								innerh2 = innerh2  - ((innerh2 * 30)/ 100);	
								innerh3 = innerh3  - ((innerh3 * 30)/ 100);	
							}
								
							$('a',this).css('height',innerh1);
							$(this).next().children(0).css('height',innerh2);
							$(this).next().next().children(0).css('height',innerh3);
							
						});
					
					}
		
				citrusCMS.matchHeight(); //rematch the heights
				return false; 
		});
		

	},
	
	boxLinks : function(){
		  $('.mainlist li').click(function(){
			var newLocation = '';
			var openPop = false;
			
			
			if ($(this).children('a')[0]){
				newLocation = $(this).children('a').attr('href');
				if ($(this).children('a').attr('class')=='openpop' || $(this).children('a').attr('class')=='more openpop') {openPop = true;}
			} else if ($(this).children('div').children('a')[0]){
				newLocation = $(this).children('div').children('a').attr('href');
				if ($(this).children('div').children('a').attr('class')=='openpop' || $(this).children('div').children('a').attr('class')=='more openpop') {openPop = true;}
			} else if ($(this).children('div').children('div').children('a')[0]){
				newLocation = $(this).children('div').children('div').children('a').attr('href');
				if ($(this).children('div').children('div').children('a').attr('class')=='openpop' || $(this).children('div').children('div').children('a').attr('class')=='more openpop') {openPop = true;}
			}
		
		
			if (newLocation != ''){
			if (openPop){
					$.get('/content/ajax/popup.asp','url='+newLocation,function(data){
						$('#showpopup').html(data)						 
							citrusCMS.showpop();
						});	
						return false;
						
				} else {
					window.location = newLocation;
				}
			}
		 });
		  
},

	scrollingMessages : function() {
			$('div.newsticker p').marquee('pointer').mouseover(function () {
				$(this).trigger('stop');
			}).mouseout(function () {
				$(this).trigger('start');
			})
		}
		  
	
}


var citrusWeb = {
	
	
}


var citrusAjax = {
	
	makeRequest: function(requestURL,getID){
		$.ajax({
		    url: requestURL,
		    success: function(data) {
			$(getID).html(data);
		  }
		});
	},
	
	submitForm : function(pageUrl) {
		
		$('#waiting').html('<img src="/_img/layup/loading.gif" />');
		$('#submitButton').type == 'button'; //if js then remove the submit function of the button
		$('#submitButton').disabled = 'disabled'; //when submited disable button
		
		waitPadd = (($('#cmsForm')).height() - 45) /2
		$('#waiting').css('paddingTop', waitPadd + 'px');
		$('#waiting').css('paddingBottom', waitPadd + 'px');
		$('#waiting').fadeIn(); //show waiting div
		
		//stops whole site appearing when ajax is called
		if(pageUrl) {pageLocation = pageUrl} else {pageLocation = window.location}
		
		$.post(pageUrl, 'ajax=1&' +  $('#cmsForm').serialize(), function(data){citrusAjax.showResponse(data)});
		
	},

	showResponse : function(originalRequest) {
			
			if(originalRequest.substring(0,4) == 'http') {
				window.location = originalRequest; //redirect
			  } else {
				$('#waiting').fadeOut() ; //hide waiting div
				$('#cmsForm').html(originalRequest); //show response
				//$('#submitButton').effect('shake', { times:3 }, 100);
				citrusCMS.load();
  			}

	}
	
}

$(document).ready(citrusCMS.load);
