var divSearchDetails = false;
var divTripOrder = false;

function changeImgThumb( url, w, h )
{	 
	 	 thumb = 'thumb.php?src='+url+'&wmax=200&hmax=150&quality=100';
		 element = document.getElementById('imgThumb');
		 if (!element) return;
		 element.src = '';
		 element.src = thumb;
		 element.style.width = w;
		 element.style.height = h;
		 actualThumb = url;
}

function changeImgThumb2( url, w, h )
{	 
		 element = document.getElementById('imgThumb');
		 if (!element) return;
		 element.src = url;
		 element.style.width = w;
		 element.style.height = h;
		 actualThumb = url;
}

function blinkDiv(name,onOff,speed)
{
 	var objStyle = document.getElementById(name).style;
	if (objStyle) {
	   objStyle.display = 'block';
	}
  	
	var div = document.getElementById(name);
	if (!div) return false;
	
  	if (onOff == 'on') {
	   if (!speed) speed = 0.5;
  	   new Effect.Opacity(name, {duration:speed, from:0.0, to:1.0});return false;
  	} else if (speed>0) {
  	   new Effect.Opacity(name, {duration:speed, from:1.0, to:0.0});return false;
  	} else {
  	   new Element.hide(name);return false;
  	}
}

var divSliderIdCurrent = 1;
 var aDivs = new Array(); 
 aDivs[0] = "table_narty"; 
 aDivs[1] = "table_tropiki";
 
function divSlider(nrDiv)
{
   if (divSliderIdCurrent < (aDivs.length-1)) divSliderIdCurrent++;
   else divSliderIdCurrent = 0;
   
   if (nrDiv==2) nrDiv=0;
   curDiv = aDivs[nrDiv];
     
   if (divSliderIdCurrent%2) {
   	  new Effect.Fade(document.getElementById(curDiv), {duration:0.5});
	  //Element.hide(curDiv);
	  window.setTimeout("divSlider("+(nrDiv+1)+")",1000);
   } else {
   	   new Effect.Appear(document.getElementById(curDiv), {duration:1.0});
	   window.setTimeout("divSlider("+(nrDiv)+")",9000);
   }
 
}

var divSliderIdCurrentOne = 1;
 var aDivsOne = new Array(); 
 var divsCount = 0;
// aDivsOne[4] = "table_grecja";
 
function divSliderOne(nrDiv)
{
   if (divSliderIdCurrentOne < (aDivsOne.length-1)) divSliderIdCurrentOne++;
   else divSliderIdCurrentOne = 0;
   
   if (nrDiv==divsCount) nrDiv=0;
   curDiv = aDivsOne[nrDiv];
//   alert(curDiv);
     
   if (divSliderIdCurrentOne%2) {
   	  new Effect.Fade(document.getElementById(curDiv), {duration:0.5});
   	  //new Effect.Fade(document.getElementById(curDiv+'2'), {duration:0.5});
	  //Element.hide(curDiv);
	  window.setTimeout("divSliderOne("+(nrDiv+1)+")",500);
   } else {
   	   new Effect.Appear(document.getElementById(curDiv), {duration:0.5});
   	   //new Effect.Appear(document.getElementById(curDiv+'2'), {duration:1.0});
	   window.setTimeout("divSliderOne("+(nrDiv)+")",5000);
   }
 
}

function divSlider2Divs(nrDiv)
{
   if (divSliderIdCurrentOne < (aDivsOne.length-2)) divSliderIdCurrentOne += 2;
   	 else divSliderIdCurrentOne = 0;
      
   if (nrDiv==divsCount) nrDiv=0;
   curDiv = aDivsOne[nrDiv];
   nrDiv2 = nrDiv + 1;
   if (nrDiv2==divsCount) nrDiv2=0; 
   curDiv2 = aDivsOne[nrDiv2];  
   //alert(curDiv + '\n' + curDiv2);

	if (divsCount < 3) { // mniej ni¿ 3 div-y to nie ma animacji tylko wy¶wietlaj± siê na sta³e
		
		if ($(curDiv)) {
			$(curDiv).show();
			new Effect.Appear($(curDiv), {
				duration: 1.0
			});
		}
	
		if ($(curDiv2)) {
			$(curDiv2).show();
			new Effect.Appear($(curDiv2), {
				duration: 1.0
			});
		}
		return;
	}
	
   if (divSliderIdCurrentOne % 4) {
	   if ($(curDiv)) $(curDiv2).show();
       new Effect.Fade($(curDiv), {duration:0.5});
       new Effect.Fade($(curDiv2), {duration:0.5}); 
       window.setTimeout("divSlider2Divs("+(nrDiv2)+")",1000);
   } else {	   
	   if ($(curDiv2)) $(curDiv2).hide();
       new Effect.Appear($(curDiv), {duration:1.0});
       new Effect.Appear($(curDiv2), {duration:1.0});
       window.setTimeout("divSlider2Divs("+(nrDiv)+")",5000);
   }
 
}

