﻿//FillLocationByService// JScript File
function mmLoadMenus(path) {
  if (window.mm_menu_0307040745_0) return;
                                                    window.mm_menu_0307040745_0 = new Menu("root",180,17,"Verdana, Arial, Helvetica, sans-serif",11,"#000000","#000000","#E9E9E9","#7AADCC","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0307040745_0.addMenuItem("Introduction","location='"+path+"introduction.html'");                                                    
  mm_menu_0307040745_0.addMenuItem("History&nbsp;","location='"+path+"history.html'");
  mm_menu_0307040745_0.addMenuItem("Corporate&nbsp;Profile&nbsp;","location='"+path+"corporate-profile.html'");
  mm_menu_0307040745_0.addMenuItem("Mission & Vision","location='"+path+"mission-vision.html'");
      mm_menu_0307040745_0.addMenuItem("Contact&nbsp;Directory","location='"+path+"AboutUs/ContactDirectory.aspx'");
   mm_menu_0307040745_0.fontWeight="bold";
   mm_menu_0307040745_0.hideOnMouseOut=true;
   mm_menu_0307040745_0.bgColor='#FFFFFF';
   mm_menu_0307040745_0.menuBorder=0;
   mm_menu_0307040745_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0307040745_0.menuBorderBgColor='#777777';
  window.mm_menu_0307043631_0 = new Menu("root",131,17,"Verdana, Arial, Helvetica, sans-serif",11,"#000000","#000000","#E9E9E9","#7AADCC","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0307043631_0.addMenuItem("Vessel&nbsp;Schedules&nbsp;","location='"+path+"Site/VesselSchedule.aspx'");
  
   mm_menu_0307043631_0.fontWeight="bold";
   mm_menu_0307043631_0.hideOnMouseOut=true;
   mm_menu_0307043631_0.bgColor='#FFFFFF';
   mm_menu_0307043631_0.menuBorder=0;
   mm_menu_0307043631_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0307043631_0.menuBorderBgColor='#777777';
window.mm_menu_0308023703_0 = new Menu("root",124,17,"Verdana, Arial, Helvetica, sans-serif",11,"#000000","#000000","#E9E9E9","#7AADCC","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
   mm_menu_0308023703_0.addMenuItem("Shipping","location='"+path+"shipping.html'");
   mm_menu_0308023703_0.addMenuItem("Logistics","location='"+path+"logistics.html'");
   mm_menu_0308023703_0.fontWeight="bold";
   mm_menu_0308023703_0.hideOnMouseOut=true;
   mm_menu_0308023703_0.bgColor='#FFFFFF';
   mm_menu_0308023703_0.menuBorder=0;
   mm_menu_0308023703_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0308023703_0.menuBorderBgColor='#777777';
  window.mm_menu_0308025139_0 = new Menu("root",136,17,"Verdana, Arial, Helvetica, sans-serif",11,"#000000","#000000","#E9E9E9","#7AADCC","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0308025139_0.addMenuItem("Apply&nbsp;Online&nbsp;","location='"+path+"Site/OnlineApplyNow.aspx'");
  mm_menu_0308025139_0.addMenuItem("Available&nbsp;Positions","location='"+path+"Site/Careers.aspx'");
   mm_menu_0308025139_0.fontWeight="bold";
   mm_menu_0308025139_0.hideOnMouseOut=true;
   mm_menu_0308025139_0.bgColor='#FFFFFF';
   mm_menu_0308025139_0.menuBorder=0;
   mm_menu_0308025139_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0308025139_0.menuBorderBgColor='#777777';
window.mm_menu_0310225110_0 = new Menu("root",116,17,"Verdana, Arial, Helvetica, sans-serif",11,"#000000","#000000","#E9E9E9","#7AADCC","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
  mm_menu_0310225110_0.addMenuItem("News&nbsp;&&nbsp;Events","location='"+path+"Site/News.aspx?Cat=NE'");
  mm_menu_0310225110_0.addMenuItem("Hot&nbsp;News","location='"+path+"Site/News.aspx?Cat=HN'");
  mm_menu_0310225110_0.addMenuItem("Hot&nbsp;Port&nbsp;News","location='"+path+"Site/News.aspx?Cat=HPN'");
  mm_menu_0310225110_0.addMenuItem("Press&nbsp;Releases&nbsp;","location='"+path+"Site/News.aspx?Cat=PR'");
   mm_menu_0310225110_0.fontWeight="bold";
   mm_menu_0310225110_0.hideOnMouseOut=true;
   mm_menu_0310225110_0.bgColor='#FFFFFF';
   mm_menu_0310225110_0.menuBorder=0;
   mm_menu_0310225110_0.menuLiteBgColor='#FFFFFF';
   mm_menu_0310225110_0.menuBorderBgColor='#777777';

mm_menu_0310225110_0.writeMenus();
} // mmLoadMenus()




function NotNull()
{
if (document.getElementById("cmbVoyage").value.length>0)
return true;
else
{
alert("Select any Voyage First");
return false;
}
}
function verify_Archives()
{
var FromDate=document.getElementById("txtFromDate");
var ToDate=document.getElementById("txtToDate");
if ((FromDate.value=="---------Select Date---------")||(ToDate.value=="---------Select Date---------"))
    {
    alert("Error: Please select Date ");
    FromDate.focus()
    return false;
    }
    else
    {
        if(CheckStartEndDate(FromDate,ToDate))
               return true;
        else
            return false;
    }
}
function FillLocationByService(Path)
{

  ShowPage(Path+'verification.aspx?SID='+document.getElementById("cmbService_oc").value);
 
}
function ShowConnectVessel(id)
{
    document.getElementById("cellConnectVoyage").innerHTML="CONNECTING SCHEDULE"
    ShowPage('verification.aspx?ConVoyID='+id);
}
function FilltextField(cmbfield,txtfield)
{
document.getElementById(txtfield).value=document.getElementById(cmbfield).value;
document.getElementById(txtfield+"Name").value=document.getElementById(cmbfield).options[document.getElementById(cmbfield).selectedIndex].text;

}
function GoForSchedule()
{


FilltextField('cmbOrigin','txtOrigin'); 
FilltextField('cmbDestination','txtDestination'); 
 if (document.getElementById("txtOrigin").value!=document.getElementById("txtDestination").value)
   return verify_form('form',1);
   else
   {
   alert("Error: Origin and Destination are not same");
   return false;
   }
}
function Verify_ScheduleID()
{
 var number=/^[0-9]*$/;
 var objSchedule=document.getElementById("txtSchedule");
 if (objSchedule.value.length>0)
   {
	     if(objSchedule.value.search(number)==-1)
	     {
	     alert("Please Fill with Numeric Data");
	     objSchedule.focus();
	         return false;
	     }
	     window.open('ScheduleDetail.aspx?ID='+objSchedule.value,'','scrollbars=Yes,titlebar=No,width=800,height=500')
	     return false;  
    }
    else
    {
        alert("Please Fill with Schedule ID");
	     objSchedule.focus();
	         return false;
	     
    }
    
    
}
////////////////////////////////////Search/////////////////////////////////


// JScript File
function setField(Obj,Val)
{	

	if(Obj.value==Val)
	{
		Obj.value="";
	}	
}
function SetEmpty(ctlid,ctlvalue)
{
if (ctlid.value==ctlvalue)
    {
        ctlid.value="";
      
    }
}
function ResetField(Obj,Val)
{

	if(Obj.value.length==0)
	{
		
		Obj.value=Val;
	}
}
function QuickSearch(Flag)
{
//alert(document.getElementById("search").value);
    if(document.getElementById("search").value=='Web Search' || document.getElementById("search").value=='')
    {
        	alert("Enter the keywords you want to search");
        	event.returnValue=false;
    }
    else
    {
        event.returnValue=false;
        if(Flag==0)
        document.location.href="../Site/Search.aspx?search="+document.getElementById("search").value+"&nocache="+Math.random();         
    else
        document.location.href="Site/Search.aspx?search="+document.getElementById("search").value+"&nocache="+Math.random();         
    
        //document.forms[0].action="../Site/Search.aspx?search="+document.getElementById("search").value+"&nocache="+Math.random();         
    
    }

}
 function ShowWeather()
        {
        var objCity=document.getElementById("txtCity");
        if (objCity.value.length>0)
        ShowResponse('Site/verification.aspx?id='+objCity.value,0);
        else
        {
         alert("Error: Please enter a city");
          
         }
         event.returnValue=false;
        }
        //for set focus on submit button
//R used for remove spaces
	function SetFunctionToCall(remove,Function,e){
	
	var key,brow,prev;

if (window.event)
    {
        key = window.event.keyCode;
        brow=0;
    }
else if (e)
    {
   key = e.which;
    brow=1;
	}
	
	if(key ==13)
{  
    if (window.event)
    CallParametersFunction(Function);
    else
     {
        if(eventraise==false)
        {
        eventraise=true;
        CallParametersFunction(Function);
        }
        else
        eventraise=false;
      }
 }
        //eval(Function);
   else
    if(remove=='R')
    {
 //   alert('sdsd');

       if(key == 32)
         event.returnValue=false;
       else
         event.returnValue=true;
    }
}
function CallParametersFunction(Function)
{
    var startindex=Function.indexOf("(");
    var endindex=Function.indexOf(")");
     if (startindex+1==endindex)
        eval(Function);
      else
       eval(Function.substring(0,startindex+1)+"'"+Function.substring(startindex+1,endindex)+"')");
}