function str2url(a,b,c){a=a.toUpperCase();a=a.toLowerCase();a=a.replace(/[\u0105\u0104\u00E0\u00E1\u00E2\u00E3\u00E4\u00E5]/g,"a");a=a.replace(/[\u00E7\u010D\u0107\u0106]/g,"c");a=a.replace(/[\u010F]/g,"d");a=a.replace(/[\u00E8\u00E9\u00EA\u00EB\u011B\u0119\u0118]/g,"e");a=a.replace(/[\u00EC\u00ED\u00EE\u00EF]/g,"i");a=a.replace(/[\u0142\u0141]/g,"l");a=a.replace(/[\u00F1\u0148]/g,"n");a=a.replace(/[\u00F2\u00F3\u00F4\u00F5\u00F6\u00F8\u00D3]/g,"o");a=a.replace(/[\u0159]/g,"r");a=a.replace(/[\u015B\u015A\u0161]/g,"s");a=a.replace(/[\u00DF]/g,"ss");a=a.replace(/[\u0165]/g,"t");a=a.replace(/[\u00F9\u00FA\u00FB\u00FC\u016F]/g,"u");a=a.replace(/[\u00FD\u00FF]/g,"y");a=a.replace(/[\u017C\u017A\u017B\u0179\u017E]/g,"z");a=a.replace(/[\u00E6]/g,"ae");a=a.replace(/[\u0153]/g,"oe");a=a.replace(/[\u013E\u013A]/g,"l");a=a.replace(/[\u0155]/g,"r");a=a.replace(/[^a-z0-9\s\'\:\/\[\]-]/g,"");a=a.replace(/[\s\'\:\/\[\]-]+/g," ");a=a.replace(/[ ]/g,"-");a=a.replace(/[\/]/g,"-");if(c==1){var d=a.charAt(0);a=d.toUpperCase()+a.slice(1)}return a}function initToolboxEvents(){var a=$("a.toolbox-button");$("div.toolbox-temp").remove();$("div.toolbox").parent("div").css({position:"relative"});$(".toolbox-tool").hover(function(){$(this).addClass("ui-state-highlight");$(this).find("input").addClass("ui-state-highlight")},function(){$(this).removeClass("ui-state-highlight");$(this).find("input").removeClass("ui-state-highlight")});a.hover(function(){$(this).css({"z-index":3});$(this).next("div.toolbox").trigger("showToolbox",[$(this)])},function(){$(this).css({"z-index":1})});$("div.toolbox").bind("showToolbox",function(a,b){b.parent().addClass("toolbox-active-content");var c=$(this).attr("id")+"-copy";var d;if($("#"+c).length==0){d=$(this).clone(true).attr("id",c).addClass("toolbox-temp");$("body").append(d);d.bind("mouseleave",function(){$(".toolbox-active-content").removeClass("toolbox-active-content");$(this).animate({opacity:0},0,function(){$(this).css({"z-index":-1e4}).hide()})})}else{d=$("#"+c)}d.css({opacity:1,top:b.offset().top-2,left:b.offset().left-d.width()+22,width:d.width(),"z-index":1e4}).show()});$(document).unbind("scroll");$(document).scroll(function(){var b=$(this).scrollTop();a.each(function(){var a=$(this).parent();if(a.offset().top<b+30&&b<a.offset().top+a.height()-30){$(this).css({position:"fixed",top:30,left:$(this).offset().left})}else{$(this).css({position:"absolute",top:1,right:1,left:"auto"})}})})}function vveLoadImage(a,b){var c=document.createElement("img");c.onload=function(){if($.isFunction(b)){b.call(c)}};c.src=a}function hideLoadBox(){$("#loadingBox").fadeOut(500,function(){$("#loadingBox").remove()})}function showLoadBox(a,b){if(typeof b=="undefined"){b=5e3}var c=$(a);var d=$(a).parent("div,p");var e=$('<div id="loadingBox"><div class="loader-w"><span class="loader-text">loading...</span></div>').css({position:"absolute",top:0,left:0,opacity:0,width:c.width()+parseInt(d.css("padding-left"))+parseInt(d.css("padding-right"))+parseInt(c.css("margin-left"))+parseInt(c.css("margin-right")),height:c.height()+parseInt(d.css("padding-top"))+parseInt(d.css("padding-bottom"))+parseInt(c.css("margin-top"))+parseInt(c.css("margin-bottom"))});d.css("position","relative").prepend(e.hide());d.children("#loadingBox").fadeTo(500,1);setTimeout("hideLoadBox()",b)}function errMsg(a,b){if(a==null)return;if(typeof b=="undefined")b=true;if(b==true){$("#errMessages").html(null)}$("#errMessages").prepend("<p>"+a+"</p>").show()}function clearErrMsg(){$("#errMessages").html(null).hide()}function clearInfoMsg(){$("#infoMessages").html(null).hide()}function infoMsg(a,b){if(a==null)return;if(typeof b=="undefined")b=true;if(b==true){clearInfoMsg()}$("#infoMessages").prepend("<p>"+a+"</p>").show()}function vveShowMessages(a){clearInfoMsg();if(typeof a.infomsg=="object"){for(var b=0;b<a.infomsg.length;b++){infoMsg(a.infomsg[b],false)}}else if(typeof a.infomsg=="string"){infoMsg(a.infomsg)}clearErrMsg();if(typeof a.errmsg=="object"){for(var c=0;c<a.errmsg.length;c++){errMsg(a.errmsg[c],false)}}else if(typeof a.infomsg=="string"){errMsg(a.errmsg)}}$(document).ready(function(){$(".form-link-lang-container a.form-link-lang").live("click",function(a,b){if(typeof b=="undefined")b=true;var c=this.lang;$(this).parent("p").find("a").removeClass("form-link-lang-sel");$(this).addClass("form-link-lang-sel");var d=$(this).closest("*:has(p[lang])");$("p[lang]",d).hide();var e=$('p[lang="'+c+'"]',d).show();if(b){e.find("input,textarea,select").focus()}d=$(this).closest("*:has(label[lang])")[0];$("label[lang]",d).hide();$('label[lang="'+c+'"]',d).show();return false});$(".form-link-lang-container a:first-child").trigger("click",[false]);initToolboxEvents();$("a.link-external").live("click",function(){window.open(this.href);return false});$("a.toolbox-changelang-button").live("click",function(){showLoadBox(".main-content");$(".main-content").load(this.href,function(){hideLoadBox();initToolboxEvents();$(document).scroll()});return false})})
