function check(){   
   if(document.getElementById("keyIndex").value == "-1")
       document.f.submit();
   else 
      return false;
}

function checkforweb(){   
   if(document.getElementById("keyIndex").value == "-1")
       document.f.submit();
   else 
      return false;
}
function setfocus() {
      document.f.w.focus(); 
      return;
} 

function go_search(url_f,input_id){
                var pw= encodeURI(document.getElementById(input_id).value);
                window.location.href= "/"+url_f+"?w="+pw;
		//return false;
}



function getMovie(movieName)
{
    if(navigator.appName.indexOf("Microsoft") != -1)
    {
        return window[movieName];
    }
    else
    {
        if(document[movieName].length != undefined)
        {
            return document[movieName][1];
        }
        return document[movieName];
    }
}
function sendStock2as(){
	//alert(stockid);
	getMovie('gghq').sendStock(stockid);
	//getMovie('gghq').focus();
}

function post_adv(){
   if(document.getElementById("title").value.length>0||document.getElementById("content").value.length>0){
        var x = new Ajax('HTML');
		x.post('/ajax','act=addmess&title='+document.getElementById("title").value+'&content='+document.getElementById("content").value+'&a='+Math.random(), function(s) {

			if(s==1){
		        alert("留言成功");
			}else{
		        alert("留言失败");
			}
			hiddlepos();
 
		});
   }else{
       alert("请输入标题或者内容");
   }
}

function reset_adv(){
   document.getElementById("title").value="";
   document.getElementById("content").value="";
}

function change(code){
  if(parseInt(code)!=1){
     document.getElementById("flash").style.display="none";
	 document.getElementById("hiddenflash").style.display="none";
     document.getElementById("showflash").style.display="";
  }else{
     document.getElementById("flash").style.display="";
	 document.getElementById("hiddenflash").style.display="";
     document.getElementById("showflash").style.display="none";
  }
}
function addCookie()
{
 if (document.all)
    {
       window.external.addFavorite('http://'+getdomain,'同花顺搜牛网');
    }
    else if (window.sidebar)
    {
       window.sidebar.addPanel('同花顺搜牛网', 'http://'+getdomain, "");
 }
}

function setHomepage(){
 if (document.all)
    {
        document.body.style.behavior='url(#default#homepage)';
  document.body.setHomePage('http://'+getdomain);
 
    }
    else if (window.sidebar)
    {
    if(window.netscape)
    {
         try
   { 
            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); 
         } 
         catch (e) 
         { 
    alert( "该操作被浏览器拒绝，如果想启用该功能，请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true" ); 
         }
    }
    var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
    prefs.setCharPref('browser.startup.homepage','http://'+getdomain);
 }
}

var sobjTimer; 
function showpos(e,obj,pos){
	var div_height =140;
	if(sobjTimer){  
		window.clearInterval(sobjTimer);  
	}	
	e=e?e:window.event;	
	mX = e.pageX || e.clientX + document.body.scrollLeft - document.body.clientLeft;
	mY = e.pageY || e.clientY + document.body.scrollTop  - document.body.clientTop;
	document.getElementById("Layer2").style.left=(mX -50)+"px";    
	if(pos==0){ 
		document.getElementById("Layer2").style.top=(mY +15)+"px";
	}else{
		document.getElementById("Layer2").style.top=(mY -180)+"px";
	}
	document.getElementById("Layer2").style.display = "block";    
} 
function ClearTimer(){
	if(sobjTimer){  
		window.clearInterval(sobjTimer);  
	}
	sobjTimer = setInterval("hiddlepos()",10000);  
} 
function hiddlepos(){  
document.getElementById("Layer2").style.display = "none";
}
function divmove(){
if(sobjTimer){  
 window.clearInterval(sobjTimer);  
}
}  


function get_tdomain(){
	var url = window.location.href;
	var domains = url.split("/");
	return domains[2];
}	

