window.addEvent('domready',function(){
	new INTOswfHeader();
	var INTOnavigationClass = new INTOnavigation();
	var INTOlinksClass = new INTOlinks();
	var INTOvideoClass = new INTOvideo();
	new INTOlanguageSwitch();
	new INTOwindowCheck();
	new INTOfixTables();
	var INTOgalleryClass = new INTOgallery();
	new INTOsidebarBox();
	new INTOappForm();
});


/*
	INTO Window-Check
	Checkt die Browserbreite & passt die Sterne an 
													*/
	
var INTOwindowCheck = new Class({
	options:{
		bodyMinWidth		:	1000,
		documentMinWidth	:	1250
	},
	initialize	:	function(){
		if(Browser.Engine.trident == true && Browser.Engine.version ==4){
			// ie6
		}
		else{
			INTOwindowCheckClass = this;
			this.checkWindow();
			window.addEvent('resize',this.checkWindow);
		}
	},
	checkWindow	:	function(){
		if(window.getSize().x < INTOwindowCheckClass.options.documentMinWidth && $$('body')[0].getSize().x >= INTOwindowCheckClass.options.bodyMinWidth){
			$$('html')[0].setStyles({'overflow-x':'hidden','width':window.getSize().x});
			if($('stars_01')) $('stars_01').setStyle('display','block');
			if($('stars_02')) $('stars_02').setStyle('display','block');
		}
		else if($$('body')[0].getSize().x < INTOwindowCheckClass.options.bodyMinWidth){
			$$('html')[0].setStyles({'overflow':'auto','width':INTOwindowCheckClass.options.bodyMinWidth});
			if($('stars_01')) $('stars_01').setStyle('display','none');
			if($('stars_02')) $('stars_02').setStyle('display','none');
		}
		else{
			$$('html')[0].setStyles({'overflow':'auto','width':'auto'});
			if($('stars_01')) $('stars_01').setStyle('display','block');
			if($('stars_02')) $('stars_02').setStyle('display','block');
		}
	}
});
	

/*
	INTO Swf-Header
	Abfrage über eID ob eine SWF-Datei zum Einbinden angegeben wurde
																		*/
	
var INTOswfHeader = new Class({
	options:{
		width	:	800,
		height	:	125
	},
	initialize	:	function(){
		INTOswfHeaderClass = this;
		var class_name = $$('#main')[0].getAttribute('className');
		if(!class_name) class_name = $$('#main')[0].getAttribute('class');
		var page_uid = class_name.split('_');
		new Request.JSON({url: window.location.href, onSuccess: function(swf_url){
			if(swf_url){
				$('head').empty();
				new Swiff(swf_url,{
					id		:	'swf_header',
					width	:	INTOswfHeaderClass.options.width,
					height	:	INTOswfHeaderClass.options.height
				}).inject($('head'));
			}
		}}).get({'eID' : 'swf_header', 'puid' : page_uid[1]});
	}
});



/*	
	INTO Navigation	
	(Auf- und Zuklappen des ersten 
	 Navigationspunktes in der zweiten Ebene) 	*/
	
var INTOnavigation = new Class({
	options:{
		speed	:	500
	},	
	initialize	:	function(){
		INTOnavigationClass = this;
		$each($$('#subnavigation .active'), function(item){
			var no_animation = false;
			if($chk(item.getNext('ol'))){							
				var ref = document.referrer.split('/');								
				$each(item.getNext('ol').getChildren('li'),function(item){
					var tmp = item.getChildren('a')[0].getAttribute('href').split('/');
					if(ref[ref.length-1] == tmp[tmp.length-1]){
						no_animation = true;	
					}
				});
			}
			
			if($chk(item.getNext()) && $chk(item.getNext().getNext()) && no_animation == false){
				var next_tag = item.getNext().getNext();
				if(next_tag.tagName == 'OL'){
					var ol_height = next_tag.getSize().y;
					next_tag.setStyles({
						'height'	:	0,
						'overflow'	:	'hidden'
					});
					next_tag.set('morph',{
						duration:INTOnavigationClass.options.speed
					}).morph({
						'height'	:	ol_height
					});
				}
			 }
		});
		
		$$('#subnavigation a,#navigation a').addEvent('click',function(item){
			if(this.hasClass('active') != true){
				var parent_ol = this.getParent('li').getParent('ol');
				if(parent_ol.hasClass('submenu') != true){
					if($chk($$('#subnavigation .active')[0])){
						if(this != $$('#subnavigation .active')[0].getParent('ol').getPrevious('a')){
							$$('#subnavigation .submenu').set('morph',{duration:INTOnavigationClass.options.speed}).morph({'height':0});
						}
					}
				}
			}
		});
		
		if($$('#subnavigation ol li').length == 1){
			new Element('li',{'class':'first'}).inject($$('#subnavigation ol')[0],'top');
		}
		this.addSidebarStars();
	},
	addSidebarStars	:	function(){
		if($$('#sidebar .box')[0]){
			var box_div = $$('#sidebar .box')[0];
			var star_div = new Element('div', { 'id' : 'stars_02' }).inject(box_div,'before');
			star_div.position({relativeTo	:	box_div, position	:	'bottomRight'	,	edge	:	'bottomRight'});
			star_div.setStyles({'margin-left':120, 'margin-top':10});
		}
	}
});


