// Lightview
Lightview.options.slideshowDelay=3;


//Prototip
Prototip.Styles.contentLeft={
	className:'tip_yaacool',
	border:5,
	borderColor:'#c6c6c6',
	closeButton:true,
	delay:0,
	hideOn:{element:'closeButton',event:'click'},
	hideAfter:0.5,
	hook:{target:'topLeft',tip:'bottomLeft'},
	images:'http://www.yaacool.com/fileadmin/tpls/res/prototip',
	offset:{x:4,y:0},
	radius:5,
	stem:{position:'bottomLeft',height:12,width:20}
};
Prototip.Styles.contentRight={
	className:'tip_yaacool',
	border:5,
	borderColor:'#c6c6c6',
	closeButton:true,
	delay:0,
	hideOn:{element:'closeButton',event:'click'},
	hideAfter:0.5,
	hook:{target:'topRight',tip:'bottomRight'},
	images:'http://www.yaacool.com/fileadmin/tpls/res/prototip',
	offset:{x:-2,y:0},
	radius:5,
	stem:{position:'bottomRight',height:12,width:20}
};

// toggle helpItems on mainHelpPage [zimt_pi2]
function foldHelp(id) {
	var id_headline='helpPage_headline_'+id;
	var id_text='helpPage_text_'+id;
	if($(id_text)) {
		if($(id_text).getStyle('display')=='none') {
			new Effect.BlindDown(id_text,{duration:0.5});
			$(id_headline).title=titleHide;//global var is defined in ext:zimt_pi2
			$(id_headline).style.backgroundImage='url(fileadmin/tpls/plugin/plugin_zimt/help/minus.gif)';
		} else {
			new Effect.BlindUp(id_text,{duration:0.5});
			$(id_headline).title=titleShow;//global var is defined in ext:zimt_pi2
			$(id_headline).style.backgroundImage='url(fileadmin/tpls/plugin/plugin_zimt/help/plus.gif)';
		}
	}
}


//make hoverBoxes for glossary
document.observe('dom:loaded', function() {
	$$('a.tip').each(function(element) {
		if(element.up('#contentLeft')==undefined) {
			new Tip(element,$(element.rel),{style:'contentRight',title:element.title});
		} else {
			new Tip(element,$(element.rel),{style:'contentLeft',title:element.title});
		}
	});
});


//set Flag for articles
function setFlag(flag) {
	new Ajax.Request('index.php?eID=zimt_flags',{
		parameters:{action:'set_flag',flag:flag},
		onSuccess:function(transport) {
			if(!transport.responseJSON) {alert('ERROR1(no JSON): '+transport.responseText);return;}
			window.location.href=window.location.href;
		},
		onFailure:function(transport) {
			if(!transport.responseJSON) {alert('ERROR2(no JSON): '+transport.responseText);return;}
			alert('ERROR: '+transport.responseJSON.returnMessage);
		}
	});
}



