﻿var ie_ver=5.5,nav=navigator.appName,ver=navigator.userAgent,accept='',sfr=ver.indexOf('Safari');if(nav=='Microsoft Internet Explorer'){var a=ver.substr(ver.indexOf('MSIE'),ver.substr(ver.indexOf('MSIE')).indexOf(';')),app_ver=parseFloat(a.substr(a.indexOf(' ')));if(app_ver>=ie_ver){accept='ie';}}else if(sfr>-1){accept='sf'}else{accept='ff';}if(accept!=''){JkB={LCL:navigator[(accept=='ie'?'userL':'l')+'anguage']};JkB.namespace=function(a,b){var c=b?b:window,d=a.split('.'),i;for(i=0;i<d.length;i++){if(!c[d[i]])c[d[i]]={};c=c[d[i]];}return c;}
Gcs="/schedules/jackbe/css/"; 
Gfb="/schedules/jackbe/fb/";
Gjf="/schedules/jackbe/jf/";
Gjj="/schedules/jackbe/";
Gjd="/schedules/jackbe/";
IP="/schedules/images/"+""+"/schedules/images/";
CVM={css:{apl:1,axischart:1,calendar:1,contextMenu:1,jbtable:1,menu:1,pager:1,slider:1,tabs:1,toolbar:1,treeview:1,menuS:1,search:1,styleInttra:1},rb:{jackbeMessages:1,inttra:1},jc:{},fb:{search:1},jf:{footer:1,jbmlPrin:1,tmp:1,tmp2:1,jfCheckbox:1,smToolBar:1,header:1,jacoboEsRey:1,search:1}};
JkB.userPatterns={};
JkB.userMasks={};
Gv=2;                 

if(typeof(whiteLabel)!="undefined")
{
    WL=true;
    BVL=function (a, b) { return typeof(a)=="undefined" ? b : a; }
    WL_sx=BVL(whiteLabel.imageSuffix,"");
    WL_color=BVL(whiteLabel.color,"#CC6600");	//jcar
    if(WLprop("carriers"))
    {
  			if(whiteLabel.carriers=="all")
    		{
    			whiteLabel.carriers="";
    			WL_carrier={};
    	  }
    	  else
    	  {	
	        whiteLabel.carriers=whiteLabel.carriers.split(",");
	        WL_carrier={};
	        for (var i in whiteLabel.carriers) {
	            WL_carrier[whiteLabel.carriers[i]]=1;
	        }
      	}
    }
    else
    {
        WL_carrier=""
    }

}
else
{
    WL=false;
    WL_sx="";
    WL_color="#CC6600";
    WL_carrier="";
    whiteLabel={}
}



if(accept=="ie"){document.write('<script charset="ISO-8859-1" src="'+Gjj+'jkb/inijkbe_'+Gv+'.jpg"></script>')}else if(accept=="ff"||accept=="sf"){var ext=accept=="sf"?".js":".gif";document.write('<script charset="ISO-8859-1" src="'+Gjj+'jkb/inijkbe_'+Gv+ext+'"></script>')}}else{alert("Your browser doesn't support JackBe.\nIf you want to browse use:\n-Microsoft Internet Explorer 5.5+\n-Netscape 7.1+\n-Firefox 1.0+\n-Safari 2.0+")}


/**
 *Search calls buildHeader and buildFooter within the JB form. 
 * This builds the Search form
 */
