function initCms(){

				clickEvent = false;
			
				$(".cms-link").hover(function(){$(this).css('fontWeight','bold');});
				$(".cms-link").mouseout(function(){
					$(this).css('fontWeight','');
				});
				
				$(".CMS-table-top").hover(function(e) {
				//$(document).find(".CMS-table-top").find("td:last").css('display','none');
				//$(document).find(".CMS-table-top").find(".redBorder").css('display','none');
				
				//$('body').find("#link").css('display','none');
				if($.browser.msie){
					$(this).find(".redBorder").width(($(this).width()));
					$(this).find(".redBorder").height($(this).height()+0);
				}else{
					$(this).find(".redBorder").width(($(this).width()));
					$(this).find("#link").width(($(this).width()));
					$(this).find(".redBorder").height($(this).height());
				}
				var offset = $(this).offset();
				//alert(offset.left);
				$(this).find(".redBorder").css('top',offset.top-6);
				$(this).find(".redBorder").css('left',offset.left-300); //294+6
				$(this).find("#link").width(($(this).width()));
				$(this).find("#link").css('top',offset.top+$(this).find(".redBorder").height());
				$(this).find("#link").css('left',offset.left-300); //294+6
				if($.browser.msie){	
					$(this).find("#link").width(($(this).width()));
				}
				//var $link = $(this).find("td:first").find("a").attr('href');
				//$(this).find("td:first").find("a").removeAttr('href');
				$(this).find(".redBorder").css('cursor','pointer');
				$(this).find(".redBorder").css('display','');
				$(this).find("#link").css('display','');
				
				//$(this).find("td:last").show();
				$(this).click( function(){
					clickEvent = true;
					$(document).find(".CMS-table-top").find(".redBorder").css('display','none');
					$('body').find("#link").css('display','none');
					$(this).find(".redBorder").css('display','');
					$(this).find("#link").css('display','');
				});
			  },
			  function(e){
			  	if(!clickEvent){
					//$(this).find("td:last").css('display','none');
					$(this).find(".redBorder").css('display','none');
					$(this).find("#link").css('display','none');
				}
				clickEvent = false;
			  });	
				
			$('.thumb').hover(function(){
				$(this).parent().parent('.orange-background').css('backgroundColor','rgb(217,134,28)');
				$(this).css('cursor','pointer');
				$(this).fadeTo("normal",.3);
			},function(){
				$(this).fadeTo("normal",1);
				$(this).parent().parent('.orange-background').css('backgroundColor','');
				});	
				//alert('cms initialized');
}


function fnInitCMSInActive()
{


	
	fnCMSInActiveLink();
	fnCMSInActiveBody();

}

function fnCMSInActiveBody()
{
	
    if($("body").attr("cmsactive")=="cms-inactive")
    {
    
        $(document).mousemove(function(e){
            	var relativeX = e.pageX ;
        		var relativeY = e.pageY ;
    
        		$("#cmsactive").css({
            		position : 'absolute',
            		top : relativeY-95,
            		left : relativeX-35
        		});        
        
                $("#cmsactive").fadeTo(10000,1).fadeIn(5000,function(e){$(this).show();});
                $("#cmsactive").fadeTo(2000,0).fadeOut(2000,function(e){$(this).hide();});
        });
   }
}


function fnCMSInActiveBody()
{
	
    if($("body").attr("cmsactive")=="cms-inactive")
    {
		$("#cmsactive").fadeTo(1000,1).fadeIn(5000,function(e){$(this).show();});
        $("#cmsactive").fadeTo(3000,0).fadeOut(2000,function(e){$(this).hide();});
	    $(document).mousemove(function(e){
            	var relativeX = e.pageX ;
        		var relativeY = e.pageY ;
    
        		$("#cmsactive").css({
            		position : 'absolute',
            		top : relativeY-75,
            		left : relativeX-35
        		});        
        
                $("#cmsactive").fadeTo(10000,1).fadeIn(5000,function(e){$(this).show();});
                $("#cmsactive").fadeTo(3000,0).fadeOut(2000,function(e){$(this).hide();});
        });
   }
}




function fnCMSInActiveLink()
{
	
	$('a').filter(function() { return $(this).attr('cmsactive'); }).each(function() { 
		
		  if($(this).attr("cmsactive")=="cms-inactive")
		  {
			
				$(this).hover(function(e)
				{
	  
				       $("body").append($("#cmsactive").clone(true).attr("id","cmsactive_clone").hide());
					   $("#cmsactive_clone").fadeTo(0,1).fadeIn(0);
				}).mousemove(function(e){
					var relativeX = e.pageX ;//- this.offsetLeft;    
					var relativeY = e.pageY ;//- this.offsetTop;
					$("#cmsactive_clone").css({
					position : 'absolute',
					top : relativeY-75,
					left : relativeX-35
					});
				}).mouseout(function(){
					$("#cmsactive_clone").hide();
			        $("body").remove("#cmsactive_clone");
				});
		  }
		   
	});
	
   
}

