$(document).ready(function(){
	// primary navigation
	$("#priNavBlock ul.priNav li").hoverClass("sfHover");

	var imgArrowCollapsed = '/img/arrowRight.gif';
	var imgArrowExpanded = '/img/arrowDown.gif';

	// side navigation
	$("#sideNav ul:not(.secLevel)[@currentPath != true]").hide()
		.parent().find('img[@src $= ' + imgArrowExpanded +']').attr('src', imgArrowCollapsed).end().end()
		.siblings('div.clickable').click(function() {
			$(this).siblings('ul.terLevel').toggle();
			$(this).siblings('ul.quatLevel').toggle();
			$(this).parent('li').toggleClass('focus');
			
			var isExpanded = ($(this).find('img[@src ^= /img/arrow]').attr('src') == imgArrowExpanded);
			$(this).find('img[@src ^= /img/arrow]').attr('src', isExpanded ? imgArrowCollapsed : imgArrowExpanded);

			return false;
	});

	$("#sideNav .secLevel li").hoverClass('secLinkHover');

        $("#countryListLink").click(function(){
		$("#countryList").slideToggle('fast');
	});		
});


$.fn.hoverClass = function(c) {
	return this.each(function(){
		$(this).hover( 
			function() {
				$(this).addClass(c);
			},
			function() { 
				$(this).removeClass(c);
			}
		);
	});
};


function newwindow2(PageURL,WinName) {
        //alert(PageURL);
        var winOptions = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=450,height=250,left=0,top=0";
        var barTitle = "Leaving_Site_" + WinName;
        WinName = window.open("",barTitle,winOptions);
        writeToPopup1(WinName, PageURL);
}
function writeToPopup1(WinName, PageURL) {
        var doc = WinName.document;
        var POP_HTML;
        POP_HTML =  "<HTML><HEAD><TITLE>Chyst&aacute;te se opustit str&aacute;nky Franklin Templeton Investments.</TITLE>\n";
        POP_HTML += "<SCRIPT>function openwindow2(PageURL,WinName) {";
        POP_HTML +=     "var winOptions = \"toolbar=yes,location=yes,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=750,height=400,left=0,top=0\";";
        POP_HTML +=     "var barTitle = \"Leaving_Site_\" + WinName;";
        POP_HTML +=     "WinName = window.open(PageURL,barTitle,winOptions);";
        POP_HTML +=     "}</SCRIPT>" ;

        POP_HTML += "<LINK rel=\"stylesheet\" type=\"text/css\" href=\"/css/styles.css\"></head>\n";
        POP_HTML += "<body bgcolor=\"#FFFFFF\" LEFTMARGIN=\"0\" TOPMARGIN=\"0\" MARGINWIDTH=\"0\" MARGINHEIGHT=\"0\">\n";
        POP_HTML += "<table width=100% cellpadding=10 cellspacing=0 border=0 style=\"margin: 10px 10px 10px 10px;\"><tr><td height=10 style=\"padding-bottom: 10px; font:12px verdana;\"><b>Chyst&aacute;te se opustit str&aacute;nky Franklin Templeton Investments.</b>\n";
        POP_HTML += "</td></tr>\n";
        POP_HTML += "<tr><td bgcolor=\"#E8F1FF\" style=\"font:11px verdana;\">\n";
        POP_HTML += "Pokud kliknete na &quot;Souhlas&iacute;m&quot; n&iacute;&#158;e, budete se opustit webov&eacute; str&aacute;nky Franklin Templeton Investments a bude sm&#283;&#345;ovat do jin&eacute; nez&aacute;visl&eacute; internetov&eacute; str&aacute;nky. Informace a slu&#158;by, kter&eacute; nab&iacute;z&iacute; tento web nebyly zkontrolov&aacute;ny a schv&aacute;leny Franklin Templeton Investments a jej&iacute; dce&#345;in&eacute; spole&#269;nosti . Provozn&iacute; podm&iacute;nky, podm&iacute;nky d&#367;v&#283;rnosti a bezpe&#269;nosti nebo pr&aacute;vn&iacute; informace mohou b&yacute;t odli&#353;n&eacute; od t&#283;ch ze str&aacute;nek Franklin Templeton Investments. Franklin Templeton Investments nen&iacute; odpov&#283;dn&aacute; za technick&eacute; probl&eacute;my nebo ot&aacute;zky kvality, kter&eacute; se m&#367;&#158;ete setkat s t&#283;mito extern&iacute;mi webov&yacute;mi str&aacute;nkami. \n";
        POP_HTML += "<br><img src=/img/s.gif width=1 height=10><br><form>\n";
        //doc.write("<input type=button value='Souhlas&iacute;m' name='ok' onclick=\"window.opener." + FrameName + ".location.href='" + PageURL + "'\;window.close();//\">\n");
        if (PageURL == "stay") {
                POP_HTML += "<input class=bodycon type=button value='Storno' name='cancel' onclick=\"window.close();\">\n";
        } else {
                //POP_HTML += "<input class=bodycon type=button value='Souhlas&iacute;m ' name='ok' onclick=\"self.location.href='" + PageURL + "'\;//\">\n";
                POP_HTML += "<input class=bodycon type=button value='Souhlas&iacute;m ' name='ok' onclick=\"openwindow2('" + PageURL + "','newWin')\;window.close();//\">\n";
                POP_HTML += "<input class=bodycon type=button value='Storno' name='cancel' onclick=\"window.close();\">\n";
        }
        POP_HTML += "</form></td></tr><tr><td style=\"padding-bottom: 10px;\">&nbsp;</td></tr></table></BODY></HTML>\n";
        doc.write(POP_HTML);
        doc.close();
        WinName.focus();
}
              
      
