jQuery(document).ready(function($){
	//+---------------------+
    //| Alert for Downloads |
    //+---------------------+
    jQuery("a.downloadalert").fancybox({
        'hideOnContentClick': false,
		'titleShow': false,
        onClosed: function(){
            eraseCheckbox();
        }
    });
    jQuery("a.downloadalert").click(function(event){
        event.preventDefault();
		tmpObject = jQuery(this);
		downloadId = tmpObject.attr("id");
    });
    jQuery("#downloadCheckbox").click(function(event){
        jQuery("#downloadArea").toggle();
		jQuery.fancybox.center();
    });
    jQuery("#downloadArea a").click(function(event){
        event.preventDefault();
		if(jQuery("#downloadCheckbox").attr('checked')){
			//window.location.href = "downloadpublication.do?citid=" + downloadId;
			window.location.href = tmpObject.attr("title");
		}
    });
    jQuery("a.toggleonline").click(function(event){
        event.preventDefault();
        jQuery("#vertical_slide" + jQuery(this).attr("id").split("v_toggle").join("")).toggle();
    });
	//+---------+
    //| Tooltip |
    //+---------+
	jQuery(".toolTip").mouseover(function(){
		jQuery(this).data("title", jQuery(this).attr("title")).attr("title","");
		jQuery(this).parent().append('<div id="toolTipBox"><div style="position:relative"><span class="toolTipArrow"><!-- arrow --></span></div>'+jQuery(this).data("title")+'</div>');
		jQuery("#toolTipBox").css("top", jQuery(this).position().top + 25);
		jQuery("#toolTipBox").css("left", jQuery(this).position().left - 20);
    });
	jQuery(".toolTip").mouseout(function(){
		jQuery(this).attr("title",jQuery(this).data("title"));
		jQuery("#toolTipBox").remove();
    });
});
function eraseCheckbox(){
    jQuery("#downloadCheckbox").attr('checked', false);
}

