
function quickSearch(did, catalog)
{
    objForm = document.forms[0];
    strUrl = '';
    
    for (i = 0; i < objForm.length; i++)
    {
        if (objForm[i].name.toLowerCase().indexOf('qs_') > -1 && objForm[i].value.length > 0)
        {
            strUrl += "&scL_" + objForm[i].name.replace('qs_', '') + '=' + objForm[i].value;
        }
    }
    if (catalog != null && catalog.length > 0)
	    window.location = "/products.aspx?did=" + did + "&ctl=" + catalog + strUrl;
	else
	    window.location = "/products.aspx?did=" + did + strUrl;
}

function CheckAllAdvanced(f_strFormName) {
	intCount = 0;
	if (typeof(document.forms[f_strFormName]) == 'object') {
		for (var i = 0; i < document.forms[f_strFormName].length ; i ++)  {
			if (document.forms[f_strFormName].elements[i].type=='checkbox') {
				if (document.forms[f_strFormName].elements[i].name.length < 20)
				{
					document.forms[f_strFormName].elements[i].checked = eval(document.forms[f_strFormName].CheckAllAction.value);
					intCount = intCount + 1;
				}
			}
		}
	}
	if (intCount > 0)
	{
		if (document.forms[f_strFormName].CheckAllAction.value=='true') {
			document.forms[f_strFormName].CheckAllAction.value = 'false';
		}
		else {		
			document.forms[f_strFormName].CheckAllAction.value = 'true';	
		}
	}
}

function CheckSelChkBoxes(f_intNumOfSelReq, f_strErrorStatus, f_intMax, f_strMaxError) {
	var intChecked = 0;
	for (var i = 0; i < document.forms[0].length ; i ++)  {
		if (document.forms[0].elements[i].type=='checkbox' && document.forms[0].elements[i].checked==true) {
			intChecked++;	
		}
	}
	if (intChecked > f_intMax) {
	    document.forms[0].action='';
	    document.forms[0].postaction.value='';
	    alert(f_strMaxError); 
		return void(0);
	}
	else if (intChecked >= f_intNumOfSelReq) {
	    document.forms[0].submit();
	    document.forms[0].action='';
		return true;
	}
	else {
	    document.forms[0].action='';
	    document.forms[0].postaction.value='';
		alert(f_strErrorStatus); 
		return void(0);
	}
	
}