﻿/// <reference path="../../js/jquery-1.6.1-vsdoc.js" />
function loadCode() {
    function slidesPicPlay() {
        var current = $('.slides .slide-pic .cur');
        var next = current.next();
        if (next == null || next.length == 0) {
            next = $('.slides .slide-pic li').eq(0);
        }

        current.attr('class', '');
        next.attr('class', 'cur');
    }

    function slidesBtnPlay() {
        var current = $('.slides .slide-li .cur');
        var next = current.next();
        if (next == null || next.length == 0) {
            next = $('.slides .slide-li li').eq(0);
        }

        current.attr('class', '');
        next.attr('class', 'cur');
    }

    function slidesPlay() {
        slidesPicPlay();
        slidesBtnPlay();
    }

    var label = 'slides-play';
    $(document).everyTime('3s', label, slidesPlay);

    var btns = $('.slide-li li');
    var pictures = $('.slide-pic li');

    btns.mouseenter(function () {
        $(document).stopTime(label);

        var i = btns.index(this);

        btns.attr('class', '');
        $(this).attr('class', 'cur');

        pictures.attr('class', '');
        pictures.eq(i).attr('class', 'cur');
    });

    btns.mouseleave(function () {
        $(document).everyTime('3s', label, slidesPlay);
    });

    if (typeof (_gat) != 'undefined' && _gat != null && typeof (_gaqAccount) != 'undefined' && _gaqAccount != null) {
        var pageTracker = _gat._getTracker(_gaqAccount);
        pageTracker._trackPageview('/index/track/company/');
    }

    var messageBox = $('#LR_User_Icon10');
    if (messageBox.length>0 && typeof(LiveReceptionCode_isonline) != 'undefined') {
        if (LiveReceptionCode_isonline)
            messageBox.append('<a href="#pop" onclick="openZoosUrl(\'chatwin\',\'&e=%25u6211%25u8981%25u54A8%25u8BE2\');return false;"></a>');
        else
            messageBox.append('<a href="#pop" onclick="openZoosUrl(\'chatwin\',\'&e=%25u6211%25u8981%25u54A8%25u8BE2\');return false;"></a>');
    }
}

var urls = [
"/js/googleanalytics.js",
"/ajaxpro/prototype.ashx",
"/ajaxpro/core.ashx",
"/ajaxpro/converter.ashx",
"/ajaxpro/E1288.Webs.Cochannels.Ctl.Search,E1288.Webs.ashx",
"/ajaxpro/E1288.Business.Companys.PictureAjaxServices,E1288.Business.ashx",
"/js/jquery-1.6.1.min.js",
"/js/jquery.timers-1.2.js",
"/js/commons.v1.js",
"/js/search.js",
"/index/js/searchresult.js"
];

function log(message) {
    if (typeof (console) != 'undefined' && console != undefined && console.log != undefined) {
        console.log(message);
    }
}

function loadComplete() {
    if (urls == null || urls.length == 0) {
        loadCode();
        log('loadCode');
        return;
    }

    var url = urls.shift();
    $.getScript(url, function () {
        log(url);

        loadComplete();
    });
}

$(document).ready(loadComplete);
