//var ap_header = new function(){
//	var hostname = document.location.host.toLowerCase();
//	if( hostname.indexOf("secure.elong") > -1)
//	{
//	    hostname = hostname.replace("secure.elong","travel.elong");
//	}

//	var headerimagepath = "http://" + hostname + "/flights";
//	var leagueoperation = JS_CONST_HEAD.LEAGUEOPERATION;
//	var card_no = JS_CONST_HEAD.CARD_NO;
//	var default_card_no = JS_CONST_HEAD.DEFAULT_CARD_NO;
//    var hotel_ad_display=JS_CONST_HEAD.HOTELADDISPLAY;
//    var air_ad_display=JS_CONST_HEAD.AIRADDISPLAY;
//	//Public
//	this.imagepath = headerimagepath;
//    var hotel_ad=(hotel_ad_display&16)==16;//是否显示酒店头广告
//    var air_ad=(air_ad_display&16)==16;//是否显示机票头广告
//	
//	this.lable_list = function()
//	{	
//		var url, focus=0, focuses=0;
//		var hotel = 2, flight = 4, tour = 8;
//		var result="";
//		url = document.location.href.toLowerCase();
//		if ( (hotel|leagueoperation) == leagueoperation )	//如果可以有酒店，就可以有点评
//		{
//			focus = ( focus==0&&url.indexOf("/hotelreviews/")>=0 ? 1:0); focuses +=focus;
//			result += lable_item(focus,"酒店点评","http://" + hostname + "/hotelreviews/default.aspx?campaign_id=" + card_no);
//		}
//		if ( (flight|leagueoperation) == leagueoperation )	//
//		{
//			focus = ( focus==0&&url.indexOf("/flights/default.aspx")>=0 ? 1:0); focuses +=focus;
//			result += lable_item(focus,"国内机票","http://" + hostname + "/flights/default.aspx?campaign_id=" + card_no);
//		}
//		if ( (flight|leagueoperation) == leagueoperation )	//
//		{
//			focus = ( focus==0&&url.indexOf("/flights/default2.aspx")>=0 ? 1:0); focuses +=focus;
//			result += lable_item(focus,"国际机票","http://" + hostname + "/flights/default2.aspx?campaign_id=" + card_no);
//		}
//		/*	度假暂时关闭
//		if ( (tour|leagueoperation) == leagueoperation )	//
//		{
//			focus = ( focus==0&&url.indexOf("/tours/")>=0 ? 1:0); focuses +=focus;
//			result += lable_item(focus,"度&nbsp;假","http://travel.elong.com/tours/index.aspx?campaign_id=" + card_no);
//		}
//		*/		
//		if ( (hotel|leagueoperation) == leagueoperation )	//
//		{
//			//if ( focuses==0 ) focus=1;
//			//else focus=0;
//			focus = ( focus==0&&url.indexOf("/hotels/")>=0 ? 1:0); focuses +=focus;		
//			result = lable_item(focus,"国内酒店","http://" + hostname + "/hotels/default.aspx?campaign_id=" + card_no) + result;
//		}	
//		//确保联盟网站只少有一项功能，一项都没有，转到elong的网站。
//		if ( result=="" ) document.location.href=document.location.href + "?campaign_id=" + defaultcardno;
//		else return result;	
//		return result;	
//	}	
//	this.ad_show=function()
//	{
//	    var url, focus=0, focuses=0;
//		var hotel = 2, flight = 4, tour = 8;
//		var result="";
//		url = document.location.href.toLowerCase();
//		if ( ((flight|leagueoperation) == leagueoperation) &&url.indexOf("/flights")>=0)	//机票广告
//		{
//		    if(air_ad)
//		    {
//		        result+="<script type='text/javascript' src='http://elong.allyes.com/main/adfshow?user=Elong|xiaofen_banner468X60_f|xiaofen_banner468X60_f&db=elong&border=0&local=yes&js=ie'></script>";
//		    }
//		    else{
//		        result+="";
//		    }
//		}
//		if (( (hotel|leagueoperation) == leagueoperation )&&url.indexOf("/hotels/")>=0 )	//酒店 广告
//		{
//		    if(hotel_ad)
//		    {
//		  
//		        result+="<script type='text/javascript' src='http://elong.allyes.com/main/adfshow?user=Elong|xiaofen_banner468X60_h|xiaofen_banner468X60_h&db=elong&border=0&local=yes&js=ie'></script>";		    
//		    }
//		    else{
//		       result+="";
//		    }
//		}
//		return result;
//	}
//	//Private
//	function lable_item( focus, text, url )
//	{

