﻿function GetParm(){
var Url=top.window.location.href;
var u,g,StrBack='';
if(arguments[arguments.length-1]=="#")
u=Url.split("#");
else
u=Url.split("?");
if (u.length==1) g='';
else g=u[1];
if(g!=''){
gg=g.split("&");
var MaxI=gg.length;
str = arguments[0]+"=";
for(i=0;i<MaxI;i++){
if(gg[i].indexOf(str)==0) {
StrBack=gg[i].replace(str,"");
break;}} }return StrBack;} 
$(document).ready(function(){   
   var itemID = GetParm('itemID').toString();  
   if(itemID.length>0){
   $.ajax({        
        type: "GET",
        url: "data.aspx", 
        dataType:"text", 
        data: "itemID="+itemID,
        success: function(result){ 
        $(".fl_lm3").each(function(item){if(item==result){$(this).show();$(this).prev().attr("class","fl_lm1 hong");          
        }});
      } 
    });}    
    else{  $(".fl_lm3").each(function(item){if(item==0){$(this).show().prev().attr("class","fl_lm1 hong");}});}
    $(".fl_lm1").click(function(){ 
          $(".fl_lm3").hide();   
          $(this).next(".fl_lm3").show(); 
          $(".fl_lm1").attr("class","fl_lm2 lan"); 
          $(this).attr("class","fl_lm1 hong"); 
     });  
     $(".fl_lm2").click(function(){ 
          $(".fl_lm3").hide();   
          $(this).next(".fl_lm3").show(); 
          $(".fl_lm1").attr("class","fl_lm2 lan"); 
          $(this).attr("class","fl_lm1 hong"); 
     }); 
     $(".fl_lm3>ul>li>a").click(function(event){  
          $(".fl_li2").attr("class","fl_li"); 
          $(".fl_lm3>ul>li>a").attr("class",""); 
          $(this).parent().attr("class","fl_li2");
          $(this).attr("class","lan1 z");  
          var offset=$(event.target).offset();
          $(".divPop").hide() 
          $(this).parent().children(".divPop").css({ top: offset.top -8+"px", left: offset.left+$(event.target).width() +10+ "px" });
          $(this).parent().children(".divPop").show();  
          event.stopPropagation();
    });  
    $(document).click(function(event) { $(".divPop").hide() }); 
    $(".divPop").click(function(event) { $(".divPop").hide() }); 
    $("#q").val(decodeURI(GetParm("q")).replace(/\+/g," "));
    var options = { max:8,matchSubset:false,selectFirst:false,scroll:false};  
    $("#q").autocomplete("data.aspx",options);    
 });   
function showFlash(theSrc){
    var tFrame = document.getElementById('iframeFlash'); 
    tFrame.src=theSrc;
}
function bookmarksite(url,title){
if (document.all)
window.external.addFavorite(url,title);
else if (window.sidebar)
window.sidebar.addPanel(url,title, "")
}
 
