var innerHeight = 0;

var innerWidth  = 0;

var scrollLeft = 0;

var scrollTop = 0;



var ajloader = FULLPATH+"assets/images/ajax-loader.gif";
var browser=navigator.appName;
var b_version=navigator.appVersion;
var version=parseFloat(b_version);
if (b_version.search(/MSIE/) > -1){
var ie = true;
	if(b_version.search(/MSIE (6|5|4)\..*/) > -1){
			var ie6 = true;
		}else{
			var ie6 = false;
		}
}else{
var ie = false;
}



window.onload = init;



function init()

{

	init_document();

}



function init_document()

{

		on_window_resize();

		on_window_scroll();

		window.onscroll = on_window_scroll;

		window.onresize = on_window_resize;

}

function on_window_scroll()

{

			if (self.pageYOffset) {

				scrollTop = self.pageYOffset;

				scrollLeft = self.pageXOffset;

			} else if (document.documentElement && document.documentElement.scrollTop) {	 

				scrollTop = document.documentElement.scrollTop;

				scrollLeft = document.documentElement.scrollLeft;

			} else if (document.body) {

				scrollTop = document.body.scrollTop;

				scrollLeft = document.body.scrollLeft;	

			}

}



function on_window_resize()

{

		innerHeight 	= parseInt(document.documentElement.clientHeight);

	 	innerWidth 		= parseInt(document.documentElement.clientWidth);

}





function hotstuffforward(next,current,divid,dur)

{

	var width = $(divid).offsetWidth;

$(divid+"_"+current).style.position = "absolute";

$(divid+"_"+current).style.left = "0px";

$(divid+"_"+current).style.top = "0px";

$(divid+"_"+current).style.zIndex = "2";



$(divid+"_"+next).style.position = "absolute";

$(divid+"_"+next).style.left = width+"px";

$(divid+"_"+next).style.top = "0px";

$(divid+"_"+next).style.zIndex = "3";

$(divid+"_"+next).style.width = width+"px";



$(divid+"_"+next).show();



new Effect.Parallel([

	new Effect.Move(divid+"_"+next, {sync: true, x: 0, y: 0, mode: 'absolute' })

], { 

  duration: dur

});

setTimeout("hideCurrent('"+divid+"_"+current+"')",parseInt(dur*1000));

}





function hotstuffbackward(next,current,divid,dur)

{

var width = $(divid).offsetWidth;

with($(divid+"_"+current).style)

{

	position = "absolute";

	left = "0px";

	top = "0px";

	zIndex = "2";

}



with($(divid+"_"+next).style)

{

	position = "absolute";

	left = "-"+width+"px";

	top = "0px";

	zIndex = "3";

	width = width+"px";

}

$(divid+"_"+next).show();



new Effect.Parallel([

	new Effect.Move(divid+"_"+next, {sync: true, x: 0, y: 0, mode: 'absolute' })

], { 

  duration: dur

});

setTimeout("hideCurrent('"+divid+"_"+current+"')",parseInt(dur*1000));



}





function hideCurrent(current){

	$(current).hide();

	}

	

	

function contact()
{
    new Ajax.Updater("errmsg", "./--contact.fastAction?lg="+lg, { 
						asynchronous: true, 
						method: "post", 
						evalScripts: true,
						parameters: $("contact").serialize()
						});
	return;
}


function contact_user()
{
    new Ajax.Updater("errmsg", "./--contact_user.fastAction?lg="+lg, { 
						asynchronous: true, 
						method: "post", 
						evalScripts: true,
						parameters: $("contact-user-form").serialize()
						});
	return;
}



function getWallMember(init,i)

{

	var initi = (init) ? "&init" : "" ;

	var post  = (init) ? "" : $("wallpost").serialize() ;

    new Ajax.Updater("wall", "./--wallmember.fastAction?lg="+lg+"&wall="+i+initi, { 

						asynchronous: true, 

						method: "post", 

						evalScripts: true,

						parameters: post

						});

	return;

}



	

function getWallGroup(init,i)