//		var lable;
//		var imagename, style;
//		if ( focus ==1 ) 
//		{
//			imagename="focus.jpg";
//			style=" font-size:12px; text-decoration:none; ";
//		}
//		else 
//		{
//			imagename="blur.jpg";
//			style="color:#fff; font-size:12px; text-decoration:none;";		
//		}
////		lable="<td width=\"2\" background=\"" + headerimagepath + "\/images\/left_" + imagename + "\"><\/td>\n" +
////			"<td width=\"45\" background=\"" + headerimagepath + "\/images\/bg_" + imagename + "\"><a href=\"" + url + "\" style=\"" + style + "\">" + text + "<\/a><\/td>\n" +
////			"<td width=\"10\" background=\"" + headerimagepath + "\/images\/right_" + imagename + "\"><\/td>\n" +
////			"<td width=\"2\"><\/td>";	
//			lable="<td width=\"64\"  background=\"" + headerimagepath + "\/images\/" + imagename + "\" style=\"no-repeat;width:65px;height:26px;text-align:center;\"><a href=\"" + url + "\" style=\"" + style + "\">" + text + "</a></td>"
//		return lable;	
//	}
//}	
//document.writeln("<center>");
//document.writeln ( "<table width=\"776\" border=\"0\"  cellpadding=\"0\" cellspacing=\"0\">");
//document.writeln ( "<tr>");
//document.writeln ( "<td width=\"276\"  bgcolor=\"#004183\"><img src=\"" + ap_header.imagepath + "\/images\/logo.gif\"  width=\"276\" height=\"76\" border=\"0\"/></td>");
//document.writeln ( "<td style=\"background:url(" + ap_header.imagepath + "\/images\/logoground.gif) no-repeat;width:500px;height:76px;text-align:center;\" valign=\"bottom\">");
//document.writeln ( "<!--AdForward Begin:-->");
//document.writeln(ap_header.ad_show());
//document.writeln ( "<!--AdForward End--> ");
//document.writeln ( "</td>");
//document.writeln ( "</tr>");
//document.writeln ( "</table>");
//document.writeln ( "<table width=\"776\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">");
//document.writeln ( "<tr align='left'>");
//document.writeln ( "<td style=\"background:url(" + ap_header.imagepath + "\/images\/tdgroud.gif) repeat-x;width:776px;height:26px;\"><table width=\"300\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
//document.writeln ( "<tr>");
//document.writeln ( "<td width=\"15\"></td>");
//document.writeln ( ap_header.lable_list() );
//document.writeln ( "<td>&nbsp;</td>");
//document.writeln ( "</tr>");
//document.writeln ( "</table></td>");
//document.writeln ( "</tr>");
//document.writeln ( "</table>");



