$(document).ready(function () {
	$('.news-list-item .news-list-morelink').click(function() {
		$(this).parent().find('.news-list-content').slideToggle("fast");
		$(this).hide();
		$(this).next().show();
		return false;
	});
	
	
	$('.news-list-item .news-list-lesslink').click(function() {
		$(this).parent().find('.news-list-content').slideToggle("fast");
		$(this).hide();
		$(this).prev().show();
		return false;
	});
	
	$('.powermail_select, .powermail_countryselect').each(function () {
		var select = $(this);
		select.hide();
		
		var options = document.createElement('div');
		$(options).attr('class', 'ixmation-dropdown-option');
		


		var current = document.createElement('div');
		$(current).attr('class', 'ixmation-dropdown-current');
		var currentVal = select.find(':selected').eq(0).text();
		if (!currentVal) {
			currentVal = select.find('option').eq(0).text();
		}
		current.appendChild(document.createTextNode(currentVal));
		
		select.find('option').each(function() {
			var text = $(this).html();
			var option = document.createElement('div');
			option.appendChild(document.createTextNode(text));
			$(option).attr('value', $(this).attr('value'));
			options.appendChild(option);
		});
		
		select.after(options);
		select.after(current);
		
		$(current).click(function () {
			$(this).next().toggle(1, function () {
				$(options).removeShadow();
				if($(options).css('display') == 'block') {
					$(options).dropShadow({top:0,left:0,blut:10});
				} else {
					$(options).removeShadow();
				}
			});
			//$(options).dropShadow();
		});
		
		$(options).find('div').click(function () {
			$(current).html($(this).html());
			currentElement = select.find(':selected').eq(0);
			if (currentElement) {
				currentElement.attr('selected', '');
			}
			//alert(select.find('[value=' + $(this).attr('value') + ']').eq(0).attr('value'));
			select.find('[value=' + $(this).attr('value') + ']').eq(0).attr('selected', 'selected');
			//newElement.attr('selected', 'selected');
			$(options).toggle(1);
			$(options).removeShadow();
		});
		
	});
	
	$('.tx_powermail_pi1_fieldwrap_html_check input').each(function () {
		$(this).checkBox();
	});

	// we need this for the following uid's as well: 34,35,52,53,70,71
	// thats only for 1 domain for every domain there will be 2 more per language
});

$(function(){
	$('#nav1 li.no, #nav2 li.no').mouseenter(function () {
		$(this).find('ul').eq(0).addClass('open').show();
	});
	$('#nav1 li.no, #nav2 li.no').mouseleave(function () {
		$(this).find('ul').eq(0).removeClass('open').hide();
	});
});