function highlight()
{ 
	var sPath = window.location.pathname;
	var sPage = sPath.substring(sPath.lastIndexOf('/') + 1);
	var strTest = sPage;
	var collect;
	if(strTest == 'overview.shtml' || strTest == 'managementteam.shtml')
	{
	    collect = document.getElementById('profile');	
	    if(collect!=null)
		collect.className ="selected";
	}
	/*else if(strTest == 'whoweare.shtml' || strTest == 'bauer.shtml' || strTest == 'sunderland.shtml' || strTest == 'itn.shtml' || strTest == 'newsquest.shtml' || strTest == 'johnstonpress.shtml')
	{
	    collect = document.getElementById('who');	
	    if(collect!=null)
		collect.className ="about-btn selected";
	}*/
	
}
/******************header navigation mouseover mouseout******************/
function mover(id)
{
 
  document.getElementById("list1").style.height="22px";
  document.getElementById("list1").style.backgroundImage="url(/images/red-x-repeat.gif)";
  document.getElementById("list1").style.backgroundRepeat="repeat-x";
  document.getElementById("list1").style.backgroundPosition="left top";
}
function mout(id)
{
 document.getElementById("list1").style.backgroundImage="url(/images/grey-x-repeat.gif)";
 document.getElementById("list1").style.backgroundRepeat="no-repeat";
 document.getElementById("list1").style.backgroundPosition="left top";
}
function mover1(id)
{
 
  document.getElementById("list1").style.height="22px";
  document.getElementById("list1").style.backgroundImage="url(/images/red-x-repeat.gif)";
  document.getElementById("list1").style.backgroundRepeat="repeat-x";
  document.getElementById("list1").style.backgroundPosition="left top";
}
function mout1(id)
{
 document.getElementById("list1").style.backgroundImage="url(/images/grey-x-repeat.gif)";
 document.getElementById("list1").style.backgroundRepeat="no-repeat";
 document.getElementById("list1").style.backgroundPosition="left top";
}
function mover2(id)
{
  document.getElementById("list2").style.height="22px";
  document.getElementById("list2").style.backgroundImage="url(/images/red-x-repeat.gif)";
  document.getElementById("list2").style.backgroundRepeat="repeat-x";
  document.getElementById("list2").style.backgroundPosition="left top";
}
function mout2(id)
{
 document.getElementById("list2").style.backgroundImage="url(/images/grey-x-repeat.gif)";
 document.getElementById("list2").style.backgroundRepeat="no-repeat";
 document.getElementById("list2").style.backgroundPosition="left top";
}
function mover3(id)
{
  document.getElementById("list3").style.height="22px";
  document.getElementById("list3").style.backgroundImage="url(/images/red-x-repeat.gif)";
  document.getElementById("list3").style.backgroundRepeat="repeat-x";
  document.getElementById("list3").style.backgroundPosition="left top";
}
function mout3(id)
{
 document.getElementById("list3").style.backgroundImage="url(/images/grey-x-repeat.gif)";
 document.getElementById("list3").style.backgroundRepeat="no-repeat";
 document.getElementById("list3").style.backgroundPosition="left top";
}
function mover4(id)
{
  document.getElementById("list4").style.height="22px";
  document.getElementById("list4").style.backgroundImage="url(/images/red-x-repeat.gif)";
  document.getElementById("list4").style.backgroundRepeat="repeat-x";
  document.getElementById("list4").style.backgroundPosition="left top";
}
function mout4(id)
{
 document.getElementById("list4").style.backgroundImage="url(/images/grey-x-repeat.gif)";
 document.getElementById("list4").style.backgroundRepeat="no-repeat";
 document.getElementById("list4").style.backgroundPosition="left top";
}
function mover5(id)
{
  document.getElementById("list5").style.height="22px";
  document.getElementById("list5").style.backgroundImage="url(/images/red-x-repeat.gif)";
  document.getElementById("list5").style.backgroundRepeat="repeat-x";
  document.getElementById("list5").style.backgroundPosition="left top";
 }