//增加广告 add by minjiang 09-8-17
var ap_header = new function() {
    var hostname = document.location.host.toLowerCase();
    if (hostname.indexOf("secure.elong") > -1) {
        hostname = hostname.replace("secure.elong", "travel.elong");
    }

    var headerimagepath = "http://" + hostname + "/flights";
    var leagueoperation = JS_CONST_HEAD.LEAGUEOPERATION;
    var card_no = JS_CONST_HEAD.CARD_NO;
    var default_card_no = JS_CONST_HEAD.DEFAULT_CARD_NO;
    var hotel_ad_display = JS_CONST_HEAD.HOTELADDISPLAY;
    var air_ad_display = JS_CONST_HEAD.AIRADDISPLAY;
    //Public
    this.imagepath = headerimagepath;
    var hotel_ad = (hotel_ad_display & 16) == 16; //是否显示酒店头广告
    var air_ad = (air_ad_display & 16) == 16; //是否显示机票头广告

    this.lable_list = function() {
        var url, focus = 0, focuses = 0;
        var hotel = 2, flight = 4, tour = 8;
        var result = "";
        url = document.location.href.toLowerCase();
        if ((hotel | leagueoperation) == leagueoperation)	//如果可以有酒店，就可以有点评
        {
            focus = (focus == 0 && url.indexOf("/hotelreviews/") >= 0 ? 1 : 0); focuses += focus;
            result += lable_item(focus, "酒店点评", "http://" + hostname + "/hotelreviews/default.aspx?campaign_id=" + card_no);
        }
        if ((flight | leagueoperation) == leagueoperation)	//
        {
            focus = (focus == 0 && url.indexOf("/flights/default.aspx") >= 0 ? 1 : 0); focuses += focus;
            result += lable_item(focus, "国内机票", "http://" + hostname + "/flights/default.aspx?campaign_id=" + card_no);
        }
        if ((flight | leagueoperation) == leagueoperation)	//
        {
            focus = (focus == 0 && url.indexOf("/flights/default2.aspx") >= 0 ? 1 : 0); focuses += focus;
            result += lable_item(focus, "国际机票", "http://" + hostname + "/flights/default2.aspx?campaign_id=" + card_no);
        }
        /*	度假暂时关闭
        if ( (tour|leagueoperation) == leagueoperation )	//
        {
        focus = ( focus==0&&url.indexOf("/tours/")>=0 ? 1:0); focuses +=focus;
        result += lable_item(focus,"度&nbsp;假","http://travel.elong.com/tours/index.aspx?campaign_id=" + card_no);
        }
        */
        if ((hotel | leagueoperation) == leagueoperation)	//
        {
            //if ( focuses==0 ) focus=1;
            //else focus=0;
            focus = (focus == 0 && url.indexOf("/hotels/") >= 0 ? 1 : 0); focuses += focus;
            result = lable_item(focus, "国内酒店", "http://" + hostname + "/hotels/default.aspx?campaign_id=" + card_no) + result;
        }
        //确保联盟网站只少有一项功能，一项都没有，转到elong的网站。
        if (result == "") document.location.href = document.location.href + "?campaign_id=" + defaultcardno;
        else return result;
        return result;
    }
    this.ad_show = function() {
        var url, focus = 0, focuses = 0;
        var hotel = 2, flight = 4, tour = 8;
        var result = "";
        url = document.location.href.toLowerCase();
//        if (((flight | leagueoperation) == leagueoperation) && url.indexOf("/flights") >= 0)	//机票广告
//        {
//            if (air_ad) {
//                //result += "<script type='text/javascript' src='http://elong.allyes.com/main/adfshow?user=Elong|air|banner_468x60&db=elong&border=0&local=yes&js=ie'></script>";
//                result += "<iframe marginheight=\"0\" marginwidth=\"0\" frameborder=\"0\" width=\"468\" height=\"60\" scrolling=\"no\" src=\"http://elong.allyes.com/main/adfshow?user=Elong|xiaofen|banner468X60_h&db=elong&border=0&local=yes\">";
//                result += "<noscript><a href=\"http://elong.allyes.com/main/adfclick?user=Elong|xiaofen|banner468X60_h&db=elong\"><img src=\"http://elong.allyes.com/main/adfshow?user=Elong|xiaofen|banner468X60_h&db=elong\" width=\"468\" height=\"60\" border=\"0\"></a></noscript></iframe>";
//            }
//            else {
//                result += "";
//            }
//        }
//        if (((hotel | leagueoperation) == leagueoperation) && url.indexOf("/hotels/") >= 0)	//酒店 广告
//        {
//            if (hotel_ad) {

//                //result += "<script type='text/javascript' src='http://elong.allyes.com/main/adfshow?user=Elong|hotel|banner_468x60&db=elong&border=0&local=yes&js=ie'></script>";
//                result += "<iframe marginheight=\"0\" marginwidth=\"0\" frameborder=\"0\" width=\"468\" height=\"60\" scrolling=\"no\" src=\"http://elong.allyes.com/main/adfshow?user=Elong|xiaofen|banner468X60_h&db=elong&border=0&local=yes\">";
//                result += "<noscript><a href=\"http://elong.allyes.com/main/adfclick?user=Elong|xiaofen|banner468X60_h&db=elong\"><img src=\"http://elong.allyes.com/main/adfshow?user=Elong|xiaofen|banner468X60_h&db=elong\" width=\"468\" height=\"60\" border=\"0\"></a></noscript></iframe>";
//            }
//            else {
//                result += "";
//            }
        //        }
        result += "<iframe marginheight=\"0\" marginwidth=\"0\" frameborder=\"0\" width=\"468\" height=\"60\" scrolling=\"no\" src=\"http://elong.allyes.com/main/adfshow?user=Elong|xiaofen|banner468X60_h&db=elong&border=0&local=yes\">";
        result += "<noscript><a href=\"http://elong.allyes.com/main/adfclick?user=Elong|xiaofen|banner468X60_h&db=elong\"><img src=\"http://elong.allyes.com/main/adfshow?user=Elong|xiaofen|banner468X60_h&db=elong\" width=\"468\" height=\"60\" border=\"0\"></a></noscript></iframe>";
        return result;
    }
    //Private
    function lable_item(focus, text, url) {

        var lable;
        var imagename, style;
        if (focus == 1) {
            imagename = "focus.jpg";
            style = " font-size:12px; text-decoration:none; ";
        }
        else {
            imagename = "blur.jpg";
            style = "color:#fff; font-size:12px; text-decoration:none;";
        }
        //		lable="<td width=\"2\" background=\"" + headerimagepath + "\/images\/left_" + imagename + "\"><\/td>\n" +
        //			"<td width=\"45\" background=\"" + headerimagepath + "\/images\/bg_" + imagename + "\"><a href=\"" + url + "\" style=\"" + style + "\">" + text + "<\/a><\/td>\n" +
        //			"<td width=\"10\" background=\"" + headerimagepath + "\/images\/right_" + imagename + "\"><\/td>\n" +
        //			"<td width=\"2\"><\/td>";	
        lable = "<td width=\"64\"  background=\"" + headerimagepath + "\/images\/" + imagename + "\" style=\"no-repeat;width:65px;height:26px;text-align:center;\"><a href=\"" + url + "\" style=\"" + style + "\">" + text + "</a></td>"
        return lable;
    }
}
document.writeln("<center>");
document.writeln("<table width=\"776\" border=\"0\"  cellpadding=\"0\" cellspacing=\"0\">");
document.writeln("<tr>");
document.writeln("<td width=\"276\"  bgcolor=\"#004183\"><img src=\"" + ap_header.imagepath + "\/images\/logo.gif\"  width=\"276\" height=\"76\" border=\"0\"/></td>");
document.writeln("<td style=\"background:url(" + ap_header.imagepath + "\/images\/logoground.gif) no-repeat;width:500px;height:76px;text-align:center;\" valign=\"bottom\">");
document.writeln("<table width=\"100%\"><tr><td align=\"right\">");
document.writeln("<!--AdForward Begin:-->");
document.writeln(ap_header.ad_show());
document.writeln("<!--AdForward End--> ");
document.writeln("</td>");
document.writeln("<td width=\"15\">");
document.writeln("</td>");
document.writeln("</tr>");
document.writeln("</table>");
document.writeln("</td>");
document.writeln("</tr>");
document.writeln("</table>");
document.writeln("<table width=\"776\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">");
document.writeln("<tr align='left'>");
document.writeln("<td style=\"background:url(" + ap_header.imagepath + "\/images\/tdgroud.gif) repeat-x;width:776px;height:26px;\"><table width=\"300\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
document.writeln("<tr>");
document.writeln("<td width=\"15\"></td>");
document.writeln(ap_header.lable_list());
document.writeln("<td>&nbsp;</td>");
document.writeln("</tr>");
document.writeln("</table></td>");
document.writeln("</tr>");
document.writeln("</table>");