
EVERYZING.truncate_to = function(target, maxLen){
    maxLen = parseInt(maxLen);
    if (isNaN(maxLen) || maxLen <= 0){ return; }
    
    var target = jQuery(target);
    
    target.each(function(){
        jQuery(this).truncate(maxLen, {
            chars: / /,
            leave: false,
            trail: [true, "...", ""]
        });
    });
}

// set initial text value of search box
EVERYZING.initSearchField = function() {
	var sObj = document.getElementById("ezsearch-string");
	var words = "Search inside all video";
	sObj.value = words;
	sObj.className = "offField";
	sObj.onfocus = function() {
		if (sObj.value == words) {
			sObj.className = "onField"
			sObj.value = "";
		}
	};
	/*
	sObj.onblur = function() {
		sObj.className = "offField";
		sObj.value = words;
	};
	*/
}
