function $(id) { return document.getElementById(id); }
function addslashes(str) { return (str+'').replace(/([\\"'])/g, "\\$1").replace(/\0/g, "\\0"); }
function stripslashes(str) { return str.replace(/(\\{1,})/g, ""); }
function is_int(str) { return (str == parseInt(str)) }

function is_email(str) { return (str.match(/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[A-Z]{2}|com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum)$/i)==null) }

function unset(array,str){ var output=[]; for(var i in array){ if (i!=str) output[i]=array[i]; } return output; }
function isset(str){ return(typeof(str)!='undefined'); }

function ltrim(str, chars) { chars = chars || "\\s"; str= str.replace(new RegExp("^[" + chars + "]+", "g"), ""); return str; }
function rtrim(str, chars) { chars = chars || "\\s"; str= str.replace(new RegExp("[" + chars + "]+$", "g"), ""); return str; }
function trim(str, chars) { return ltrim(rtrim(str, chars), chars); }

var DWS = {
	emptyFunction: function() { return false; },
	addLoadEvent: function(f) {
		var ol = window.onload;
		if(typeof(ol) == 'function') window.onload = function() { ol(); f(); }
		else if(typeof(f) == 'function') window.onload = f;
	},
	/*display: function(o) { 
		var d=o.style.display;
		if (o.nodeName == 'TD' && (d=='none' || d==''))
		{
			var td = document.createElement('td');
			td.setAttribute('id', o.getAttribute('id'));
			td.setAttribute('colspan', o.getAttribute('colspan'));
			td.style.display = 'table-cell';
			td.innerHTML = o.innerHTML;
			o.parentNode.appendChild(td);
			o.parentNode.removeChild(o);
		}
		else
		{
			if (d!='' && d!='none') o.style.display='none'
			else o.style.display=(arguments.length>1 ? "inline":"block") 
		}

	},*/
	setOpacity: function(obj, o) {
		obj.style.opacity=(o/100);
		obj.style.filter='alpha(opacity='+o+');';
	},
	getTopPos: function(obj) {
		var r = obj.offsetTop;
		while((obj = obj.offsetParent) != null) r += obj.offsetTop;
		return r;
	},
	getLeftPos: function(obj) {
		var r = obj.offsetLeft;
		while((obj = obj.offsetParent) != null) r += obj.offsetLeft;
		return r; 
	},
	CheckAll: function(l,v) { l=l.getElementsByTagName('input'); for(i in l) { if (l[i].type=='checkbox') { l[i].checked=v; }}},
	isDate: function(d) { return (d.match(/[0-9]{2}:[0-9]{2}/) && d.substr(0,2)<=23 && d.substr(0,2)>=0 && d.substr(3,2)>=0 && d.substr(3,4)<=59) },
	disallowPNG: (navigator.appVersion.indexOf('MSIE') != -1) && !this.isOpera,
	o2Str: function(o) { var r=[]; for(a in o) { if (isset(o[a])) { r.push(a+': '+o[a]); } } return '{'+r.join(', ')+'}'; },
	copy:function(e, target)    {
        var eId      = $(e);
        var copyE    = eId.cloneNode(true);
        var cLength  = copyE.childNodes.length -1;
        copyE.id     = e+'-copy';

        for(var i = 0; cLength >= i;  i++)    {
        if(copyE.childNodes[i].id) {
        var cNode   = copyE.childNodes[i];
        var firstId = cNode.id;
        cNode.id    = firstId+'-copy'; }
        }
        $(target).appendChild(copyE);
        },
    weekdays: ['lundi','mardi','mercredi','jeudi','vendredi','samedi','dimanche']
};


var mouseX, mouseY;
function mouseMove(e) {
	// On mémorise les pisitions 
	mouseX = (!document.all) ? e.pageX : event.x+DWS.body.scrollLeft;
	mouseY = (!document.all) ? e.pageY : event.y+DWS.body.scrollTop;
}

/*
function XopenLogin() {
	var i = this.href.indexOf('#');
	lr = (i>=0)?this.href.substring(0,i):this.href;
	smailPopup.setTitle('<span>'+(this.title || 'Se connecter sur Smail.fr')+'</span><p style="margin: 0;">Nouveau sur Smail ? <a href="/inscription.php">Inscris-toi</a></p>');

	loginform = document.createElement('form');
	loginform.id = 'lfrm_popup';

	loginform.innerHTML = '<div class="field"><label for="authlogin" class="left">Pseudo :</label><input name="authlogin" id="authlogin" class="txt" type="text" /></div><div class="field"><label for="authpassword" class="left">Password :</label><input name="authpassword" id="authpassword" class="txt" type="password" /></div><div class="field"><label class="left">&nbsp;</label><input value="Se connecter" type="submit" name="submit" /></div><div style="text-align: center;"><br /><input name="persist" id="persist" value="1" type="checkbox" /><label for="persist">Je souhaite rester connecté</label></div><hr /><div style="text-align: center;"><a href="/perdu.php" onclick="javascript: return popup(\'/perdu.php\', 400, 275);">Mot de passe perdu ?</a></div>';
	
	smailPopup.content.appendChild(loginform);
	smailPopup.show();
	return false;
}*/

DWS.addLoadEvent(function() {

DWS.body = document.getElementsByTagName("body").item(0);

DWS.body.onmousemove = mouseMove;

screenMask = {
	scrmask: false,
	init: function() {
		this.scrmask = document.createElement('div');
		this.scrmask.id = 'scrmask';
		DWS.body.appendChild(this.scrmask);
		/*if(DWS.disallowPNG) DWS.addCSS('* html #scrmask, * html #popup { background-image: none; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="/images/transparent.png", sizingMethod="scale"); }');*/
	},
	show: function() { this.scrmask.style.display = 'block'; },
	hide: function() { this.scrmask.style.display = 'none'; },
	height: function(x) { this.scrmask.style.height = x; }
}; screenMask.init();


smailPopup = {
	div: false,
	divC: false,
	close: false,
	title: false,
	content: false,
	move: false,
	moveX: 0,
	moveY: 0,

	init: function() {
		var _this = this;
		this.div = document.createElement('div');
		this.div.id = 'popup';

		var divC = document.createElement('div');
		divC.id = 'popupC';
		this.div.appendChild(divC);
		this.divC = divC;

		this.close = document.createElement('a');
		this.close.href = '#';
		this.close.innerHTML = '&nbsp;';
		this.close.id='closePopup';
		this.close.title = 'Fermer';
		this.close.onclick = function() { _this.hide(); return false; };
		divC.appendChild(this.close);
		
		this.title = document.createElement('div');
		this.title.id = 'popupTitle';
		divC.appendChild(this.title);

		this.content = document.createElement('div');
		this.content.id = 'popupContent';
		divC.appendChild(this.content);
		
		DWS.body.appendChild(this.div);

		// Move
		this.title.onmousedown = function() { 
			smailPopup.move = true; 
			smailPopup.moveX = mouseX - DWS.getLeftPos(smailPopup.div);
			smailPopup.moveY = mouseY - DWS.getTopPos(smailPopup.div);
			DWS.setOpacity(smailPopup.divC, 70);
		};
		this.title.onmouseup = function() { 
			smailPopup.move = false; 
			DWS.setOpacity(smailPopup.divC, 100);
		};
		var mm = DWS.body.onmousemove;

		DWS.body.onmousemove = function(e) {
			mm(e); 
			try	{
				if(smailPopup && smailPopup.move) {
					smailPopup.div.style.top = (mouseY-smailPopup.moveY) + 'px';
					smailPopup.div.style.left = (mouseX-smailPopup.moveX) + 'px';
				}
			} catch (e) {}
		};
	},

	setTitle: function(t, c) {
		this.title.innerHTML = t ? t : '';
		this.div.className = c ? c : 'smail';
	},
	show: function(nc) {
		this.hideSelect(true);
		screenMask.show();
		this.div.style.visibility = 'hidden';
		this.div.style.display = 'block';
		this.close.style.display = (nc==true)?'none':'block';
		this.resize();
		this.div.style.visibility = 'visible';
		document.onkeyup = function (e){e=e||event||this.parentWindow.event; if(e.keyCode==27) smailPopup.hide();}
	},
	hide: function() {
		this.clear();
		this.hideSelect(false);
		this.div.style.display = 'none';
		screenMask.hide();
	},
	resize: function() {
		var arrayPageSize = getPageSize();
		var arrayPageScroll = getPageScroll();
		this.div.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 15 - this.div.offsetHeight) / 2) - 10 + 'px');
		if (this.div.style.top.substr(0,1) == '-') this.div.style.top='0px';

		this.div.style.left = (((arrayPageSize[0] - this.div.offsetWidth) / 2) + 'px');
		if (this.div.style.left.substr(0,1) == '-') this.div.style.left='0px';
		
		screenMask.height(arrayPageSize[1] + 'px');
	},
	clear: function() {
		var f = null;
		while(f = this.content.firstChild) this.content.removeChild(f);
	},
	hideSelect: function(v) {
		var selects = document.getElementsByTagName("select");
		for (i = 0; i != selects.length; i++) {
			selects[i].style.visibility = v?'hidden':'visible';
		}
	}
}; smailPopup.init();

});