{

	var initi = (init) ? "&init" : "" ;

	var post  = (init) ? "" : $("wallpost").serialize() ;

    new Ajax.Updater("wall", "./--wallgroup.fastAction?lg="+lg+"&wall="+i+initi, { 

						asynchronous: true, 

						method: "post", 

						evalScripts: true,

						parameters: post

						});

	return;

}



function checkspan(check)

{	

	if(check && check.getAttribute("type")=="checkbox")

	{

		if(check.checked == true || check.checked == 1 || check.checked == "checked" )

			check.checked = false;

		else

			check.checked = true;

	}

	return;

}







function logout()

{

    new Ajax.Request("./--logout.fastAction", { 

						asynchronous: true, 

						method: "get", 

						evalScripts: true,

						parameters: "lg="+lg,

						onComplete: function(){location.href=FULLPATH;}

						});

	return;

}



function login()

{

    new Ajax.Updater("loginresponse", "./--login.fastAction?lg="+lg, { 

						asynchronous: true, 

						method: "post", 

						evalScripts: true,

						parameters: $("login").serialize()

						});

	return;

}


function retrievepass()
{
    new Ajax.Updater("loginresponse", "./--retreive.fastAction?lg="+lg, { 
						asynchronous: true, 
						method: "post", 
						evalScripts: true,
						parameters: $("retrievepass").serialize()
						});
	return;
}
function resetpass()
{
    new Ajax.Updater("loginresponse", "./--reset.fastAction?lg="+lg, { 
						asynchronous: true, 
						method: "post", 
						evalScripts: true,
						parameters: $("resetpass").serialize()
						});
	return;
}

function createaccount()

{

    new Ajax.Updater("createaccountresponse", "./--createaccount.fastAction?lg="+lg, { 

						asynchronous: true, 

						method: "post", 

						evalScripts: true,

						parameters: $("createaccount").serialize()

						});

	return;

}







function reloadCaptcha(param)

{

$("captcha").src = FULLPATH+"assets/captcha.php?"+Math.random()+param;

$("inputcaptcha").value = "";

	return;

}



function reloadpage()

{

document.location.reload();

}







function boxup(id,sc)

{

	if($("box_"+id).offsetHeight){

		Effect.BlindUp("box_"+id, { duration: 1.0 });

		var scrol = false;

	}else{

	new Effect.Parallel([

	new Effect.BlindDown("box_"+id, {sync:true,duration: 1.0 })

	], { 

	  duration: 1.0

	});

		var scrol = sc ? true : false;

	}

	$("box_"+id).style.overflow = "hidden";

	setTimeout("setheight("+id+","+scrol+")",1100);

}



function setheight(id,scrol)

{

	var box = "box_"+id;

	$(box).style.height = "auto";

	if(scrol)

	 Effect.ScrollTo(box, {duration: 1.0, offset:-50})

}





function clickclear(thisfield, defaulttext) {

	if (thisfield.value == defaulttext)

		thisfield.value = "";

}



function clickrecall(thisfield, defaulttext) {

	if (thisfield.value == "")

		thisfield.value = defaulttext;

}





function onpasswordclear(t,v)

{

if( (t.type != "password") && (t.value == v) ){

if(ie){

var newO=document.createElement('input');

newO.setAttribute('type','password');

newO.setAttribute('name','logpassword');

newO.setAttribute('className','inputforIE');

newO.setAttribute('onclick',t.getAttribute("onclick"));

newO.setAttribute('onkeypress',t.getAttribute("onkeypress"));

newO.setAttribute('onblur',t.getAttribute("onblur"));



t.parentNode.replaceChild(newO,t);



newO.focus();

newO.select();

}else{ 

	t.type='password';

		clickclear(t,v);

		t.focus();

	}

}

}



function onpasswordrecall(t,v)

{

if( (t.type != "text") && (t.value == "") ){

if(ie){

var newO = document.createElement('input');

newO.setAttribute('type','text');

newO.setAttribute('name','logpassword');

newO.setAttribute('className','inputforIE');

newO.setAttribute('onclick',t.getAttribute("onclick"));

newO.setAttribute('onkeypress',t.getAttribute("onkeypress"));

newO.setAttribute('onblur',t.getAttribute("onblur"));



t.parentNode.replaceChild(newO,t);

		clickrecall(newO,v);

}else{ 

	t.type='text';

		clickrecall(t,v);

	}

}

}







