function popUppi(URL) {
	eval("window.open(URL,'','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=1,height=1,left=0,top=0');");
}
function popUppi2(URL) {
	eval("window.open(URL,'','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=1,height=1,left=0,top=0');");
}
function popUppi3(URL) {
	eval("window.open(URL,'','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=500,left=0,top=0');");
}
function popUp(URL) {	eval("window.open(URL,'','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=350,height=180,left=0,top=0');");
}
function tpopUp(URL) {
var wiinle = (screen.width - 704) / 2;
var wiinUp = (screen.height - 549) / 2;
eval("window.open(URL,'','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=704,height=449,left='+wiinle+',top='+wiinUp);");
}
function popUps(URL,width,height) {	eval("window.open(URL,'','toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width='+width+',height='+height+',left=0,top=0');");
}

function vaheta_hover(tr, todo) {
	if (todo == 'over')
	{
		tr.getElementsByTagName('td')[0].getElementsByTagName('img')[0].src='img_sys/menu1_vasak_hover.jpg';
		tr.getElementsByTagName('td')[2].getElementsByTagName('img')[0].src='img_sys/menu1_parem_hover.jpg';
		tr.getElementsByTagName('td')[1].className='linkbar_bg_hover';		
	} else {
		tr.getElementsByTagName('td')[0].getElementsByTagName('img')[0].src='img_sys/menu1_vasak.jpg';
		tr.getElementsByTagName('td')[2].getElementsByTagName('img')[0].src='img_sys/menu1_parem.jpg';
		tr.getElementsByTagName('td')[1].className='linkbar_bg';
	}
}

// nurgast rulluv banner

$(function(){
	fix_flash();
//	setTimeout("$('#pageflip').slideDown('normal');", 1000);
	$("#pageflip").hover(function() {  //On hover...
	$("#pageflip img , .msg_block").stop()
		.animate({ //Animate and expand the image and the msg_block (Width + height)
			width: '182px',
			height: '404px'
		}, 500);
	} , function() {
	$("#pageflip img").stop() //On hover out, go back to original size 50x52
		.animate({
			width: '182px',
			height: '56px'
		}, 220);
	$(".msg_block").stop() //On hover out, go back to original size 50x50
		.animate({
			width: '182px',
			height: '56px'
		}, 200); //Note this one retracts a bit faster (to prevent glitching in IE)
});

});

function fix_flash() {
    // loop through every embed tag on the site
    var embeds = document.getElementsByTagName('embed');
    for (i = 0; i < embeds.length; i++) {
        embed = embeds[i];
        var new_embed;
        // everything but Firefox & Konqueror
        if (embed.outerHTML) {
            var html = embed.outerHTML;
            // replace an existing wmode parameter
            if (html.match(/wmode\s*=\s*('|")[a-zA-Z]+('|")/i))
                new_embed = html.replace(/wmode\s*=\s*('|")window('|")/i, "wmode='opaque'");
            // add a new wmode parameter
            else
                new_embed = html.replace(/<embed\s/i, "<embed wmode='opaque' ");
            // replace the old embed object with the fixed version
            embed.insertAdjacentHTML('beforeBegin', new_embed);
            embed.parentNode.removeChild(embed);
        } else {
            // cloneNode is buggy in some versions of Safari & Opera, but works fine in FF
            new_embed = embed.cloneNode(true);
            if (!new_embed.getAttribute('wmode') || new_embed.getAttribute('wmode').toLowerCase() == 'window')
                new_embed.setAttribute('wmode', 'opaque');
            embed.parentNode.replaceChild(new_embed, embed);
        }
    }
    // loop through every object tag on the site
    var objects = document.getElementsByTagName('object');
    for (i = 0; i < objects.length; i++) {
        object = objects[i];
        var new_object;
        // object is an IE specific tag so we can use outerHTML here
        if (object.outerHTML) {
            var html = object.outerHTML;
            // replace an existing wmode parameter
            if (html.match(/<param\s+name\s*=\s*('|")wmode('|")\s+value\s*=\s*('|")[a-zA-Z]+('|")\s*\/?\>/i))
                new_object = html.replace(/<param\s+name\s*=\s*('|")wmode('|")\s+value\s*=\s*('|")window('|")\s*\/?\>/i, "<param name='wmode' value='transparent' />");
            // add a new wmode parameter
            else
                new_object = html.replace(/<\/object\>/i, "<param name='wmode' value='transparent' />\n</object>");
            // loop through each of the param tags
            var children = object.childNodes;
            for (j = 0; j < children.length; j++) {
                try {
                    if (children[j] != null) {
                        var theName = children[j].getAttribute('name');
                        if (theName != null && theName.match(/flashvars/i)) {
                            new_object = new_object.replace(/<param\s+name\s*=\s*('|")flashvars('|")\s+value\s*=\s*('|")[^'"]*('|")\s*\/?\>/i, "<param name='flashvars' value='" + children[j].getAttribute('value') + "' />");
                        }
                    }
                }
                catch (err) {
                }
            }
            // replace the old embed object with the fixed versiony
            object.insertAdjacentHTML('beforeBegin', new_object);
            object.parentNode.removeChild(object);
        }
    }
}
