/*function check_advanced_search(kw)  { error = 0; if (kw.length < 3) { error_message = "Please enter atleast 3 characters for search"; error = 1; } if (kw == "Enter Product / Company Name") { error_message = "Please enter correct string for search"; error = 2; } if (error == 1) { alert(error_message); return false; } if (error == 2) { alert(error_message); return false; } else { return true; } }*/ 

function check_advanced_search()
{
	var str='';
	var from = '';
	form1 = document.quick_find;

        form1.ss.value = form1.ss.value.replace(/^\s+/g, '').replace(/\s+$/g, '');
	while(form1.ss.value.indexOf('  ')>0)
	{
		form1.ss.value = form1.ss.value.replace('  ',' ');	
	}
	form1.ss.value = form1.ss.value.replace(/[^a-zA-Z0-9+ ]/g, ' ');
	
	var temp=form1.ss.value.replace(/\s/g, '');
        if (form1.ss.value.length < 3)
        {
                alert("Enter at least three characters for search.");
                form1.ss.focus();
                return false;
        }
        else
        {
		_gaq.push(['_trackEvent', 'Search','HOME PAGE SEARCHBOX', form1.ss.value]);
		var a = form1.ss.value.replace(/\+/g, ' ');
		a = a.replace(/\s+/g, '+');
		str +='ss='+a;
		str = "http://www.hellotrade.com/suppliers?"+str;
		str = myReplace(str,"\\\\?\\\\&","?");
		window.location = str;
		return false;
	}
}

function myReplace(str, a, b) {
        var re = new RegExp(a, "g");
        var ret = str.replace(re,b);
        return ret;
}


function footer() { var value = ""; value = readCookie('v4iil'); var url = document.URL; var redirect = ""; if(url.match('/cgi/')) { redirect = '/'; } else { if(url.match('signout.html')) { redirect = '/'; } else { redirect = escape(url); } } if(value == null || value == "") { document.getElementById('signornot1').innerHTML = '<a href="http://my.hellotrade.com/cgi-bin/ht-joinfree.mp?action=joinfree&modid=HELLOTD">Join Free</a>&nbsp;&nbsp;&nbsp;&nbsp;<b>|</b>&nbsp;&nbsp;&nbsp;&nbsp;<a HREF="http://my.hellotrade.com/cgi-bin/ht-usr-login.mp?login=true&modid=HELLOTD&redirect=/" target="_top">Login</a>'; } else { document.getElementById('signornot1').innerHTML = '<A HREF="http://my.hellotrade.com/cgi-bin/ht-usr-login.mp?logoff=true&modid=HELLOTD&redirect=/" target="_top">Logout</A>&nbsp;&nbsp;&nbsp;&nbsp;<b>|</b>&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="http://my.hellotrade.com/" target="_top">My HelloTrade</A>'; } } function readCookie(name) { var ca = document.cookie.split(';'); var nameEQ = name + "="; for(var i=0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1, c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); } return null; }