function textCounter(field,cntfield,maxlimit) {

if (field.value.length > maxlimit)

field.value = field.value.substring(0, maxlimit);

else

cntfield.value = maxlimit - field.value.length;

if (maxlimit - field.value.length == 0 ){

	cntfield.style.color = "#ff0000";

	}else{

	cntfield.style.color = "#fff";

	}

}  



function openpic(id)

{

	   new Ajax.Updater("thephotoenlarge","./--changepic.fastAction", { 

						asynchronous: true, 

						method: "get", 

						evalScripts: true,

						parameters:"id="+id ,

						onSuccess:function(){

							if(!$("photoenlarge").offsetHeight){

							$("photoenlarge").appear();

							setTimeout("ddopenpic()",1000);

							setTimeout("stopenpic()",1700);

								}	

							}

						});

		

		return;



}



function onmopenpic(id)

{

if(!$("l_h_"+id).offsetHeight)

$("l_h_"+id).show();

if($("alttext"))

$("alttext").innerHTML = $("l_h_"+id).title;

}



function onoopenpic(id)

{

if($("l_h_"+id).offsetHeight)

$("l_h_"+id).hide();	

if($("alttext"))

$("alttext").innerHTML = "";

}



function ddopenpic()

{

Effect.BlindDown("thephotoenlarge", { duration: 0.5 });

}

function stopenpic()

{

Effect.ScrollTo("thephotoenlarge", { offset:-50 });

}



function closeopenpic()

{

Effect.BlindUp("thephotoenlarge", { duration: 0.5 });

	setTimeout("Effect.Fade('photoenlarge')",750);

}



function sortCreate(divid,mod,sortitem,formid){

        Sortable.create(divid, {

                    tag:'li', 

                   	overlap:'vertical',

                    constraint: 'vertical',

                    onUpdate: function() {

                     updateaccountsort(divid,mod,sortitem,formid);

                    }

    	});

}







function sortCreatePhoto(divid,clas,mod){

        Sortable.create(divid, {

                    tag: "div", 

                   	overlap: "horizontal",

					only: clas ,

                    constraint: 'horizontal',

                    onUpdate: function() {

                    updateaccountsortphoto(divid,mod);

                   			 }

    			});

}





function sortCreatePhotoCat(mod){

        Sortable.create("sortGallery_updater_"+mod, {

                    tag:'div', 

                   	overlap:'vertical',

					only:'toptoplevel_'+mod,

                    constraint: 'vertical',

                    onUpdate: function() {

    new Ajax.Updater("responsecategory_"+mod,"./--updateaccount.fastAction?lg="+lg+"&mod="+mod+"&sort_cat", { 

						asynchronous: true, 

						method: "post", 

						evalScripts: true,

						parameters: Sortable.serialize("sortGallery_updater_"+mod) +"&"+ $("requirement").serialize()

						});

                    }

    	});

}





function updateaccountsortphoto(divid,mod){

    new Ajax.Request("./--updateaccount.fastAction?lg="+lg+"&mod="+mod+"&sort&divid="+divid, { 

						asynchronous: true, 

						method: "post", 

						evalScripts: true,

						parameters: Sortable.serialize(divid) +"&"+ $("requirement").serialize()

						});

	return;

	

}



function changeCategory(t,divid,us,cat){

	    new Ajax.Updater(divid,"./--changecategory"+cat+".fastAction?lg="+lg, { 

						asynchronous: true, 

						method: "get", 

						evalScripts: true,

						parameters:"us="+us+"&cat="+t

						});

	return;

}



function updateaccounteditGallery(id,mod,box,h){

	

	var divid = "reedit_"+mod;

	$(divid).style.opacity = "0";

	$(divid).style.paddingBottom = "0px";

	$(divid).show();

	//$(divid).innerHTML = "";



	var height = $(divid).parentNode.offsetHeight;

	if(height<h){heightresize = height; $(divid).parentNode.style.height = h+"px"; height = h;}

	var dividresp = "reeditform_"+mod;

    new Ajax.Updater(dividresp,"./--updateaccount.fastAction?lg="+lg+"&mod="+mod+"&editform&id="+ id, { 

						asynchronous: true, 

						method: "post", 

						evalScripts: true,

						parameters: $("requirement").serialize()

						,onComplete:function (){

							var heightdiv = $(divid).offsetHeight;

							$(divid).style.paddingBottom = parseInt(height - heightdiv)+"px";

							$(divid).appear();

							Effect.ScrollTo("box_"+box, {duration: 1.0, offset:-50});

							}

						});

	return;

	

}

