
	function ReturnGlobal (response) {eval(response);}
	
	function setCookie(c_name,value,expiredays) {
		var exdate=new Date();
		exdate.setDate(exdate.getDate()+expiredays);
		document.cookie=c_name+ "=" +escape(value)+
		((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
    }
	
	function openWindow(url,w,h,tb,stb,l,mb,sb,rs,x,y){
		var t=(top.layers)? ',screenX='+x+',screenY='+y: ',left='+x+',top='+y; //A LITTLE CROSS-BROWSER CODE FOR WINDOW POSITIONING
		tb=(tb)?'yes':'no'; stb=(stb)?'yes':'no'; l=(l)?'yes':'no'; mb=(mb)?'yes':'no'; sb=(sb)?'yes':'no'; rs=(rs)?'yes':'no';
		var x=window.open(url, 'newWin'+new Date().getTime(), 'scrollbars='+sb+',width='+w+',height='+h+',toolbar='+tb+',status='+stb+',menubar='+mb+',links='+l+',resizable='+rs+t);
		x.focus();
	}
	
	function entitiesToSymbols(text) {
		oDiv = document.createElement("DIV");
		oDiv.innerHTML = text;
		text = oDiv.innerText || oDiv.firstChild.nodeValue;
		return text;
	}
    
    function inArray(needle, haystack)
    {
    	for (var i in haystack)
    	{
    		if (needle == haystack[i])
    			return true;
        }
    }
    
    function JSONLength ( json ) {
    
        if ( typeof json != 'object' ) { return false; }
    
        var c = 0;
        
        for ( var i in json ) { c ++; }
        
        return c;
    
    }

    function copyText (text2copy) {
        if (window.clipboardData) {
            window.clipboardData.setData("Text",text2copy);
        } 
        else {
            var flashcopier = 'flashcopier';
            if(!document.getElementById(flashcopier)) {
                var divholder = document.createElement('div');
                divholder.id = flashcopier;
                document.body.appendChild(divholder);
            }
            document.getElementById(flashcopier).innerHTML = '';
            var divinfo = '<embed src="'+FilesURL+'_clipboard.swf" FlashVars="clipboard='+escape(text2copy)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
            document.getElementById(flashcopier).innerHTML = divinfo;
        }
    }
    
    String.prototype.toProperCase = function(){
        return this.toLowerCase().replace(/\w+/g,function(s){
            return s.charAt(0).toUpperCase() + s.substr(1);
        });
    }