function changeDiv(obj, id) {
	$("li[tag=li]").each(function () {
		$(this).removeClass("on");
	});
	if(document.getElementById("ticketSelect")!=null){
	document.getElementById("ticketSelect").selectedIndex=0;
	}
	$(obj).addClass("on");
	$("div[tag=show]").each(function () {
		$(this).css({"display":"none"});
	});
	$("#"+id).css({"display":""});
	
}
function changeSelDiv(obj){
if(obj.value==""){
return;
}
$("li[tag=li]").each(function () {
		$(this).removeClass("on");
	});
	$(obj).addClass("on");
	$("div[tag=show]").each(function () {
		$(this).css({"display":"none"});
	});
	$("#"+obj.id).parent("li").addClass("on");
	$("#"+obj.value).css({"display":""});;
}

//Enter 回车提交
function submitEnter(event, btnId) {
	if(event.keyCode == 13) {
		document.getElementById(btnId).click();
	}
}
 function SearchLine()
 {  
     if($("#linekeyword").val()!='')
     {
        window.location.href="/travel/line.htm?keyword="+encodeURI($("#linekeyword").val());//+"&searchtype="+;
        
     }
     else
     {
         window.location.href="/travel/line/index.html";
     }     
 }
 function SearchTicket()
 {  
    if($("#ticketkeyword").val()!='')
     {
         window.location.href="http://www.suiyoo.com/ticket/list.htm?ticketkeyword="+encodeURI($("#ticketkeyword").val());
        
     }
     else
     {
         window.location.href="http://www.suiyoo.com/ticket/list.htm";
     } 
 }
 function AddFavorite(url,title){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}

 function SetHome(obj,url)
{
  try
  {
    obj.style.behavior='url(#default#homepage)';
    obj.setHomePage(url);
  }
  catch(e)
  {
    if(window.netscape)
    {
      try
      {
        netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
      }
      catch (e)
      {
        alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将[signed.applets.codebase_principal_support]设置为'true'");
      }
      var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
      prefs.setCharPref('browser.startup.homepage',url);
    }
  }
}
function mouseIn(mouseX,mouseY,id)
{
  var element = $('#'+id);
  var offset = element.offset();
  var left = offset.left;
  var top = offset.top;
  var right = left + element.width();
  var bottom = top + element.height();
  if(mouseX < left || mouseX > right || mouseY < top || mouseY > bottom)
  {
    return false;
  }
  else
  {
    return true;
  }
}
function switchmodTag(modtag,modcontent,modk,tabnum) { 
    for(i=1; i < tabnum; i++) {
      if (i==modk) {
        document.getElementById(modtag+i).className="bigsearchbuton"; 
        document.getElementById(modcontent+i).style.display="inline";
        }
      else {
        document.getElementById(modtag+i).className="";
        document.getElementById(modcontent+i).style.display="none"; 
        }
    }
  }
  function gohref(url)
  {
     window.location.href=url;
  }
  function hotsearch()
			{
			     var searchcontent = $('#Top_search_box_1');
                  var offset = $('#linekeyword').offset();
                  var left2 = offset.left + $('#linekeyword').width()-15;
                  var top2 = offset.top+32;
                  searchcontent.css('position','absolute');
                  searchcontent.css('z-index',5000);
                  searchcontent.css(
                  {
                    'left':left2+"px",
                    "top":top2+"px"
                  }
                  );
                  searchcontent.css("display","block");
			}
			$(document).click(function(e)
            {
              var mouseX = e.pageX;
              var mouseY = e.pageY;
              if(!mouseIn(mouseX,mouseY,'linekeyword') )
              {
                $('#Top_search_box_1').hide();
              }
            }
            )