    function cl(v) {
        console.log(v);
    }


    
    /**
     * str_replace - similar to the PHP function
     */
    function str_replace(search, replace, subject, count) {
        f = [].concat(search), r = [].concat(replace), s = subject, ra = r instanceof Array, sa = s instanceof Array;
        s = [].concat(s);
        if (count) {
            this.window[count] = 0;
        }
        for (i = 0, sl = s.length; i < sl; i++) {
            if (s[i] === '') {
                continue;
            }
            for (j = 0, fl = f.length; j < fl; j++) {
                temp = s[i] + '';
                repl = ra ? (r[j] !== undefined ? r[j] : '') : r[0];
                s[i] = (temp).split(f[j]).join(repl);
                if (count && s[i] !== temp) {
                    this.window[count] += (temp.length - s[i].length) / f[j].length;
                }
            }
        }
        return sa ? s : s[0];
    }


    /**
     * is_array - similar to the PHP function
     */
      function is_array(input){
        return typeof(input)=='object'&&(input instanceof Array);
      }


    function callFunction(callback, context /*, args */) {
        console.log(callback);
        console.log(context);
        var args = Array.prototype.slice.call(arguments, 2);
        var namespaces = callback.split(".");
        var func = namespaces.pop();
        for (var i = 0; i < namespaces.length; i++) {
            context = context[namespaces[i]];
        }
        return context[func].apply(context, args);
    }





	function getWindowWidth(){
		if (document.body && document.body.offsetWidth) {
		 winW = document.body.offsetWidth;
		}
		if (document.compatMode=='CSS1Compat' &&
			document.documentElement &&
			document.documentElement.offsetWidth ) {
		 winW = document.documentElement.offsetWidth;
		}
		if (window.innerWidth) {
		 winW = window.innerWidth;
		}

		return winW;
	}



	function getWindowHeight(){
		if (document.body && document.body.offsetHeight) {
		 winH = document.body.offsetHeight;
		}
		if (document.compatMode=='CSS1Compat' &&
			document.documentElement &&
			document.documentElement.offsetHeight ) {
		 winH = document.documentElement.offsetHeight;
		}
		if (window.innerHeight) {
		 winH = window.innerHeight;
		}

		return winH;
	}

