﻿
//===================================================
//===================数据更新的处理==================
//===================================================

function LeftLoadingPic(LoadingFont){
    
    var LeftLoadingPicCode = "<img src=\"../../../alxAll/image/Public/LeftLoading.gif\" width=\"16\" height=\"16\" border=\"0\">";

    var LeftLoadingPics = "<span style='vertical-align:middle;text-align:center;'>" +
                          "" + LoadingFont + LeftLoadingPicCode + 
                          "</span>";

    return LeftLoadingPics;
}

function MainLoadingPic(LoadingFont){

    var MainLoadingPicCode = "<span style='vertical-align:middle;text-align:center;margin-top:-5px'>" +
                             "   <img src=\"../../../alxAll/image/Public/MainLoading.gif\" width=\"300px\" height=\"13\" border=\"0\">" + 
                             "</span>";
                             
    var MainLoadingTableCode = "" +
				"<table cellSpacing='0' cellPadding='0' border='0' class='G_Tab_Self_Loading' height='20px' align='center'>" +
				"   <tr>" +
				"		<td colspan='3' class='G_Tab_Top_Loading'></td>" +
				"	</tr>" +
				"	<tr>" +
				"		<td class='G_Tab_Left_Loading'></td>" +
				"		<td class='G_Tab_Center_Loading'>" +
				"		    <div class='G_div_Center_Loading'>" +
				"               <span>&nbsp;&nbsp;" + LoadingFont + MainLoadingPicCode + "</span>" +
				"           </div>" +
                "       </td>" +
				"		<td class='G_Tab_Right_Loading'></td>" +
				"	</tr>" +
				"	<tr>" +
				"		<td colspan='3' class='G_Tab_Bottom_Loading'></td>" +
				"	</tr>" +
			    "</table>";

    return MainLoadingTableCode;
}
//===================================================


//===================================================
//===============旅游知识信息模块的加载==============
//===================================================
function doLoadLyZsInfo(){
	
	var request_url ='../../DealAjax/DealSomeNews.aspx';
	var request_method ='post';
	var request_pars ='DealModel=LoadLyZsInfo';
	var request_asynchronous =true;    
	var myAjax = new Ajax.Request(
		request_url,
		{
			method:request_method,
			parameters:request_pars,
			asynchronous:request_asynchronous,       
			onComplete:function(Response){
			
				var result = Response.responseText;
				
				var ArrResult = new Array();
				ArrResult = result.split("[!#!]");
				
				if(ArrResult.length==1){
					var LoadLyZsInfo = ArrResult[0].toString();
				
	                if(document.getElementById("LabLyZsInfo")){
	                    document.getElementById("LabLyZsInfo").innerHTML = LoadLyZsInfo;
	                    
                        //加载最新快捷查询模块的数据
                        doLoadProvinceLineShow_OpenModel();
	                }
				}
			}
		}    
	);
}
//===================================================


//===================================================
//==================快捷查询模块的加载===============
//===================================================
function doLoadProvinceLineShow_OpenModel(){
	
	var request_url ='../../DealAjax/DealSomeNews.aspx';
	var request_method ='post';
	var request_pars ='DealModel=ProvinceLineShow_OpenModel';
	var request_asynchronous =true;    
	var myAjax = new Ajax.Request(
		request_url,
		{
			method:request_method,
			parameters:request_pars,
			asynchronous:request_asynchronous,       
			onComplete:function(Response){
			
				var result = Response.responseText;
				
				var ArrResult = new Array();
				ArrResult = result.split("[!#!]");
				
				if(ArrResult.length==1){
					var ProvinceLineShow_OpenModel = ArrResult[0].toString();
				
	                if(document.getElementById("LabProvinceLineShow")){
	                    document.getElementById("LabProvinceLineShow").innerHTML = ProvinceLineShow_OpenModel;	                    
    
                        //===================================================
                        //景区链接数据的加载
                        document.getElementById("LabWebConnection").innerHTML = MainLoadingPic("景区链接数据加载中...");
        
                        doLoadJqLjData();
                        //===================================================
	                }
				}
			}
		}    
	);
}
//===================================================


//===================================================
//=============部分快捷查询数据的加载================
//===================================================
function doLoadKjSearch_DepartmentData(ObjName,oValue){
	
	var request_url ='../../DealAjax/DealSomeNews.aspx';
	var request_method ='post';
	var request_pars ='DealModel=KjSearch_DepartmentData&LineFeiLei=' + encodeURI(oValue);
	var request_asynchronous =true;    
	var myAjax = new Ajax.Request(
		request_url,
		{
			method:request_method,
			parameters:request_pars,
			asynchronous:request_asynchronous,       
			onComplete:function(Response){
			
				var result = Response.responseText;
				
	            if(document.getElementById(ObjName)){
	                document.getElementById(ObjName).innerHTML = result;
	            }
			}
		}    
	);
}
//===================================================