var divOperatorSliderIdCurrent = 1;
 var aOperatorDivs = new Array(); 
 aOperatorDivs[0] = "Operator1"; 
 aOperatorDivs[1] = "Operator2"; 
 aOperatorDivs[2] = "Operator3"; 
 aOperatorDivs[3] = "Operator4"; 
 aOperatorDivs[4] = "Operator5"; 
 aOperatorDivs[5] = "Operator6"; 
 aOperatorDivs[6] = "Operator7"; 
 
function divOperatorSlider(nrDiv)
{
   if (divOperatorSliderIdCurrent < (aOperatorDivs.length-1)) divOperatorSliderIdCurrent++;
   else divOperatorSliderIdCurrent = 0;
   
   if ( nrDiv == aOperatorDivs.length ) nrDiv=0;
   curDiv = aOperatorDivs[nrDiv];
     
   if (divOperatorSliderIdCurrent%2) {
   	  new Effect.Fade(document.getElementById(curDiv), {duration:0.5});
	  //Element.hide(curDiv);
	  window.setTimeout("divOperatorSlider("+(nrDiv+1)+")",1000);
   } else {
   	   new Effect.Appear(document.getElementById(curDiv), {duration:1.0});
	   window.setTimeout("divOperatorSlider("+(nrDiv)+")",3000);
   }
 
}
function divSliderArray( nrDiv, arrName, pointer, postfix )
{
   if (pointer < (arrName.length-1)) pointer++;
   else pointer = 0;
   
   if ( nrDiv == arrName.length ) nrDiv=0;
   curDiv = arrName[nrDiv];
   if (!curDiv) return;
     
   if (pointer%2) {
   	  new Effect.Fade(document.getElementById(curDiv), {duration:0.5});
	  //Element.hide(curDiv);
	  window.setTimeout("divSliderArray("+(nrDiv+1)+",aOfertaDivs"+postfix+","+pointer+","+postfix+" )",1000);
   } else {
   	   new Effect.Appear(document.getElementById(curDiv), {duration:1.0});
	   window.setTimeout("divSliderArray("+(nrDiv)+",aOfertaDivs"+postfix+","+pointer+","+postfix+" )", 12000);
   }
 
}

function mig(div,time)
{
   new Effect.Fade(div,{duration:2.0});
   new Effect.Appear(div);

   window.setTimeout("mig('"+div+"',"+time+")",time);

}

function effectHighlight(div){
		 new Effect.Highlight(document.getElementById(div),{duration:0.3})
}

function pokaz(div,onOff)
{
 var obj = document.getElementById(div);
 if (!obj) return false;
 	 var objStyle = document.getElementById(div).style;
 	 if (objStyle) {
	    if (onOff=='off')
	 	   	objStyle.display = 'none';
		 else
		 	objStyle.display = 'block'; 
	 }
}

