	$(document).ready(function() {
	
	  // add modal windows
	  
	  $('.jqmWindow').prependTo('form:first');
	  
	  $('#friendscontactlist').jqm({modal: true, trigger: '.openFriendsList'});//,closeClass: '.closeFriendRequest'
	  $('#friendRequestModal').jqm({modal: true, trigger: '.openFriendRequest'});//,closeClass: '.closeFriendRequest'
	  $('#messageBoxModal').jqm({modal: true, trigger: '.openMessageBox'});		  
	  $('#loginModal').jqm({modal: true, trigger: '.openLoginModal'});			  	 
	  $('.jqmClose').mouseover(function(){
			$(this).addClass('jqmCloseHover');
	  });
	  $('.jqmClose').mouseout(function(){
		$(this).removeClass('jqmCloseHover');
	  });
		//$("#navTier1 li").append('<div class="cornerTL"></div>');
		
		$(".boxd").append('<img class="tl" src="/media/images/corner_boxd_tl.gif" width="3" height="3" alt="" />');
		$(".boxd").append('<img class="tr" src="/media/images/corner_boxd_tr.gif" width="3" height="3" alt="" />');
		$(".boxd").append('<img class="bl" src="/media/images/corner_boxd_bl.gif" width="3" height="3" alt="" />');
		$(".boxd").append('<img class="br" src="/media/images/corner_boxd_br.gif" width="3" height="3" alt="" />');		
	    
	    $(".boxA").append('<div class="cornerTL" ></div>');
	    $(".boxA").append('<div class="cornerTR" ></div>');
	    $(".boxA").append('<div class="cornerBL" ></div>');
	    $(".boxA").append('<div class="cornerBR" ></div>');
	    
		
	   //$(".shadowbox").wrap("<div class='shadowbox' style='display:none'><div class='zict'><div class='zictl'>&nbsp;</div><div class='zictm'>&nbsp;</div><div class='zictr'>&nbsp;</div><div class='clear'</div></div><div class='zicc'><div class='ziccl'>&nbsp;</div><div class='ziccm'></div><div class='ziccr'>&nbsp;</div><div class='clear'</div></div><div class='zicb'><div class='zicbl'>&nbsp;</div><div class='zicbm'>&nbsp;</div><div class='zicbr'>&nbsp;</div><div class='clear'></div></div></div>");
	    		    
	  jQuery.fn.hasClass = function(c) {
		return this.is('.'+c)
	  };
	  
	
	  setTimeZone();
	});				
	// workaround Safari 2.0 height issues
	//if ($.browser.safari) setInterval("$('.br,.bl').css('bottom', '1px');$('.br,.bl').css('bottom', '-2px')", 500);
	if ($.browser.safari) setInterval("$('.boxStep').css('height', '101%');$('.boxStep').css('height', '100%')", 500);
	if ($.browser.safari) setInterval("$('.btnBR').css('bottom', '1px');$('.btnBR').css('bottom', '16px')", 500);


	  function blockUI(){
	  	if ($('#uiBlock')) $('#uiBlock').remove();

	  	var uio=$('<div></div>').css({height:'100%',width:'100%',position:'fixed',left:0,top:0,'z-index':2500,opacity:0});
	  	uio.attr('id', 'uiBlock');
	  	uio.css('cursor','wait');
	  	uio.appendTo('body');
	  	 if($.browser.msie && $.browser.version<7){
	  	 	uio.css('background-color', '#fff');
	  	 	$('html,body').css({height:'100%',width:'100%'});
  	 		uio=uio.css({position:'absolute'})[0];
  	 		for(var y in {Top:1,Left:1})uio.style.setExpression(y.toLowerCase(),"(_=(document.documentElement.scroll"+y+" || document.body.scroll"+y+"))+'px'");
	  	 }
	  }
	  
	  function unblockUI(){
	  	if ($('#uiBlock')) $('#uiBlock').remove();
	  }

	
      function setTimeZone(bool){      
                
        var theCookie = $.cookie('timezone');
 
        //If the first time user comes, the time displayed will be based on GMT. 
        //But from the next time it will display the time in specified timezone         
      	if(theCookie==null){      		
			var d = new Date();
			var timezoneoffset=null;
			try{
				timezoneoffset = parseInt(d.getTimezoneOffset()/60);				
				timezoneoffset = (timezoneoffset>0)?"+"+Math.abs(timezoneoffset):"-"+Math.abs(timezoneoffset);				
				timezoneoffset = "Etc/GMT"+timezoneoffset;
				$.cookie('timezone',timezoneoffset,{ expires: 10000 });
			}catch(err){}
		}
		
      }
    
      
document.beforeAjaxRequest = function(objControl){	
		blockUI();
};
						
document.afterAjaxRequest = function(objControl){			
		unblockUI();
};


function onF8Logout(){

}