function mout5(id)
{
 document.getElementById("list5").style.backgroundImage="url(/images/grey-x-repeat.gif)";
 document.getElementById("list5").style.backgroundRepeat="no-repeat";
 document.getElementById("list5").style.backgroundPosition="left top";
}
function mover6(id)
{
  document.getElementById("list6").style.height="22px";
  document.getElementById("list6").style.backgroundImage="url(/images/red-x-repeat.gif)";
  document.getElementById("list6").style.backgroundRepeat="repeat-x";
  document.getElementById("list6").style.backgroundPosition="left top";
}
function mout6(id)
{
 document.getElementById("list6").style.backgroundImage="url(/images/grey-x-repeat.gif)";
 document.getElementById("list6").style.backgroundRepeat="no-repeat";
 document.getElementById("list6").style.backgroundPosition="left top";
}
function mover7(id)
{
  document.getElementById("list7").style.height="22px";
  document.getElementById("list7").style.backgroundImage="url(/images/red-x-repeat.gif)";
  document.getElementById("list7").style.backgroundRepeat="repeat-x";
  document.getElementById("list7").style.backgroundPosition="left top";
}
function mout7(id)
{
 document.getElementById("list7").style.backgroundImage="url(/images/grey-x-repeat.gif)";
 document.getElementById("list7").style.backgroundRepeat="no-repeat";
 document.getElementById("list7").style.backgroundPosition="left top";
}
function mover8(id)
{
  document.getElementById("list8").style.height="22px";
  document.getElementById("list8").style.backgroundImage="url(/images/red-x-repeat.gif)";
  document.getElementById("list8").style.backgroundRepeat="repeat-x";
  document.getElementById("list8").style.backgroundPosition="left top";
}
function mout8(id)
{
 document.getElementById("list8").style.backgroundImage="url(/images/grey-x-repeat.gif)";
 document.getElementById("list8").style.backgroundRepeat="no-repeat";
 document.getElementById("list8").style.backgroundPosition="left top";
}
function mover9(id)
{
  document.getElementById("list9").style.height="22px";
  document.getElementById("list9").style.backgroundImage="url(/images/red-x-repeat.gif)";
  document.getElementById("list9").style.backgroundRepeat="repeat-x";
  document.getElementById("list9").style.backgroundPosition="left top";
}
function mout9(id)
{
 document.getElementById("list9").style.backgroundImage="url(/images/grey-x-repeat.gif)";
 document.getElementById("list9").style.backgroundRepeat="no-repeat";
 document.getElementById("list9").style.backgroundPosition="left top";
}
function mover10(id)
{
  document.getElementById("list10").style.height="22px";
  document.getElementById("list10").style.backgroundImage="url(/images/red-x-repeat.gif)";
  document.getElementById("list10").style.backgroundRepeat="repeat-x";
  document.getElementById("list10").style.backgroundPosition="left top";
}
function mout10(id)
{
 document.getElementById("list10").style.backgroundImage="url(/images/grey-x-repeat.gif)";
 document.getElementById("list10").style.backgroundRepeat="no-repeat";
 document.getElementById("list10").style.backgroundPosition="left top";
}

/**************************************************************/
function callpdf(pdf)
{
  var filename=pdf;
  var url="/download_pdf.aspx?pdf="+filename; 
 document.location=url;
}

 function agencyneworks()
   {      
   //alert('xdfdf');
       if(document.getElementById("ctl00_ContentPlaceHolder1_drp_country").value == "0")
        {
          alert("Please select Country");          
          document.getElementById("ctl00_ContentPlaceHolder1_drp_country").focus();
          return false;
        }   
        if(document.getElementById("ctl00_ContentPlaceHolder1_drp_port").value == "0")
        {
          alert("Please select Port");          
          document.getElementById("ctl00_ContentPlaceHolder1_drp_port").focus();
          return false;
        }    
   }
   var imgHTTP=getreq();
  var time=new Date(); 
  
   function LoadNews(pgnum,hid)
{   
    var year='0';
    if(document.getElementById('ddlYear'))
        year=document.getElementById('ddlYear').value;
    var imgHTTP=getreq();
    var url="/ajax/News-landing-Ajax.aspx";    
    url=url+"?flag=loadnews&HID="+hid+"&Pgnum="+pgnum+"&year="+year+"&time="+time.getTime();
    imgHTTP.open('GET',url,false);                               
    imgHTTP.send(null);    
   
    var response1 =  imgHTTP.responseText.split("$");   
    if (response1[0]!="")
       document.getElementById('DivNewscont').innerHTML=response1[0];
}
function LoadNews_back(pgnum,hid)
{   
    var year='0';
    if(document.getElementById('ddlYear'))
        year=document.getElementById('ddlYear').value;
    var imgHTTP=getreq();
    var url="/ajax/News-landing-Ajax.aspx";    
    url=url+"?flag=loadnews_back&HID="+hid+"&Pgnum="+pgnum+"&year="+year+"&time="+time.getTime();
    imgHTTP.open('GET',url,false);                               
    imgHTTP.send(null);    
   
    var response1 =  imgHTTP.responseText.split("$");   
    if (response1[0]!="")
    {
       document.getElementById('DivNewscont').innerHTML=response1[0];
       
    }
}
/****FOR MAJOR CLIENTS PAGE STARTS****/