function pokazRow(div,onOff)
{
 	 var objStyle = document.getElementById(div).style;
 	 if (objStyle) {
	    if (onOff=='off')
	 	   	objStyle.display = 'none';
		 else
		 	objStyle.display = display_row('block'); 
	 }
}
function showOrderBox(div)
{
 		if (divTripOrder == false) {
			   divTripOrder = true;
		} else {
			   divTripOrder = false;
		}
			
		var objStyle = document.getElementById(div).style;
			if (objStyle) {
						if (divTripOrder == false) {
						   new Effect.BlindUp(document.getElementById(div), {duration:0.5})
						} else {
						   new Effect.BlindDown(document.getElementById(div), {duration:1.0});
						}
			}
}
var oldLeftHeight;
function hideDivSearchDetails( div ) {
   			if (divSearchDetails == false) {
			   divSearchDetails = true;
			} else {
			   divSearchDetails = false;
			}
						if (divSearchDetails == false) {
						   //objStyle.display = 'none';
						   new Effect.BlindUp(document.getElementById(div), {duration:0.5})
						   //document.getElementById(div+'Link').innerHTML = 'wyszukiwanie zaawansowane';
						   tblLewa = document.getElementById('tabela_lewa');
                    		if (tblLewa) {
                    		   tblLewa.style.height = oldLeftHeight;
                    		}
						} else {
						   var tabelaSzukWys = 300;
						   var hh = document.height+tabelaSzukWys;
						   
						   //objStyle.display = 'block';//display_row('block');
						   new Effect.BlindDown(document.getElementById(div), {duration:1.0});
						   //document.getElementById(div+'Link').innerHTML = 'ukryj szukanie zaawansowane';

                    		tblLewa = document.getElementById('tabela_lewa');
                    		if (tblLewa) {				
                    		   oldLeftHeight = tblLewa.style.height;
                    		   tblLewa.style.height = hh-180;
                    		}
						}	
}

/**
* detekcja przegladarki
*/
function getBrowser()
{
	var ns4 = (document.layers)? true:false;
	var ns6 = (document.getElementById)? true:false;
	var ie4 = (document.all)? true:false;
	if (ie4)
	{
		if((navigator.userAgent.indexOf('MSIE 5')> 0)||(navigator.userAgent.indexOf('MSIE 6')> 0)||window.opera)
		{
			return('ie5');
		} else {
			return('ie4');
		}
		if (ns6)
		{
			ns6=false;
		}
	} 
	if (ns6) {
		return('ns6');
	} else {
		return('ns4');
	}
	
}

/**
* wyswietla/chowa wiersz tabeli w zaleznosci od przegladarki
*/
function display_row(display) {
  
	if (getBrowser()=='ns6') {
		return 'table-row';
	} else {
		return display;
	}
}

function sprawdz_szukaj()
{
 if (document.forms['szukaj'].szukaj.value.length > 2)
 {
  return true;
 } else
 {
  return false;
 }
}

function dodajDoUlubionych()
{
	var adres = 'http://www.travelpunkt.pl';
	var tytul = 'TRAVELPUNKT - biuro podró¿y';
	if (confirm("Dodaæ stronê do ulubionych?"))
	{
	  window.external.addFavorite(adres, tytul); 
	}
}

function przeladuj( adres )
{
      window.document.location.href = adres; 
}

// detekcja przegladarki
var ns4 = (document.layers)? true:false;
var ns6 = (document.getElementById)? true:false;
var ie4 = (document.all)? true:false;
var ie5 = false;
if (ie4)
{
	if((navigator.userAgent.indexOf('MSIE 5')> 0)||(navigator.userAgent.indexOf('MSIE 6')> 0)||window.opera)
	{
		ie5=true;
	}
	if (ns6)
	{
		ns6=false;
	}
}


// wielkosc okienka przegladarki
function browsewidth()
{
	if (ns4 || ns6)
	{
        available_width=innerWidth;
    } else {
        available_width=document.body.clientWidth;
    }
	return available_width
}

function browseheight()
{
	if (ns4 || ns6)
	{
        available_height=innerHeight;
    } else {
        available_height=document.body.clientHeight;
    }
	return available_height
}

function wlaczWarstwe(divv,onoff,wid,hei,top)
{
    // polozenie
	if (browsewidth()>=760)
	{
		x=((browsewidth()/2)-(wid/2));
	} else
	{
		x=300;
	}
	
	if (top>0)
	{
		y = top;
	} else {
		if (browseheight()>=500)
		{
			y=((browseheight()/2)-(hei/2));
		} else
		{
			y=400;
		}
	}
	if ( onoff == "on" )
	{
		warstwa( divv,'on',x,y,wid,hei );
	}
	if ( onoff == "off" || onoff == null )
	{
		warstwa(divv);
	} 
    
    
}

