﻿this.tooltip = function(){	
	/* CONFIG */		
		xOffset = 15;
		yOffset = 80;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */		
	$(".centerContent_left_div_div2>ul>li>a").hover(function(e){											  
		this.t = this.title;
		this.title = "";									  
		$("body").append("<p id='tooltip'>"+ this.t +"</p>");
		$("#tooltip")
			.css("top",(e.pageY + xOffset) + "px")
			.css("left",(e.pageX - yOffset) + "px")
			.fadeIn("fast");		
    },
	function(){
		this.title = this.t;		
		$("#tooltip").remove();
    });	
	$(".centerContent_left_div_div2>ul>li>a").mousemove(function(e){
		$("#tooltip")
			.css("top",(e.pageY + xOffset) + "px")
			.css("left",(e.pageX - yOffset) + "px");
	});			
};



// starting the script on page load
$(document).ready(function(){
	tooltip();
});

// JScript File

    function setTab(tabSelector, contSelector) {
        $(contSelector).each(function(i) { $(this).hide(); });
        $(contSelector).eq(0).show();
        
        $(tabSelector).each(function(i) {
            $(this).hover(function() {
                $(contSelector).each(function(i) {
                $(this).hide();
            });
            $(contSelector).eq(i).show();
            });
        });
    }

    //指定Tab标签的焦点
    //tabSelector tab的jQuery选择器表达式
    //contSelector tab的jQuery选择器表达式
    //index 焦点tab的索引，从0开始
    function setAccordion(tabSelector, contSelector, index) {
        
        $(tabSelector).each(function(i) { $(this).css("cursor", "pointer") });
        $(contSelector).each(function(i) { $(this).hide(); });
        $(contSelector).eq(index).show();
        $(tabSelector).each(function(i) {
            $(this).click(function() {
                $(contSelector).each(function(j) {
                if (i != j) {
                    $(this).hide();
                    }
                    
                });
                $(contSelector).eq(i).slideToggle("slow");
            });
        });
    }


    function goSearchKeyword(searchKeyword) {
        window.location.href = "search.aspx?q=" + escape(searchKeyword)
    
    }
    
    //点击广告计数
    function AdvCount(LID, URL) {     
        $.post(
            "/ajax/ajaxadvhitcount.aspx",
            { Action: "post",
                lid: LID
            },
            function(data) {
                if (data) {

                }
                else {

                }
        });
        window.open(URL);
    
    }
    
    
    //点击竞价计费
    function SearchBidMoney(bid, username, bidtype, bidmoney, amid, URL) {  
        if  ( bidtype==99){
            $.post(
                "/ajax/ajaxsearchbidmoney.aspx",
                { Action: "post",
                    bid: bid, 
                    username: username,
                    bidtype: bidtype,
                    bidmoney: bidmoney,
                    amid: amid,
                    url: URL
                },
                function(data) {
                    if (data) {

                    }
                    else {

                    }
            });
        }
        window.open(URL);
    
    }
    
    //注销
    function LoginOut() {     
        $.post(
            "/ajax/ajaxuserloginout.aspx",
            { Action: "post"
            },
            function(data) {
                if (data) {

                }
                else {

                }
        });
        window.location.href = "index.aspx" ;
    
    }
   
   //
    function copyToClipBoard(txtContent){
        var clipBoardContent='';
        clipBoardContent+=txtContent;
        window.clipboardData.setData("Text",clipBoardContent);
    }
     