function updateeditGalleryItem(mod){

    new Ajax.Updater("responsecategory_"+mod,"./--updateaccount.fastAction?lg="+lg+"&mod="+mod+"&edit", { 

						asynchronous: true, 

						method: "post", 

						evalScripts: true,

						parameters: $("editform_"+mod).serialize() +"&"+ $("requirement").serialize()

						,onSuccess: function (){

							$("reedit_"+mod).fade({duration:0.2});

						}

						,onComplete:function(){

							if(heightresize)

								$("reedit_"+mod).parentNode.style.height = heightresize+"px";

							}

						});

	return;

	

}

function updateeditcatname(mod)

{

    new Ajax.Updater("responsecategory_"+mod,"./--updateaccount.fastAction?lg="+lg+"&mod="+mod+"&edit_cat", { 

						asynchronous: true, 

						method: "post", 

						evalScripts: true,

						parameters: $(mod+"editform").serialize() +"&"+ $("requirement").serialize()

						});

	return;

	

}



function updateaccountsort(divid,mod,sortitem,formid){

    new Ajax.Updater("response_"+mod, "./--updateaccount.fastAction?lg="+lg+"&mod="+mod+"&sort", { 

						asynchronous: true, 

						method: "post", 

						evalScripts: true,

						parameters: Sortable.serialize(divid)+"&"+ $(formid).serialize() +"&"+ $("requirement").serialize()

						});

	return;

	

}



function updateGallery(mod,box)

{

	if(!$("box_"+box).offsetHeight){

			boxup(box,1);

	}else{

			 Effect.ScrollTo("box_"+box, {duration: 1.0, offset:-50});

	}

    new Ajax.Updater("sortGallery_updater_"+mod, "./--updateaccount.fastAction?lg="+lg+"&mod="+mod+"&upd", { 

						asynchronous: true,

						method: "post", 

						evalScripts: true,

						parameters: $("requirement").serialize()

						});

	return;

	

}



function updateaccountform(divid,formid,mod,sortitem){

	

		var divresp = box();

    new Ajax.Updater(divresp, "./--updateaccount.fastAction?lg="+lg+"&mod="+mod+"&form", { 

						asynchronous: true, 

						method: "post", 

						evalScripts: true,

						parameters: $(formid).serialize() +"&"+ $("requirement").serialize()

						,onComplete: function (){

								//divresp.appear();

								//setTimeout("shrinkresponse('response_"+mod+"')",1000);

								}

						});

	return;

	

}

function costumcrop(){

	

	var divid = "response_information_customcrop";

	$(divid).style.opacity = "0";

	$(divid).style.paddingBottom = "0px";

	$(divid).show();

	

	var h = 500;



	var height = $(divid).parentNode.offsetHeight;

	if(height<h){heightresize2 = height; $(divid).parentNode.style.height = h+"px"; height = h;}

	

	$(divid).style.height = height+"px";

	

	    new Ajax.Updater( divid ,"./--updateaccount.fastAction?mod=information&crop&lg="+lg, { 

						asynchronous: true, 

						method: "post", 

						evalScripts: true,

						parameters:$("requirement").serialize()

						,onComplete: function(){

								$(divid).appear();

						}

						});

	return;

}



function saveCrop()

{

	var query = cropquery();

	if(!query){

			closeCrop();

	}else{

		    new Ajax.Updater("response_information_customcrop", "./--resize.fastAction", { 

						asynchronous: true, 

						method: "get", 

						evalScripts: true,

						parameters: "save&lg="+lg+"&"+query

						,onComplete: function(){closeCrop();}

						});

	return;



			

	}

}

function closeCrop()

