/*
window.GET = function(){
    var array = window.location.search.substring(1).split(/&;/);
        // URLs can be like either
        // "sample.html?test1=hi&test2=bye" or
        // "sample.html?test1=hi;test2=bye" 
    window._GET = {};
    for(var i = 0; i < array.length; i++){
        var assign = array[i].indexOf('=');
        if(assign == -1){
            _GET[array[i]] = true;//if no value, treat as boolean
        }else{
            _GET[array[i].substring(0, assign)] = array[i].substring(assign + 1);
        }
    }
}
*/

window.onload = function () { 
    var btnSignUp = document.getElementById("searchsubmit");
    var s = document.getElementById("s");

    var t1ck=true;
	if (document.getElementById("s").value.length < 3 ) {
		t1ck=false;
		document.getElementById("searchsubmit").disabled = true;
		document.getElementById("searchsubmit").style.opacity="0.3";
	}
	
    s.onkeyup = formValidation;
}

function formValidation(oEvent) { 
    oEvent = oEvent || window.event;
    var txtField = oEvent.target || oEvent.srcElement; 
	var slength = document.getElementById("s").value.length;
    var t1ck=true;
    
    if (slength < 3 ) {
		t1ck=false;
		document.getElementById("searchsubmit").disabled = true;
		document.getElementById("searchsubmit").style.opacity="0.3";
	}
	
	if (slength > 3 ) {
		t1ck=true;
	}
	
	if (t1ck) {
        document.getElementById("searchsubmit").disabled = false;
		document.getElementById("searchsubmit").style.opacity="1";
    } else {
        document.getElementById("searchsubmit").disabled = true;
		document.getElementById("searchsubmit").style.opacity="0.3";
    }
} 