/* 	
	INTO Links
	(Links öffnen im neuen Fenster, 
	 W3C-standardkonform)				*/

var INTOlinks = new Class({
	initialize	:	function(){
		$each($$('#main a'),function(item){
			if(item.hasClass('internal-link-new-window') == true ||
			   item.hasClass('external-link-new-window') == true){
				item.addEvent('click',function(e){
					if(item.getParent('div').hasClass('video') != true){
						window.open(item.getAttribute('href'));
					}
					e.stop();
				});
			}
		});
		$each($$('#external_links a'),function(item){
			item.addEvent('click',function(e){
				window.open(item.getAttribute('href'));
				e.stop();
			});
		});
	}
});	


/*	
	INTO Videolinks	
	(FCE für die Youtube-Einbindung) 	*/
	
var INTOvideo = new Class({
	options:{
		default_width	:	500,
		default_height	:	350,
		duration		:	450
	},
	initialize	:	function(){
		INTOvideoClass = this;
		
		// Handling für im Content eingebundene Videos
		$each($$('#content .video .external-link-new-window'),function(item){
			if(item.getParent('div').getParent('div').getParent('div').hasClass('two_cols') != true){
				var url = INTOvideoClass.get_url(item.getAttribute('href'));
				if(url){
					var item_width = item.getParent('div').getSize().x;
					var video_height = item_width * 0.75;
					new Swiff(url,{
							  width		:	item_width,
							  height	:	video_height,
							  container	:	item
					});
				}
			}
		});
		
		// Handling für Videos in der Sidebar
		$each($$('#sidebar .video .external-link-new-window,#content div .video .external-link-new-window'),function(item){
			var preview_img = INTOvideoClass.get_image(item.getAttribute('href'));
			INTOvideoClass.url = INTOvideoClass.get_url(item.getAttribute('href'));
			INTOvideoClass.parent = item.getParent('div');
			if(preview_img){
				INTOvideoClass.insert_video(preview_img,'youtube',item.getParent('div').getChildren('h2')[0].get('html'));
			}
		});

	},
	
	get_url	:	function(url){
		if(url.test("youtube") == true){
			var url = 'http://www.youtube.com/v/'+url.replace(/^[^v]+v.(.{11}).*/,"$1");
		}
		else if(url.test("vimeo") == true){
			vimeo_id = url.replace('http://vimeo.com/','');
			vimeo_id = vimeo_id.replace('http://www.vimeo.com/','');
			var url = 'http://www.vimeo.com/moogaloop.swf?clip_id='+vimeo_id+'&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1';
		}
		return url;
	},
	
	get_image	:	function(url){
		if(url.test("youtube") == true){
			var url = 'http://img.youtube.com/vi/'+url.replace(/^[^v]+v.(.{11}).*/,"$1")+'/2.jpg';
			return url;
		}
		else{
			vimeo_id = url.replace('http://vimeo.com/','');
			vimeo_id = vimeo_id.replace('http://www.vimeo.com/','');
			var embed_vimeo = 'http://vimeo.com/api/v2/video/'+vimeo_id+'.json?callback=INTOvideoClass.insert_video';
			new Element('script',{
				'src'	:	embed_vimeo,
				'type'	:	'text/javascript'
			}).inject($$('head')[0],'bottom');
		}
	},
	
	close_base_div	:	function(){
		if($('single_video')){
			$('single_video').dispose();
		}
		if($('base')){
			$('base').set('morph',{
				 duration:INTOvideoClass.options.duration,
				 onComplete	:	function(){
					 $('base').dispose();
				}
			})
			.morph({'opacity':0});	
		}
	},
	
	insert_video	:	function(response,mode,title){
		if(mode == 'youtube'){
			var preview_img = response;	
		}
		else{
			var preview_img = response[0]['thumbnail_medium'];				
		}
		var prevImg = new Element('img',{
			src			:	preview_img,
			'class'		:	'preview_img'
		})
		.replaces(INTOvideoClass.parent.getChildren('a')[0])
		.addEvent('click',function(e){
			var window_height = $$('html')[0].offsetHeight;
			if(window_height < document.body.scrollHeight) window_height = document.body.scrollHeight;
			new Element('div',{
				'id'	:	'base'})
			.inject($$('body')[0],'top')
			.setStyles({'opacity':0,'height':window_height-5})
			.set('morph',{
				duration	:	INTOvideoClass.options.duration,
				onComplete	:	function(){
					
					new Element('div',{
						id		:	'single_video'
					})
					.inject($$('body')[0])
					.setStyle('min-height',INTOvideoClass.options.default_height);
							
							
					var html = e.target.retrieve('title');
					new Element('h2',{
						'html'	:	html
					})
					.inject($('single_video'));
							
					new Element('a',{
						'html'	:	'X'
					}).inject($$('#single_video h2')[0])
					.addEvent('click',INTOvideoClass.close_base_div);
							
					new Swiff(e.target.retrieve('url'),{
						width	:	INTOvideoClass.options.default_width,
						height	:	INTOvideoClass.options.default_height
					}).inject($('single_video'));
							
					$('single_video').position();
					window.addEvent('resize',function(){
						if($('single_video')) $('single_video').position();
					});
					window.addEvent('scroll',function(){
						if($('single_video')) $('single_video').position();
					});
			}})
			.morph({'opacity':0.9})
			.addEvent('click',INTOvideoClass.close_base_div);
		}).setStyle('cursor','pointer');
		prevImg.store('url',INTOvideoClass.url);
		prevImg.store('title',title);
	}
});