function search(a,b){
        AB('<body id="bodyId" bgproperties="fixed" style="background-image: url(/schedules/images/blank.gif);">')
        AB('<div style="position: relative; left: 0px; top: 0px; width: 100px; height: 100px; display: none;" id="i24"><iframe id="ifBan" name="ifBan" width="743" scrolling="no" height="108" frameborder="0" src="" style="position: absolute; left: 274px; top: 439px;"></iframe><iframe id="ifBanRef" name="ifBanRef" scrolling="no" frameborder="0" src="" style="position: absolute; left: 274px; top: 439px;"></iframe></div>')
        AB('<div><table style="position: relative; left: 0px; top: 0px;" align=center cellpadding=0 cellspacing=0><tbody><tr valign=top><td></td><td valign=top>');
        //header
		//QC1667
		if(whiteLabel.fitFrame == 'yes')
			AB('<div style="position: relative; left: 0px; top: 0px; width: 567px; height: 590px; background-color: rgb(255, 255, 255);"><div style="position: relative; left: 0px; top: 0px; width: 567px; height: 50px;"><div id=dvForHeader style="position: relative; left: 0px; top: 0px; width: 567px; height: 50px;"><a id="i19" style="position: absolute; left: 25px; top: 14px;" href=search.do><img style="position: relative; left: 0px; top: 0px;" src=images/')
		else
            //AB('<div id="topDiv" style="position: relative; left: 0px; top: 0px; width: 760px; height: 150px; background-color: rgb(255, 255, 255);"><div id="dvWel" style="position: relative; left: 0px; top: 0px; width: 760px; height: 50px;"><div style="position: relative; left: 0px; top: 0px; width: 760px; height: 50px;"><a id="i19" style="position: absolute; left: 10px; top: 14px;" href=search.do><img style="position: relative; left: 0px; top: 0px;" src=images/')
            AB('<div style="position: relative; left: 0px; top: 0px; width: 760px; height: 590px; background-color: rgb(255, 255, 255);"><div style="position: relative; left: 0px; top: 0px; width: 760px; height: 50px;"><div id=dvForHeader style="position: relative; left: 0px; top: 0px; width: 760px; height: 50px;"><a id="i19" style="position: absolute; left: 10px; top: 14px;" href=search.do><img style="position: relative; left: 0px; top: 0px;" src=images/')

	AB(WL?BVL(whiteLabel.logo,"OceanSchedules-LogoJB_2_"+vLocale):"OceanSchedules-LogoJB_2_"+vLocale)
    AB('.gif imgname=OceanSchedules-LogoJB_2_en border=0> </a><img id="i32" style="position: absolute; left: 272px; top: 25px;" src=images/left_arrow.gif imgname=left_arrow border=0><div style="position: absolute; left: 285px; top: 8px; width: 200px; height: 40px;"><span style="position: absolute; left: 0px; top: 0px;">')
        AB("<a href='affiliateProgram.do' style='font-size: 9px; color: #CCCCCC; line-height:12px;text-decoration:none' id='i33' onmouseover='this.style.textDecoration=vUnderline' onmouseout='this.style.textDecoration=\"none\"'>"+rb1.your+" <span style='font-size: 9px;color:#F9A74E'>"+rb1.logo+"</span><br>"+rb1.here+" - "+rb1.find+"<br>"+rb1.outHow+"</a>");
		//QC512
		AB('</span></div><img style="position: absolute; left: 372px; top: 0px;" src=images/bg_btnJB'+WL_sx+'.gif imgname=bg_btnJB border=0 height=25 width=386> <img src=images/bg_btn_slashJB'+WL_sx+'.gif border=0 style="position: absolute; left: 355px; top: 0px;" imgname=bg_btn_slashJB> <span id="lbWel" class=welcome style="position: absolute; left: 380px; top: 6px;">'+GM('inttra','welcome')+'&nbsp;'+'</span><span style="position: absolute; right: 10px; top: 6px;" id="spLogin"> <a id=anLogin class=lnkHder style="" href='+rootURL+'userlogin.do>'+GM('inttra','login')+'</a> <span class="lnkHder" id="i2_cp_cp" >|</span> <a id=anRegister class=lnkHder style="" href=userregister.do>'+GM('inttra','register')+'</a> </span><div style="position: absolute; left: 428px; top: 34px; width: 330px; height: 20px;"><div style="position: absolute; right: 3px; top: 0px;">'+buildMenu()+'</div></div></div></div>')
      //finish header

AB('<div><div id=b_728x90 style="position: absolute; left: 20px; top: 69px; width: 728px; height: 90px;"><div style="position: absolute; left: 0px; top: 0px; width: 728px; height: 90px; background-color: rgb(255, 243, 232);" class="adbor" id="ina"><font style="position: absolute; left: 234px; top: 29px; font-size: 22px; color: rgb(26, 182, 212);" class="tit" id="i49"><b>OCEAN</b></font><font style="position: absolute; left: 313px; top: 29px; font-size: 22px; color: rgb(245, 133, 37);" class="tit" id="i49_cp"><b>SCHEDULES.COM</b></font><div id="b_ref_728x90"></div><div id="b_ref_530x200"></div><div id="b_ref_180x150"></div></div></div>')
AB('</div>')
//AB('<div></div>')

//QC1667
	if(whiteLabel.fitFrame == 'yes'){
		AB('<div id=dvCont style="position: absolute; left: 0px; top: 197px; width: 567px; height: 372px;"><div id="b_180x150" style="position: absolute; left: 574px; top: 0px; width: 180px; height: 150px;"><div style="position: absolute; left: 0px; top: 0px; width: 180px; height: 150px; background-color: rgb(255, 243, 232);" class="adbor" id="inb"><font style="position: absolute; left: 57px; top: 52px; font-size: 18px; color: rgb(26, 182, 212);" class="tit" id="i49"><b>OCEAN</b></font><font style="position: absolute; left: 13px; top: 73px; font-size: 18px; color: rgb(245, 133, 37);" class="tit" id="i49_cp_cp"><b>SCHEDULES.COM</b></font></div></div><div style="position: absolute; left: 0px; top: -20px; width: 567px; height: 370px;"><table cellpadding=0 cellspacing=0 style="position: absolute; left: 16px; top: 0px; z-index: 900;"><tr><td id=tab1 class=tb_sel_bg><div class=tb onMouseDown="javascript:this.className=\'tb_dwn\';" onMouseUp="javascript:this.className=\'tb\';" onClick="javascript:changeTab(\'location\');"><nobr><span id="spSearchBy1" class=tb_txt_grey>'+GM('inttra','searchBy')+'</span><span id="spLocation" class=tb_txt_color style="COLOR:'+WL_color+'"> '+GM("inttra",'location').toUpperCase()+'</span></nobr></div></td><td><img id=tab1img src=images/tab_sel_rt.png alt=tab border=0 /></td><td width=4><spacer width=4 height=4 /></td><td id=tab2 class=tb_unsel_bg><div class=tb onMouseDown="javascript:this.className=\'tb_dwn\';" onMouseUp="javascript:this.className=\'tb\';" onClick="javascript:changeTab(\'vessel\');"><nobr><nowrap><span id="spSearchBy2" class=tb_txt_white>'+GM("inttra",'searchBy')+'</span> <span id="spVessel" class=tb_txt_white>'+GM("inttra",'vessel').toUpperCase()+'</span></nobr></div></td><td><img id=tab2img src=images/tab_unsel_rt.png alt=tab border=0 /></td></tr></table>');
		if(vLocale == 'pt' || vLocale == 'es')
			AB('<span class=required style="position: absolute; right: -25px; top: 0px;">'+GM("inttra",'required')+'</span>');
		else
			AB('<span class=required style="position: absolute; right: 15px; top: 0px;">'+GM("inttra",'required')+'</span>');
	}else{
		AB('<div id=dvCont style="position: absolute; left: 0px; top: 197px; width: 760px; height: 372px;"><div id="b_180x150" style="position: absolute; left: 574px; top: 0px; width: 180px; height: 150px;"><div style="position: absolute; left: 0px; top: 0px; width: 180px; height: 150px; background-color: rgb(255, 243, 232);" class="adbor" id="inb"><font style="position: absolute; left: 57px; top: 52px; font-size: 18px; color: rgb(26, 182, 212);" class="tit" id="i49"><b>OCEAN</b></font><font style="position: absolute; left: 13px; top: 73px; font-size: 18px; color: rgb(245, 133, 37);" class="tit" id="i49_cp_cp"><b>SCHEDULES.COM</b></font></div></div><div id="b2_180x150" style="position: absolute; left: 575px; top: 189px; width: 180px; height: 150px;"></div><div style="position: absolute; left: 0px; top: -20px; width: 567px; height: 370px;"><table cellpadding=0 cellspacing=0 style="position: absolute; left: 16px; top: 0px; z-index: 900;"><tr><td id=tab1 class=tb_sel_bg><div class=tb onMouseDown="javascript:this.className=\'tb_dwn\';" onMouseUp="javascript:this.className=\'tb\';" onClick="javascript:changeTab(\'location\');"><nobr><span id="spSearchBy1" class=tb_txt_grey>'+GM('inttra','searchBy')+'</span><span id="spLocation" class=tb_txt_color style="COLOR:'+WL_color+'"> '+GM("inttra",'location').toUpperCase()+'</span></nobr></div></td><td><img id=tab1img src=images/tab_sel_rt.png alt=tab border=0 /></td><td width=4><spacer width=4 height=4 /></td><td id=tab2 class=tb_unsel_bg><div class=tb onMouseDown="javascript:this.className=\'tb_dwn\';" onMouseUp="javascript:this.className=\'tb\';" onClick="javascript:changeTab(\'vessel\');"><nobr><nowrap><span id="spSearchBy2" class=tb_txt_white>'+GM("inttra",'searchBy')+'</span> <span id="spVessel" class=tb_txt_white>'+GM("inttra",'vessel').toUpperCase()+'</span></nobr></div></td><td><img id=tab2img src=images/tab_unsel_rt.png alt=tab border=0 /></td></tr></table>');
		if(vLocale == 'pt' || vLocale == 'es')
			AB('<span class=required style="position: absolute; right: -25px; top: 0px;">'+GM("inttra",'required')+'</span>');
		else
			AB('<span class=required style="position: absolute; right: 15px; top: 0px;">'+GM("inttra",'required')+'</span>');
	}

  //form to submit
  AB('<div id="dvSch" name="dvSch" class=divBorder style="position: absolute; left: 16px; top: 20px; width: 536px; height: 153px; z-index: 890;">')
  AB('<form id="searchForm" name="searchForm" method="post" action="schedule-search.do" req="T" z="0" onsubmit="return OSM(this)">');
  AB('<div style="position: absolute; left: 145px; top: 48px; width: 80px; height: 22px; z-index: 1000;" id="i102_cp"><a href="javascript:openPortList()" style="position: absolute; right: 17px; top: 0px; color: rgb(73, 125, 183); text-decoration: underline;" id="i88_cp_cp"><nobr>'+GM('inttra','showPorts')+'</a></div><div style="position: absolute; left: 408px; top: 48px; width: 80px; height: 22px; z-index: 1000;" id="i102"><a href="javascript:openPortList()" style="position: absolute; right: 17px; top: 0px; color: rgb(73, 125, 183); text-decoration: underline;" id="i88_cp"><nobr>'+GM('inttra','showPorts')+'</a></div>')
  AB('<fieldset id="c_searchType" name="c_searchType" STYLE="position:absolute;left:5px;top:12px;width:1%;display:table-cell;border-style:none;" ><table cellpadding=1 cellspacing=0 ><tr class="divSche" height=25><td align=center valign=middle><input osr=T type=radio id="searchType" name="searchType" value="0" onclick="cp(this);" ></td><td NOWRAP style="cursor:pointer" onclick="CCN(-1)">'+GM("inttra","port2point")[0][0]+'</td><td align=center valign=middle><input osr=T type=radio id="searchType" name="searchType" value="1" onclick="cp(this);" ></td><td NOWRAP style="cursor:pointer" onclick="CCN(-1)">'+GM("inttra","port2point")[1][0]+'</td></table></fieldset><script>AV(\'searchType\',\'0\')</script><div id="jbs_outerContainer_origin" class="divBorder" STYLE="position:absolute;left:6px;top:65px;width:256;height:22;border-width:0;z-index:1000;" ><div id="c_origin" name="c_origin" STYLE="position:absolute;left:0px;top:0px;border-width:0;" ><input type="text" autocomplete=off id="origin" name="origin" osr=T size=46.2 t=0 onfocus="" onblur=""></div><script></script></div><input type="hidden" id="originId" name="originId" ><input type="hidden" name="originId_en" id="originId_en"/><input id="updateOriginH" type="hidden" name="updateOriginH"/><div id="jbs_outerContainer_destination" class="divBorder" STYLE="position:absolute;left:268px;top:65px;width:256;height:22;border-width:0;z-index:1000;" ><div id="c_destination" name="c_destination" STYLE="position:absolute;left:0px;top:0px;border-width:0;" ><input type="text" autocomplete=off id="destination" name="destination" osr=T size=46.2 t=0></div></div><input type="hidden" id="destinationId" name="destinationId" ><input type="hidden" id="destinationId_en" name="destinationId_en" ><input type="hidden" id="updateDestinationH" name="updateDestinationH" ><fieldset id="c_searchSort" name="c_searchSort" STYLE="position:absolute;left:5px;top:104px;width:1%;display:table-cell;border-style:none;" ><table cellpadding=1 cellspacing=0 ><tr class="divSche" height=25><td align=center valign=middle><input type=radio id="searchSort" name="searchSort" value="2" ></td><td NOWRAP style="cursor:pointer" onclick="CCN(-1)">'+GM("inttra","byDepartureArrive")[0][0]+'</td><td align=center valign=middle><input type=radio id="searchSort" name="searchSort" value="5" ></td><td NOWRAP style="cursor:pointer" onclick="CCN(-1)">'+GM("inttra","byDepartureArrive")[1][0]+'</td></table></fieldset><script>AV(\'searchSort\',\'2\')</script><FONT id="lbWkd" class="divScheB"STYLE="position:absolute;left:409px;top:96px;">'+GM("inttra","weeksOut")+'</font><FONT id="lbReq1" class="required"STYLE="position:absolute;left:6px;top:50px;font-size:11;">*</font><FONT id="lbReq2" class="required"STYLE="position:absolute;left:268px;top:50px;font-size:11;">*</font><FONT id="lq" class="required"STYLE="position:absolute;left:268px;top:97px;font-size:11;">*</font><FONT id="lq3" class="required"STYLE="position:absolute;left:400px;top:97px;font-size:11;">*</font><FONT id="lbDes" class="divScheB"STYLE="position:absolute;left:277px;top:50px;">'+GM("inttra","destination")+'</font><div id="c_date" name="c_date" STYLE="position:absolute;left:268px;top:112px;border-width:0;" ><input type="text" autocomplete=off id="date" name="date" osr=T size=17 t=0 onfocus="VLF(this)" onblur="VLB(this);if((UD(this,\'v\')!=this.value&&this.V)||UD(this,\'dc\')){UDS(this,\'dc\',F);undefined}"><span style="position: absolute; left: 0px; top: 0px;"><img ;="" ).style.visibility="visible" date_cal="" onclick="GI(\'date\').focus()" style="cursor:pointer;position: absolute; left: 92px; top: 1px;" alt="'+GM('inttra','selectDate')+'" src="images/calendar.jpg"/></span></div>');
  
  AB('<div id="vsAd" style="display:none;position: absolute; left: 0px; top: 105px; width: 536px; height: 65px; z-index:-10"><iframe width="536" scrolling="no" height="65" frameborder="0" name="vsAdFrame" id="vsAdFrame" style="position: relative; left: 0px; top: 0px;"></iframe></div>')

  AB('<div id="c_weeksOut" name="c_weeksOut" STYLE="position:absolute;left:401px;top:114px;display:inline"><select STYLE="position:relative;left:0px;top:0px;width:50;" onblur="SKT()" onkeypress="return SKP(event);" id="weeksOut" name="weeksOut" l=""><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option>');
  if(WL){
	AB('<option value="6">6</option>');
  }else{
	AB('<option value="6" SELECTED>6</option>');
  }
  AB('</select></div><FONT id="lbDat" class="divScheB"STYLE="position:absolute;left:277px;top:96px;">'+GM("inttra","bDate")+'</font><FONT id="lbOri" class="divScheB"STYLE="position:absolute;left:15px;top:50px;">'+GM("inttra","origin")+'</font><input type="hidden" id="showSurroundingPorts" name="showSurroundingPorts" Value="Y" ><input type="hidden" id="PInUserType" name="PInUserType" value=""><input type="hidden" id="PInUserRole" name="PInUserRole" value="SchedulesInquiry"><input type="hidden" id="PInINTTRAProduct" name="PInINTTRAProduct" value=""><input type="hidden" id="lad" name="lad" value=""><input type="hidden" id="dad" name="dad" value=""><input type="hidden" id="isp" name="isp" value=""><input type="hidden" id="carrierScac" name="carrierScac" value=""></form>');

 //form structer
 //QC1667 , change width size to 162
 //QC150
  if(WL){
	  AB('<div id=gsDiv style="position: absolute; left: 385px; top: 154px; width: 162px; height: 40px;"><div class=dvBtGet style="position: absolute; left: -20px; top: -2px; width: 175px; height: 40px;"><img src=images/bg_btn_slash4'+WL_sx+'.gif name=btSla border=0 class=asLink style="position: absolute; left: 0px; top: 0px;" imgname=bg_btn_slash4> <button class=btGet value="'+GM('inttra','getSchedules')+'" style="BACKGROUND-COLOR:'+WL_color+';position: absolute; left: 25px; top: 0px; width: 125px; height: 32px;" onClick="javascript:vs()" type=button> <u></u>'+GM('inttra','getSchedules')+' </button> <img class=asLink style="position: absolute; left: 141px; top: 0px;" src=images/icon_arrow3'+WL_sx+'.gif imgname=icon_arrow3 border=0 height=32 width=30></div></div><div id=dvPref style="position: absolute; left: 0px; top: 156px; width: 100px; height: 20px;"><a id=aPreferences style="position: absolute; left: 0px; top: -1px; text-decoration: underline;" href=preferences.do>'+GM("inttra","preferences")+' </a><span style="position: absolute; left: 75px; top: -1px; font-size: 11px; color: rgb(73, 125, 183);" id="i74">|</span><div style="position: absolute; left: 86px; top: -1px; width: 100px; height: 20px;"><a id="aPreferences_cp" style="position: absolute; left: 0px; top: 0px; text-decoration: underline;" href=mailto:feedback@OceanSchedules.com>'+GM("inttra","feedback")+'</a></div></div>')
  }else{
	  AB('<div id=gsDiv style="position: absolute; left: 385px; top: 154px; width: 162px; height: 40px;"><div class=dvBtGet style="position: absolute; left: -20px; top: -2px; width: 175px; height: 40px;"><img src=images/bg_btn_slash4'+WL_sx+'.gif name=btSla border=0 class=asLink style="position: absolute; left: 0px; top: 0px;" imgname=bg_btn_slash4> <button class=btGet value="'+GM('inttra','getSchedules')+'" style="BACKGROUND-COLOR:'+WL_color+';position: absolute; left: 25px; top: 0px; width: 125px; height: 32px;" onClick="javascript:vs()" type=button> <u></u>'+GM('inttra','getSchedules')+' </button> <img class=asLink style="position: absolute; left: 141px; top: 0px;" src=images/icon_arrow3'+WL_sx+'.gif imgname=icon_arrow3 border=0 height=32 width=30></div></div><div id=dvPref style="position: absolute; left: 0px; top: 156px; width: 400px; height: 20px;"><a id=aPreferences style="position: relative; left: 0px; top: -1px; text-decoration: underline;" href=preferences.do>'+GM("inttra","preferences")+'</a><span style="position: relative; left:3px; top: -1px; font-size: 11px; color: rgb(73, 125, 183);" id="i74">|</span><a id="aPreferences_cp" style="position: relative; top:-1px; left:6px; text-decoration: underline;" href=mailto:feedback@OceanSchedules.com>'+GM("inttra","feedback")+'</a><span style="position: relative; left:9px; top: -1px; font-size: 11px; color: rgb(73, 125, 183);" >|</span><span style="position: relative; top:2px; left:2px"><a id="ck_email" class="stbar chicklet" style="position: relative; top:-1px; left:12px;" href="javascript:void(0);"><img src="http://w.sharethis.com/chicklets/email.gif" /></a><a id="ck_sharethis" class="stbar chicklet" href="javascript:void(0);" style="position: relative; top:-1px; left:15px; text-decoration: underline;"><img src="http://w.sharethis.com/chicklets/sharethis.gif" /></a></span><a id="ck_sharethis_link" style="position: relative; top:-1px; left:17px; text-decoration: underline;" href="javascript:void(0);">ShareThis</a><span style="position: relative; top:2px; left:20px"><a id="share_this_info" class="stbar chicklet" href="javascript:void(0);" style="position: relative; top:-1px; left:0px;"><img src="images/share_this_info.gif" title="What is ShareThis?" onclick="showShareThisInfor(this)" style="cursor: pointer; margin-left:2px" border="0" /></a><script type="text/javascript">var shared_object = SHARETHIS.addEntry({title:"OceanSchedules.com"});shared_object.attachButton(document.getElementById("ck_sharethis"));shared_object.attachButton(document.getElementById("ck_sharethis_link"));shared_object.attachChicklet("email", document.getElementById("ck_email"));</script></span></div>') 
	  
//	  <script type="text/javascript">SHARETHIS.addEntry({title:"OceanSchedules.com"});</script><img src="images/share_this_info.gif" title="What is ShareThis?" onclick="showShareThisInfor(this)" style="cursor: pointer; margin-left:0px" border="0" /></div></div>')  

//<span style="position: absolute; left: 151px; top: -1px; font-size: 11px; color: rgb(73, 125, 183);" >|</span><div style="position: absolute; left: 162px; top: -1px; width: 100px; height: 20px;"><script type="text/javascript">SHARETHIS.addEntry({title:"OceanSchedules.com"});</script><img src="images/share_this_info.gif" title="What is ShareThis?" onclick="showShareThisInfor(this)" style="cursor: pointer; margin-left:0px" border="0" /></div></div>') 

  }
 
 

 if(whiteLabel.bottomAd !="no"){
	AB('<table cellpadding="0" cellspacing="0" border="0" style="position: absolute; left: 0px; top: 190px; width: 530px; height: 135px;"><tr><td height="6" width="6"><img src="images/tips_tlt.gif" border="0" width="6"></td><td background="images/tips_tp.gif"><spacer height="6" /></td><td height="6" width="6"><img src="images/tips_trt.gif" border="0" width="6"></td></tr><tr><td background="images/tips_lt.gif"><spacer width="6" /></td><td style="width: 501px; height: 130px;" valign="middle"><div id=botad><div id="b_530x200" style="position: relative; left: -1px; top: 0px; width: 526px; height: 125px;"></div></div></td><td background="images/tips_rt.gif"><spacer width="6" /></td></tr><tr><td height="6"><img src="images/tips_blt.gif" border="0" height="6"></td><td background="images/tips_bt.gif"><spacer height="6" /></td><td height="6"><img src="images/tips_brt.gif" border="0" height="6"></td></tr></table></div>')
 }else{
	AB('<div id=botad><div id="b_530x200" style="position: absolute; left: 0px; top: 190px; width: 530px; height: 160px;"></div></div></div></div>')
 }


 //footer
buildFooter()
 ABS("ini()")
 FB()

}

