/*
son of suckerfish menu script from:
http://www.htmldog.com/articles/suckerfish/dropdowns/
 */
 
 sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
			this.style.zIndex=200; //this line added to force flyout to be above relatively positioned stuff in IE
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

/*              open_window (link, width, height, title) */
function open_window(link,w,h, title) {

	var winl = (screen.width - w) / 2;
    var wint = (screen.height - h) / 2;
    if (title=="") { title = "ilm.pri.ee"; }
	
	if (window.newWin && !window.newWin.closed) {
		window.newWin.resizeTo(w,h);
	}
	var win = "width="+w+",height="+h+",top="+wint+",left="+winl+"menubar=no,location=no,resizable=yes,scrollbars=yes";
	newWin = window.open(link,title,win);

	newWin.focus();
		
}

function refreshParent() {
	window.opener.location.href = window.opener.location.href;
	if (window.opener.progressWindow)	{
		window.opener.progressWindow.close()
	}
	window.close();
}
$(document).ready(function() {
	  var newsoption = {
		  firstname: "mynews",
		  secondname: "showhere",
		  thirdname:"news_display",
		  fourthname:"news_button",
		  playingtitle:"Mitmes:",
		  newsspeed:'7000',
		  effectis:'0',
		  mouseover:true,
		  newscountname:"test",
		  disablenewscount:false,
		  imagedir:'/pildid/jquery_pildid/'
		}
		$.init_news(newsoption);
		$(".accordion").show().accordion({
			header:'h2',
			active:'#accordion_open',
			selectedClass:'current',
			autoHeight: false
		});
		$(".clue_title").cluetip({
			splitTitle: "|",
			width:350,
			arrows:true,
			cluetipClass: "jtip",
			dropShadow:false,
			fx: {
				open:"fadeIn",
				openSpeed:300
			}
		});
		var myURL = 'http://' + location.hostname;
		$('a[href^=http://]').not('a[href^='+myURL+']' && '.no_new_win' ).attr('target', '_blank');
});