/*
		INTO LanguageSwitch
										*/
var INTOlanguageSwitch = new Class({
	options:{
		duration	:	200
	},
	initialize	:	function(){
		var INTOlanguageSwitchClass = this;
		if($('language_switch')){
			$('language_switch').addClass('js');
			$each($$('#language_switch li'),function(item){
				if(item.hasClass('active')  != true){
					item.setStyles({'opacity':0,'display':'none'});	
				}
				else{
					item.addEvent('click',function(){
						$$('#language_switch li').setStyle('display','block');
						$$('#language_switch li')
						.set('morph',{duration:INTOlanguageSwitchClass.options.duration})
						.morph({'opacity':1});
					});
				}
			});
			$('language_switch').addEvent('mouseleave',function(){
				$each($$('#language_switch li'),function(item){
					if(item.hasClass('active')  != true){
						item
						.set('morph',{duration:INTOlanguageSwitchClass.options.duration,onComplete:function(){
							$$('#language_switch li').setStyle('display','none');
							$$('#language_switch li')[0].setStyle('display','block');
						}})
						.morph({'opacity':0});
					}
				});
			}.bind(this));
		}
	}

});



/*
		INTO Fix Tables
								*/
								
var INTOfixTables = new Class({
	initialize	:	function(){
		$each($$('#content .contenttable tr'),function(item){
			if(item.hasClass('powermail_all') != true){
				$each(item.getChildren('td')[0].getChildren('p'),function(item){
					if(! item.getChildren('a')[0]){
						var innerHTML = item.get('html').replace(/ /g,'&nbsp;');
						item.set('html',innerHTML);
					}
				});
			}
		});
	}
});




/*	
	INTO Gallery
	"Lightbox" für die Galerie, Steuerung via Tastatur	 	*/
	