function warstwa(nazwa,wlacz,pozx,pozy,wid,hei)
{
	// Netscape 4.x Code
	if (ns4)
	{
		objWarstwa = document.layers[nazwa];
	}
	// Netscape 6.x Code
	/*if (ns6)
	{*/
		objWarstwa = document.getElementById(nazwa);
		if (objWarstwa)
			objWarstwa = document.getElementById(nazwa).style;
		else
			return false;
	/*}
	// IE
	if (ie4 || ie5)
	{
		objWarstwa = eval(document.all[nazwa]);
		objWarstwa = objWarstwa.style;
	}*/

	if (pozx && pozy)
	{
		objWarstwa.left = pozx;
		objWarstwa.top = pozy;
		objWarstwa.width = wid;
		objWarstwa.height = hei;
	}

	if (objWarstwa && (wlacz == 'off' || wlacz == null))
	{
		if (ns4)
		{
			objWarstwa.visibility="hide";
		} else
		{
			objWarstwa.visibility="hidden";
		}
	}

	if (objWarstwa && (wlacz == 'on'))
	{
		if (ns4)
		{
			objWarstwa.visibility="show";
		} else
		{
			objWarstwa.visibility="visible";
		}
	}
}

function popupNewsletter(myform)
{
    if (! window.focus) return true;
    okno(this.action,'newsletter',500,300,'yes','yes' );
    myform.target='newsletter';
    return true;
}


noweokno=null;
function okno(url,nazwa,x,y,scroll,resize) {
	if (noweokno)
	{
		noweokno.close();
	}
	if (nazwa==null)
	{
		nazwa = '';
	}
	if (scroll==null)
	{
		scroll=0;
	}
	if (resize==null)
	{
		resize=0;
	}
	if (x!=null)
	{
		x1=((screen.availWidth/2)-(x/2)); y1=((screen.availHeight/2)-(y/2));
		noweokno=window.open(url,nazwa,'toolbar=0,location=0,status=0,menubar=0,scrollbars='+scroll+',resizable='+resize+',left='+x1+',top='+y1+',width='+x+',height='+y);
	} else
	{
		window.open(url,nazwa,'toolbar=0,location=0,status=0,menubar=0,scrollbars='+scroll+',resizable=yes,left=0,top=0,width='+(screen.availWidth-40)+',height='+(screen.availHeight-40));
	}
}

fotaokno=null;
function fotka( url, nazwa, x, y, scroll ) {
	if (nazwa==null)
	{
		nazwa = '';
	}
	if (scroll==null)
	{
		scroll=0;
	}
	if (fotaokno)
	{
		fotaokno.close();
	}
	if (x!=null)
	{
		x1=((screen.availWidth/2)-(x/2)); y1=((screen.availHeight/2)-(y/2));
		if (x1<0)
		{
			x1=0; scroll=1; x=screen.availWidth-50; y=y+40;
		}
		if (y1<0)
		{
			y1=0; scroll=1; y=screen.availHeight-50; x=x+40;
		}
		fotaokno = window.open('','fotogaleria','toolbar=0,location=0,status=0,menubar=0,scrollbars='+scroll+',resizable=1,left='+x1+',top='+y1+',width='+x+',height='+y);
		fotaokno.document.open();
		fotaokno.document.write ('<html>'); 
		fotaokno.document.write ('<head>'); 
		fotaokno.document.write ('<title>'+nazwa+'</title>'); 
		fotaokno.document.write ('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">'); 
		fotaokno.document.write ('</head>'); 
		fotaokno.document.write ('<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">'); 
		fotaokno.document.write ('<p align="center"><a href="javascript:void(null)" onClick="window.close();"><img src="'+url+'" border="0"></a></p>'); 
		fotaokno.document.write ('</body>'); 
		fotaokno.document.write ('</html>'); 
		fotaokno.document.close();
		fotaokno.focus();
	} else
	{
		fotaokno = window.open(url,'fotogaleria','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1');
		fotaokno.document.open();
		fotaokno.document.write ('<html>'); 
		fotaokno.document.write ('<head>'); 
		fotaokno.document.write ('<title>'+nazwa+'</title>'); 
		fotaokno.document.write ('<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">'); 
		fotaokno.document.write ('</head>'); 
		fotaokno.document.write ('<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">'); 
		fotaokno.document.write ('<p align="center"><a href="javascript:void(null)" onClick="window.close();"><img src="'+url+'" border="0"></a></p>'); 
		fotaokno.document.write ('</body>'); 
		fotaokno.document.write ('</html>'); 
		fotaokno.document.close();
		fotaokno.focus();
	}
}

