﻿$(document).ready(function(){
 // initialize tooltip
/*
    var api=$(".pin").tooltip({ 
     
        // use single tooltip element for all tips 
        tip: '.tooltip',  
         
        // tweak the position 
        offset: [-280, -200], 
         events: { 
    def:      "click,mouseout",                // default show/hide events for an element 
    tooltip:        "mouseover,mouseout click"            // the tooltip element 
},
        // use "slide" effect 
        effect: 'slide',
		onBeforeShow:function(){
		$('.pin').attr('src','files/images/pin_gray.png');
		this.getTrigger().attr('src','files/images/'+this.getTrigger().attr('id')+'_hover.png'); 
		},
		onShow: function() {},
		onBeforeHide:function(){
		$('.pin').attr('src','files/images/pin_gray.png'); 
		}	
         
    // add dynamic plugin  
    }).dynamic( { 
     
        // customized configuration on bottom edge 
        bottom: { 
         
            // slide downwards 
            direction: 'up', 
             
            // bounce back when closed 
            bounce: true 
        } }).hover(function(){
		$(this).attr('src','files/images/pin_red.png'); 
		},function(){
		$(this).attr('src','files/images/pin_gray.png');
		}).click(function(){$(this).attr('src','files/images/pin_red.png'); return false});
		*/
		var myurl = document.URL;
		var mysearch = myurl.split('#');
		if (mysearch.length>1)
			{
				var anker = mysearch[(mysearch.length-1)];
				akk=$("h3 a[href$="+anker+"]");
		}else
		{
			akk=$("h3:first a");
		}

	
	$("h3 a:not(.news h3 a)").click(function(){
	if(akk!=$(this)){
			akk.parent().next().stop(true,true).slideToggle('fast');
			akk.css('color','#E20031');
			akk=$(this);
			$(this).parent().next().stop(true,true).slideToggle('fast');
			$(this).css('color','#000');

			}
		return false;
	}).parent().next().hide();
	akk.css('color','#000').parent().next().fadeIn('slow');
	
	$('a.lightbox').fancybox({'titleShow':false});
	$('.addthis_toolbox a').hover(
		function(){
		$(this).stop(true,true).animate({width:'105px','marginLeft':'-34px','height':'33px'},500,'easeInOutBack');
		},
		function(){
		$(this).stop(true,true).animate({width:'40px','marginLeft':'31px','height':'33px'},300,'easeInOutBack');
		})
		/*$(".close").click(function(){
	$('.tooltip').fadeOut('slow');
	return false
	})*/
	
})