function getPageScroll(){
	var yScroll;
	var xScroll;
	if (self.pageYOffset) {
		xScroll = self.pageXOffset;
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){	 // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
		xScroll = document.documentElement.scrollLeft;
	} else if (DWS.body) {// all other Explorers
		yScroll = DWS.body.scrollTop;
		xScroll = DWS.body.scrollLeft;
	}
	arrayPageScroll = new Array(xScroll,yScroll);
	return arrayPageScroll;
}

function getPageSize() {
	var xScroll, yScroll;
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = DWS.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (DWS.body.scrollHeight > DWS.body.offsetHeight){ // all but Explorer Mac
		xScroll = DWS.body.scrollWidth;
		yScroll = DWS.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = DWS.body.offsetWidth;
		yScroll = DWS.body.offsetHeight;
	}
	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
		if(window.scrollMaxY > 0 ) { windowWidth -= 17; }
		if(window.scrollMaxX > 0 ) { windowHeight -= 17; }
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (DWS.body) { // other Explorers
		windowWidth = DWS.body.clientWidth;
		windowHeight = DWS.body.clientHeight;
	}	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}
	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}
	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
	return arrayPageSize;
}

/* JSON2 */
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}('3(!l.m){m={}}(5(){5 f(n){7 n<10?\'0\'+n:n}3(6 S.w.p!==\'5\'){S.w.p=5(a){7 l.1o()+\'-\'+f(l.1p()+1)+\'-\'+f(l.1q())+\'T\'+f(l.1r())+\':\'+f(l.1s())+\':\'+f(l.1t())+\'Z\'};M.w.p=1u.w.p=1v.w.p=5(a){7 l.1w()}}q e=/[\\1x\\U\\V-\\W\\X\\Y\\11\\12-\\13\\14-\\15\\17-\\18\\19\\1a-\\1b]/g,G=/[\\\\\\"\\1y-\\1z\\1A-\\1B\\U\\V-\\W\\X\\Y\\11\\12-\\13\\14-\\15\\17-\\18\\19\\1a-\\1b]/g,8,x,1c={\'\\b\':\'\\\\b\',\'\\t\':\'\\\\t\',\'\\n\':\'\\\\n\',\'\\f\':\'\\\\f\',\'\\r\':\'\\\\r\',\'"\':\'\\\\"\',\'\\\\\':\'\\\\\\\\\'},o;5 H(b){G.1d=0;7 G.N(b)?\'"\'+b.y(G,5(a){q c=1c[a];3(6 c===\'I\'){7 c}7\'\\\\u\'+(\'1e\'+a.1f(0).1g(16)).1h(-4)})+\'"\':\'"\'+b+\'"\'}5 z(a,b){q i,k,v,9,A=8,h,2=b[a];3(2&&6 2===\'B\'&&6 2.p===\'5\'){2=2.p(a)}3(6 o===\'5\'){2=o.J(b,a,2)}1C(6 2){C\'I\':7 H(2);C\'K\':7 1D(2)?M(2):\'D\';C\'1E\':C\'D\':7 M(2);C\'B\':3(!2){7\'D\'}8+=x;h=[];3(6 2.9===\'K\'&&!2.1F(\'9\')){9=2.9;E(i=0;i<9;i+=1){h[i]=z(i,2)||\'D\'}v=h.9===0?\'[]\':8?\'[\\n\'+8+h.L(\',\\n\'+8)+\'\\n\'+A+\']\':\'[\'+h.L(\',\')+\']\';8=A;7 v}3(o&&6 o===\'B\'){9=o.9;E(i=0;i<9;i+=1){k=o[i];3(6 k===\'I\'){v=z(k,2);3(v){h.1i(H(k)+(8?\': \':\':\')+v)}}}}O{E(k 1j 2){3(1k.1l.J(2,k)){v=z(k,2);3(v){h.1i(H(k)+(8?\': \':\':\')+v)}}}}v=h.9===0?\'{}\':8?\'{\\n\'+8+h.L(\',\\n\'+8)+\'\\n\'+A+\'}\':\'{\'+h.L(\',\')+\'}\';8=A;7 v}}3(6 m.P!==\'5\'){m.P=5(a,b,c){q i;8=\'\';x=\'\';3(6 c===\'K\'){E(i=0;i<c;i+=1){x+=\' \'}}O 3(6 c===\'I\'){x=c}o=b;3(b&&6 b!==\'5\'&&(6 b!==\'B\'||6 b.9!==\'K\')){1m 1n 1G(\'m.P\');}7 z(\'\',{\'\':a})}}3(6 m.Q!==\'5\'){m.Q=5(c,d){q j;5 R(a,b){q k,v,2=a[b];3(2&&6 2===\'B\'){E(k 1j 2){3(1k.1l.J(2,k)){v=R(2,k);3(v!==1H){2[k]=v}O{1I 2[k]}}}}7 d.J(a,b,2)}e.1d=0;3(e.N(c)){c=c.y(e,5(a){7\'\\\\u\'+(\'1e\'+a.1f(0).1g(16)).1h(-4)})}3(/^[\\],:{}\\s]*$/.N(c.y(/\\\\(?:["\\\\\\/1J]|u[0-1K-1L-F]{4})/g,\'@\').y(/"[^"\\\\\\n\\r]*"|1M|1N|D|-?\\d+(?:\\.\\d*)?(?:[1O][+\\-]?\\d+)?/g,\']\').y(/(?:^|:|,)(?:\\s*\\[)+/g,\'\'))){j=1P(\'(\'+c+\')\');7 6 d===\'5\'?R({\'\':j},\'\'):j}1m 1n 1Q(\'m.Q\');}}})();',62,115,'||value|if||function|typeof|return|gap|length||||||||partial||||this|JSON||rep|toJSON|var||||||prototype|indent|replace|str|mind|object|case|null|for||escapeable|quote|string|call|number|join|String|test|else|stringify|parse|walk|Date||u00ad|u0600|u0604|u070f|u17b4|||u17b5|u200c|u200f|u2028|u202f||u2060|u206f|ufeff|ufff0|uffff|meta|lastIndex|0000|charCodeAt|toString|slice|push|in|Object|hasOwnProperty|throw|new|getUTCFullYear|getUTCMonth|getUTCDate|getUTCHours|getUTCMinutes|getUTCSeconds|Number|Boolean|valueOf|u0000|x00|x1f|x7f|x9f|switch|isFinite|boolean|propertyIsEnumerable|Error|undefined|delete|bfnrt|9a|fA|true|false|eE|eval|SyntaxError'.split('|'),0,{}))

