/*
var _officeItemListCombobox = null;
var _cssStyleSelectJQ = null;
var _animationTypeSelectJQ = null;
var _animationType = "slide";
*/	
	var direction = 'asc';
	var lastSort = 'datum';

	function chooseLinklistLink(ll_id, searchtype){
		
	var link = $('#linklistSelect').val();
	var type = '';
	if(document.getElementById('linklistSelectType') != null){
		var type = $('#linklistSelectType').val();
		if(searchtype == 'type'){
			$('#linklistSelectContainer').load(baseUrl+"index.php/linklist/getLinklistSelect/",
					{
						ll_id: ll_id,
						link: link,
						type: type
					}, function(){ 
					});
		} else {
			$('#linklistSelectTypeContainer').load(baseUrl+"index.php/linklist/getLinklistSelectType/",
					{
				ll_id: ll_id,
				type: type,
				link: link
					}, function(){ 
					});
		}
		
	}
	$('#linklist').load(baseUrl+"index.php/linklist/chooseLink/",
		{
			ll_id: ll_id,
			type: type,
			link: link
		}, function(){ 
		});
	
	}
		/*function print(){
			
			var f = window.open(printUrl, "pdf_ausgabe", "width=800,height=550, scrollbars=yes, resizable=yes");
			f.focus();
		}*/
		function switchImgSize(node, switchTo){
			if(switchTo == 0){
				document.getElementById("largeview"+node).style.display = 'block';
				document.getElementById("smallview"+node).style.display = 'none';
			} else {
				document.getElementById("smallview"+node).style.display = 'block';
				document.getElementById("largeview"+node).style.display = 'none';
			}
		}

function mailAdvise(){ location.href = "mailto:?body="+escape(currentUrl); }

function sortLinklist(criteria, linklist){
	if(lastSort != criteria){
		lastSort = criteria;
		direction = 'asc';
	} 
	var link = $('#linklistSelect').val();
	var type = '';
	if(document.getElementById('linklistSelectType') != null){
		var type = $('#linklistSelectType').val();
	}
	$('#linklist').load(baseUrl+"index.php/linklist/chooseLink/",
			{
				criteria: criteria,
				ll_id: linklist,
				direction: direction,
				type: type,
				link: link
			}, function(){
				if(direction == 'asc'){
					direction = 'desc';
				} else {
					direction = 'asc';
				}
				if(criteria == 'title'){
					$("#listtitle"+linklist).removeClass(
						"sorterLink"
						);

					$("#listtitle"+linklist).addClass(
						"sorterLinkOrange"  
					);
					$("#listcriteria"+linklist).removeClass(
						"sorterLinkOrange"
						);
					$("#listcriteria"+linklist).addClass(
						"sorterLink"
						);
				} else {
					$("#listtitle"+linklist).removeClass(
							"sorterLinkOrange"
							);

						$("#listtitle"+linklist).addClass(
							"sorterLink"  
						);
						$("#listcriteria"+linklist).removeClass(
							"sorterLink"
							);
						$("#listcriteria"+linklist).addClass(
							"sorterLinkOrange"
							);
				}
			});
	}


	
/*
		$(
			function()
			{
				var comboboxSettings = {animationSpeed: 100};
				
				// Create the example combobox
				setupCombobox();
				
				// Create the different styles combobox
				_cssStyleSelectJQ = $("#cssStyleSelect").combobox({}, comboboxSettings);
				// Combobox has its own onChange event, but the onChange of the Select element can be used as well.
				// changeAnimation works in this manner.
				_cssStyleSelectJQ.combobox.onChange = 
					function()
					{	
						changeStyle();
					};
				
				// Create the Animation types combobox
				// Note: There is no need to configure the onChange event as the event is defined in the html
				//	<select id="animationTypeSelect" onchange="changeAnimation()">
				_animationTypeSelectJQ = $("#animationTypeSelect").combobox({}, comboboxSettings);
			});
			
			// create a jquery combobx and set the Css class styles
			function setupCombobox()
			{
				_officeItemListCombobox = $('#linklistSelect').combobox(
					{
						comboboxContainerClass: "comboboxContainer",
						comboboxValueContentContainerClass: "comboboxValueContainer",
						comboboxValueContentClass: "comboboxValueContent",
						comboboxDropDownClass: "comboboxDropDownContainer",
						comboboxDropDownButtonClass: "comboboxDropDownButton",
						comboboxDropDownItemClass: "comboboxItem",
						comboboxDropDownItemHoverClass: "comboboxItemHover",
						comboboxDropDownGroupItemHeaderClass: "comboboxGroupItemHeader",
						comboboxDropDownGroupItemContainerClass: "comboboxGroupItemContainer"
					},
					{
						animationType: _animationType,
						width: 250
					});
			}
			*/
			function changeStyle()
			{
			
				var cssStyleSelectJQ = $("#cssStyleSelect");
				var selectedStyle = cssStyleSelectJQ.val();
				selectedStyle = "style/screen/" + selectedStyle + ".css";
				
				_officeItemListCombobox.combobox.remove()
				
				$("link[@title='combobox']").attr("href", selectedStyle);
				
				// Time delay required for the new css stylesheet to be processed by the Browser,
				// otherwise, jquery.combobox cannot calculate the correct layout for the new styles
				setTimeout(setupCombobox, 1);
			}
			
			function changeAnimation()
			{
				var animationTypeSelectJQ = $("#animationTypeSelect");
				_animationType = animationTypeSelectJQ.val();
				
				_officeItemListCombobox.combobox.remove();
				setupCombobox();
			}
			
			// Example to show the dynamic insertion of data directly into the original Select element
			// and then calling the jQuery combobox to synchronise by calling update().
			function updateCombobox()
			{
				var officeItemListSelectJQ = $("#linklistSelect");
				var currentDate = Date();
				officeItemListSelectJQ.append("<option value='" + currentDate + "'>" + currentDate + "</option>");

				_officeItemListCombobox.combobox.update();
			}

