function validate(obj)
{
	// url / source / ext / page / file.html
    var source = "all";
    var ext = "all";

    if(obj.source!=null) {
        source = obj.source.value;
    }
    
    if(obj.ext!=null) {
        ext = obj.ext.value;
    }
    
    search = trim(obj.search.value);
    
    window.location.href = "http://www.absub.com/files/" + source + "/" + ext + "/1/" + search.replace(" ","+") + ".html";
	return false;		
}

function HideContent(d) {
    if(d.length < 1) { return; }
    document.getElementById(d).style.display = "none";
}

function ShowContent(d) {
    if(d.length < 1) { return; }
    document.getElementById(d).style.display = "block";
}

function trim(str, chars) {
	return ltrim(rtrim(str, chars), chars);
}
 
function ltrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}
 
function rtrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}