{

	var divid = "response_information_customcrop";

	$(divid).fade();

	if(heightresize2)

		$(divid).parentNode.style.height = heightresize2 +"px";

}





function updatebox(box,mod)

{

	

    new Ajax.Updater(box, "./--updateaccount.fastAction?lg="+lg+"&mod="+mod+"&upd", { 

						asynchronous: true, 

						method: "post", 

						evalScripts: true,

						parameters: $("requirement").serialize()

						

						});

	return;

	

}



function deletedown(id,mod)

{

	var msg = lg == "en" ? "Are you sur you want to delete this item?" : "Êtes-vous sûr de vouloir supprimer cette item" ;

if(confirm(msg)){

		new Ajax.Request("./--updateaccount.fastAction?lg="+lg+"&mod="+mod+"&del", { 

						asynchronous: true, 

						method: "post", 

						evalScripts: true,

						parameters: $("requirement").serialize() +"&id="+ id

						,onComplete:

							function (){

								Effect.BlindUp("item_"+mod+"_"+id, { duration: 0.6 });

								setTimeout("timeoutremove('item_"+id+"')",800);

							}

						});

}

	return;

	

}





function deletegal(id,mod)

{

	if(id=="")

	{

	var msg = lg == "en" ? "Please choose a category to delete." : "Svp choisir une catégorie à supprimer." ;

		alert(msg);

		return;

	}

	var msg = lg == "en" ? "Are you sur you want to delete this category\nand ALL IS CONTENT?" : "Êtes-vous sûr de vouloir supprimer cette catégorie\nET TOUT SON CONTENU" ;

if(confirm(msg)){



new Ajax.Updater("response_"+mod,"./--updateaccount.fastAction?lg="+lg+"&mod="+mod+"&delcat", { 

						asynchronous: true, 

						method: "post", 

						evalScripts: true,

						parameters: $("requirement").serialize() +"&id="+ id

						,onComplete:

							function (){

								Effect.BlindUp("sortable_"+mod+"_category_"+id, { duration: 0.6 });

								setTimeout("timeoutremove('sortable_"+mod+"_category_"+id+"')",800);

							}

						});

}

	return;

	

}



function timeoutremove(id)

{

	$(id).remove();

}

function box()

{

	var content = (lg=="en")? "One moment please.." : "Un moment svp..." ;

	showoverlay(content);

	var box = document.getElementById("dummyresponseaccount");



	if(!box)

	{

	box = document.createElement("div"); 

	box.id = "dummyresponseaccount";

	document.body.appendChild(box);

	}		

	return box;

	

}



function shrinkresponse(div)

{

	Effect.DropOut($(div));

	if($(div+"_query")){

	$(div+"_query").remove();

	}

}





function enableInput(id,ida,v,formid,but)

{

	

if($(id).disabled == true)

{

			$(id).disabled= false;

			$(id).style.border = "1px solid #fff";

			$(id).style.color = "#000";

			$(id).style.background = "#fff";

			$(id).style.height = "12px";

			$(id).focus();

			inner = $(ida).innerHTML;

			$(ida).innerHTML = v;



}

else

{

	

	if(!but)

	{

		$(formid).submit();

	}



		$("idforfocus"+formid).disabled = false;

		$("idforfocus"+formid).focus();

		$(id).style.color = "#fff";

		$(id).style.background = "none";

		$(id).style.border = "0";

		$(id).style.height = "14px";

		$(ida).innerHTML = inner;

		setTimeout("setTimeoutDisable('"+id+"')",2000);

		

	}

}





function setTimeoutDisable(id){

	$(id).disabled= true;

}







function uplpdfsubmit()

{

	if($("title").value.replace(/\s+/) == ""){alert( (lg=="en")? "You must put a title" : "Vous devez mettre un titre" ); return;}

	

	var uplframe = document.createElement("div");

	uplframe.id = "uplframe";

	uplframe.innerHTML = "<iframe name='uplframe' src=\""+FULLPATH+"--updateaccount.fastAction?lg="+lg+"&mod=download&upl\" scrolling='no' border='0'style='width:1px;height:1px;overflow:hidden;' frameborder='0'></iframe> ";

	var onc = $("uplpdf").action;

	document.body.appendChild(uplframe);

	$("uplpdf").target = "uplframe";

	$("uplpdf").action = FULLPATH+"--updateaccount.fastAction?lg="+lg+"&mod=download&upl";

	document.forms["uplpdfForm"].submit();

	

	

	var divresp = box();

	var img = createLoader();

	img.style.paddingLeft = "10px";

	var span = createSpanResponse("download","One moment please");

	divresp.appendChild(span);

	span.appendChild(img);

	divresp.appear();

	$("uplpdf").action = onc;

}