function hotelFotos(hoteCode, idTouroperator, foto, x, y) {
	x1=((screen.availWidth/2)-(x/2)); y1=((screen.availHeight/2)-(y/2));
	if (x1<0)
	{
		x1=0; scroll=1; x=screen.availWidth-50; y=y+40;
	}
	if (y1<0)
	{
		y1=0; scroll=1; y=screen.availHeight-50; x=x+40;
	}
  window.open('hotel_foto.php?hotel_code='+hoteCode+'&id_touroperator='+idTouroperator+'&foto='+foto,'fotogaleria','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,left='+x1+',top='+y1+',width='+x+',height='+y);
}

/**
* maskaOnlyDigits
*
* pozostawia w polu jedynie cyfry
*/
function  maskaInt(field) {
        var str, field;
        var myRegExp = /[^0-9]/g;
        str = field.value;
        str = str.replace(myRegExp,"");

        var oEvent = window.event;
        // pomijamy zmiany dla klawisza TAB - bo tracil sie focus
        if (oEvent && ((oEvent.which && oEvent.which!=9 && oEvent.which!=16 && oEvent.which!=37 && oEvent.which!=39) ||
           (oEvent.keyCode && oEvent.keyCode!=9 && oEvent.keyCode!=16 && oEvent.keyCode!=37 && oEvent.keyCode!=39))) {
            field.value = str;
            field.focus();

        }  else if (getBrowser()=='ns6') {
        	field.value = str;
            field.focus();
        }
}


function  maskaDaty(field) {

	var str, field;
	var myRegExp = /[^0-9]/g;
	str = field.value;
	str = str.replace(myRegExp,"");
	switch (str.length){
		case 0:
		case 1:
		case 2:
		break;
		case 3:
			str = str.substr(0,2) + "-" + str.substr(2);
		break;
		case 4:
			str = str.substr(0,2) + "-" + str.substr(2);
		break;
		case 5:
			str = str.substr(0,2) + "-" + str.substr(2,2) + "-" + str.substr(4,4);
		break;
		case 6:
			str = str.substr(0,2) + "-" + str.substr(2,2) + "-" + str.substr(4,4);
		break;
		case 7:
			str = str.substr(0,2) + "-" + str.substr(2,2) + "-" + str.substr(4,4);
		break;
		case 8:
			str = str.substr(0,2) + "-" + str.substr(2,2) + "-" + str.substr(4,4);
		break;
		default:
			str = str.substr(0,2) + "-" + str.substr(2,2) + "-" + str.substr(4,4);
		break;			
	}

        var oEvent = window.event;

        // pomijamy zmiany dla klawisza TAB - bo tracil sie focus
        if (oEvent && ((oEvent.which && oEvent.which!=9 && oEvent.which!=16) ||
           (oEvent.keyCode && oEvent.keyCode!=9 && oEvent.keyCode!=16))) {
            field.value = str;
            field.focus();

//            alert('zmiana pola: kayCode=' + oEvent.keyCode + ' which=' + oEvent.which);
        } else if (getBrowser()=='ns6') {
        	field.value = str;
            field.focus();
        }
}

var formTarget='document.forms["tripOrder"].';
function sprawdz_maila( pole, warning ) { 
 		 
		 passwordBox = eval(formTarget+pole);
		 emailok = false;
		 wzore=/^[0-9a-z±æê³ñó¶¿¼¡ÆÊ£ÑÓ¦¯¬._-]+(@|\(at\))+[0-9a-z±æê³ñó¶¿¼¡ÆÊ£ÑÓ¦¯¬._-]+\.[a-z]{2,4}$/i;// wzor emaila
		 passwordBox.value = trim(passwordBox.value);
		 if (!(!wzore.test(passwordBox.value)) || 
		 	passwordBox.value == '' ) 
			emailok=true;
 		if (!emailok)
 		{
		  passwordBox.focus();
		  alert(warning);
		  return false;
 		} else 
		  return true;
}