/**
 * Draws the Search form.
 */
function callSearch(){ 
    search("icon_arrow3"+WL_sx,"bg_btn_slash4"+WL_sx);
    }
vUnderline="underline";

/**
 * Contains the buildMenu function
 * buildMenu function will build a dynamic menu only if its white label otherwise build normal menu.
 */
function header(a,b,c,d,e){
    
}

/**
 * In charge of building the footer for the results page. Can 
 * build a whitelabel or default footer 
 */


selTab=1
vWeeksOut1=1
vWeeksOut2=1
vWeeksOut6=6
vOrigin1="";
vOriginId1=""
vOrigin2="";
vOriginId2=""
function changeTab(a)
{
    if(a=="location" && selTab!=1)
    {
        vWeeksOut2=GV("weeksOut")
        AV("weeksOut",vWeeksOut1);
        vDate2=GV("date");
        AV("date",vDate1);
        CN("tab1","tb_sel_bg")
        vOrigin2=GV("origin")
        AV("origin",vOrigin1);
        vOriginId2=GV("originId")
        AV("originId",vOriginId1);
        CN("tab1","tb_sel_bg")
        GI("tab1img").src='images/tab_sel_rt.png'
        CN("tab2","tb_unsel_bg")
        GI("tab2img").src='images/tab_unsel_rt.png'
        BNI("c_searchSorti102_cpi102jbs_outerContainer_destinationc_searchTypelbDeslq","B")
        if(whiteLabel.pointToPoint=="no")
        {
            GI("c_searchType").style.display="none";
            //GI("searchType").parentNode.parentNode.childNodes[3].style.display="none";
        }
        BNI("vsAd","N");

        selTab=1
        CN("spSearchBy1","tb_txt_grey");
        CN("spSearchBy2","tb_txt_white");
        ST("spLocation","color",WL_color);
        ST("spVessel","color","#ffffff");
        ST("dvSch","height","153")
        ST("gsDiv","top",154)
        ST("dvPref","top",156)
        ST("jbs_outerContainer_origin","top",65)
        ST("lbDat","top","96px")
		ST("lbReq1","top","50px")
        ST("lbOri","top","50px")
        ST("lbReq2","top",50)
        ST("c_date","top",112)
        ST("c_weeksOut","top",114)
        ST("lbWkd","top",96)
        ST("lq3","top",97)
        IH("lbOri",GM("inttra","origin"))
		
        //AV("dateoriginupdateOriginHdestinationupdateDestinationH"," ")
        //AV("searchTypesearchSort","02")
    }
    else if(a=="vessel" &&selTab!=2)
    {
//        if(GI("vsAd")==null) {

//<iframe width="730" scrolling="no" height="70" frameborder="0" src="" name="ifBanBot" id="ifBanBot" style="position: relative; left: 0px; top: 0px;"></iframe>
/*
	if(!WL){
		GI("ifBanBot").src="/schedules/js/AdsGroupColorAds_1.html?sitePage=/SearchResults&listParam=x01,x02,x03,x04,x05&qType=S&adsURL="+adsURL	
    }else if(whiteLabel.bottomAd!="no"){
        GI("ifBanBot").src="/schedules/js/AdsGroupColorAds_1.html?sitePage=/SearchResults&listParam=x01,x02,x03,x04,x05&qType=S&adsURL="+adsURL	
    }
*/

			if(!WL){
//				IH('vsAd','<div id="vsAdDiv" style="position: relative; left: 0px; top: 0px;"><iframe width="536" scrolling="no" height="65" frameborder="0" name="vsAd" id="vsAd" style="position: relative; left: 0px; top: 0px;"></iframe><iframe style="display:none;position:absolute;top:-2;left:266" scrolling="no" height="65" frameborder="0" width="203" src="./jackbe/htm/blank.htm" id="hdcall"></iframe></div>');
				GI("vsAdFrame").src="/schedules/js/AdsGroupAds_1.html?sitePage=/SearchResults&listParam=x40,x41,x42,x43&qType=S&adsURL="+adsURL
			}else if(whiteLabel.EmulGoogleAds!="no"){
//				IH('vsAd','<div id="vsAdDiv" style="position: relative; left: 0px; top: 0px;"><iframe width="536" scrolling="no" height="65" frameborder="0" name="vsAd" id="vsAd" style="position: relative; left: 0px; top: 0px;"></iframe></div>');
				GI("vsAdFrame").src="/schedules/js/AdsGroupAds_1.html?sitePage=/SearchResults&listParam=x40,x41,x42,x43&qType=S&adsURL="+adsURL
            }
//		}
        vWeeksOut1=GV("weeksOut")
		if(WL){
			AV("weeksOut",vWeeksOut2);
		}else{
			AV("weeksOut",vWeeksOut6);
		}
        vDate1=GV("date");
        AV("date",vDate2);
        vOrigin1=GV("origin");
        AV("origin",vOrigin2);
        vOriginId1=GV("originId")
        AV("originId",vOriginId2);
        CN("tab1","tb_unsel_bg")
        GI("tab1img").src='images/tab_unsel_rt.png'
        CN("tab2","tb_sel_bg")
        GI("tab2img").src='images/tab_sel_rt.png'
        BNI("c_searchSorti102_cpi102jbs_outerContainer_destinationc_searchTypelbDeslq","N")
        BNI("vsAd","B");
        selTab=2
        CN("spSearchBy1","tb_txt_white");
        CN("spSearchBy2","tb_txt_grey");
        ST("spLocation","color","#ffffff");
        ST("spVessel","color",WL_color);
        ST("dvSch","height","60")
        ST("gsDiv","top",61)
        ST("dvPref","top",63)
        ST("lbReq1","top",10)        
        ST("jbs_outerContainer_origin","top",25)
        ST("lbDat","top",10)
        ST("lbOri","top",10)
        ST("lbReq2","top",10)
        ST("c_date","top",25)
        ST("c_weeksOut","top",25)
        ST("lbWkd","top",10)
        ST("lq3","top",10)
        IH("lbOri",GM("inttra","vesselName"))
            //AV("dateoriginupdateOriginHdestinationupdateDestinationH"," ")

 
    }

}

