﻿//var j = jQuery.noConflict();

//AJAX方法取得数据并显示到页面上
function getfooter()
{
   //$("#load").show();
    $.ajax({
        type: "get",//使用get方法访问后台
        dataType: "json",//返回json格式的数据
        url: "/getfooter",//要访问的后台地址
        data: "{}",//要发送的数据
        //complete :function(){$("#load").hide();},//AJAX请求完成时隐藏loading提示
        success: function(json){//json为返回的数据，在这里做数据绑定
            var data = json["result"];
            $("#footer").html(data);
        }
    });
}

//导航高亮显示
function setFocusNav()
{
    var _thisurl = document.location.href;
    
    if(_thisurl.lastIndexOf("/index")!=-1)
    {
        $("#Image11").attr("src",$("#Image11").attr("src").replace(".gif","_over.gif"));
    }
    if(_thisurl.lastIndexOf("/lastest")!=-1)
    {
        $("#Image12").attr("src",$("#Image12").attr("src").replace(".gif","_over.gif"));
    }
    if(_thisurl.lastIndexOf("/best")!=-1)
    {
        $("#Image13").attr("src",$("#Image13").attr("src").replace(".gif","_over.gif"));
    }
    if(_thisurl.lastIndexOf("/tags")!=-1)
    {
        $("#Image14").attr("src",$("#Image14").attr("src").replace(".gif","_over.gif"));
    }
    if(_thisurl.lastIndexOf("/post")!=-1)
    {
        $("#Image15").attr("src",$("#Image15").attr("src").replace(".gif","_over.gif"));
    }
}

$(function(){setFocusNav();setTimeout('getfooter()',1000);setInterval('getfooter()',1000*300);});

function CheckKeywords()
{
    var kw=document.getElementById("ctl00_cphSearch_Search1_txtKeywords").value;
    kw = kw.replace("\"", "").replace("%", "").replace("&", "").replace(":", "").replace("\\", "").replace("/", "");
    kw = kw.replace(">", "").replace("<", "").replace(".", "");
    
    if(kw=="")
    {
        alert("请输入关键字");
    }
    else
    {
        var _url="/"+window.encodeURIComponent(kw)+"/search";
        top.location.replace(_url);
    }
}

//playSwf("134x49_torino.swf",134,49);
function playSwf(fPath,width,height) 
{	
	//alert(fPath,width,height);
	var str;
	str = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+width+"\" height=\""+height+"\">\n\r";
	str += "	<param name=\"movie\" value=\""+fPath+"\" />\n\r";
	str += "	<param name=\"quality\" value=\"high\" />\n\r";
	str += "	<param name=\"wmode\" value=\"transparent\" />\n\r";
	str += "	<embed src=\""+fPath+"\" quality=\"high\"  width=\""+width+"\" height=\""+height+"\" type=\"application/x-shockwave-flash\"></embed>\n\r";
	str += "</object>\n\r";
	//alert(str);
	document.write(str);
}