/* Dom Builder 
function $db(p,t)
{
    for(var i in t) 
    {
        var tag = i.split('_')[0];
        var e = document.createElement(tag);
        typeof(t[i])=='object' ? $db(p.appendChild(e),t[i]) : tag=='t'?p.appendChild(document.createTextNode(t[i])) : tag=='class'?p.className=t[i]: tag=='s'?p.style.cssText=t[i]: p[i]=t[i];
    }
    return p
}

function HTML2JSON(html){ return DOM2JSON(HTML2DOM(html)); }
function DOM2JSON(Element){
var node=new Object();
if(Element.nodeName=="#text"){ node=Element.nodeValue; }
else{
	if(Element.attributes !== null && Element.attributes.length > 0) 
	{
		var temp = arguments[1] || Element.nodeName.replace('#text', 't');
		if (!isset(node[temp])) node[temp] = new Object();

		for(var i=0;i<Element.attributes.length;i++) 
		{ 
			if(Element.attributes[i].nodeName == 'style') node[temp].s=Element.attributes[i].nodeValue;
			else { node[temp][Element.attributes[i].nodeName]=Element.attributes[i].nodeValue; }
		}
	}

	if(Element.childNodes.length>0)
	{ 
		for(var i=0;i<Element.childNodes.length;i++) 
		{ 
			var temp = Element.childNodes[i].nodeName;
			if (temp == '#text') { temp = 't'; }
			var temp2=temp;
			var j=2;
			while(isset(node[temp])) { temp=temp2+'_'+j++; }

			node[temp]  = DOM2JSON(Element.childNodes[i],temp);
			if(isset(node[temp][temp])) 
			{
				for(j in node[temp][temp]) if (!isset(node[temp][j])) node[temp][j] = node[temp][temp][j];
				delete node[temp][temp];
			}
		}
	}
}

return node;
}


function HTML2DOM(HTMLstring)
{
	var docBody = DWS.body || document.documentElement;
	if (!docBody) return;
	
	if (document.createRange && (rangeObj = document.createRange())){
	var docFrag, rangeObj;
	rangeObj.selectNode(docBody);
	
	if ( rangeObj
	&& rangeObj.createContextualFragment
	&& (docFrag = rangeObj.createContextualFragment(HTMLstring))){
	return docFrag;
	}
	} else if (
	'string' == typeof docBody.innerHTML
	&& document.createElement
	&& document.createDocumentFragment){
	var div = document.createElement('div');
	var docFrag = document.createDocumentFragment();
	div.innerHTML = HTMLstring;
	
	while (div.firstChild){
	docFrag.appendChild(div.firstChild)
	};
	
	return docFrag;
	}
	
	return null;
}


Function.prototype.forEach = function(object, block, context) {
    for (var key in object) {
        if (typeof this.prototype[key] == "undefined") {
            block.call(context, object[key], key, object);
        }
    }
};

function forEach(object, block, context) {
    if (object) {
        var resolve = Object; // default
        if (object instanceof Function) {
            // functions have a "length" property
            resolve = Function;
        } else if (object.forEach instanceof Function) {
            // the object implements a custom forEach method so use that
            object.forEach(block, context);
            return;
        } else if (typeof object.length == "number") {
            // the object is array-like
            resolve = Array;
        }
        resolve.forEach(object, block, context);
    }
}


/*
function Ajax() {
    this.failed = false;
    this.xmlhttp = null;
    this.method = 'GET';
    this.URLString = null;
    this.timer = null;
    this.output=null;
    this.resetFunction();
};

Ajax.prototype = {
    resetFunction: function() {
        this.onloading = DWS.emptyFunction;
        this.onsuccess = DWS.emptyFunction;
        this.createAJAX();
    },

    createAJAX: function() {
        this.failed = false;
        try {
            this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e1) {
            try {
                this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e2) {
                this.xmlhttp = null;
            }
        }
        if (! this.xmlhttp) {
            if (typeof XMLHttpRequest != "undefined") {
                this.xmlhttp = new XMLHttpRequest();
            } else {
                this.failed = true;
            }
        }                
    },

    timerRequest: function(file, time, options) {
        var _this = this;
        this.timer = setInterval(function() { _this.request(file, options); }, time);
    },

    stopTimer: function() {
        clearInterval(this.timer);
    },
    request: function(file, options) {
        if(options) {
            this.onsuccess = options.onsuccess || this.onsuccess;
            this.method = options.method || this.method;
        }
        //this.xmlhttp.output = this.output;

        if(!this.failed) {
            if (this.xmlhttp) {
                var self = this;
                if (this.method == "GET") {
                    file += '?'+this.URLString;
                    this.xmlhttp.open(this.method, file, true);
                } else {
                    this.xmlhttp.open(this.method, file, true);
                    try {
                        this.xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
                    } catch (e) { }
                }
                this.xmlhttp.onreadystatechange = function() {
                    switch (self.xmlhttp.readyState) {
                        case 1:
                        case 2:
                        case 3:
                            self.onloading();
                            break;
                        case 4:
                            self.failed = false;
                            self.responseText = self.xmlhttp.responseText;
                            self.responseXML = self.xmlhttp.responseXML;
                            self.onsuccess(self.xmlhttp);
                    }
                };
                this.failed = true;
                this.xmlhttp.send(this.URLString);
            }
        }
    }
};
*/