/**
 * Calls footer JB form to draw the footer 
 */

/**
 * In charge of building the footer.
 * Can build a whitelabel or default footer
 */
function buildFooter()
{
    if(WL)
    {
        if(whiteLabel.footer!="no")
        {
         AB('<div style="z-index:1000;position: absolute; left: 0px; top: 365px; width: 760px; height: 30px;"><table style="position: relative; left: 0px; top: 0px;" border=1 cellpadding=0 cellspacing=0 width=100%><tbody><tr height=20><td colspan=2><span style="position: absolute; left: 3px; top: 3px; font-size: 11px;"><hr width="760"/></span></td></tr><tr><td style="width: 60%;"><div style="position: relative; left: 0px; top: 0px; width: 500px; height: 20px;">')
            AB(whiteLabel.footer);
				 AB('</div></td><td></td></tr></tbody></table></div>')
        }
    }
    else{
        AB('<div style="z-index:1000;position: absolute; left: 0px; top: 365px; width: 760px; height: 30px;"><table style="position: relative; left: 0px; top: 0px;" border=1 cellpadding=0 cellspacing=0 width=100%><tbody><tr height=20><td colspan=2><span style="position: absolute; left: 3px; top: 3px; font-size: 11px;"><hr width="760"/></span></td></tr><tr>'+
        		'<td><div style="position: relative; left: 0px; top: 0px; height: 20px;">')
        AB('<a class=lnkFoo href=privacypolicy.do>'+GM("inttra","privacy")+'</a>'+
       		'<span class=lbPrivacy style="font-size: 11px;">&nbsp; | &nbsp;</span>'+
         		'<a class=lnkFoo href=contactus.do>'+GM("inttra","contact")+'</a>'+
         		'<span class=lbPrivacy style="font-size: 11px;">&nbsp; | &nbsp;</span>'+
         		'<a class=lnkFoo href=termsandconditions.do>'+GM("inttra","legal")+'</a>'+
        		'</div></td><td id=i18 align=right>'+
        		'<span class=copyright style="position: relative; left: 0px; top: 0px;"></span>'+
        		'<div style="position: relative; left: 0px; top: 0px;">'+
        		'<span style="position: relative; left: 0px; top: 0px;font-size: 10px;font-family: Verdana; color: #636363; letter-spacing:0px;"><nobr>\251 '+GM("inttra","copyright")+' '+'2007 OceanSchedules.com '+GM("inttra","rightsReserved")+'</span></div></td></tr><tr><td height="20"> <a style=\"font-size: 10px;color:#3399CC;\" href=\"#\" onClick=\"window.open(\'http://www.miibeian.gov.cn/\', \'\', \'status, menubar, scrollbars, height=600, width=800\');return false;\" target=\"_blank\">&#20140;ICP&#22791;09040597&#21495;</a></td></tr></tbody></table></div>');
				 AB('</div></td><td></td></tr></tbody></table></div>')
   }

}

/**
 * In charge of building the Menu
 * Can build a whiteLabel or a default menu
 * @param _rb_ - 
 */
function buildMenu(_rb_)
{
   
	v_return=[]
    if(WL)
    {
        if(whiteLabel.menu!="no")
        {
            var menuItems=whiteLabel.menu.split("|"),mi;
            if(whiteLabel.menuLeft>0||whiteLabel.menuTop>0)
                v_return.push("<div style='position:absolute;left:"+whiteLabel.menuLeft+"px;top:"+whiteLabel.menuTop+"px'>")
            else
								v_return.push("<div style='position:absolute;right:0px;top:0px'><nobr>")
            for(var i in menuItems)
            {
                if(i>0)
                    v_return.push('<span style="color:'+((!IB(whiteLabel.menuFontColor)&&whiteLabel.menuFontColor!='no')?whiteLabel.menuFontColor:'#636363')+'" > | </span>')
                mi=menuItems[i].split(",");
                v_return.push('<a style="color:'+((!IB(whiteLabel.menuFontColor)&&whiteLabel.menuFontColor!='no')?whiteLabel.menuFontColor:'#636363')+'" href="'+mi[1]+"?"+(window.location+"").substring((window.location+"").indexOf("?")+1)+'">'+mi[0]+'</a>');
            }
            if(whiteLabel.top>0||whiteLabel.left>0)
                v_return.push("</div>")
        }
    }
    else
    {
        if ((window.location+"").indexOf("schedule-search.do")>-1||(window.location+"").indexOf("vessel-search.do")>-1)
        {

            v_return.push("<div style='position:absolute;right:0px;top:0px'><nobr>")
            v_return.push('<a style="color:#636363;text-decoration:none;" href="search.do">'+GM('inttra','aHome')+'</a> | ');
        }
        else
        {
            v_return.push("<div style='position:absolute;right:0px;top:0px'><nobr>")
        }
        v_return.push('<a style="color:#636363;text-decoration:none;" href="advertise.do" class="highlight">'+GM('inttra','advertise')+'</a> | <a style="color:#636363;text-decoration:none;" href="'+ rb1.newsUrl +'">'+GM('inttra','aNews')+'</a> | <a style="color:#636363;text-decoration:none;" href="aboutus.do">'+GM('inttra','aboutUs')+'</a> | <a style="color:#636363;text-decoration:none;" target="_blank" href="/schedules/images/doc/OceanSchedules_Help_7_0_'+JkB.LCL+'.pdf">'+GM('inttra','aHelp')+'</a>')
        v_return.push("</div>")
    }
	return v_return.join("")
}


/**
 * Builds custom links only when its whitelabel
 * @param _rb_ - ?
 */
function buildCustomLink(_rb_)
{
	var vReturn=[]
    if(WL)
    {
        if(whiteLabel.customlink!="")
        {
            var menuItems=whiteLabel.customlink.split("|"),mi;
								vReturn.push("<div style='position:absolute;left:0px;top:0px;width:368'>")
            for(var i in menuItems)
            {
                if(i>0)
                    vReturn.push('<span style="color:'+((typeof(whiteLabel.menuFontColor)!='undefied'&&whiteLabel.menuFontColor!='no')?whiteLabel.menuFontColor:'')+'" > | </span>')
                mi=menuItems[i].split(",");
                vReturn.push('<a style="COLOR: #497db7;" href="'+mi[1]+'">'+mi[0]+'</a>');
            }

        }
        if(whiteLabel.feedbackLink!="no")
        {
            if(vReturn.length>0
             )
            {
                vReturn.push('<span style="color:'+((typeof(whiteLabel.menuFontColor)!='undefied'&&whiteLabel.menuFontColor!='no')?whiteLabel.menuFontColor:'')+'" > | </span>')
            }
            vReturn.push('<a style="COLOR: #497db7;" href="mailto:'+whiteLabel.feedbackLink+'">'+GM('inttra','feedback')+'</a>');
        }
    }
    if(vReturn.length>0)
    {
                 vReturn.push("</div>")
                 IH("dvPref",vReturn.join(""))
    }
}
F=false;
rdf=readCookie("SCHEDULESDATEFORMAT");

/**
 * Variables used for date format
 */
if(rdf=="DD-MM-YY")
{
    ddf="dd-MM-yyyy";
    idf="d-M-y";
}
else if(rdf=="MM-DD-YY")
{
    ddf="MM-dd-yyyy";
    idf="M-d-y";
}
else
{
	rdf = "DD-MMM-YY";
    ddf="dd-MMM-yyyy";
    idf="d-MMM-y";
}
ddft=ddf+" hh:mm a";
ddftbr=ddf+"<br>hh:mm a";

/**
 * Sets blank values to origin, originId, destination, destinationId
 */
function cp(a){if(GV(a)==0){AV("originoriginIddestinationdestinationId",B);jbs1.j_n();jbs2.j_n();}};


/**
 * Initalizes auto suggest functionality
 */
function ini(){
    /*IH("lbDat","("+ddf+")",1);*/gsp();
    CCA.j_j_e=F;
    
    jbs1=new j_b("origin");
    jbs2=new j_b("destination");
    AE("date","onfocus",'sc()');
    AE("bodyId","onmousedown",function(eve){tmd(eve)});
    AE("weeksOut","onfocus",function(eve){tmd(eve)});
    AE("date","onmousedown",function(eve){tmd2(eve)});
    sD=new Date();
    ssD=(sD.getMonth()+1)+"/"+sD.getDate()+"/"+sD.getFullYear();
    AV("date",aDS(sD,ddf));
    vDate1=aDS(sD,ddf);
    vDate2=aDS(sD,ddf);
    GI("origin").focus()
    };


/**
 * Manages event propagation functionality.
 * Knows when to make calendar disappear from the document when user clicks outside the calendar
 * @param asd - Window event.
 */
function tmd2(asd)
{
    asd=(!asd)?window.event:asd;
    asd.cancelBubble=true;
    if(asd.stopPropagation)asd.stopPropagation();};


    function tmd(asd){
    if(CCA.active)
    {
    
        RCL('date')
        if(GI("hdcall")!=null)
        {
            BNI("hdcall","N")
        }

    }
        };

/**
 * 
 */
function li(a){
    if(IB(a))
    {
        loggedIn=F;
        j_x=F;
        IH("lbWel","&nbsp;"+GM('inttra','guest'),1);
        GI("aPreferences").href=rootURL+"preferenceRedirect.do";
    }
    else
    {
        loggedIn=T;
        j_x=T;
        IH("lbWel",",&nbsp;"+readCookie("SCHEDULESNAME"),1);
    	AV("anLogin",GM('inttra','logout'));
    	AV("anRegister",GM('inttra','myAccount'));
    	GI("anLogin").href="javascript:confirmLogoutMsg()";
    	GI("anRegister").href=rootURL+"myaccountRedirect.do";
    }
    };


/**
 * checks date format
 */ 
function cd()
{
    if(!aPD(GV("date"),idf))
    {
        alert("Please use date format "+rdf+".");
        AV("date",sD);
        return F;
    }
    return T;
};

/**
 * Pastes the chosen date to the date field
 */
function sc(){
    GI("date").select();
    var a;a=GV("date");
    if(!aPD(GV("date"),idf))
        AV("date","");
    CCD("date",268,(selTab==1?133:42),"dvSch");
    if(GI("hdcall")!=null)
    {
        BNI("hdcall","B")
    }

};

/**
 * Required Fields
 * param a - Name of field to check for data
 * returns boolean - true if passed validation else false
 */ 
function rf(a){
    var msg;
if(selTab==2&&a=="origin")
{
    msg=GM("inttra","vessel");
}
else
{
    msg=a
}
    if(IB(GV(a))){A("Must specify an "+msg+". Please enter an "+msg+" and try again.");GI(a).focus();return F;}return T;};