/****For Glossary page starts****/
var alphaArr=new Array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
function loadGlossary(alpha,funcname,hid)
{
    var imgHTTP=getreq();
    var url="/ajax/glossary-ajax.aspx";    
    url=url+"?flag=loadglossary&HID="+hid+"&func="+funcname+"&keyword="+alpha+"&time="+time.getTime();

    imgHTTP.open('GET',url,false);                               
    imgHTTP.send(null);    
   
    var response1 =  imgHTTP.responseText.split("$");   

    if (response1[0]!="")
       document.getElementById('DivGlossarycont').innerHTML=response1[0];

    alpha= alpha.toLowerCase();                 
    for(var i=0;i<26;i++)
    {    
        if(alphaArr[i]==alpha)
            document.getElementById(alphaArr[i]).className='selected';
        else
            document.getElementById(alphaArr[i]).className='';
    }
}
/****For Glossary page ends****/
/****For tenders starts***/
function LoadTenders(pgnum,hid,funcname)
{   
    var keyword="";
    if(funcname!="back")    
        keyword=document.getElementById('txtSearchTenders').value;
    var imgHTTP=getreq();
    var url="/ajax/Tenders-ajax.aspx";    
    url=url+"?flag=loadtenders&HID="+hid+"&Pgnum="+pgnum+"&func="+funcname+"&keyword="+keyword+"&time="+time.getTime();
  
    imgHTTP.open('GET',url,false);                               
    imgHTTP.send(null);    
   
    var response1 =  imgHTTP.responseText.split("$");
    
    if (response1[0]!="")
       document.getElementById('Divcont').innerHTML=response1[0];
    else
       document.getElementById('Divcont').innerHTML='<div class="tenders-table cl-grey fnt-14">No tenders found</div>';
}
function SearchTenders_keypress(pgnum,hid,funcname,ev)
{   
    var keyword=document.getElementById('txtSearchTenders').value;
    var code;
    if(document.all)
        code=ev.keyCode; 
    else if(document.getElementById)
        code=ev.which;  
    if(code==13)
    {
        if(trim(keyword)== "" || trim(keyword) == "SEARCH TENDERS")
        {
            alert('Please enter a keyword to search');
            document.getElementById('txtSearchTenders').focus();        
        }
        else
        {
            var imgHTTP=getreq();
            var url="/ajax/Tenders-ajax.aspx";    
            url=url+"?flag=loadtenders&HID="+hid+"&Pgnum="+pgnum+"&func="+funcname+"&keyword="+keyword+"&time="+time.getTime();
           
            imgHTTP.open('GET',url,false);                               
            imgHTTP.send(null);    
           
            var response1 =  imgHTTP.responseText.split("$");
            
            if (response1[0]!="")
               document.getElementById('Divcont').innerHTML=response1[0];
            else
                document.getElementById('Divcont').innerHTML='<div class="tenders-table cl-grey fnt-14">No tenders found</div>';
        }
    }
}
function SearchTenders(pgnum,hid,funcname)
{   
    var keyword=document.getElementById('txtSearchTenders').value;
   
    if(trim(keyword)== "" || trim(keyword) == "SEARCH TENDERS")
    {
        alert('Please enter a keyword to search');
        document.getElementById('txtSearchTenders').focus();        
    }
    else
    {
        var imgHTTP=getreq();
        var url="/ajax/Tenders-ajax.aspx";    
        url=url+"?flag=loadtenders&HID="+hid+"&Pgnum="+pgnum+"&func="+funcname+"&keyword="+keyword+"&time="+time.getTime();
       
        imgHTTP.open('GET',url,false);                               
        imgHTTP.send(null);    
       
        var response1 =  imgHTTP.responseText.split("$");
        
        if (response1[0]!="")
           document.getElementById('Divcont').innerHTML=response1[0];
        else
           document.getElementById('Divcont').innerHTML='<div class="tenders-table cl-grey fnt-14"> <span class=\"flotlt padlt15\">No tenders found</span></div>';
     }
}
/***For tenders ends***/