/* sprintf */
function str_repeat(i, m) { for (var o = []; m > 0; o[--m] = i); return(o.join('')); }
function sprintf () {
  var i = 0, a, f = arguments[i++], o = [], m, p, c, x;
  while (f) {
    if (m = /^[^\x25]+/.exec(f)) o.push(m[0]);
    else if (m = /^\x25{2}/.exec(f)) o.push('%');
    else if (m = /^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(f)) {
      if (((a = arguments[m[1] || i++]) == null) || (a == undefined)) throw("Too few arguments.");
      if (/[^s]/.test(m[7]) && (typeof(a) != 'number'))
        throw("Expecting number but found " + typeof(a));
      switch (m[7]) {
        case 'b': a = a.toString(2); break;
        case 'c': a = String.fromCharCode(a); break;
        case 'd': a = parseInt(a); break;
        case 'e': a = m[6] ? a.toExponential(m[6]) : a.toExponential(); break;
        case 'f': a = m[6] ? parseFloat(a).toFixed(m[6]) : parseFloat(a); break;
        case 'o': a = a.toString(8); break;
        case 's': a = ((a = String(a)) && m[6] ? a.substring(0, m[6]) : a); break;
        case 'u': a = Math.abs(a); break;
        case 'x': a = a.toString(16); break;
        case 'X': a = a.toString(16).toUpperCase(); break;
      }
      a = (/[def]/.test(m[7]) && m[2] && a > 0 ? '+' + a : a);
      c = m[3] ? m[3] == '0' ? '0' : m[3].charAt(1) : ' ';
      x = m[5] - String(a).length;
      p = m[5] ? str_repeat(c, x) : '';
      o.push(m[4] ? a + p : p + a);
    }
    else throw ("Huh ?!");
    f = f.substring(m[0].length);
  }
  return o.join('');
}


function in_array(needle, haystack, argStrict) {
    var key = '', strict = !!argStrict;
    if (strict) {
        for (key in haystack) {
            if (haystack[key] === needle) {
                return true;
            }
        }
    } else {
        for (key in haystack) {
            if (haystack[key] == needle) {
                return true;
            }
        }
    }
    return false;
}
