﻿// JScript 文件
var TP={
    UrlParameter  :'',
    UrlKey:'',
    //颜色
    Color: {
        font: '',
        font_highlight: '',
        link: '',
        link_highlight: '',
        box_border: '',
        box_border_highlight: '',
        box_background: '',
        background: '',
        talbevisual: ''
    },
     //序列化颜色
    getColorSerial: function(){
        this.Color.font=TPCssSet.Color.font;
        this.Color.talbevisual=TPCssSet.Color.talbevisual;
        this.Color.link=TPCssSet.Color.link;
        this.Color.link_highlight=TPCssSet.Color.link_highlight;
        this.Color.box_border=TPCssSet.Color.box_border;
        this.Color.box_border_highlight=TPCssSet.Color.box_border_highlight;
        this.Color.box_background=TPCssSet.Color.box_background;
        this.Color.background=TPCssSet.Color.background;
        this.Color.talbevisual=TPCssSet.Color.talbevisual;
        var ret = this.Color.font + "," +
            this.Color.font_highlight + "," +
            this.Color.link + "," +
            this.Color.link_highlight + "," +
            this.Color.box_border + "," +
            this.Color.box_border_highlight + "," +
            this.Color.box_background + "," +
            this.Color.background + "," +
            this.Color.talbevisual
        return ret;
    },
    GetPageSize: function(){
        var xScroll, yScroll;
        if (window.innerHeight && window.scrollMaxY) {
            xScroll = document.body.scrollWidth;
            yScroll = window.innerHeight + window.scrollMaxY;
        } else if (document.body.scrollHeight > document.body.offsetHeight){ 
            xScroll = document.body.scrollWidth;
            yScroll = document.body.scrollHeight;
        } else { 
            xScroll = document.body.offsetWidth;
            yScroll = document.body.offsetHeight;
        }
        var windowWidth, windowHeight;
        if (self.innerHeight) { 
            windowWidth = self.innerWidth;
            windowHeight = self.innerHeight;
        } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
            windowWidth = document.documentElement.clientWidth;
            windowHeight = document.documentElement.clientHeight;
        } else if (document.body) {
            windowWidth = document.body.clientWidth;
            windowHeight = document.body.clientHeight;
        }
        if(yScroll < windowHeight){
            pageHeight = windowHeight;
        } else {
            pageHeight = yScroll;
        }
        if(xScroll < windowWidth){
            pageWidth = windowWidth;
        } else {
            pageWidth = xScroll;
        }
        arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
        return arrayPageSize;
    },
     LoadComplete:function()
     {
        parent.document.all("__TPFlightDirectFrame").style.height=document.body.scrollHeight;
        parent.document.all("__TPFlightDirectFrame").style.width=document.body.scrollWidth;
     }
}
document.write('<iframe src="http://iframe.17ujp.com/flightsearch.aspx?MERCHANTID='+TPUserInfo.merchantId+'&SALERID='+TPUserInfo.saleId+'&UID='+TPUserInfo.userId+'&userType='+TPUserInfo.userType+'&orderAdmin='+TPUserInfo.orderAdmin+'&color='+encodeURIComponent(TP.getColorSerial())+'&clientUrl='+encodeURIComponent(TPUserInfo.userDomain)+'&SearchCondition='+encodeURIComponent(TPUserInfo.searchCondition)+'&loginUrl='+encodeURIComponent(TPUserInfo.loginUrl)+'&IsHasMember='+TPUserInfo.IsHasMember+'&PageType='+TPUserInfo.PageType+'&CssType='+TPUserInfo.cssType+'" frameBorder="0" id="__TPFlightDirectFrame"  scrolling="no" ></iframe>');
var f =  parent.document.getElementById('__TPFlightDirectFrame');
//var l = parent.document.getElementById('__TPDirectLoader');
f.style.height = document.body.scrollHeight;
f.style.width = 770+'px';
//l.style.marginTop = f.scrollHeight/2+180;
//l.style.marginLeft = f.scrollWidth/2-180;
f.onreadystatechange = function(){
 if( this.readyState == "complete" ){ }}