/****For tenders landing starts***/
function LoadMainTenders(pgnum,hid,funcname)
{   
    //var keyword=document.getElementById('txtSearchTenders').value
    var keyword="";
    var imgHTTP=getreq();
    var url="/ajax/Tenders-Main-ajax.aspx";    
    url=url+"?flag=loadtenders&HID="+hid+"&Pgnum="+pgnum+"&func="+funcname+"&keyword="+keyword+"&time="+time.getTime();
  
    imgHTTP.open('GET',url,false);                               
    imgHTTP.send(null);    
   
    var response1 =  imgHTTP.responseText.split("$");
    
    if (response1[0]!="")
       document.getElementById('Divcont').innerHTML=response1[0];
    else
       document.getElementById('Divcont').innerHTML='<div class="tenders-table cl-grey fnt-14"><span class=\"flotlt padlt15\">No tenders found</span></div>';
}
function LoadMainTendersBack(pgnum,hid,funcname)
{   
    var keyword="";
    var imgHTTP=getreq();
    var url="/ajax/Tenders-Main-ajax.aspx";    
    url=url+"?flag=loadtenders&HID="+hid+"&Pgnum="+pgnum+"&func="+funcname+"&keyword="+keyword+"&time="+time.getTime();
  
    imgHTTP.open('GET',url,false);                               
    imgHTTP.send(null);    
   
    var response1 =  imgHTTP.responseText.split("$");
    
   
    if (response1[0]!="")
       document.getElementById('Divcont').innerHTML=response1[0];
    else
       document.getElementById('Divcont').innerHTML='<div class="tenders-table cl-grey fnt-14"> <span class=\"flotlt padlt15\">No tenders found</span></div>';
}

function TendersCategoryChange(pgnum,hid,funcname)
{   
    var keyword="";
   
        var imgHTTP=getreq();
        var url="/ajax/Tenders-Main-ajax.aspx";    
        url=url+"?flag=loadtenders&HID="+hid+"&Pgnum="+pgnum+"&func="+funcname+"&keyword="+keyword+"&time="+time.getTime();
       
        imgHTTP.open('GET',url,false);                               
        imgHTTP.send(null);    
       
        var response1 =  imgHTTP.responseText.split("$");
        
        if (response1[0]!="")
           document.getElementById('Divcont').innerHTML=response1[0];
        else
           document.getElementById('Divcont').innerHTML='<div class="tenders-table cl-grey fnt-14"> <span class=\"flotlt padlt15\">No tenders found</span></div>';
     
}
/***For tenders landing ends***/

/****FOR MAJOR CLIENTS PAGE STARTS****/
function Loadclients(pgnum,hid,funcname)
{   
    var imgHTTP=getreq();
    var url="/ajax/major-clients-ajax.aspx";    
    url=url+"?flag=loadclients&HID="+hid+"&Pgnum="+pgnum+"&func="+funcname+"&time="+time.getTime();
    
    imgHTTP.open('GET',url,false);                               
    imgHTTP.send(null);    
   
    var response1 =  imgHTTP.responseText.split("$");   
    if (response1[0]!="")
       document.getElementById('Divcont').innerHTML=response1[0];
}
/****FOR MAJOR CLIENTS PAGE ENDS****/
/***Ajax Function***/