//===================================================
//=============快捷查询数据的加载最新================
//===================================================
function doLoadKjSearch_News(ObjName,oValue){
	
	var request_url ='../../DealAjax/DealSomeNews.aspx';
	var request_method ='post';
	var request_pars ='DealModel=KjSearch_News&LineFeiLei=' + encodeURI(oValue);
	var request_asynchronous =true;    
	var myAjax = new Ajax.Request(
		request_url,
		{
			method:request_method,
			parameters:request_pars,
			asynchronous:request_asynchronous,       
			onComplete:function(Response){
			
				var result = Response.responseText;
				
	            if(document.getElementById(ObjName)){
	                document.getElementById(ObjName).innerHTML = result;
	            }
			}
		}    
	);
}
//===================================================


//===================================================
//===============快捷查询最新相关函数================
//===================================================
function $getObj(Name){
	if(document.getElementById(Name)){
		return document.getElementById(Name);
	}
}

function doSetClassName(Name,Value){
	$getObj(Name).className = Value;
}

function doResetAll(){

	doSetClassName('divEveryDay','menu_two');
	doSetClassName('divOne','menu_two');
	doSetClassName('divTwo','menu_two');
	doSetClassName('divThree','menu_two');
	doSetClassName('divFour','menu_two');
	doSetClassName('divShort','menu_two');
	doSetClassName('divLong','menu_two');
	doSetClassName('divOut','menu_two');
}

function doChange(Name,oValue){

    document.getElementById("td_LineInfo").innerHTML = MainLoadingPic("[" + oValue + "]线路数据加载中...请稍候...");
    
	doResetAll();	
	doSetClassName(Name,'menu_four');    
	doLoadKjSearch_News("td_LineInfo",oValue);	
}
//===================================================



//===================================================
//============景区链接数据的加载与即时更新===========
//===================================================
function doLoadJqLjData(){
	
	var request_url ='../../DealAjax/DealSomeNews.aspx';
	var request_method ='post';
	var request_pars ='DealModel=LoadJqLjData';
	var request_asynchronous =true;    
	var myAjax = new Ajax.Request(
		request_url,
		{
			method:request_method,
			parameters:request_pars,
			asynchronous:request_asynchronous,       
			onComplete:function(Response){
			
				var result = Response.responseText;
				
				var ArrResult = new Array();
				ArrResult = result.split("[!#!]");
				
				if(ArrResult.length==1){
					var LoadJqLjData = ArrResult[0].toString();
				
	                if(document.getElementById("LabWebConnection")){
	                    document.getElementById("LabWebConnection").innerHTML = LoadJqLjData;
           
                        //在线客服数据的加载
                        //doLoadOnLineQQCode();
	                }
				}
			}
		}    
	);
}
//===================================================


//===================================================
//============在线客服数据的加载与即时更新===========
//===================================================
function doLoadOnLineQQCode(){
	
	var request_url ='../../DealAjax/DealSomeNews.aspx';
	var request_method ='post';
	var request_pars ='DealModel=LoadOnLineQQCode&isZkOrTh=zk';
	var request_asynchronous =true;    
	var myAjax = new Ajax.Request(
		request_url,
		{
			method:request_method,
			parameters:request_pars,
			asynchronous:request_asynchronous,       
			onComplete:function(Response){
			
				var result = Response.responseText;
				
				var ArrResult = new Array();
				ArrResult = result.split("[!#!]");
				
				if(ArrResult.length==1){
					var LoadOnLineQQCode = ArrResult[0].toString();
				
	                if(document.getElementById("LabQQOnLineCenter")){
	                
	                    if(LoadOnLineQQCode!=""){
                            document.getElementById("LabQQOnLineCenter").style.display = "block";
	                        document.getElementById("LabQQOnLineCenter").innerHTML = LoadOnLineQQCode;
	                    }
	                    else{
                            document.getElementById("LabQQOnLineCenter").style.display = "none";
	                    }
	                }

                    //====================
                    //初始化在线客服位置
	                if(myload_flybar){
                        myload_flybar();
                    }
                    //====================
				}
			}
		}    
	);
}
//===================================================


//===================================================
//================相关信息加载提示===================
//===================================================
function doSomeInfoShow(){

    if(document.getElementById("LabLyZsInfo")){
        document.getElementById("LabLyZsInfo").innerHTML = LeftLoadingPic("旅游知识信息数据加载中...");
    }
    
    if(document.getElementById("LabProvinceLineShow")){
        document.getElementById("LabProvinceLineShow").innerHTML = "<div style='width:220px;margin:100px'>" + LeftLoadingPic("快捷查询数据加载中...") + "</div>"
    }
    
    if(document.getElementById("LabWebConnection")){
        document.getElementById("LabWebConnection").innerHTML = LeftLoadingPic("景区链接数据加载中...");
    }
}
//===================================================

//===================================================
//==========窗体加载时加载首页相关数据===============
//===================================================
doLoadMainInfoDatas = function(){

    //相关信息加载提示
    doSomeInfoShow();
    
    //加载最新快捷查询模块的数据
    doLoadProvinceLineShow_OpenModel();
}
//===================================================
//===================================================