/**
 * Validates if suggest value is valid
 */
function vf(a){if(IB(GV(a+"Id"))){A("Must enter a valid "+(selTab==1?a:GM("inttra","vesselName"))+" from the dropdown list");GI(a).focus();return F;}return T;};

/**
 * Submits search if all validations are successfull
 */
function vs(){
if(selTab==1)
{
        if(rf("origin")&&rf("destination")&&vf("origin")&&vf("destination")&&rf("date")&&cd())
            {
                if(cDif("origin","destination"))
                {
					AV("carrierScac", vCarrierScac);
                    AV("date",aDS(aPD(GV("date"),idf),ddf))
                    tmpd=aPD(GV("date"),ddf);
                    AV("lad",aDS(tmpd,"MM/dd/yyyy"));
                    AV("dad",aDS(addDays(tmpd,PI(GV("weeksOut"))*7),"MM/dd/yyyy"));
                    AV("isp",GV("showSurroundingPorts")=="Y"?1:0);
                    if(loggedIn)
                    {
                        if(WL)
                            AV("PInUserType","White Label");                    
                        else
                           AV("PInUserType","Registered");
                    }
                    else
                    {
                        AV("PInUserType","Public");
                    }
                    if (document.referrer.indexOf('inttra.com') == -1)
                        AV("PInINTTRAProduct","");
                    else if (document.referrer.indexOf('need.url') > -1)
                        AV("PInINTTRAProduct","INTTRABooking");                
                    else if (document.referrer.indexOf('www.inttra.com') > -1)
                        AV("PInINTTRAProduct","INTTRAHome");
                    else
                       AV("PInINTTRAProduct","OceanSchedules'");
                    GI("searchForm").action="schedule-search.do";
                    GI("searchForm").submit();
                }
		}
}
else{
    if(rf("origin")&&vf("origin")&&rf("date")&&cd())  {
						AV("carrierScac", vCarrierScac);
                        AV("date",aDS(aPD(GV("date"),idf),ddf))
                        tmpd=aPD(GV("date"),ddf);
                        AV("lad",aDS(tmpd,"MM/dd/yyyy"));
                        AV("dad",aDS(addDays(tmpd,PI(GV("weeksOut"))*7),"MM/dd/yyyy"));
                        AV("isp",GV("showSurroundingPorts")=="Y"?1:0);
                        if(loggedIn)
                        {
                            if(WL)
                                AV("PInUserType","White Label");                    
                            else
                               AV("PInUserType","Registered");
                        }
                        else
                        {
                            AV("PInUserType","Public");
                        }
                        if (document.referrer.indexOf('inttra.com') == -1)
                            AV("PInINTTRAProduct","");
                        else if (document.referrer.indexOf('need.url') > -1)
                            AV("PInINTTRAProduct","INTTRABooking");                
                        else if (document.referrer.indexOf('www.inttra.com') > -1)
                            AV("PInINTTRAProduct","INTTRAHome");
                        else
                           AV("PInINTTRAProduct","OceanSchedules'");
                        GI("searchForm").action="vessel-search.do";
                        GI("searchForm").submit();
    }
};
}

/**
 * Checks if origin and destination are the same
 */
function cDif(a,b){if(GV(a)==GV(b)){A("Origin and destination are the same, please try a different search");GI(a).focus();return F;}return T;};var j_E,j_y,j_u,j_i=10,j_C=F;que="";

/**
 * Creates a unique Id
 * @return - Returns a unique id
 */
function uid(){var num=Math.random();while(num==0){num=Math.random();}return["jbg_",num.toString(16).substr(2),(uid.cont++).toString(16).substr(2)].join("");};uid.cont=(new Date()).getTime();

/**
 * Returns source element. Crossbrowser function
 * @return target element
 */
function j_d(e){return!e.target?e.srcElement:e.target;};

/**
 * JBSuggest widget code
 */
function j_b(pID){
    this.id=pID;this.obj=GI(this.id);
    this.obj.jbs=this;
    this.uId="jbs"+pID;
    this.objId=GI(pID+"Id");
    this.objIdEn=GI(pID+"Id_en");
    W[this.uId]=this;
    this.j_u="";
    this.j_y="";
    this.j_r=-1;
    this.j_C=F;
    var t=this;
    AE(pID,"onkeydown",function(e){t.j_m(e)});
    AE(pID,"onfocus",function(e){t.obj.select()});
    AE(pID,"onblur",
            function(e){
								// QC 12826
								//BNI("div_jbs_optionsContainer_"+pID,"N");

                                t.exit=T;
                                vObj=j_d(e);
                                if(L(vObj.value)>2)t.j_H();});
                                this.j_m=function(e){
                                    this.exit=F;
                                    switch(e.keyCode){
                                            case 16:
                                            case 17:
                                            case 18:
                                            case 20:
                                            case 39:
                                            case 37:break;
                                            case 27:this.j_n();
                                            this.objId.value=B;
                                            this.objIdEn.value=B;
                                            break;
                                            case 38:this.j_q();
                                            clearTimeout(this.j_E);
                                            break;
                                            case 40:this.j_p();
                                            clearTimeout(this.j_E);
                                            break;
                                            case 13:
                                            case 9:if(L(this.obj.value)>2)t.j_H();
                                            break;
                                            case 8:if(this.obj.value.length<4){this.j_C=F;this.j_n();
                                            break;}
                                            default:this.objId.value=B;
                                            this.objIdEn.value=B;
                                            var j_K=e.charCode?e.charCode:e.keyCode;
                                            if(this.j_E){clearTimeout(this.j_E);
                                            }this.objId.value=B;
                                            this.objIdEn.value=B;
                                            this.j_E=setTimeout("W['"+this.uId+"'].j_G()",30);
                                            }};
                                            this.j_H=function(){
                                                if(this.j_r!=-1&&!this.j_C)
                                                    {this.j_I();}};
                                           this.j_G=function(){
                                               if(!j_C){this.j_f()}
                                               else{que=GV(this.id);}};
                                           this.j_I=function(){
                                                   if(L(this.osr.cities)>0){this.obj.value=this.j_t[this.j_r][1][0];
                                                   this.objId.value=this.j_t[this.j_r][1][1];
                                                   this.objIdEn.value=this.j_t[this.j_r][1][2];
                                                   this.j_g();
                                                   }

                                               };
                                               this.j_g=function(pID){this.j_r=-1;
                                               this.j_n(pID);
                                               };
                                               this.j_n=function(){
                                                   try{RMV("div_jbs_optionsContainer_"+pID);
                                               }catch(e){}};
                                               this.j_f=function(){this.j_y=this.obj.value;
                                               if(L(this.j_y)>2){this.reqOptions={};
                                               this.reqOptions.asyn=true;
                                               this.reqOptions.onreadystatechange=function(req){
                                                                                    if(req.readyState==4){
                                                                                        if(selTab==1)
                                                                                        {
                                                                                            eval("j_L="+req.responseText);
                                                                                        }
                                                                                        else
                                                                                        {
                                                                                            eval("j_L="+req.responseText);
                                                                                            j_L=j_L.PkgCarrierSchedulesPrcSearchVesselName.pOutVesselList.rows.DynaBean
                                                                                            if(j_L)
                                                                                            {
                                                                                                j_L=transformVessel(j_L);
																							 
																								if(j_L.cities == null || j_L.cities == 'undefined' || j_L.cities == '' ||j_L.cities[0] == 'undefined' || j_L.cities[0][0] == 'undefined' ) {
																								}else{
																									if(j_L.cities[0][0] == 0){
																										j_L={cities:[],total:0,objId:"jbsorigin"}
																									}
																								}
                                                                                            }
                                                                                            else
                                                                                                j_L={cities:[],total:0,objId:"jbsorigin"}
                                                                                        }
                                               var vThis=W[j_L.objId]
                                                   ;if(L(vThis.obj.value)<3){j_C=F;
                                                   que="";
                                                   return;
                                                   }
                                                   var vQue=que;
                                                   vThis.osr=j_L;
                                                   vThis.j_v();
                                                   if(que.length>0){que="";
                                                   j_C=F;
                                                   vThis.j_f(pID,vQue);
                                                   }else vThis.j_C=F;
                                                   }
                                               };
                                               j_j=this.reqOptions.onreadystatechange;
                                               this.reqOptions.onreadystatechange.pThis=this;

if(typeof(osr)=="undefined")
{
    this.j_u=this.j_y;
    this.j_C=T;
    if(selTab==1)
    {
        if(GV("searchType")==0&&(!forcePlaceListOrigin&&!forcePlaceListDestination))
        {
            if(WL)    	
                var vURL="autocomplete.do?locationName="+escape(this.obj.value)+"&objId="+this.uId+"&locale="+((whiteLabel.portsList.length>0&&whiteLabel.portsList!="null")?whiteLabel.portsList:JkB.LCL);
            else
                var vURL="autocomplete.do?locationName="+escape(this.obj.value)+"&objId="+this.uId+"&locale="+JkB.LCL;
        }
        else
        {	
            var vURL="getLocation.do?origin=new&locationName="+escape(this.obj.value)+"&pointOnly="+(GV("searchType")==0)+"&objId="+this.uId;
            if(forcePlaceListOrigin)
                forcePlaceListOrigin=F;
            else if(forcePlaceListDestination)
                forcePlaceListDestination=F;	
        }
    }
    else
    {
        var vURL="ajaxVessel.do?origin=new&locationName="+escape(this.obj.value)+"&pointOnly="+(GV("searchType")==0)+"&objId="+this.uId;
    }
    PM(vURL,this.uiD,"P",F,this.reqOptions);
    return;
}
if(selTab==1)
{

	if(this.j_y.indexOf(this.j_u)!=0||typeof(osr)=="undefined"||(osr.total>100&&(U(osr.cities[L(osr.cities)-1][0]+"",0,L(this.j_y)).toLowerCase()<=this.j_y.toLowerCase())&&(!(U(osr.cities[L(osr.cities)-1][0],0,L(this.j_y)).toLowerCase()==U(osr.cities[0][0],0,L(j_y)).toLowerCase()&&U(osr.cities[0]+"",0,L(this.j_y)).toLowerCase()==this.j_y.toLowerCase()))))
    {
        this.j_u=this.j_y;this.j_C=T;this.j_B=[];this.osr=N;var vURL="getLocation.do?origin=new&locationName="+escape(this.obj.value)+"&pointOnly="+(GV("searchType")==0)+"&objId="+this.uId;PM(vURL,this.uiD,"P",F,this.reqOptions);
    }
	else
	{
		this.j_l();
	}
}
else
{
    alert("here2")
}
}
else
{
    this.j_n();
}


};
this.j_l=function(){var i;this.j_B=[];
if(this.osr == null || this.osr == 'undefined' || this.osr == ''){
}else{
	for(i in this.osr.cities){
		if(IO((this.osr.cities[i][0]).toLowerCase(),this.j_y.toLowerCase())==0){
			this.j_B.push(this.osr.cities[i]);
			if(this.j_B.length>9)
				break;
		}
	}
}
this.j_g(pID);
this.j_k(pID)};
this.j_k=function(){if(!this.exit||this.j_B.length==0){if(DA){var options="<DIV id='div_jbs_optionsContainer_"+pID+"' style='position:relative;left:0px; top:19px;background:orange'>"+"<IFRAME id='jorge' WIDTH=100% HEIGHT=100% FRAMEBORDER=0 SCROLLING=NO SRC='./jackbe/htm/blank.htm' style='z-index:1;position:absolute;left:0px;top:0px;'></IFRAME>"+"<div class='jbs_optionsContainer' id='i20' STYLE='position:relative;z-index:50'>"+"<table id='jbs_optionsContainer_"+pID+"'><tbody>";}else var options="<div id='div_jbs_optionsContainer_"+pID+"' class='jbs_optionsContainer' style='left: 0px; top: 19px;' id='i20'><table style='zindex:505' id='jbs_optionsContainer_"+pID+"'><tbody>";if(this.j_B.length==0){options+="<tr><td nowrap='nowrap' style='background:red;color:#ffffff;border-style:solid;border-color: red;border-width:1px' class='jbs_optionContainer'>No results found</td></tr>";}else{this.j_t=[];for(var i=0;i<this.j_B.length;i++){this.j_t.push(["1",this.j_B[i]]);options+="<tr'><td nowrap='nowrap' onclick=W['"+this.uId+"'].j_I("+i+",'"+this.id+"') onmouseover=W['"+this.uId+"'].j_s("+i+",'"+this.id+"') class='jbs_optionContainer' id='jbs_optionContainer"+i+"'>";options+="<a style='font-family:Verdana;color:#666666;font-size:11px;padding:0px; height:15px;text-decoration:none;'    href='#' id='jbs_optionLink"+i+"'  >"+this.j_B[i][0]+"</a>";options+="</td></tr>";}}options+="</tbody></table></div></div>";var j_h=GI("jbs_outerContainer_"+this.id);j_h.insertAdjacentHTML("beforeEnd",options);var j_A=GI("jbs_optionsContainer_"+this.id);var input=this.obj;this.j_r=0;this.j_o();}else{this.j_D();}};this.j_D=function(){if(this.j_B.length>0){this.obj.value=this.j_B[0][0];this.objId.value=this.j_B[0][1];}else if(L(this.obj.value)>0)this.j_k();};this.j_q=function(){if(this.j_r!=-1){this.j_J();if(this.j_r!==0){this.j_r--;}}else{this.j_r=this.j_t.length-1;}this.j_o();};this.j_J=function(){var j_z=GI("jbs_optionContainer"+this.j_r);if(j_z){j_z.className="jbs_optionContainer";}};this.j_o=function(){var j_z=GI("jbs_optionContainer"+this.j_r);if(j_z){j_z.className="jbs_selectedOptionContainer";}if(this.exit)return;this.obj.focus();};this.j_v=function(){this.j_g();if((this.osr.cities).length>10){this.j_B=this.osr.cities.slice(0,9);}else{this.j_B=this.osr.cities;}this.j_k();};this.j_F=function(){this.obj.value=this.j_w;};this.j_p=function(pID){if(this.j_r!=-1){this.j_J();if(this.j_r!==this.j_t.length-1){this.j_r++;}}else{this.j_r=0;}this.j_o();};this.j_s=function(index,pID){this.j_J();this.j_r=index;this.j_o();}};function j_a(a){j_a.b.push(a);};j_a.b=[];function j_c(a){IH(a,j_a.b.join(""));j_a.b=[];};