var INTOgallery = new Class({
	options:{
		duration				:	500,
		duration_clickThrough	:	150,
		max_height				:	500,
		max_width				:	800
	},
	initialize	:	function(){
		INTOgalleryClass = this;
		$each($$('.tx-intogallery-pi1 .preview'),function(item){
			item.addEvent('click',function(e){
				if(e) e.stop();
				INTOgalleryClass.imagelink = this;
				var base = new Element('div',{'id':'galleryBase'}).inject($$('body')[0],'top');
				var height = ($$('#main')[0].getSize().y + $$('#navigation')[0].getSize().y + $$('#head')[0].getSize().y + 25);
				if(window.getSize().y > height) height = window.getSize().y;
				base.setStyles({
					'display'	:	'block',
					'opacity'	:	0,
					'height'	:	height,
					'width'		:	window.getSize().x
				});
				base.set('morph',{duration:INTOgalleryClass.options.duration, onComplete : function(){
					new Asset.image(INTOgalleryClass.imagelink.getAttribute('href'),{id:'previewImage', onload: function(item){
						var layer = new Element('div',{'id':'previewLayer'}).inject($$('body')[0],'top');
						item.inject(layer,'top');
						
						if($('previewImage').getSize().x > INTOgalleryClass.options.max_width){
							$('previewImage').setAttribute('width',INTOgalleryClass.options.max_width);
							$('previewImage').removeAttribute('height');
						}
						if($('previewImage').getSize().y > INTOgalleryClass.options.max_height){
							$('previewImage').setAttribute('height',INTOgalleryClass.options.max_height);
							$('previewImage').removeAttribute('width');
						}
						
						INTOgalleryClass.insertControlMenu();
						layer.position();
						INTOgalleryClass.preloadItems();
						
						base.addEvent('click',INTOgalleryClass.closeLightbox);
						window.addEvent('resize',INTOgalleryClass.onResizeEvent);
						window.addEvent('scroll',INTOgalleryClass.onResizeEvent);
						window.document.addEvent('keydown',function(event){
							if(event.key == 'esc') INTOgalleryClass.closeLightbox();
							if(event.key == 'right') INTOgalleryClass.image('next');
							if(event.key == 'left') INTOgalleryClass.image('prev');
					    });
					}});																									
				}}).morph({'opacity':0.8});
			});
		});
		if(this.get('openFirst',window.location.href) == 'true') $$('.tx-intogallery-pi1 .first')[0].fireEvent('click');
		if(this.get('openLast',window.location.href) == 'true') $$('.tx-intogallery-pi1 .last')[0].fireEvent('click');
	},
	closeLightbox	:	function(){
		if($('previewLayer')){
			$('previewLayer').dispose();
		}
		$('galleryBase').set('morph',{'duration':INTOgalleryClass.options.duration, onComplete:function(){
			$('galleryBase').dispose();
		}}).morph({'opacity':0});			
	},
	image			:	function(mode){
		var stopThis = false;
		$$('#previewLayer .next,#previewLayer .prev').setStyle('visibility','visible');
		if(mode == 'next'){
			if(INTOgalleryClass.imagelink.hasClass('last') == true){
				stopThis = true;
				if(!$chk($$('.tx-intogallery-pi1 .pagebrowser .active')[0])){
					$$('#previewLayer .next')[0].setStyle('visibility','hidden');
				}
				else{
					if($$('.tx-intogallery-pi1 .pagebrowser .active')[0].getNext('a')){
						window.location.href = $$('.tx-intogallery-pi1 .pagebrowser .active')[0].getNext('a').getAttribute('href')+'&openFirst=true';
					}
					else{
						$$('#previewLayer .next')[0].setStyle('visibility','hidden');
					}
				}
			}
			else{
				$$('#previewLayer .next').removeClass('nextPage');
				$$('#previewLayer .prev').removeClass('lastPage');
				if(INTOgalleryClass.imagelink.getNext('a')){
					var selected_image = INTOgalleryClass.imagelink.getNext('a');	
					if(selected_image.hasClass('last')) $$('#previewLayer .next')[0].setStyle('visibility','hidden');	
					if(! selected_image.getNext('a')){
						if($chk($$('.tx-intogallery-pi1 .pagebrowser .active')[0])){
							if($$('.tx-intogallery-pi1 .pagebrowser .active')[0].getNext('a')){
								$$('#previewLayer .next')[0].setStyles({'visibility':'visible'}).addClass('nextPage');
							}
						}
					}
				}
				else{
					selected_image = INTOgalleryClass.imagelink;
				}
			}
		}
		else{
			if(INTOgalleryClass.imagelink.hasClass('first') == true){
				stopThis = true;
				if(!$chk($$('.tx-intogallery-pi1 .pagebrowser .active')[0])){
						$$('#previewLayer .prev')[0].setStyle('visibility','hidden');
				}
				else{
					if($$('.tx-intogallery-pi1 .pagebrowser .active')[0].getPrevious('a')){
						window.location.href = $$('.tx-intogallery-pi1 .pagebrowser .active')[0].getPrevious('a').getAttribute('href')+'&openLast=true';
					}	
					else{
						$$('#previewLayer .prev')[0].setStyle('visibility','hidden');
					}
				}
			}
			else{
		$$('#previewLayer .next').removeClass('nextPage');
		$$('#previewLayer .prev').removeClass('lastPage');
				if(INTOgalleryClass.imagelink.getPrevious('a')){
					var selected_image = INTOgalleryClass.imagelink.getPrevious('a');
					if(selected_image.hasClass('first')) $$('#previewLayer .prev')[0].setStyle('visibility','hidden');	
					if(! selected_image.getPrevious('a')){
						if($chk($$('.tx-intogallery-pi1 .pagebrowser .active')[0])){
							if($$('.tx-intogallery-pi1 .pagebrowser .active')[0].getPrevious('a')){
								$$('#previewLayer .prev')[0].setStyles({'visibility':'visible'}).addClass('lastPage');
							}
						}
					}
				}
				else{
					selected_image = INTOgalleryClass.imagelink;
				}
			}
		}
		if(stopThis != true){
			$$('#previewLayer .controls').setStyle('display','none');
			$$('#previewLayer img').set('morph',{duration:INTOgalleryClass.options.duration_clickThrough, onComplete:function(){
				$$('#previewLayer img').dispose();
				new Asset.image(selected_image.getAttribute('href'),{id:'previewImage', onload: function(item){
					item.inject($('previewLayer'),'top');
					item.setStyle('opacity',0);
						
					if($('previewImage').getSize().x > INTOgalleryClass.options.max_width){
						$('previewImage').setAttribute('width',INTOgalleryClass.options.max_width);
						$('previewImage').removeAttribute('height');
					}
					if($('previewImage').getSize().y > INTOgalleryClass.options.max_height){
						$('previewImage').setAttribute('height',INTOgalleryClass.options.max_height);
						$('previewImage').removeAttribute('width');
					}
						
					$('previewLayer').position();
					item.set('morph',{duration:INTOgalleryClass.options.duration_clickThrough,onComplete:function(){
						$$('#previewLayer .controls').setStyle('display','block');
						$$('#previewLayer .close')[0].position({
							'relativeTo'	:	$('previewImage'),
							edge			:	'upperLeft',
							position		:	'upperRight'
						});
					}}).morph({'opacity':1});
					INTOgalleryClass.imagelink = selected_image;
					INTOgalleryClass.preloadItems();
				}.bind(this)});
			}.bind(this)}).morph({'opacity':0});
		}
	},
	preloadItems	:	function(){
		if(INTOgalleryClass.imagelink.getPrevious('a')){
		   new Asset.image(INTOgalleryClass.imagelink.getPrevious('a').getAttribute('href'));
		}
		if(INTOgalleryClass.imagelink.getNext('a')){
		   new Asset.image(INTOgalleryClass.imagelink.getNext('a').getAttribute('href'));
		}
	},
	onResizeEvent	:	function(){
		if($('previewLayer')){
			$('previewLayer').position();	
			var height = ($$('#main')[0].getSize().y + $$('#navigation')[0].getSize().y + $$('#head')[0].getSize().y + 25);
			if(window.getSize().y > height) height = window.getSize().y;
			$('galleryBase').setStyles({
				'height'	:	height,
				'width'		:	window.getSize().x
			});	
			$$('#previewLayer .controls').setStyle('display','block');
			$$('#previewLayer .close')[0].position({
				'relativeTo'	:	$('previewImage'),
				edge			:	'upperLeft',
				position		:	'upperRight'
			});
		}
	},
	insertControlMenu	:	function(){
		var controls = new Element('div',{
			'class'		:	'controls'
		}).inject($('previewLayer'),'bottom');
		new Element('a',{'class':'close'}).inject(controls).addEvent('click',INTOgalleryClass.closeLightbox).position({
			'relativeTo'	:	$('previewImage'),
			edge			:	'upperLeft',
			position		:	'upperRight'});
		new Element('a',{'class':'prev'}).inject(controls).addEvent('click',function(){INTOgalleryClass.image('prev');});
		new Element('a',{'class':'next'}).inject(controls).addEvent('click',function(){INTOgalleryClass.image('next');});
		new Element('p',{'html':$$('.infotext')[0].get('html')}).inject(controls);
		if(!$chk($$('.tx-intogallery-pi1 .pagebrowser .active')[0])){
			if(!INTOgalleryClass.imagelink.getPrevious('a')){
				$$('#previewLayer .prev')[0].setStyle('visibility','hidden');			
			}
		}
		else{
			if(!INTOgalleryClass.imagelink.getPrevious('a') && $$('.tx-intogallery-pi1 .pagebrowser .active')[0].getPrevious('a')){
				$$('#previewLayer .prev')[0].addClass('lastPage');
			}
			else if(!INTOgalleryClass.imagelink.getPrevious('a') && !$$('.tx-intogallery-pi1 .pagebrowser .active')[0].getPrevious('a')){
				$$('#previewLayer .prev')[0].setStyle('visibility','hidden');			
			}
			if(!INTOgalleryClass.imagelink.getNext('a') && $$('.tx-intogallery-pi1 .pagebrowser .active')[0].getNext('a')){
				$$('#previewLayer .next')[0].addClass('nextPage');
			}
			else if(!INTOgalleryClass.imagelink.getNext('a') && !$$('.tx-intogallery-pi1 .pagebrowser .active')[0].getNext('a')){
				$$('#previewLayer .next')[0].setStyle('visibility','hidden');			
			}
		}
	},
	get					:	function(key,url){
	    if(arguments.length < 2) url =location.href;
	    if(arguments.length > 0 && key != ""){
	        if(key == "#"){
	            var regex = new RegExp("[#]([^$]*)");
	        } else if(key == "?"){
	            var regex = new RegExp("[?]([^#$]*)");
	        } else {
	            var regex = new RegExp("[?&]"+key+"=([^&#]*)");
	        }
	        var results = regex.exec(url);
	        return (results == null )? "" : results[1];
	    } else {
	        url = url.split("?");
	        var results = {};
	            if(url.length > 1){
	                url = url[1].split("#");
	                if(url.length > 1) results["hash"] = url[1];
	                url[0].split("&").each(function(item,index){
	                    item = item.split("=");
	                    results[item[0]] = item[1];
	                });
	            }
	        return results;
	    }

	}
});





/*
	INTO Sidebar Boxes
													*/
	
var INTOsidebarBox = new Class({
	initialize	:	function(){
		$each($$('#sidebar .blue_box'),function(item){
			item.addClass('js_blue_box');
			new Element('div',{
				'class'	:	'p_end'
			}).inject(item,'after');
		});
	}
});




/*
	INTO Application
													*/
var INTOappForm = new Class({
	initialize	:	function(){
		if($chk($$('.tx-intoapplication-pi1')[0])){
			if($('form_error')) alert($('form_error').get('html'));
			if($$('select[name=destinations]')[0]){
			$$('select[name=destinations]')[0].addEvent('change',function(){
				$each(this.getChildren('option'),function(item){
					if(item.selected == true){
						new Request.JSON({url: window.location.href, onSuccess: function(response){
							$$('select[name=duration] option').dispose();
							$each(response,function(item){
								new Element('option',{
										'value'	:	item.uid,
										'html'	:	item.duration
								}).inject($$('select[name=duration]')[0]);
							});
						}}).get({'eID' : 'into_app', 'option' : item.getAttribute('value')});
					}
				});
			});
			}
		}
	}
});
	





/*		
		TYPO3-eigenes JavaScript
		- Spamschutz
										*/
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);}
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);}