function getreq()
{ // returns false if exists
	if(window.ActiveXObject)
	 { // if IE
		try
		 {
		    return new ActiveXObject("Msxml2.XMLHTTP");
	    }
	    catch(e)
	    {
		    try
		    {
		        return new ActiveXObject("Microsoft.XMLHTTP");
		    }
		    catch(e)
		    {
		        return;
		    }
		}
	}
	else if(window.XMLHttpRequest)
	{ // if Mozilla, Safari, etc.
		return new XMLHttpRequest();
	}
}
function AddItems()
{
var itemExist=0;
    var indx=document.getElementById('ctl00_ContentPlaceHolder1_drpDwnItems').selectedIndex;
    var t=document.getElementById('ctl00_ContentPlaceHolder1_drpDwnItems');
    var opt = document.createElement("option");
    opt.text = document.getElementById('ctl00_ContentPlaceHolder1_drpDwnItems').options[indx].text;
    opt.value = document.getElementById('ctl00_ContentPlaceHolder1_drpDwnItems').options[indx].value;
    
    var len=document.getElementById("ctl00_ContentPlaceHolder1_listItem").options.length;
    for(var i=0;i<len;i++)
    {
        if(document.getElementById("ctl00_ContentPlaceHolder1_listItem").options[i].text==opt.text)
        {
            itemExist=1;
            alert('Item already exists');
        }
    }
    if(itemExist==0 && indx!=0)  
        document.getElementById("ctl00_ContentPlaceHolder1_listItem").options.add(opt);   
}
function RemoveItems()
{
    var len=document.getElementById("ctl00_ContentPlaceHolder1_listItem").options.length;
    for(var i=0;i<len;i++)
    {
        if(document.getElementById("ctl00_ContentPlaceHolder1_listItem").options[i] && document.getElementById("ctl00_ContentPlaceHolder1_listItem").options[i].selected)
        {
            document.getElementById("ctl00_ContentPlaceHolder1_listItem").remove(i);
            i--;
        }
    }
}



/************Scripts for Site Search starts*************/
function hitsearch(e)
{
    var code;
        if(document.all)
            code=e.keyCode; 
        else if(document.getElementById)
            code=e.which;  
    if(code==13)
    {
        if(searchKeyword()==true)
            return true;
        else 
            return false;
    }    
}

function searchKeyword()
{
    var srchtxt='',univtxt='';
    if(document.getElementById('txtMainSearch'))
        srchtxt=trim(document.getElementById('txtMainSearch').value)
    else
        srchtxt=trim(document.getElementById('ctl00_txtMainSearch').value)
   var flag=1;

    if(srchtxt=='' || srchtxt=='SEARCH')
    {
        alert('Please enter keyword to search');
        document.getElementById('txtMainSearch').focus();
        flag=0;
    }
    if(flag==1)
    {
    document.forms[0].method="post";
    document.forms[0].action="/app/search.aspx";
    document.forms[0].submit();
   } 
   else
    return false;
}
/************Scripts for Site Search ends*************/


/****/
function searchPaging(pgnum)
{   
    var keyword=document.getElementById('hfSearchKeyword').value;
    var imgHTTP=getreq();
    var url="/ajax/search-ajax.aspx";    
    url=url+"?flag=search&Pgnum="+pgnum+"&keyword="+keyword+"&time="+time.getTime();
  
    imgHTTP.open('GET',url,false);                               
    imgHTTP.send(null);    
   
    var response1 =  imgHTTP.responseText.split("$");
   
    if (response1[0]!="")
       document.getElementById('search-cont').innerHTML=response1[0];
//    else
//       document.getElementById('search-cont').innerHTML='<div class="cl-grey fnt-14">No tenders found</div>';
}


/****/
function consignmentTrackVal()
{   
    if(document.getElementById('ctl00_ContentPlaceHolder1_txtContainerNo').value=="")
    {
        alert('Please enter the number');
        document.getElementById('ctl00_ContentPlaceHolder1_txtContainerNo').focus();
        return false;
    }
    else if(document.getElementById('ctl00_ContentPlaceHolder1_drp_Consignment').value=="0")
    {
        alert('Please select consignment type');
        document.getElementById('ctl00_ContentPlaceHolder1_drp_Consignment').focus();
        return false;
    }
    else
    {
     document.getElementById("ctl00_ContentPlaceHolder1_divGo").style.display="none";      
     document.getElementById("ctl00_ContentPlaceHolder1_loadimgMs").style.display="block";
     return true;
    }

}
/****/
function containerTrackValTest()
{   
    if(document.getElementById('txtContainerNo').value=="")
    {
        alert('Please enter the number');
        document.getElementById('txtContainerNo').focus();
        return false;
    }
    else if(document.getElementById('drp_Consignment').value=="0")
    {
        alert('Please select consignment type');
        document.getElementById('drp_Consignment').focus();
        return false;
    }
    else
    {
     document.getElementById("divGo").style.display="none";      
     document.getElementById("loadimgMs").style.display="block";
     return true;
    }

}

//var window_dimensions = "left=20,top=20,width=800,height=500,toolbars=no,menubar=no,location=no,scrollbars=no,resizable=no,status=no"  
//window.opener=self 
//window.open("/app/container-track.aspx","_blank",  window_dimensions);  
 

