﻿
gTKTURL="http://211.78.84.234/SLCM/TKT/TKTlist.aspx";gHTLURL="http://211.78.84.234/SLCM/HTL/HTLlist.aspx";gADBoxURL="http://211.78.84.234/SLC-ADBox";gADLink=gADBoxURL+"/adLink/";GetPromTXT=function(id)
{if(!http_request)
{alert('Giving up :( Cannot create an XMLHTTP instance');return false;}
var surl=getPrefixPath()+"includes/GetPromotion_txt.aspx?typ="+id.charAt(0);http_request.open('Get',surl,false);http_request.send(null);var frmDB="";if(http_request.readyState==4&&http_request.status==200)
{frmDB=http_request.responseText;}
eval("$promD="+frmDB+";");return $promD;};GetSelfShelfTXT=function(id)
{if(!http_request)
{alert('Giving up :( Cannot create an XMLHTTP instance');return false;}
var surl=getPrefixPath()+"includes/SelfShelf_TXT.aspx?typ="+id
http_request.open('Get',surl,false);http_request.send(null);var frmDB="";if(http_request.readyState==4&&http_request.status==200)
{frmDB=http_request.responseText;}
eval("$promD="+frmDB+";");return $promD;};GetPromIMG=function(id)
{if(!http_request)
{alert('Giving up :( Cannot create an XMLHTTP instance');return false;}
var surl=getPrefixPath()+"includes/GetPromotion_img.aspx?typ="+id.charAt(0);http_request.open('Get',surl,false);http_request.send(null);var frmDB="";if(http_request.readyState==4&&http_request.status==200)
{frmDB=http_request.responseText;}
eval("$promD="+frmDB+";");return $promD;};GetSelfShelfIMG=function(id)
{if(!http_request)
{alert('Giving up :( Cannot create an XMLHTTP instance');return false;}
var surl=getPrefixPath()+"includes/SelfShelf_IMG.aspx?typ="+id
http_request.open('Get',surl,false);http_request.send(null);var frmDB="";if(http_request.readyState==4&&http_request.status==200)
{frmDB=http_request.responseText;}
eval("$promD="+frmDB+";");return $promD;};SetPromTXT=function(id)
{var $promD=GetPromTXT(id)
for(var k in $promD)
{var o=eval("document.all."+k);if(o!=null)
{if(o.length>1)
{for(var i=0;i<$promD[k].length;++i)
{if(i>=o.length){break;}
if(typeof($promD[k][i])!="undefined")
{if(k=="MO"||k=="KO"||k=="NO"||k=="AO"||k=="IO")
{o[i].href=$promD[k][i][1];continue;}
gMaxString=parseInt((o[i].parentNode.clientWidth-35)/10);if(gMaxString<=0){gMaxString=20;}
if($promD[k][i][0].length>gMaxString)
{o[i].innerHTML=$promD[k][i][0].substring(0,gMaxString)+"...";}
else
{o[i].innerHTML=$promD[k][i][0];}
if($promD[k][i][2]>0||!o[i].nextSibling)
{o[i].style.cursor="hand";}
o[i].link=$promD[k][i][1];o[i].seq=i+1;o[i].pCD=o[i].id;o[i].onclick=function()
{updADBrowse(this);if(this.link)
{if(".JPG.GIF.BMP.PNG.MHT".indexOf(this.link.slice(-4).toUpperCase())>-1)
{window.open(gADLink+this.link);}
else if(this.link.indexOf("^")>-1||this.link.charAt(0)=="@")
{promoSend(id.charAt(0),this.link);}
else
{window.open(this.link);}}};if(o[i].parentNode.nextSibling!=null)
if(o[i].parentNode.nextSibling.firstChild.data.charCodeAt(0)!=160)
{o[i].parentNode.nextSibling.innerHTML=$promD[k][i][2]>0?"$"+$promD[k][i][2]+"元起":"....";}
if($promD[k][i][3]!="")
{o[i].parentNode.previousSibling.innerHTML="<img src='"+gADBoxURL+"/adDisplay/"+$promD[k][i][3]+"' onerror='this.src=\"images/overseas-travels/iron-1.GIF\";' />";}}}}
else
{o.innerHTML=$promD[k][0][0];if($promD[k][i][2]>0)
{o.style.color="blue";o.style.cursor="hand";}
o.link=$promD[k][0][1];o.seq=1;o.pCD=o.id;o.onclick=function()
{updADBrowse(this);if(this.link)
{if(".JPG.GIF.BMP.PNG.MHT".indexOf(this.link.slice(-4).toUpperCase())>-1)
{window.open(gADLink+this.link);}
else if(this.link.indexOf("^")>-1||this.link.charAt(0)=="@")
{promoSend(id.charAt(0),this.link);}
else
{window.open(this.link);}}};o.parentNode.nextSibling.innerHTML=$promD[k][0][2]?"$"+$promD[k][0][2]+"元起":"....";if($promD[k][i][3]!="")
{o[i].parentNode.previousSibling.innerHTML="<img src='"+gADBoxURL+"/adDisplay/"+$promD[k][i][3]+"' onerror='this.src=\"images/overseas-travels/iron-1.GIF\";' />";}}}}};SetSelfShelfTXT=function(id)
{var $promD=GetSelfShelfTXT(id);var k,i=0;for(var k in $promD)
{var o=eval("document.all."+k);if(o!=null)
{if(o.length>1)
{for(var i=0;i<$promD[k].length;++i)
{if(i>=o.length){break;}
if(typeof($promD[k][i])!="undefined")
{if(i>$promD[k].length-1)
{continue;}
gMaxString=parseInt((o[i].parentNode.clientWidth-35)/10);if(gMaxString<=0){gMaxString=20;}
if($promD[k][i][0].length>gMaxString)
{o[i].innerHTML=$promD[k][i][0].substring(0,gMaxString)+"...";}
else
{o[i].innerHTML=$promD[k][i][0];}
if($promD[k][i][2]>0)
{o[i].style.cursor="hand";}
o[i].link=$promD[k][i][1];o[i].seq=i+1;o[i].pCD=o[i].id;o[i].onclick=function()
{updADBrowse(this);if(this.link)
{if(this.link.indexOf("showCustomTrip")>-1)
{eval(this.link.replace("//showCustomTrip",""));}
else if(this.link.indexOf("^")>-1||this.link.charAt(0)=="@")
{promoSend(id.charAt(0),this.link);}
else
{window.open(this.link);}}};if(o[i].parentNode.nextSibling!=null)
if(o[i].parentNode.nextSibling.firstChild.data.charCodeAt(0)!=160)
{o[i].parentNode.nextSibling.innerHTML=$promD[k][i][2]>0?"$"+$promD[k][i][2]+"元起":"....";}}}}
else
{o.innerHTML=$promD[k][0][0];if($promD[k][i][2]>0)
{o.style.color="blue";o.style.cursor="hand";}
o.link=$promD[k][0][1];o.seq=1;o.pCD=o.id;o.onclick=function()
{updADBrowse(this);if(this.link)
{if(this.link.indexOf("showCustomTrip")>-1)
{eval(this.link.replace("//showCustomTrip",""));}
else if(this.link.indexOf("^")>-1||this.link.charAt(0)=="@")
{promoSend(id.charAt(0),this.link);}
else
{window.open(this.link);}}};o.parentNode.nextSibling.innerHTML=$promD[k][0][2]>0?"$"+$promD[k][0][2]+"元起":"....";}}}};SetPromIMG_R=function(id,RTime)
{var $promD=GetPromIMG(id);this.oName="rotatePromImg"+id;this.idx=0;eval(this.oName+" = this;");eval(this.oName+".destObjs = document.all."+id);if(!(id in $promD)){return;}
if(!this.destObjs){alert("找不到物件!!!");return;}
this.imgArr=$promD[id];this.setImg=function()
{var i,idx;if(typeof(this.destObjs[0])=="undefined")
{oSub=this.destObjs;oSub.style.cursor="pointer";oSub.src=this.imgArr[0][0];oSub.link=this.imgArr[0][1];oSub.alt=this.imgArr[0][2];oSub.oParent=this;oSub.idx=idx;oSub.seq=1;oSub.pCD=oSub.id;oSub.onclick=function()
{updADBrowse(this);if(this.link)
{if(".JPG.GIF.BMP.PNG.MHT".indexOf(this.link.slice(-4).toUpperCase())>-1)
{window.open(gADLink+this.link);}
else if(this.link.indexOf("^")>-1||this.link.charAt(0)=="@")
{promoSend(id.charAt(0),this.link);}
else
{window.open(this.link);}}};}
else
for(var i=0;i<this.destObjs.length;++i)
{if(i>=this.imgArr.length){continue;}
idx=(this.idx+i)%this.imgArr.length;if(!this.imgArr[idx]){break;}
oSub=this.destObjs[i];oSub.style.cursor="pointer";oSub.src=this.imgArr[idx][0];oSub.link=this.imgArr[idx][1];oSub.alt=this.imgArr[idx][2];oSub.oParent=this;oSub.idx=idx;oSub.seq=i+1;oSub.pCD=oSub.id;oSub.onclick=function()
{updADBrowse(this);if(this.link)
{if(".JPG.GIF.BMP.PNG.MHT".indexOf(this.link.slice(-4).toUpperCase())>-1)
{window.open(gADLink+this.link);}
else if(this.link.indexOf("^")>-1||this.link.charAt(0)=="@")
{promoSend(id.charAt(0),this.link);}
else
{window.open(this.link);}}};}
this.idx=(this.idx+1)%this.imgArr.length;if(typeof(RTime)!="undefined")
{setTimeout(this.oName+".setImg()",RTime);}};this.setImg();var flg=id.charAt(0);var pCD=flg+"P";myAd=new Banner(5,430,190,"Welcome",1,0,"ADarea",pCD);for(var i=0;i<3;++i)
{if(i>$promD[pCD].length-1){$promD[pCD].push($promD[pCD][i-1]);}
if($promD[pCD][i][1].indexOf("^")>=0)
{switch(flg)
{case"M":case"N":case"K":var arr=$promD[pCD][i][1].split("^");var Date1=new Date();arr[4]=Date1.getFullYear()+"/"+(Date1.getMonth()+1)+"/"+Date1.getDate();Date1.setMonth(Date1.getMonth()+2);arr[5]=Date1.getFullYear()+"/"+(Date1.getMonth()+1)+"/"+Date1.getDate();$promD[pCD][i][1]="./Tour/TourList.aspx?searchD="+arr[0]+"^"+arr[1]+"^"+arr[2]+"^"+arr[4]+"^"+arr[5]+"^"+arr[3];break;case"A":myAd.TKTQuery=function()
{var oFrm=crtFormModule();oFrm.crtWin("ifrList");oFrm.action=gTKTURL;oFrm.putVar("saUrl",location.href);oFrm.putVar("myHead",get("headBanner").src);oFrm.putVar("myFoot",encodeURI(get("agtInfo").outerHTML));oFrm.putVar("searchD",this.ads[this.currentAd].href);oFrm.submit();};myAd.link=function()
{showWait(event);this.TKTQuery();};break;case"I":myAd.HTLQuery=function()
{var oFrm=crtFormModule();oFrm.crtWin("ifrList");oFrm.action=gHTLURL;oFrm.putVar("saUrl",location.href);oFrm.putVar("myHead",get("headBanner").src);oFrm.putVar("myFoot",encodeURI(get("agtInfo").outerHTML));oFrm.putVar("searchD",this.ads[this.currentAd].href);oFrm.submit();};myAd.link=function()
{showWait(event);this.HTLQuery();};break;default:return;}}}
myAd.Ad($promD[pCD][0][0],$promD[pCD][0][1],null,$promD[pCD][0][2]);myAd.Ad($promD[pCD][1][0],$promD[pCD][1][1],null,$promD[pCD][1][2]);myAd.Ad($promD[pCD][2][0],$promD[pCD][2][1],null,$promD[pCD][2][2]);myAd.output();};SetSelfShelfIMG=function(id)
{var $promD=GetSelfShelfIMG(id);var k,i=0;for(k in $promD)
{var o=eval("document.all."+k);if(o!=null)
{if(o.length>1)
{for(var i=0;i<o.length;++i)
{if(i>$promD[k].length-1)
{o[i].src="./images/ad_Space.jpg";continue;}
o[i].style.cursor="hand";o[i].src=typeof($promD[k][i])=="undefined"?o[i].src:$promD[k][i][0];o[i].link=$promD[k][i][1];o[i].alt=$promD[k][i][2];o[i].seq=i+1;o[i].pCD=o[i].id;o[i].onclick=function()
{updADBrowse(this);if(this.link)
{if(this.link.indexOf("showCustomTrip")>-1)
{eval(this.link.replace("//showCustomTrip",""));}
else if(this.link.indexOf("^")>-1||this.link.charAt(0)=="@")
{promoSend(id.charAt(0),this.link);}
else
{window.open(this.link);}}};}}
else
{o.style.cursor="pointer";o.src=$promD[k][0][0];o.link=$promD[k][0][1];o.alt=$promD[k][0][2];o.seq=1;o.pCD=o.id;o.onclick=function()
{updADBrowse(this);if(this.link)
{if(this.link.indexOf("showCustomTrip")>-1)
{eval(this.link.replace("//showCustomTrip",""));}
else if(this.link.indexOf("^")>-1||this.link.charAt(0)=="@")
{promoSend(id.charAt(0),this.link);}
else
{window.open(this.link);}}};}}}
var $promD=GetPromIMG(id);var flg=id.charAt(0);var pCD=flg+"P";myAd=new Banner(5,617,273,"Welcome",1,0,"ADarea",pCD);for(var i=0;i<3;++i)
{if(i>$promD[pCD].length-1){$promD[pCD].push($promD[pCD][i-1]);}
if($promD[pCD][i][1].indexOf("^")>=0)
{switch(flg)
{case"D":var arr=$promD[pCD][i][1].split("^");var Date1=new Date();arr[4]=Date1.getFullYear()+"/"+(Date1.getMonth()+1)+"/"+Date1.getDate();Date1.setMonth(Date1.getMonth()+2);arr[5]=Date1.getFullYear()+"/"+(Date1.getMonth()+1)+"/"+Date1.getDate();$promD[pCD][i][1]="./Tour/TourList.aspx?searchD="+arr[0]+"^"+arr[1]+"^"+arr[2]+"^"+arr[4]+"^"+arr[5]+"^"+arr[3];break;default:return;}}}
myAd.Ad($promD[pCD][0][0],$promD[pCD][0][1],null,$promD[pCD][0][2]);myAd.Ad($promD[pCD][0][0],$promD[pCD][0][1],null,$promD[pCD][0][2]);myAd.Ad($promD[pCD][0][0],$promD[pCD][0][1],null,$promD[pCD][0][2]);myAd.output();};SetSelfShelfIMG_R=function(id,RTime)
{var $promD=GetSelfShelfIMG(id);var k,i=0;var mAD_Pool={}
for(k in $promD)
{mAD_Pool[k]=[];var o=eval("document.all."+k);if(o!=null)
{this.oID=k;this.oName="oAD_Ctrl_"+k;eval(this.oName+" = this;");for(var i=0;i<$promD[k].length;++i)
if(typeof($promD[k][i])!="undefined")
{mAD_Pool[k].push([$promD[k][i][0],$promD[k][i][1],$promD[k][i][2]]);}
if(o.length>1)
{for(var i=0;i<o.length;++i)
{if(i>$promD[k].length-1)
{o[i].src="./images/ad_Space.jpg";continue;}
o[i].style.cursor="hand";o[i].src=typeof($promD[k][i])=="undefined"?o[i].src:$promD[k][i][0];o[i].link=$promD[k][i][1];o[i].alt=$promD[k][i][2];o[i].seq=i+1;o[i].pCD=o[i].id;o[i].onclick=function()
{updADBrowse(this);if(this.link)
{if(this.link.indexOf("showCustomTrip")>-1)
{eval(this.link.replace("//showCustomTrip",""));}
else if(this.link.indexOf("^")>-1||this.link.charAt(0)=="@")
{promoSend(id.charAt(0),this.link);}
else
{window.open(this.link);}}};}}
else
{o.style.cursor="pointer";o.src=$promD[k][0][0];o.link=$promD[k][0][1];o.alt=$promD[k][0][2];o.seq=1;o.pCD=o.id;o.onclick=function()
{updADBrowse(this);if(this.link)
{if(this.link.indexOf("showCustomTrip")>-1)
{eval(this.link.replace("//showCustomTrip",""));}
else if(this.link.indexOf("^")>-1||this.link.charAt(0)=="@")
{promoSend(id.charAt(0),this.link);}
else
{window.open(this.link);}}};}
this.rotation=function(k)
{var o=items(k);if(mAD_Pool[k].length<=o.length){return;}
if(this.oID=="P100"){return;}
this.oID=k;this.oName="oAD_Ctrl_"+k;mAD_Pool[k]=mAD_Pool[k].concat([mAD_Pool[k].shift()]);for(var i=0;i<o.length;++i)
{o[i].src=mAD_Pool[k][i][0];o[i].link=mAD_Pool[k][i][1];o[i].alt=mAD_Pool[k][i][2];}
if(typeof(RTime)!="undefined")
{setTimeout(this.oName+".rotation('"+this.oID+"')",RTime);}}
this.rotation(k);}}
var $promD=GetPromIMG(id);var flg=id.charAt(0);var pCD=flg+"P";myAd=new Banner(5,617,273,"Welcome",1,0,"ADarea",pCD);for(var i=0;i<3;++i)
{if(i>$promD[pCD].length-1){$promD[pCD].push($promD[pCD][i-1]);}
if($promD[pCD][i][1].indexOf("^")>=0)
{switch(flg)
{case"D":var arr=$promD[pCD][i][1].split("^");var Date1=new Date();arr[4]=Date1.getFullYear()+"/"+(Date1.getMonth()+1)+"/"+Date1.getDate();Date1.setMonth(Date1.getMonth()+2);arr[5]=Date1.getFullYear()+"/"+(Date1.getMonth()+1)+"/"+Date1.getDate();$promD[pCD][i][1]="./Tour/TourList.aspx?searchD="+arr[0]+"^"+arr[1]+"^"+arr[2]+"^"+arr[4]+"^"+arr[5]+"^"+arr[3];break;default:return;}}}
myAd.Ad($promD[pCD][0][0],$promD[pCD][0][1],null,$promD[pCD][0][2]);myAd.Ad($promD[pCD][0][0],$promD[pCD][0][1],null,$promD[pCD][0][2]);myAd.Ad($promD[pCD][0][0],$promD[pCD][0][1],null,$promD[pCD][0][2]);myAd.output();};promoSend=function(promoType,promoUrl,group_sn)
{var frm,action,searchD,sD,eD,tw,tksearch;switch(promoType)
{case"D":if(promoUrl.split("^").length==4)
{action="./Tour/Tourlist.aspx";}
else if(promoUrl.charAt(0)=="@")
{action="./Tour/Tourlist_Group.aspx";}
break;case"A":showWait(event);action=gTKTURL;tksearch=promoUrl;break;case"I":showWait(event);action=gHTLURL;tksearch=promoUrl;break;case"M":case"N":case"K":action="./Tour/TourList.aspx";break;default:return;}
var oFrm=crtFormModule();if(promoType=="A")
{oFrm.crtWin("ifrList");oFrm.action=action;oFrm.putVar("saUrl",location.href);oFrm.putVar("myHead",get("headBanner").src);oFrm.putVar("myFoot",encodeURI(get("agtInfo").outerHTML));oFrm.putVar("searchD",tksearch);oFrm.submit();}
else if(promoType=="I")
{oFrm.crtWin("ifrList");oFrm.action=action;oFrm.putVar("saUrl",location.href);oFrm.putVar("myHead",get("headBanner").src);oFrm.putVar("myFoot",encodeURI(get("agtInfo").outerHTML));oFrm.putVar("searchD",tksearch);oFrm.submit();}
else
{var newDate,newUrl;newUrl=new Array();promoUrl=promoUrl.split("^");if(!promoUrl[4]||promoUrl[4]=="")
{newDate=new Date();promoUrl[4]=newDate.getFullYear()+"/"+(newDate.getMonth()+1)+"/"+newDate.getDate();}
if(!promoUrl[5]||promoUrl[5]=="")
{newDate=new Date(promoUrl[4]);newDate.setMonth(newDate.getMonth()+2);promoUrl[5]=newDate.getFullYear()+"/"+(newDate.getMonth()+1)+"/"+newDate.getDate();}
for(var i=0;i<3;++i)
{newUrl.push(promoUrl[i]);}
newUrl.push(promoUrl[4]);newUrl.push(promoUrl[5]);newUrl.push(promoUrl[3]);oFrm.target="_self";oFrm.action=action;oFrm.putVar("tourType","Set");oFrm.putVar("searchD",newUrl.join("^"));oFrm.putVar("group_sn",group_sn);oFrm.submit();}};updADBrowse=function(o)
{var tp=o.tagName=="A"?"TXT":"IMG";var promotion_cd=o.pCD;var sequence=o.seq;var zWinCtrl='scrollbars=yes,titlebar=0,width=0,height=0,top=2000,left=2000';if(!http_request)
{alert('Giving up :( Cannot create an XMLHTTP instance');return false;}
var surl=getPrefixPath()+'includes/upd_ADBrowse.aspx?tp='+tp+'&promotion_cd='+promotion_cd+'&sequence='+sequence;http_request.open('Get',surl,false);http_request.send(null);};