/*
* saSitemap - jQuery Plugin
* Copyright (c) 2009 Chunchu Lin for Smart Agence
*
*/
;eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(5($){$.14.l=5(j){4 k={H:I,A:I,B:J K("15 L M-N","16 L M-N","O 17","O 18")};4 j=$.19(k,j);u 6.P(5(){4 f=$(6);4 g=f.7(\'1a:1b(C)\');4 h=j.B;4 i=5(){4 a=g.7(\'C\');4 b=\'\';9(j.A){b=\'<p Q="D"><a v="" m="w-n">\'+h[2]+\'</a></p>\'}q{b=\'<p Q="D"><a v="" m="">\'+h[3]+\'</a></p>\'}f.R(b);$(\'p#D a\').S(5(){9($(6).1c(\'w-n\')){$(6).T("w-n").o(h[3]);a.x("y","U");$(\'a.r-s\').z("t").7("8").o(\'[\'+h[1]+\']\')}q{$(\'a.r-s\').V("t").7("8").o(\'[\'+h[0]+\']\');a.x("y","W");$(6).T("w-n").o(h[2])}$(6).X();u E})};g.P(5(){4 b=\'\';4 c=$(6);4 d=c.7("C:F");4 e=c.7("a:F");c.z("1d");e.z("G");9(j.A){b=\'<a m="r-s" G="\'+h[0]+\'" v="Y:;"><8 m="Z">[\'+h[0]+\']</8></a> \';d.x("y","W")}q{b=\'<a m="r-s t" G="\'+h[1]+\'" v="Y:;"><8 m="Z">[\'+h[1]+\']</8></a> \';d.x("y","U")}c.R(b);c.7("a.r-s:F").S(5(){4 a=$(6);a.X();d.1e(1f,5(){9($(6).1g(\':1h\')){a.z("t").7("8").o(\'[\'+h[1]+\']\')}q{a.V("t").7("8").o(\'[\'+h[0]+\']\')}u E});u E})});9(j.H){i()}})}})(10);10(1i).1j(5($){9($("#l").1k>0){9($("1l").1m("1n")=="1o"){4 a=J K("11 12","13 12","11 n","13 n");$("#l").l({B:a})}q{$("#l").l()}}});',62,87,'||||var|function|this|find|span|if||||||||||||sitemap|class|all|text||else|open|close|off|return|href|hide|css|display|addClass|hideAll|labels|ul|toggle|false|first|title|toggleSwitch|true|new|Array|le|sous|niveau|Tout|each|id|prepend|click|toggleClass|block|removeClass|none|blur|javascript|fx|jQuery|Display|sublevel|Hide|fn|Afficher|Masquer|afficher|masquer|extend|li|has|hasClass|hasMenu|slideToggle|500|is|visible|document|ready|length|html|attr|lang|en'.split('|'),0,{}))

jQuery.noConflict();
jQuery(function($) {

    if (typeof(tplPath)=="undefined") {tplPath="img/";}

    /* - - - - - - - - - - - - - - - - - - - - - [ Gestion corps du texte article ] */
    function SmartSize(a){var b=$("#"+a);if(b.length>0){var c=12;$("#Tplus").click(function(){c=c+1;b.css("fontSize",c+"px");return false;});$("#Tmoins").click(function(){c=c-1;b.css("fontSize",c+"px");return false;})}}

    /* - - - - - - - - - - - - - - - - - - - - - [ Ajout aux favoris ] */
    function bookmarksite(){var a=document.title;var b=document.location.href;if(window.sidebar){window.sidebar.addPanel(a,b,"")}else if(window.opera&&window.print){var c=document.createElement('a');c.setAttribute('href',b);c.setAttribute('title',a);c.setAttribute('rel','sidebar');c.click()}else if(document.all){window.external.AddFavorite(b,a)}}
  
    /* - - - - - - - - - - - - - - - - - - - - - [ Roll over ] */
    function setroll(a){if(typeof a!="string"){return}var b=$("#"+a).find("ul");b.find("li a").hover(function(){if(this.id!="wikio"){roll($(this).find("img"))}},function(){if(this.id!="wikio"){roll($(this).find("img"))}})}
    function roll(o){var src,ftype,newsrc;src=o.attr("src");ftype=src.substring(src.lastIndexOf('.'),src.length);if(/_over/.test(src)){newsrc=src.replace('_over','')}else{newsrc=src.replace(ftype,'_over'+ftype)}o.attr("src",newsrc)}   

    /* - - - - - - - - - - - - - - - - - - - - - [ Colonnes identiques ] */
    function equalHeight(items){var maxHeight=0;items.each(function(){if($(this).height()>maxHeight){maxHeight=$(this).height();}});items.each(function(){$(this).css('height',maxHeight+'px');});}
	
    /* - - - - - - - - - - - - - - - - - - - - - [ Clic sur parent ] */
    function clickParent($parent, $child) {$parent.css({ cursor: 'pointer' }).click(function(e) {e.preventDefault();document.location.href = $child.attr('href');});}

    /* - - - - - - - - - - - - - - - - - - - - - [ Bloc ouvrant-fermant ] */
    (function(i){i.fn.openclose=function(g){var h={labels:new Array("Ouvrir","Fermer","Tout ouvrir","Tout fermer"),type:"openclose",opened:true,hideAll:false};var g=i.extend(h,g);return this.each(function(){var c=i(this);var d=g.labels;var e=i(this).find(".inner2:first");c.find(".inner2:first").hide();var f=i(this).find("h2, .eqH3 p:not(.date), .inner>h3");c.find(".inner2:first").hide();f.wrapInner('<span class="togglebut"><a href="javascript:;"></a></span>');f.find("a").append('<span class="label"><span class="labelinner">… '+d[0]+'<span class="skin">&nbsp;</span></span></span>');c.find(".togglebut a").click(function(){var a=i(this);var b=a.find(".label");if(c.hasClass("open")){e.fadeOut("fast",function(){b.html('<span class="labelinner">… '+d[0]+'<span class="skin">&nbsp;</span></span>');c.removeClass('open').addClass("close")})}else{e.fadeIn("fast",function(){b.html('<span class="labelinner">… '+d[1]+'<span class="skin">&nbsp;</span></span>');c.removeClass("close").addClass('open')})}});if(g.hideAll&&i(this).hasClass("hideAll")){i(this).before('<p id="toggle"><a href="javascript:;" class="hide-all">'+d[2]+'<span class="skin">&nbsp;</span></a></p>');i('#toggle').click(function(){if(i(this).hasClass("hide-all")){i(this).removeClass("hide-all").find("a").html(d[2]);i('.openclose').removeClass("close").addClass("open").find(".togglebut a").trigger("click")}else{i(this).addClass("hide-all").find("a").html(d[3]);i('.openclose').removeClass("open").addClass("close").find(".togglebut a").trigger("click")}})}})}})(jQuery);

	
	  
		
		// lightbox
		if($('.home').length>0) {
		if(document.cookie.indexOf('visited=true')==-1){
			var fifteenDays=1000*60*60*24*15;
			var expires=new Date((new Date()).valueOf()+fifteenDays);
			document.cookie="visited=true;expires="+expires.toUTCString();
			
			if($(".home").length > 0) {
					$.fn.colorbox({href:"http://www.opcadefi.fr/fileadmin/templates/internet/lightbox.html", width:"620", height:"450",  iframe:true}); 


					}
			
		}
	}
	// END

    // ToolBox
	if( $('#toolBox').length > 0 ) {
        $('#print').click(function(e) {
            e.preventDefault();
            window.print();
        });
        SmartSize('main');
	}
    // END
    
    
    // Modalbox pour choix de la convention
    if( $('#convention').length > 0 ) {
        $('#convention a').colorbox({ inline:true, overlayClose:false, escKey:false });
    }
    
    // 14/12/2011 - Modalbox dans colonne centrale pour choix de la convention
    if( $('.choixconvention').length > 0 ) {
        $('.choixconvention a').colorbox({ inline:true, overlayClose:false, escKey:false });
    }
    
    $('.locked').click(function(){
    	var block = $("#convention-choice");
    	 $('.locked').colorbox({href: block, title: '', inline:true, overlayClose:false, escKey:false});
    });
    // END

	
    // Gestion des blocks deroulants
	if( $('.openclose').length > 0 ) {
		var opened=false;
		var hideAll=false;
		if($('.openclose.open').length>0){opened=true;}
		if($('.openclose.hideAll').length>0){hideAll=true;}
		var options = new Object();
		$('.openclose').each(function(count){
			if($('html').attr('lang')=='en') {var tab = new Array("Open","Close","Display all","Hide all");options.labels=tab;}
			if(hideAll&&$(this).hasClass("hideAll")){options.hideAll=true;}
			$(this).openclose(options);
			if(opened&&$(this).hasClass('open')){$(this).removeClass('open').addClass('close').find('.togglebut a').trigger('click');} 
		});
		var url=$.url();
		var Getanchor=url.attr('anchor');
		if(Getanchor){
			$('div#'+Getanchor).find('.togglebut a').trigger('click');
			$('html,body').animate({scrollTop:$('#'+Getanchor).offset().top-30},'slow');
		}
		$('.openclose:last').append('<p class="accordeon-nav"><a href="javascript:;" id="accordeon-all">Tout ouvrir</a> / <a href="javascript:;" id="accordeon-none">Tout fermer</a></p>');
		$('#accordeon-all').click(function() {
			$('.openclose .inner2').show();
			$('.openclose').addClass('open');
			return false;
		});
		$('#accordeon-none').click(function() {
			$('.openclose .inner2').hide();
			$('.openclose').removeClass('open');
			return false;
		});
		/* declenchement */
		/*if(!opened){
			$(".openclose:first").removeClass('open').addClass("close").find(".togglebut a").trigger('click');
		}*/
	}
    // END

    
    // Gestion des onglets
    if( $('.onglets').length > 0 ) {
        $('.onglets').find('.menu-onglet a').click(function(e) {
            e.preventDefault();
            var item = $(this).attr('href');
            $(this).parents('.menu-onglet').find('.active').removeClass('active');
            $(this).parents('li').addClass('active');
            $(this).parents('.onglets').find('.box-onglet .active').removeClass('active').parents('.box-onglet').find(item).addClass('active');
        });
    }
    // END

    
    // Vide au focus les champs preremplis
    function clearInput( item ) {
        $(item).focus(function() {
            if (this.value == this.defaultValue) {
                this.value = "";
            }
        }).blur(function() {
            if (!this.value.length) {
                this.value = this.defaultValue;
            }
        });
    }
    clearInput('form .clear'); 
    // END
   
    
    // Affichage des rubriques de la colonnes gauche (page type)
	if( $('#main-nav').length > 0 ) {
        $('#main-nav').find('.cat > a').click(function(e) {
            if( $(this).parents('li').find('ul').length ) {
                e.preventDefault();
                if( $(this).parents('li').hasClass('open') == false ) {
                    $('#main-nav').find('.open ul').slideUp('normal', function() {
                        $(this).parents('.open').removeClass('open');
                    });
                    $(this).parents('li').find('ul').hide().parents('li').addClass('open').find('ul').slideDown();
                } else {
                    $(this).parents('li').find('ul').slideUp('normal', function() {
                        $(this).parents('li').removeClass('open');
                    });
                }
            }
        });
    }
    // END

    
    // Permet de cliquer sur l'integralite de l'article de la homepage
    if( $('#actualites').length > 0 ) {
        var $item = $('#actualites').find('.article');
        $item.each(function() {
            clickParent($(this), $(this).find('h3 a'));
        });        
    }
    // END    
    
    
    // Permet de cliquer sur l'integralite de l'article de la page actualites
    if( $('#articles').length>0) {
        var $item = $('#articles').find('.article');
        $item.each(function() {
            clickParent($(this), $(this).find('h2 a'));
        });        
    }
    // END
    
    
    // Carousel 3d coverflow (homepage)
    if( $('#home-carousel').length > 0 ) {
        var instanceOne = new ImageFlow();
        instanceOne.init({ 
            ImageFlowID: 'home-carousel', 
            captions: false,
            imageCursor: 'pointer',
            reflections: false, 
            reflectionP: 0.5,
            imageFocusMax: 2,
            imagesM: 1,
            imageFocusM: 1.8,
            xStep: 100,
            imagesHeight: 0.55,
            opacity: true
        });
    }
    // END
    
    
    // Gestion du changement de fond du bloc actualites (homepage)
    if( $('#actualites').length > 0 ) {
    
        var index       = 0;
        var $actualites = $('#actualites');
        var $navigation = $actualites.find('.cat .navigation');
        var $background = $actualites.find('.cat .background');
        var nbItems     = $navigation.find('a').length;
        var timer       = false;
    
        $navigation.delegate('li:not(.active) a', 'click', function(e) {
        
            e.preventDefault();
            index = $navigation.find('a').index( $(this) );
            
            // Changement de background
            $background.find('li.active').fadeOut(1000, function() {
                $(this).removeClass('active');
            });
            
            $background.find('li:eq('+index+')').fadeIn(1000, function() {
                $(this).addClass('active');
            });
            
            // Changement d'onglets
            $navigation.find('li.active').animate({ marginLeft: '-10px' }, 1000, function() {
                $(this).removeClass('active');
            }); 

            $(this).parents('li').animate({ marginLeft: '0px' }, 1000, function() {
                $(this).addClass('active');
            });
            
        });

        $actualites.bind('mouseenter focus', function() {
            clearInterval(timer);
        });
        
        // Tab leave
        $actualites.bind('mouseleave blur', function() {
            makeInterval();
        });  
        
        function makeInterval() {
        
            timer = setInterval(function(){
                index++;
                index >= nbItems ? index = 0 : index;
                $('#actualites .cat .navigation li:eq('+index+') a').click();
            }, 3000);
        
        }
        
        makeInterval();
        
    }
    // END  
    
    
    // Gestion du positionnement des listes pours les blocs particuliers et organismes (homepage)
    if( $('.home #row-a .col-b ul').length > 0 ) {
        $('.home #row-a .col-b ul').each(function(i) {
            i++;
            $(this).addClass('list-'+i).find('li').each(function(j) {
                j++;
                $(this).addClass('item-'+j);
            });
        });
    }
    // END   

    
    // Carte interactive
    if( $('#cartographie').length > 0 ) {

        $('#france').find('area').bind('mouseenter', function() {
            var region = $(this).attr('class');
            var url    = $('#maparea-hover').url();
            var path   = url.attr('host') + url.attr('directory');
            $('#maparea-hover').attr('src', path + region + '.png');
        });
        
        $('#france').find('map').bind('mouseleave', function() {
            var url    = $('#maparea-hover').url();
            var path   = url.attr('host') + url.attr('directory');
            $('#maparea-hover').attr('src', path + 'map.png');
        });
    
    }
    // END     

    
    // Slider anti-spam
    if( $('#formulaire').length > 0 ) {
        $('#slider').slider({
			value: 0.1,
			min: 0,
			max: 1,
            step: 0.01,
			slide: function( event, ui ) {
                checkValidity(ui.value);
			}
		});
        
        function checkValidity( position ) {
            if(position >= 0.9) {
                $('#formulaire').find('.ui-slider a').addClass('valid');
                $('#check-validity').val(1);
            } else {
                $('#formulaire').find('.ui-slider a').removeClass('valid');
                $('#check-validity').val(0);
            }
        }
        
		checkValidity( $('#slider').slider('value') );
        
    }
    
    if( $('#slider').length > 0 ) {
        
        $('#slider').parents('form').submit(function(e) {
               
            if( $('#check-validity').attr('value') == 0 ) {
                e.preventDefault();
                $(this).find('.ui-slider .ui-slider-handle').fadeOut(500, function() { $(this).fadeIn(1000); });
            }
        
        });
        
    }
    
    // END  

    
    // Mon classeur
    // Edité: fermé par défaut + suppression de code JS en trop
    // TODO: avec un cookie
    $('#mon-classeur').hide();
    $('#fast-nav').find('.buttons a.classeur').removeClass('active');
    var nbElem = $(".elements li").size();
    if (nbElem > 8) {
        
        // Disable link
        $('#favorites').click(function(e) {
            e.preventDefault();
            alert('Votre classeur est plein, veuillez supprimer un lien via l\'icône "-" pour pouvoir en ajouter un nouveau');
            return false;
        });
    }
    
    if( $('#mon-classeur').length > 0 ) {
    
    	// Suppression d'un item
        /*$('#mon-classeur').find('.elements .delete a').click(function(e) {
            e.preventDefault();
            $(this).parents('li').fadeOut(1000, function() {
                $(this).remove();
                
                // Plus aucun item
                if( $('#mon-classeur').find('.elements li').length == false ) {
                    $('#mon-classeur').find('.elements').remove().end().find('.empty.inactive').fadeIn(1000, function() {
                        $(this).removeClass('inactive');
                    });
                }
                
                // Mise à jour du cookie
            });
        });*/
        
        // Close
        $('#mon-classeur').find('.close').click(function(e) {
            e.preventDefault();
            $('#mon-classeur').slideUp(1000, function() {
                $('#fast-nav').find('.buttons a.classeur.active').removeClass('active');
            });
        });     
        
        // Open
        $('#fast-nav').find('.buttons a.classeur').click(function(e) {
            e.preventDefault();
            $(this).addClass('active');
            $('#mon-classeur').slideDown(1000);
        });
        
		// Open on bookmarking
		var url=$.url();
		var bkmrk=url.param('tx_mnpagebookmark_pi1[submitMode]');
		if(bkmrk=='add'){
			$('#fast-nav').find('.buttons a.classeur').addClass('active');
            $('#mon-classeur').slideDown(1000);
		}
		
    }
    // END    
    
    
    // Centrage vertical des sous elements du menu pour IE7
    if( $('.ie7 #header-nav .sub-category').length > 0 ) {
        $('#header-nav').find('.sub-category a').wrapInner('<table><tr><td></td></tr></table>');
        $('#header-nav').find('.sub-category a td').click(function(e) {
            e.preventDefault();
            document.location.href = $(this).parents('a').attr('href');
        });
    }
    // END  

    
    // Gestion des listes paires-impaires pour IE
    if( $('.oldie #criteres-results ul').length > 0 ) {
        $('#criteres-results ul li:even').css('background-color', '#f0f4f6');
    }
    // END
    
    /* Onglets, premier ouvert */
    $('.menu-onglet li:first-child').addClass('active');
	$('.box-onglet div:first-child').addClass('active');
	
	/* Catalogue de formations 
	 *
	 */
	
	//var old_city = $("#tx_sac2pactioncollectives_pi1\\.old_ville");
	var rubrique = $("input[name='tx_sac2pactioncollectives_pi1[old_rubrique]']");
	var stage = $("input[name='tx_sac2pactioncollectives_pi1[old_stage]']");
	var region = $("input[name='tx_sac2pactioncollectives_pi1[old_region]']");
	var ville = $("input[name='tx_sac2pactioncollectives_pi1[old_ville]']");
	var intRegex = /^\d+$/; /* Nombre entier */
	
	/* Retour depuis la page liste > affichage des critères déjà sélectionnés */
	var str = stage.val();
	if(intRegex.test(str)) {
		
		$('#second').show();
		var rubrique_principale = $("#tx_sac2pactioncollectives_pi1\\.rubrique_principale");
		
		/* Recherche des sous thématiques */
		/* Requête Ajax*/
		$.ajax({			
			type: "GET",
			url: "?eID=sa_c2p_actioncollectives",
			contentType: "application/json; charset=utf-8",
			data: "rubrique_principale=" + rubrique_principale.val(),
			dataType: "json",
			
			success: function(result) {
			
				if( result.success == "true" ) {
					$('#second').show();
					
					$("#tx_sac2pactioncollectives_pi1\\.rubrique_stage").empty(); // empty
					
					$("#tx_sac2pactioncollectives_pi1\\.rubrique_stage").append('<option value="">Toutes les sous thématiques</option>');
					$.each(result.items, function(key,item) {
						if(key == stage.val()) {
							$("#tx_sac2pactioncollectives_pi1\\.rubrique_stage").append('<option value="' + key + '" selected="selected">' + item + '</option>');
						} else {
							$("#tx_sac2pactioncollectives_pi1\\.rubrique_stage").append('<option value="' + key + '">' + item + '</option>');
						}
						
					});
				}
			},
			error: function() {
				//alert('error');	
			}
		}); /* Fin Ajax */
		
	}
	
	var str = ville.val();
	if(intRegex.test(str)) {
		$('#ville').show();
		var region = $("#tx_sac2pactioncollectives_pi1\\.region");
		
		/* Requête Ajax pour récupérer la liste des villes */
		$.ajax({			
			type: "GET",
			url: "?eID=sa_c2p_actioncollectives",
			contentType: "application/json; charset=utf-8",
			data: "region=" + region.val(),
			dataType: "json",
			
			success: function(result) {
				
				if( result.success == "true" ) {
					$('#ville').show();
					$("#tx_sac2pactioncollectives_pi1\\.ville").empty(); // empty
					
					$("#tx_sac2pactioncollectives_pi1\\.ville").append('<option value="">Toutes les villes</option>');
					$.each(result.items, function(key,item) {
						if(key==ville.val()) {
							$("#tx_sac2pactioncollectives_pi1\\.ville").append('<option value="' + key + '" selected="selected">' + item + '</option>');
						} else {
							$("#tx_sac2pactioncollectives_pi1\\.ville").append('<option value="' + key + '">' + item + '</option>');
						}
						
					});
				}
			},
			error: function() {
				//alert('error');	
			}
		}); /* Fin Ajax */
		
	}
	
	$("#tx_sac2pactioncollectives_pi1\\.rubrique_principale").change(function () {
		var rubrique_principale = $("#tx_sac2pactioncollectives_pi1\\.rubrique_principale");
		
		/* Aucun rubrique sélectionné : on cache le second select */
		if(rubrique_principale.val() == 0) {
			$('#second').hide();
		}
		
		if(rubrique_principale.val() != 0) {
			$('#second').show();
		}
		
		/* Requête Ajax*/
		$.ajax({			
			type: "GET",
			url: "?eID=sa_c2p_actioncollectives",
			contentType: "application/json; charset=utf-8",
			data: "rubrique_principale=" + rubrique_principale.val(),
			dataType: "json",
			
			success: function(result) {
				
				if( result.success == "true" ) {
					$('#second').show();
					$("#tx_sac2pactioncollectives_pi1\\.rubrique_stage").empty(); // empty
					
					$("#tx_sac2pactioncollectives_pi1\\.rubrique_stage").append('<option value="">Toutes les sous thématiques</option>');
					$.each(result.items, function(key,item) {
						$("#tx_sac2pactioncollectives_pi1\\.rubrique_stage").append('<option value="' + key + '">' + item + '</option>');
					});
				}
			},
			error: function() {
				//alert('error');	
			}
		}); /* Fin Ajax */
					
	});
	
	/* Choix de la région */
	$("#tx_sac2pactioncollectives_pi1\\.region").change(function () {
		var region = $("#tx_sac2pactioncollectives_pi1\\.region");
		
		/* Aucun rubrique sélectionné : on cache la ville */
		if(region.val() == 0) {
			$('#ville').hide();
		}
		
		if(region.val() != 0) {
			$('#ville').show();
		}
		
		/* Requête Ajax*/
		$.ajax({			
			type: "GET",
			url: "?eID=sa_c2p_actioncollectives",
			contentType: "application/json; charset=utf-8",
			data: "region=" + region.val(),
			dataType: "json",
			
			success: function(result) {
				
				if( result.success == "true" ) {
					$('#ville').show();
					$("#tx_sac2pactioncollectives_pi1\\.ville").empty(); // empty
					
					$("#tx_sac2pactioncollectives_pi1\\.ville").append('<option value="">Toutes les villes</option>');
					$.each(result.items, function(key,item) {
						$("#tx_sac2pactioncollectives_pi1\\.ville").append('<option value="' + key + '">' + item + '</option>');
					});
				}
			},
			error: function() {
				//alert('error');	
			}
		}); /* Fin Ajax */
		
	});
}); /* jQuery END */

var browserName=navigator.appName;var browserVer=parseInt(navigator.appVersion);var version="";var msie4=(browserName=="Microsoft Internet Explorer"&&browserVer>=4);if((browserName=="Netscape"&&browserVer>=3)||msie4||browserName=="Konqueror"||browserName=="Opera"){version="n3";}else{version="n2";}
function blurLink(theObject){if(msie4){theObject.blur();}}
function decryptCharcode(n,start,end,offset){n=n+offset;if(offset>0&&n>end){n=start+(n-end-1);}else if(offset<0&&n<start){n=end-(start-n-1);}
return String.fromCharCode(n);}
function decryptString(enc,offset){var dec="";var len=enc.length;for(var i=0;i<len;i++){var n=enc.charCodeAt(i);if(n>=0x2B&&n<=0x3A){dec+=decryptCharcode(n,0x2B,0x3A,offset);}else if(n>=0x40&&n<=0x5A){dec+=decryptCharcode(n,0x40,0x5A,offset);}else if(n>=0x61&&n<=0x7A){dec+=decryptCharcode(n,0x61,0x7A,offset);}else{dec+=enc.charAt(i);}}
return dec;}
function linkTo_UnCryptMailto(s){location.href=decryptString(s,-1);}
