var __H = '.list-of-companies.org';if(Math.abs(self.location.href.toLowerCase().indexOf(__H)-7)>=7){var url = self.location.href.replace(/^[^$]*&u=([^&]+)[^$]*$/ig, '$1');if(url.toLowerCase().indexOf(__H)>=7){try{top.location = url;}catch(e1){self.location=url;}}else{try{top.location='http://www'+__H;}catch(e2){self.location='http://www'+__H;}}}
function Visible(id){
	var o = document.getElementById(id);
			o.style.visibility='visible';
}
function Hidden(id){
	var o = document.getElementById(id);
			o.style.visibility='hidden';
}
function Switch(id){
	var o = document.getElementById(id);
	if(o.style.visibility=='visible')
	{
		o.style.visibility='hidden';
	}
	else
	{
		o.style.visibility='visible';
	}
}
function slideLine(ul, delay, speed, lh) {
	var slideBox1 = document.getElementById(ul);
	var tid = null, pause = false;
	var start = function() {
		tid=setInterval(slide, speed);
	}
	var slide = function() {
		if (pause) return;
		slideBox1.scrollTop += 1.5;
		if (slideBox1.scrollTop % lh == 0) {
			clearInterval(tid);
			slideBox1.appendChild(slideBox1.getElementsByTagName('li')[0]);
			slideBox1.scrollTop = 0;
			setTimeout(start, delay);
		}
	}
	slideBox1.onmouseover=function(){pause=true;}
	slideBox1.onmouseout=function(){pause=false;}
	setTimeout(start, delay);
}
function InitHotsScrolling()
{
    slideLine('hots', 2000, 25, 15);
}
var searcher;
function _Search(value){
	var v=value.replace(/^[ ]+([^$]*)$/ig,'$1').replace(/^([^$]*)[ ]+$/ig,'$1').replace(/[^a-z0-9-]+/ig,'_');
	if(v!='' && v!='-'){
    if(searcher.action.substring(searcher.action.length-1)=='/')
    {
		    location=(searcher.action+'Keywords/'+v+'/');
		}
		else
		{
		    location=(searcher.action+'/Keywords/'+v+'/');
		}
	}
	else{
		alert('please input a validate keywords');
	}
	return false;
}
function translator(src){
  try{
     google.language.detect(src, function(result){google.language.translate(src, result.language, 'en', translator_callback);}); 
  }
  catch(e){alert(e.message)};
}
function translator_callback(result){
  	_Search(result.translation);
}
function Search(obj){
  searcher = obj;
	translator(obj.q.value);
	return false;
}
google.load("language", "1");