// ÅÄÖ (to save it to utf8)

redirect = function(url) {
	document.location = url;	
}

var ie = false;

var version = navigator.userAgent;
if ((verOffset=version.indexOf("MSIE"))!=-1) {
	ie = true;
}

var ie6 = version.toLowerCase().indexOf( ('MSIE 6.0').toLowerCase() );

if(ie6 == -1) {
	ie6 = false;
}else{
	ie6 = true;	
}

var ie7 = version.toLowerCase().indexOf( ('MSIE 7.0').toLowerCase() );

if(ie7 == -1) {
	ie7 = false;
}else{
	ie7 = true;	
}


var startedArrow = false;

document.observe('dom:loaded', function(event) {
	
	if($('createPoll')) {
		$('createPoll').observe('click', function(event) {
			redirect('/skapa-omrostning.html');	
		});
	}
	
	// Make arrow slide down in mouseover
	if($('createPoll') && !ie7 && !ie6) {
		
		$('createPoll').observe('mouseover', function(event) {
			
			if(!startedArrow) {
				
				var queue = Effect.Queues.get('arrow');
				
				if(!queue.length || queue.length == 0) {
	
					new Effect.DropOut('pollArrow', { scope: 'arrow', queue: 'end' });
					startedArrow = true;
				}
			}
	
		});
		
		if(!ie) {
			var type = 'mouseleave';
		}else{
			var type = 'mouseout';	
		}
			
		$('createPoll').observe(type, function(event) {
			
			setTimeout('showArrow();', 500);
	
		});
	}
	
});

showArrow = function() {
	$('pollArrow').appear({ scope: 'arrow', queue: 'end', duration: 1.0 });
	startedArrow = false;
}

showIntro = function() {
	$('intro').update(fullText + ' <a href="javascript:void(0);" title="Dölj" onclick="hideIntro();">Dölj</a>');
}

hideIntro = function() {
	$('intro').update(smallText + ' <a href="javascript:void(0);" title="Läs mer" onclick="showIntro();">Läs mer!</a>');
}