function czyWypelnionePole( pole, komunikat, minLen )
{
   if (!minLen) minLen = 3;
   txtBox = eval(formTarget+pole);
   if (!txtBox) {
   	  txtBox = document.getElementById(pole);
   }
   if (txtBox) {
      if (txtBox.value.length >= minLen)
      {
       return true;
      } else
      {
       alert( komunikat );
       txtBox.focus();
       return false;
      }
   } else {
   	 //alert(pole);
   }
}
function czyWypelnioneJednoZPol( pole1, pole2, komunikat, minLen )
{
   if (!minLen) minLen = 3;
   txtBox = eval(formTarget+pole1);
   txtBox2 = eval(formTarget+pole2);
   
   if (txtBox.value.length >= minLen || txtBox2.value.length >= minLen)
   {
    return true;
   } else
   {
    alert( komunikat );
    txtBox.focus();
    return false;
   }
}

// Removes leading whitespaces
function LTrim( value ) {
  var re = /\s*((\S+\s*)*)/;
  return value.replace(re, "$1");
}

// Removes ending whitespaces
function RTrim( value ) {
  var re = /((\s*\S+)*)\s*/;
  return value.replace(re, "$1");
}

// Removes leading and ending whitespaces
function trim( value ) {
  return LTrim(RTrim(value));
}

function resize_iframe(idiframe){
  moz=document.getElementById&&!document.all
  mozHeightOffset=20
  document.getElementById(idiframe).height=null
  document.getElementById(idiframe).height=window.frames[idiframe].document.body.scrollHeight+(moz?mozHeightOffset:0)
}

function prevImg(ar, i) {
	i = i - 1;
	if (i < 0) {
		i = (ar.length - 1)
	};
	changeImgThumb2( ar[i][0], ar[i][1], ar[i][2] );	
	return i;
}
function nextImg(ar, i) {
	i = i + 1;
	if (i > (ar.length - 1)) {
		i = 0;
	};
	changeImgThumb2( ar[i][0], ar[i][1], ar[i][2] );	
	return i;
}

function Bookmark(title, url) {
	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title); }
	else if(window.opera && window.print) { // Opera Hotlist
		return true; 
	}
}

var Url = {
		 
		// public method for url encoding
		encode : function (string) {
			return escape(this._utf8_encode(string));
		},
	 
		// public method for url decoding
		decode : function (string) {
			return this._utf8_decode(unescape(string));
		},
	 
		// private method for UTF-8 encoding
		_utf8_encode : function (string) {
			string = string.replace(/\r\n/g,"\n");
			var utftext = "";
	 
			for (var n = 0; n < string.length; n++) {
	 
				var c = string.charCodeAt(n);
	 
				if (c < 128) {
					utftext += String.fromCharCode(c);
				}
				else if((c > 127) && (c < 2048)) {
					utftext += String.fromCharCode((c >> 6) | 192);
					utftext += String.fromCharCode((c & 63) | 128);
				}
				else {
					utftext += String.fromCharCode((c >> 12) | 224);
					utftext += String.fromCharCode(((c >> 6) & 63) | 128);
					utftext += String.fromCharCode((c & 63) | 128);
				}
	 
			}
	 
			return utftext;
		},
	 
		// private method for UTF-8 decoding
		_utf8_decode : function (utftext) {
			var string = "";
			var i = 0;
			var c = c1 = c2 = 0;
	 
			while ( i < utftext.length ) {
	 
				c = utftext.charCodeAt(i);
	 
				if (c < 128) {
					string += String.fromCharCode(c);
					i++;
				}
				else if((c > 191) && (c < 224)) {
					c2 = utftext.charCodeAt(i+1);
					string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
					i += 2;
				}
				else {
					c2 = utftext.charCodeAt(i+1);
					c3 = utftext.charCodeAt(i+2);
					string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
					i += 3;
				}
	 
			}
	 
			return string;
		}
	 
	}

function merlinXurl(href) {
	document.location = "/?ep3[]="+Url.encode(href);
}