/**
 * checks if passed value is int
 * @param a - value to be evaluated
 */
function isInt(a){return!/\D/.test(a)};

/**
 * ?
 * @param a -
 * @param b - date
 */
function aPD(a,b){if(typeof(b)=="undefined")b="dd/mm/yyyy";var z={january:1,february:2,march:3,april:4,may:5,june:6,july:7,august:8,september:9,october:10,november:11,december:12,jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12};RV=function(str,i,minlength,maxlength,ra,rb){for(var x=maxlength;x>=minlength;x--){var e=str.substring(i,i+x);if(e.length<minlength)return false;if(isInt(e)){c+=e.length;e=parseInt(e,10);if(typeof(ra)!=="undefined"){if(e<ra||e>rb)return false}return e;}}return false;};var c=0,d=0,e="",f=0,g=1,h=1,i=00,j=0,k=0,l="",m=0,x,y,aa;while(b.length>0){re=new RegExp((b.charAt(d)).replace(/([\$,\(,\),\*,\+,\.,\[,\?,\\,\^,\{,\|,\*,\\])/g,"\\\$1")+"*");b=b.replace(re,"");e=RegExp.lastMatch;if(e=="yyyy"||e=="yyy"||e=="yy"||e=="y"){f=RV(a,c,e.length,4);if(f===F){return null;}if(f<100){if(f>50){f=1900+(f);}else{f=2000+(f-0);}}}else if(e=="MM"||e=="M"){g=RV(a,c,e.length,2,1,12);if(g===F){return null;}}else if(e=="MMM"||e=="NNN"){aa=(a.substr(c).match(/[a-z]*/i)+"").toLowerCase();g=z[aa];aa=aa.length;if(isNaN(g)||(e=="NNN"&&aa!==3))return null;c+=aa;}else if(e=="dd"||e=="d"){h=RV(a,c,e.length,2,1,31);if(h===F)return null;}else if(e=="hh"||e=="h"){i=RV(a,c,e.length,2,1,12);if(i===F)return null;}else if(e=="HH"||e=="H"){i=RV(a,c,e.length,2,0,23);if(i===F)return null;}else if(e=="mm"||e=="m"){j=RV(a,c,e.length,2,0,59);if(j===F)return null;}else if(e=="ss"||e=="s"){k=RV(a,c,e.length,2);if(k===F)return null;}else if(e=="S"||e=="SS"||e=="SSS"){m=RV(a,c,e.length,3,0,999);if(m===F)return null;}else if(e=="a"){l=a.substring(c,c+2).toUpperCase();if(l!=="AM"&&l!=="PM")return null;c+=2;}else{if(a.substring(c,c+e.length)!=e)return null;else{c+=e.length;}}}if(g==2){if(((f%4==0)&&(f%100!=0))||(f%400==0)){if(h>29){return null;}}else{if(h>28){return null;}}}if((g==4)||(g==6)||(g==9)||(g==11)){if(h>30){return null;}}if(i<12&&l=="PM"){i=i-0+12;}else if(i>11&&l=="AM"){i-=12;}return new Date(f,g-1,h,i,j,k,m);};
	
/**
 * ?
 * @param a -
 * @param b - date
 */	
function aDS(a,b){z={1:"Jan",2:"Feb",3:"Mar",4:"Apr",5:"May",6:"Jun",7:"Jul",8:"Aug",9:"Sep",10:"Oct",11:"Nov",12:"Dec"};var rv="",hours=a.getHours();if(typeof(b)=="undefined")b="dd/mm/yyyy";RV=function(str,b){return(("00".substr(0,(b.length-(str+"").length)))+str)};var c=0,d=0,e="",f=0,g=1,h=1,i=00,j=0,k=0,l="",m=0,x,y;while(b.length>0){re=new RegExp((b.charAt(d)).replace(/([\$,\(,\),\*,\+,\.,\[,\?,\\,\^,\{,\|,\*,\\])/g,"\\\$1")+"*");b=b.replace(re,"");e=RegExp.lastMatch;if(e=="yyyy"||e=="yyy"){rv+=RV(PI(a.getFullYear()),e);}else if(e=="yy"||e=="y"){rv+=RV(PI((a.getFullYear()+"").substr(2,2)),e);}else if(e=="MM"||e=="M"){rv+=RV((PI(a.getMonth())+1),e);}else if(e=="MMM"||e=="NNN"){rv+=z[a.getMonth()+1];}else if(e=="dd"||e=="d"){rv+=RV(a.getDate(),e);}else if(e=="hh"||e=="h"){rv+=RV((hours-((hours>12)?12:0)),e);}else if(e=="HH"||e=="H"){rv+=RV(hours,e);}else if(e=="mm"||e=="m"){rv+=RV(a.getMinutes(),e);}else if(e=="ss"||e=="s"){rv+=RV(a.getSeconds(),e);}else if(e=="S"||e=="SS"||e=="SSS"){rv+=RV(a.getMilliseconds(),e);}else if(e=="a"){rv+=(hours>11)?"pm":"am";}else{rv+=e;}}return rv;};var weekDays2=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];

/**
 * Returns first second of passed date.
 * @param a date.
 * @return a - first second of the passed date.
 */	
function truncDate(a){a.setHours(0);a.setMinutes(0);a.setSeconds(0);a.setMilliseconds(0);return a;};

/**
 * Returns last second of passed date.
 * @param a - date.
 * @return a - last second of the passed date.
 */
function lastMinuteDate(a){a.setHours(23);a.setMinutes(59);a.setSeconds(59);a.setMilliseconds(999);return a;};

/**
 * Slider class that adds functionality to slider objects.
 */
function SliderHelper(updateFunc){this.addSliderDateManager=function(props,vSliObj){var undefProp;try{if(!props.objName){undefProp="objName";throw "UndefinedPropertyException"};if(!props.startDate){undefProp="startDate";throw "UndefinedPropertyException"};if(!props.endDate){undefProp="endDate";throw "UndefinedPropertyException"};if(!props.LeftKnobLabel){undefProp="LeftKnobLabel";throw "UndefinedPropertyException"};if(!props.RightKnobLabel){undefProp="RightKnobLabel";throw "UndefinedPropertyException"};}catch(e){if(e=="UndefinedPropertyException")return A(errorHandle.UndefinedPropertyException+"\nProperty : "+undefProp);};var stDate=Date.parse(props.startDate),eDate=Date.parse(props.endDate),day=864e5,dateArray=[],dateStrArray=[];for(var i=stDate;i<eDate+day;i=i+day){dateArray.push(i)};function getDateFormat(milli){var aux=new Date(milli);return aDS(aux,preference_DateFormat)};props.LeftKnobLabel.innerHTML=getDateFormat(dateArray[0]);props.RightKnobLabel.innerHTML=getDateFormat(dateArray[dateArray.length-1]);props.objName.setMax(dateArray[dateArray.length-1]);props.objName.setMin(dateArray[0]);props.objName.reset();updateFunc();var listener={sliderKnobMoved:function(sliderEvent){var values=sliderEvent.getActualValueArray();var knobType=sliderEvent.getKnobType();if(knobType==Slider.START){props.LeftKnobLabel.innerHTML=getDateFormat(values[0]);}else{props.RightKnobLabel.innerHTML=getDateFormat(values[1]);}},sliderKnobChanged:function(sliderEvent){var values=sliderEvent.getActualValueArray();var knobType=sliderEvent.getKnobType();if(knobType==Slider.START){props.LeftKnobLabel.innerHTML=getDateFormat(values[0]);vSliObj.startTruncDate=truncDate(new Date(values[0]));}else{props.RightKnobLabel.innerHTML=getDateFormat(values[1]);vSliObj.endTruncDate=lastMinuteDate(new Date(values[1]));}updateFunc();}};props.objName.addMoveListener(listener);props.objName.addChangeListener(listener);};this.addSliderNumberManager=function(sliderProps){var sl=sliderProps,undefProp;try{if(!sl.objName){undefProp="objName";throw "UndefinedPropertyException"};if(!sl.LeftKnobLabel){undefProp="LeftKnobLabel";throw "UndefinedPropertyException"};if(!sl.RightKnobLabel){undefProp="RightKnobLabel";throw "UndefinedPropertyException"};if(!sl.decimals&&sl.decimals!=0){undefProp="decimals";throw "UndefinedPropertyException"};}catch(e){if(e=="UndefinedPropertyException")return A(errorHandle.UndefinedPropertyException+"\nProperty : "+undefProp);}var props={sliderKnobMoved:function(sliderEvent){var values=sliderEvent.getActualValueArray();var knobType=sliderEvent.getKnobType();if(knobType==Slider.START){sl.LeftKnobLabel.innerHTML=PI(values[0])+" day"+(PI(values[0])==1?"":"s");}else{sl.RightKnobLabel.innerHTML=PI(values[1])+" day"+(PI(values[1])==1?"":"s");}},sliderKnobChanged:function(sliderEvent){var values=sliderEvent.getActualValueArray();var knobType=sliderEvent.getKnobType();if(knobType==Slider.START){sl.LeftKnobLabel.innerHTML=PI(values[0])+" day"+(PI(values[0])==1?"":"s");}else{sl.RightKnobLabel.innerHTML=PI(values[1])+" day"+(PI(values[1])==1?"":"s");}updateFunc();}};sl.objName.addChangeListener(props);sl.objName.addMoveListener(props);};};var errorHandle={InvalidObjectException:function(methodName){A("Error: Not an object! \nThe "+methodName+" method must receive a valid object!")},UndefinedPropertyException:"Error: One or more required properties have not been defined!",InvalidTypeException:"Error: InvalidTypeException!"};

/**
 * Reads cookie data
 * @param name - cookie name
 */
function readCookie (name) 
{
    var nameEQ = name + "=";
    var ca = document.cookie.split (';');
    
    for(var i = 0; i < ca.length; ++i) 
    {
        var c = ca [i];

        while (c.charAt (0) == ' ') 
            c = c.substring (1, c.length);
    
        if (c.indexOf (nameEQ) == 0) 
            return c.substring (nameEQ.length, c.length);
    }

    return null;
}

/**
 * Gets schedulesport value from cookie and assigns it to showSurroundingPorts element.
 */
function gsp()
{
var value=readCookie("SCHEDULESPORT");
AV("showSurroundingPorts",(value==null)?"Y":value);

}

/**
 * Removes _filler from document if it exists
 * @param a - prefix.
 */
function loadedIF(a)
{
    
    if(GI(a+"_filler"))
        RMV(a+"_filler")
}

/**
 * Opens logut popup
 */
function confirmLogoutMsg(){

 var showLogout= readCookie("showLogoutMsg");
 
 if(eval(showLogout)){ //Eval because showLogout its in string
  //do logout
  document.location="logout.do";
 }
 else{
  document.getElementById("dvConfirmLogOut").style.display="block";
  document.getElementById("dvConfirmLogOutGlass").style.display="block";
 }
}

/**
 * Called by the Cancel Logout button
 */
function cancelLogout(){
    document.getElementById("dvConfirmLogOut").style.display="none";
    document.getElementById("dvConfirmLogOutGlass").style.display="none"; 
    saveLogoutValue()
}


/**
 * Gets value of do not display this message again checkbox
 * @return  - value of checkbox
 */
function getLogoutValue(){
    return document.getElementById("chkConfirmLogout").checked;
}

/**
 * Saves logut checkbox value in popup
 */
function saveLogoutValue(){
    var showLogout = getLogoutValue(); //true or false 
    //alert("caja seleccionada?: "+showLogout)
    setCookie("showLogoutMsg",showLogout,1);
    //alert(readCookie("showLogoutMsg"));
}

/**
 * Sets cookie data
 */
function setCookie(cookieName,cookieValue,nDays) {
     var today = new Date();
      var expire = new Date(); 
      if (nDays==null || nDays==0) nDays=1;
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = cookieName+"="+escape(cookieValue)
                 + ";expires="+expire.toGMTString(); 
}

function addDays(myDate,days) {
    return new Date(myDate.getTime() + days*24*60*60*1000);
}

/**
 * Called from the Logout link
 */
function confirmLogoutMsg(){
	var showLogout= readCookie("showLogoutMsg");
	
	if(eval(showLogout)){ //Eval because showLogout its in string
		//do logout
		document.location="logout.do";
	}
	else{
        document.getElementById("ifConfirmLogOut").src="./jackbe/htm/logOut.jsp"
		document.getElementById("dvConfirmLogOut").style.display="block";
		
		var theWindow = document.getElementById("dvConfirmLogOut");
		var theWidth= document.body.offsetWidth;
		
		theWidth=theWidth/3;
		
		theWindow.style.left=theWidth;
		document.getElementById("dvConfirmLogOutGlass").style.display="block";
	}
}

/**changes the vessel stucture to look like cities 
**/
/**
 * Submits statistics through Pacemaker
 */
function submitStatistic(statisticType,statisticVal){if(statisticVal==""){statisticVal="-1";}var newurl="schedulestatistic.do?statisticType="+statisticType+"&statisticValue="+statisticVal;
var reqOptions = {};
  reqOptions.asyn = true;
  reqOptions.onreadystatechange = function(req){
    if(req.readyState == 4){
      null;
    }
  }

    PM(newurl,"info","G",T,reqOptions);
}

/**
 * Opens porlist popup
 */
function openPortList(a){
    var winl=(screen.width-600)/2;
    var wint=(screen.height-700)/2;
    if(!WL)
    	newwin=window.open("portlist_en.do?locale="+JkB.LCL+"&"+(window.location+"").substring((window.location+"").indexOf("?")+1),null,'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=700,left = '+winl+',top = '+wint)
    else
    	newwin=window.open("portlist_en.do?locale="+((whiteLabel.portsList.length>0&&whiteLabel.portsList!="null")?whiteLabel.portsList:JkB.LCL)+"&"+(window.location+"").substring((window.location+"").indexOf("?")+1),null,'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=700,left = '+winl+',top = '+wint)
    	
    	
    	
    newwin.focus();
}

/**
 * Builds header
 */
function buildHeader()
{
    header(rootURL+"userlogin.do",rootURL+"userregister.do",WL?BVL(whiteLabel.logo,"OceanSchedules-LogoJB_2_"+vLocale):"OceanSchedules-LogoJB_2_"+vLocale,"./images/doc/OceanSchedules_Help_6_0_46_"+vLocale+".pdf","<a href='affiliateProgram.do' style='font-size: 9px; color: #CCCCCC; line-height:12px' onmouseover='this.style.textDecoration=vUnderline' onmouseout='this.style.textDecoration=\"none\"'>"+rb1.your+" <span style='font-size: 9px;color:#F9A74E'>"+rb1.logo+"</span><br>"+rb1.here+" - "+rb1.find+"<br>"+rb1.outHow+"!</a>");
}

/**
 * Reads whiteLabel object and builds the appropriate UI
 */
function whiteLabelHP()
{
    var vTop=183;
    if(WL)
    {

        //GI("searchForm").action="schedule-search.do?affiliateCode="+whiteLabel.affiliateCode
        GI("searchForm").action="schedule-search.do?affiliateCode="+whiteLabel.affiliateCode+"&"+(window.location+"").substring((window.location+"").indexOf("?")+1)
        if(whiteLabel.header=="no")
        {
            BNI("dvForHeader","N");
            vTop-=58;
        }
        else
        {
            GI("i19").style.top="0px";
            GI("i19").href+="?"+(window.location+"").substring((window.location+"").indexOf("?")+1)
            BNI("i32i33anRegisteranLogini2_cp_cplbWel","N")
            //BNI("i32","N")
        }
        if(whiteLabel.leaderboard =="no")
        {
            BNI("b_728x90","N");
            vTop-=100
        }
        else
        {
            //GI("b_728x90").style.top="75px"
            if(whiteLabel.header=="no")
                GI("b_728x90").style.top="5px";
        }
        if(whiteLabel.rectangleAd=="no")
        {
            BNI("b_180x150","N");
        }
        if(whiteLabel.pointToPoint=="no")
        {
            GI("c_searchType").style.display="none";
            //GI("searchType").parentNode.parentNode.childNodes[3].style.display="none";
        }
        if(whiteLabel.bottomAd=="no")
        {
            BNI("botad","N");
        }
            BNI("aPreferences","N");
            BNI("i74","N");
            if(whiteLabel.feedbackLink=="no")
        {
            BNI("aPreferences_cp","N");
        }
        else
        {
            BNI("aPreferencesi74","N");
            GI("aPreferences_cp").style.left="0px"
            GI("aPreferences_cp").style.color="#497db7";
            GI("aPreferences_cp").href="mailto:"+whiteLabel.feedbackLink
        }
        //BNI("botaddvPrefaPreferencesi74i102_cpi102","N");
        GI('dvCont').style.top=(vTop+"px");
        buildCustomLink()
        if(whiteLabel.VslSchEnabled=="no")
        {
            RMV(GI("tab2").nextSibling)
            RMV("tab2")        
        }
    }
    BNI("main","I");
    //quitar que las siguentes 3 lineas no esten comentadas
    //GI("i88_cp_cp").style.color='#497db7'
    //GI("i88_cp").style.color='#497db7'
    //GI('origin').focus()
}

/**
 * Initializes values
 */
function initValues()
{
	forcePlaceListDestination=forcePlaceListOrigin=F;
	var vAC=F;
    if(vDate!="null")
    {
        vAC=T;
        AV("date",vDate);
    };
    if(vWeeksOut!="null")
    {
        vAC=T;
        AV("weeksOut",vWeeksOut);
    }	
    if(vSearchType!="null")
    {
        vAC=T;
        AV("searchType",vSearchType);
    }	
    if(vSearchSort!="null")
    {
        vAC=T;
    	AV("searchSort",vSearchSort);
    }
    if(vOrigin!="null")
    {
    		forcePlaceListOrigin=vOrigin.length==5?T:F;
        vAC=T;
        AV("origin",vOrigin);GI("origin").focus();jbs1.j_m(1);
    };         
    if(vDestination!="null")
    {
    	  forcePlaceListDestination=vDestination.length==5?T:F;
        vAC=T;
        AV("destination",vDestination);GI("destination").focus();jbs2.j_m(1);
    };
    if(vAC)
        GI("searchSort").focus();    
}

/**
 * Sets passed value to origin element then sets the focus.
 * @param a - value to assign.
 */
function origin(a)
{
    vAC=T;
    AV("origin",a);GI("origin").focus();jbs1.j_m(1);
}

/**
 * Sets passed value to destination element then sets the focus.
 * @param a - Value to assign.
 */
function destination(a)
{
    vAC=T;
    AV("destination",a);GI("destination").focus();jbs2.j_m(1);
}

/**
 * 
 */
function WLprop(wlprop)
{
    return !(typeof(whiteLabel[wlprop])=="undefined"||(whiteLabel[wlprop]+"").toUpperCase()=="N0")
}﻿
function transformVessel(a)
{
	
	if(a.constructor==Array){
        var vCities = []
        var vCounter =0;
		 
		for(var xx=0;xx<a.length;xx++){
			var currVesselValue ="";
			currVesselValue = "" + a[xx].VESSEL_NAME;
			var strVesselFilter = vesselFilter.split("~*~");	
			var vesselFound = 0;

			for(i=0;i<=strVesselFilter.length;i++){
				var filterVesselValue = "";
				filterVesselValue = "" + strVesselFilter[i];
				if(filterVesselValue == currVesselValue){
					vesselFound = 1;
				}
			}
			if(vesselFound == 0){
				if(a[xx].LLOYDS_NUMBER){
					vCounter++;
					vCities.push([a[xx].VESSEL_NAME,a[xx].LLOYDS_NUMBER,a[xx].VESSEL_NAME])
				}else{
					vCounter++;
					vCities.push([a[xx].VESSEL_NAME,0,a[xx].VESSEL_NAME])
				}
			}
		}
 
		a = {cities:vCities,total:vCounter,objId:"jbsorigin"};
    }
    else
    {
		var vesselFound = 0;
		var strVesselFilter = vesselFilter.split("~*~");
		var strVessel = ""+a.VESSEL_NAME;
		for(i=0;i<=strVesselFilter.length;i++){
			var filterVessel = ""+ strVesselFilter[i];
			if(filterVessel == strVessel){
			 vesselFound = 1;
			}
		}
		if(vesselFound == 0){
			if(a.LLOYDS_NUMBER) {
				a = {cities:[[a.VESSEL_NAME,a.LLOYDS_NUMBER,a.VESSEL_NAME]],total:1,objId:"jbsorigin"};
			}else{ 
				a = {cities:[[a.VESSEL_NAME,0,a.VESSEL_NAME]],total:1,objId:"jbsorigin"};
			}
		}else{
			a = {cities:[[0,0,0]],total:0,objId:"jbsorigin"};
		}
    }
	return a
}
  
﻿JkB.LCL='en'
rb1={
callPortTerminalName:"Call Port Terminal Name",
nfo:"Info",
callPorts:"Call Ports",
callPrt:"Call Port",
acceptanceLocations:"Acceptance Locations",
locationType:"Location Type",
searchResultsFor:"Search results for:",
searchByVessel:"SEARCH BY VESSEL",
searchByLocation:"SEARCH BY LOCATION",
downSchedules:"Download Schedules",
prefError:"Please select at least one service type.",
withTranshiptment:"With Transshipment",
welcome:"Welcome",
tprts:"Transshipment Ports",
surrPrts:"Surrounding Ports",    
guest:"Guest",
mainTitle:"SEARCH OCEAN SCHEDULES",
aHome:"Home",
aHelp:"Help",
aNews:"News",
advertise:"Advertise With Us",
aboutUs:"About Us",
login:"Login",
logout:"Logout",
register:"Register",
myAccount:"My Account",
port2point:[["Port to Port",
"0"],
["Point to Point",
"1"]],
byDepartureArrive:[["By Departure",
"2"],
["By Arrival",
"5"]],
origin:"Origin",
destination:"Destination",
aDate:"Date",
weeksOut:"Weeks Out",
getSchedules:"GET SCHEDULES",
privacy:"Privacy and Security Policy",
contact:"Contact Us",
legal:"Legal Terms & Conditions",
copyright:"Copyright",
searchResultsFor:"Search results for",
downloadSchedules:"Download Schedules",
newSearch:"New Search",
schedulesManager:"Schedules Manager",
schedulesManagervessel:"Schedules Manager",
departure:"Departure",
displayAll:"Clear filters to display all results",
weekDays:"Day of the Week",
mon:"M",
tue:"T",
wed:"W",
thu:"T",
fri:"F",
sat:"S",
aSun:"S",
TRANSITTIME:"Transit Time",
days:"Days",
arrival:"Arrival",
ports:"Ports",
carriers:"Carriers",
aSelectAll:"select all",
selectAll:"select all",
deselectAll:"deselect all",
aClear:"clear",
infoContactBook:"Info|Cntct|Book",
noResultsFound:"No Results Found",
from:"from",
to:"to",
bDate:"Start Date",
shown:"shown",
schedules:"schedules",
schedulesShown:"schedules shown",
carrier:"Carrier",
depart:"Depart",
day:"Day",
transitTime:"Transit Time",
arrive:"Arrive",
preferences:"Preferences",
feedback:"Feedback",
info:"Voyage Information",
voyage:"Voyage",
lloydsNumber:"Lloyd's Number",
portExport:"Port of Export",
portDischarge:"Port of Discharge",
closeWindow:"close window",
carrierName:"Carrier Name",
departureDay:"Departure Day",
departureDate:"Departure Date",
departurePort:"Departure Port",
departurePortUNCODE:"Departure Port UNCODE",
transitTime:"Transit Time",
arrivalDay:"Arrival Day",
arrivalDate:"Arrival Date",
arrivalPort:"Arrival Port",
arrivalPortUNCODE:"Arrival Port UNCODE",
vesselName:"Vessel Name",
voyageNumber:"Voyage Number",
lloydsNumber:"Lloyd's Number",
showPorts:"show ports",
to:"to",
addionalVoyageAlt:"Voyage Information",
requestContact:'Request contact from a carrier',
onlyEnabled:"(Disabled) This button is only enabled with carrier approval, which this carrier has not provided.",
createBooking:"Create a booking for this voyage",
Info_Cntct_Book:'Info|Cntct|Book',
January:'January',
February:'February',
March:'March',
April:'April',
May:'May',
June:'June',
July:'July',
August:'August',
September:'September',
October:'October',
November:'November',
December:'December',
Monday:'Mon',
Tuesday:'Tue',
Wednesday:'Wed',
Thursday:'Thu',
Friday:'Fri',
Saturday:'Sat',
Sunday:'Sun',
your:'Your',
here:'here', 
logo:'Logo',
find:'Find',
outHow:'out how!',
contactCarrier:'CONTACT NOW',
searchBy:'SEARCH BY',
voyageditionalInfo:'Voyage and Additional Information',
vessel:'VESSEL (BETA)',
location:'LOCATION',
required:"* = Required Field",
surrounding:"Surrounding",
transshipment:"Transshipment",
direct:"Direct",
With:"with",
serviceType:"Service Type",
notSpecified:"Not Specified",
expand:"expand",
clickToExpandThis:"Click to expand this",
collapse:"collapse",
clickToCollapseThis:"click to collapse this",
boldText:"Bold Text",
realTimeUpdate:"Real-Time Update",
dates:"Dates",
of:"of",
clearFilter:"Clear filters to display all results",
sortAscending:"Sort Ascending",
sortDescending:"Sort Descending",
selectDate:"Select Date",
BookingCutOff:"Booking Cut-Off:",
VesselCutOff:"Vessel Cut-Off:",
VesselCutOffDry:"Vessel Cut-Off, Dry:",
VesselCutOffReefer:"Vessel Cut-Off, Reefer:",
VesselCutOffHazmat:"Vessel Cut-Off, HAZMAT:",
VesselCutOffLCL:"Vessel Cut-Off, LCL:",
DocumentationCutOff:"Documentation Cut-Off:",
EarliestContainerDropOff:"Earliest Container Drop-Off: ",
StringName:"String Name:",
VesselFlag:"Vessel Flag:",
VesselBuiltYear:"Vessel Built Year:",
vesselNominalCapacity:"Vessel Nominal Capacity (TEUs):",
additionalInfo:"Additional Information",
portStayRef:"Port Stay Reference",
address:"Address",
phone:"Phone",
fax:"Fax",
hrsOfOperation:"Hours of Operation",
website:"Website",
state:"State",
req:"Required Field",
timeUpdate:"realtime update",
rightsReserved:"All Rights Reserved",
yourLogoHere:"Your Logo here - Find out how!!",
startDate:"Start Date",
selectAllCarriers:"Select All Carriers",
deselectAllCarriers:"Deselect All carriers",
savePrefs:"Save Preferences",
cancel:"Cancel",
english:"English",
spanish:"Spanish",
chinese:"Chinese",
portugues:"Portuguese",
dateFormat:"Date Format",
lang:"Language",
showSurrPort:"Show Surrounding Ports With Search Results",
yes:"Yes",
no:"No",
setPrefs:"Setting preferences allows you to customize the user interface (for display and entry format for date) and to configure the results screen to auto-filter based on carrier, departure day of the week and arrival day of the week. Setting carriers, days of the week and surrounding ports can make your queries more useful to you and save you time.",
carriersShown:"carriers shown",
nextPageCont:"continued on next page...",
prevPageCont:"...continued from previous page",
terminalInfo:"Terminal Information",
portInfor:"Port Information",
address:"Address",
phone:"Phone",
fax:"Fax",
email:"Email",
contactCarrierName:"Contact <Carrier Name>",
likeToBeContacted:"I would like to be contacted by <Carrier Name>",
name:"Name",
jobTitle:"Job Title",
companyName:"Company Name",
phoneNumber:"Phone Number",
emailAddress:"Email Address",
country:"Country",
selectACountry:"Select a Country",
notes:"Notes/Comments",
city:"City",
usersCity:"User’s city (20 chars AN)",
numContainers5N:"# of containers/month on this trade (5 N)",
numContainers6N:"# of containers/month on all trades (6N)",
commodity:"Commodity (35 char AN)",
alredyCustomer:"I am already a customer of this carrier on this trade",
sumbit:"Submit",
hittingSubmit:'Hitting "Submit" on this page will send your contact information below to <Carrier Name> and ask them to make contact with you about this specific voyage. The information that is displayed defaults from your site registration information. If nothing is displayed, you can register at the top right corner of every screen in the application. Please enter or confirm your details below.',
indicatesReq:"= required fields",
dragToAdjustTransit:"Drag to adjust transit time",
disabled:"(Disabled) This button is only enabled with carrier approval, which this carrier has not provided.",
startNewSearch:"Start New Search",
dragToAdjustDeparture:"Drag to adjust departure date",
dragToAdjustArrival:"Drag to adjust arrival date",
newsUrl:"news.do",
dragDepDate:"Drag to adjust departure date",
dragTransTime:"Drag to adjust transit time",
dragArrDate:"Drag to adjust arrival date"
};
 