function createIframe()

{

	var iframe = document.createElement("iframe");

	iframe.scrolling = "no";

	iframe.border = "0";

	iframe.setAttribute("allowTransparency","true");

	iframe.frameBorder = "0";

	iframe.style.width = "1px";

	iframe.style.height = "1px";

	iframe.style.overflow = "hidden";

	iframe.src = "";

	return iframe;

}



function createLoader()

{

	var img = document.createElement("img");

	img.src = ajloader;

	return img;

}



function createSpanResponse(mod,msg)

{

	var span = document.createElement("span");

	span.className = "responseaccountquery";

	span.id = "response_"+ mod +"_query";

	var txt = document.createTextNode(msg);

	span.appendChild(txt);

	return span;

}



function uplloader(div)

{

	var divresp = boxalphaAppear(div);

	var img = createLoader();

	img.style.paddingLeft = "10px";

	var span = createSpanResponse(div,"One moment please");

	divresp.appendChild(span);

	span.appendChild(img);

	divresp.appear();

}





function loadvideoplayer(videoname,k,auto)

{

	

	var hasRightVersion = DetectFlashVer(9,0,0);

	if(hasRightVersion) {

    var so = new SWFObject(FULLPATH+'assets/swf/player.swf?'+Math.random(), 'shoot', '572', '427', '8', '#1d1d1d');

    so.useExpressInstall(FULLPATH+'assets/js/swfobject/expressinstall.swf');

    so.addParam('menu', 'false');

	so.addParam("allowFullScreen", "true");

	//var str = new Boolean( ((!auto)? false:true) );

	so.addVariable('autoStart',parseInt(auto));

	so.addVariable('phpPath',"--flvprovider.fastAction");

	so.addVariable('pictureFolder',"../../assets/users/vidthumbs");

	so.addVariable('myMovie', videoname);

    so.write('videoplayer');

	} else { 

	var alternateContent = 'Please update your flash version to see this content.<a href="http://www.macromedia.com/go/getflash/">Get Flash</a>';

	$("videoplayer").innerHTML = alternateContent;

	}



	$("nodeTxt").innerHTML = $("nodeTxt_"+k).innerHTML;



return;



}




var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(input){var output="";var chr1,chr2,chr3,enc1,enc2,enc3,enc4;var i=0;input=Base64._utf8_encode(input);while(i<input.length){chr1=input.charCodeAt(i++);chr2=input.charCodeAt(i++);chr3=input.charCodeAt(i++);enc1=chr1>>2;enc2=((chr1&3)<<4)|(chr2>>4);enc3=((chr2&15)<<2)|(chr3>>6);enc4=chr3&63;if(isNaN(chr2)){enc3=enc4=64;}else if(isNaN(chr3)){enc4=64;}output=output+this._keyStr.charAt(enc1)+this._keyStr.charAt(enc2)+this._keyStr.charAt(enc3)+this._keyStr.charAt(enc4);}return output;},decode:function(input){var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(i<input.length){enc1=this._keyStr.indexOf(input.charAt(i++));enc2=this._keyStr.indexOf(input.charAt(i++));enc3=this._keyStr.indexOf(input.charAt(i++));enc4=this._keyStr.indexOf(input.charAt(i++));chr1=(enc1<<2)|(enc2>>4);chr2=((enc2&15)<<4)|(enc3>>2);chr3=((enc3&3)<<6)|enc4;output=output+String.fromCharCode(chr1);if(enc3!=64){output=output+String.fromCharCode(chr2);}if(enc4!=64){output=output+String.fromCharCode(chr3);}}output=Base64._utf8_decode(output);return output;},_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;},_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;}}

