$(function(){
	$("div.news_teaser img").css({opacity:0.5});
	$("div.menu ul li:not(.active)").mouseover(function(){
		$(this).addClass("mouse_hover");
	}).mouseout(function(){
		$(this).removeClass("mouse_hover");
	});
	$("div.news_teaser").mouseover(function(){
		$(this).addClass("m_over");
		$("img",this).css({opacity:1});
	}).mouseout(function(){
		$(this).removeClass("m_over");
		$("img",this).css({opacity:0.5},0);
	});
	var cn_h = $(".cn .pad").height();
	if (cn_h < 350){
		$(".news_shortcuts").addClass('fixed')
	}
});
function makePassword()
{
	var field = document.getElementById('passwdtxt');
	field.style.display="none";
	var newf = document.getElementById('password');
	newf.style.display="";
	field.value = '';
	newf.focus();
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}

function changeType(id)
{
	var elem = document.getElementById(id);
	if(elem.className=='active')
	{
		elem.className='';
	}
	else
	{
		elem.className='active';
	}
}
function checkCitsVariants(el2)
{
	if(el2.id=='a_0')
	{
		document.getElementById('a_0').checked=true;	
	}
	else
	{
		document.getElementById('a_00').value='';
	}
}
function addValueTrack(viens,divi)
{
	document.getElementById(viens).value=divi;
}
function wo(url, imgw, imgh, scrol, tolbar) {
    var W = 100;
    var H = 100;
    var res = "no";
    var poss = "";
    var scr = "no";
    var tlb = "no";
    if (imgw) {
        W = imgw;
    }
    if (imgh) {
        H = imgh;
    }
    if (scrol) {
        scr = "yes";
    }
    if (tolbar) {
        tlb = "yes";
    }
    x = (window.screen.width - W) / 2;
    y = (window.screen.height - H) / 2 - 150;
    poss = ",left=" + x + ", top=" + y;
    var w = window.open(url, "_blank", "toolbar=no, location=no, directories=no, status=no, menubar=" + tlb + ", scrollbars=" + scr + ", resizable=" + res + ",width=" + W + ",height=" + H + poss);
}