
// function to manage internal menues
function ShowHideDiv(divid)
{
    var divObj1 = document.forms[0].getElementsByTagName('h5');      
    for (var i=1; i<divObj1.length;i++)
    { 
          var DivId  = divObj1[i];
          var id=DivId.id;
          if(id!="")
          {
                if(id.substring(0,6)=='htopic')  // hide div
                {
                   var tmpclass='htopic'+divid;
                   //alert(tmpclass)
                   //alert(id)
                   if(id==tmpclass) 
                      document.getElementById(id).className='activeTab'
                   else
                      document.getElementById(id).className=''
                    
                }
          }
    }
    var divObj = document.forms[0].getElementsByTagName('div');      
    for (var i=1; i<divObj.length;i++)
    { 
          var DivId  = divObj[i];
          var id=DivId.id;
          if(id!="")
          {
            if(id.substring(0,11)=='articlesdiv')  // hide div
            {
                var tmp='articlesdiv'+divid
                
               if(id==tmp) 
                    document.getElementById(id).style.display='Block'; 
               else
                    document.getElementById(id).style.display='none';
            }
          }
    }
}

  function showDiv(topic,subtopics)
    {     
//        var stab = get_cookie("selectedTab");
//        var sdiv = get_cookie("selectedDiv");
//        if(topic==null && subtopics==null)
//        {
//            topic=get_cookie("selectedTab");
//            subtopic=get_cookie("selectedDiv");
//            if(topic==null && subtopics==null)
//                return false;
//        }
//        else
//        {
//            set_cookie ( "selectedTab", topic);
//            set_cookie ( "selectedDiv", subtopics);
//        }           
//        topic=get_cookie("selectedTab");
//        subtopics=get_cookie("selectedDiv");
//        //delete_cookie ( "selectedTab" );
        var divObj = document.forms[0].getElementsByTagName('li');      
        for (var i=1; i<divObj.length;i++)
        {  
          var DivId  = divObj[i];
          var id=DivId.id;
          if(id!="")
          {
            if(id.substring(0,6)=='tabhea')  // hide div
            {
                 document.getElementById(id).className='deActiveTab';
            }
                document.getElementById(topic).className='activeTab';  
          }
        }        
         // for show hide divs
        var divObj = document.forms[0].getElementsByTagName('div');      
        for (var i=1; i<divObj.length;i++)
        {  
          var DivId  = divObj[i];
          var id=DivId.id;
          if(id!="")
          {
            if(id.substring(0,12)=='tabContainer')  // hide div
                 document.getElementById(id).style.display='none';
            document.getElementById(subtopics).style.display='block';
          }
       }
    }
    //anuja added function for search
    function pressentersite2()
		{
    		if(window.event.keyCode == 13)
	    	{
		        gotosearchsite2();
		    }
		    else
		    {
		        return false;
		    }
		}
		function gotosearchsite2()
		{
		    //onclick="location.href='/search.aspx?query='+txt1.value; return false;" 
		    window.location = "http://www.lexisnexis.com/search.aspx?query=" + window.document.forms[0].s2.value;
		}
		function resetkeywordssite2()
		{
		    window.document.forms[0].s2.value = "";
		}
    
    
    function jsBreadCrumb()
    {
        //alert('before')
        //alert(document.getElementById('ctl00_TagNameLeft_hdBreadCrumb').value);
        document.getElementById('ctl00_TagNameLeft_hdBreadCrumb').value=document.getElementById('ctl00_TagNameLeft_hdBreadCrumb').value+"<div class=\"clearFloat\">&nbsp;</div>";
        //alert(document.getElementById('ctl00_TagNameLeft_hdBreadCrumb').value);
        document.getElementById('ulbreadcrumb').innerHTML=document.getElementById('ctl00_TagNameLeft_hdBreadCrumb').value;
        //alert('after')
    }
    
    
    
    // email popup function
    function mailIdValidation(sender,value)
     {
    
                 
                    invalidChars = " /:,;"
                   var rtValue = true;
                  
                   if(value.Value.length!=0)
                   { 
                        for (i=0; i<invalidChars.length; i++) 
                        {
                            badChar = invalidChars.charAt(i)
                            if (value.Value.indexOf(badChar,0) > -1) 
                            {
                                value.IsValid = false;
                                rtValue = false;
                                //alert("There are some invalid characters in the \"Email\" field.");
                                //document.getElementById("Messagelbl").innerText="There are some invalid characters in the \"Email\" field.";
                                return ;
                            }
                        }
                    
                        atPos = value.Value.indexOf("@",1)
                    
                        if (atPos == -1)
                        {
                       
                            value.IsValid = false;
                             rtValue = false;
                             //alert("Please enter a value in a correct format in the \"Email\" field.");
                            //document.getElementById("Messagelbl").innerText="Please enter a value in a correct format in the \"Email\" field.";
                            return;
                        }
                        if (value.Value.indexOf("@",atPos+1) > -1)
                        {
                            value.IsValid = false;
                             rtValue = false;
                             //alert("Please enter a value in a correct format in the \"Email\" field.");
                            //document.getElementById("Messagelbl").innerText="Please enter a value in a correct format in the \"Email\" field.";
                            return;
                        }
                        periodPos = value.Value.indexOf(".",atPos)
                        if (periodPos == -1)
                        {
                            value.IsValid = false;
                             rtValue = false;
                             //alert("Please enter a value in a correct format in the \"Email\" field.");
                            //document.getElementById("Messagelbl").innerText="Please enter a value in a correct format in the \"Email\" field.";
                            return;
                        }
                        if (periodPos+3 > value.Value.length)
                        {
                            value.IsValid = false;
                             rtValue = false;
                             
                           return ;
                        }
                    
                     return rtValue;
                  }
                    value.IsValid = true;
    }
function numberValidation(sender,value)
  {
   
    var lwr     =   "1234567890";
    if(value.Value.length!=0)
            {
                for(i=0;i<value.Value.length;i++)
                {
                    if(lwr.indexOf(value.Value.charAt(i))==-1)
                    {
                        value.IsValid = false;
                       
                        return;
                    }
                 }
            }
        value.IsValid = true;
  }

            
                     
function getEmail()
{
                     
             document.getElementById('EventDiv').style.left = 200;
            
             document.getElementById('EventDiv').style.top = 200;
            
            document.getElementById('EventDiv').style.display="block";
            
           /*Hide the select box*/
                for (var x=0; x<6; x++)
                {
                var y = document.getElementsByTagName("select")[x] || document.getElementsByTagName("SELECT")[x];                                               
                if(y!=null)
                y.style.display = "none";
                
                document.getElementById("GetBy").style.display = "block";                
                }
                /*code end here for select box hiding*/ 
          
            var divObj = document.getElementById('EventDiv');  
            //Drag.init(divObj);
}
           function invisiblediv()
            {
                
                /*Revisible the select box*/
                for (var x=0; x<6; x++){
                var y = document.getElementsByTagName("select")[x] || document.getElementsByTagName("SELECT")[x];
                 if(y!=null)
                y.style.display = "block";
                
                
                
                }
                /*code end here for select box hiding*/ 

                 document.getElementById('EventDiv').style.display='none';
            }
      

//function getEmail()
//{
//           
//             document.getElementById('EventDiv').style.left = 250;
//             document.getElementById('EventDiv').style.top = 200;
//            document.getElementById('EventDiv').style.display='block';
//           /*Hide the select box*/
//                           for (var x=0; x<6; x++){
//                                                var y = document.getElementsByTagName("select")[x] || document.getElementsByTagName("SELECT")[x];                                               
//                                                y.style.display = "none";
//                                    }
//                          /*code end here for select box hiding*/ 
//            var divObj = document.getElementById('EventDiv');  
//            Drag.init(divObj);                                                                        
//         }
//           function invisiblediv()
//            {
//                                                /*Revisible the select box*/
//                                                for (var x=0; x<6; x++){
//                                                            var y = document.getElementsByTagName("select")[x] || document.getElementsByTagName("SELECT")[x];
//                                                            y.style.display = "block";
//                                                }
//                                                /*code end here for select box hiding*/ 
//                 document.getElementById('EventDiv').style.display='none';
//            }
//            
//      

    var divarr = new Array();
        divarr[0] ='signOn';
        divarr[1] ='ManageAccount';
        divarr[2] ='Contactrep';

        var tabarr = new Array();
        tabarr[0] = 'tab1';
        tabarr[1] = 'tab2';
        tabarr[2] = 'tab4';

        function selectedDiv(id)
        {
         
	        for(i=0;i<divarr.length;i++)
	        {
	            if(id == divarr[i] && id == 'ManageAccount')
		        {   
		            document.getElementById(divarr[0]).style.display='Block';
			        document.getElementById(tabarr[i]).className='activeTab'; //deActiveTab
			        document.getElementById('register').style.display='none';
			        document.getElementById('hiddenCheck').InnerHTML = 'ManageAccount'; 
		        }
		        else if(id == divarr[i])
		        {   
		            document.getElementById('register').style.display='Block'; 
		            document.getElementById('hiddenCheck').InnerHTML = 'signOn';     			
			        document.getElementById(divarr[i]).style.display='Block';
			        document.getElementById(tabarr[i]).className='activeTab'; //deActiveTab
		        }
		        else
		        {        			
			        document.getElementById(divarr[i]).style.display='none';
			        document.getElementById(tabarr[i]).className='deActiveTab';
		        }
	        }
        	
        }
        function minContent(thisDiv,thisImg1,thisImg2)	{

 
	document.getElementById(thisDiv).style.display = "none";
	document.getElementById(thisImg1).style.visibility="hidden";
	document.getElementById(thisImg2).style.visibility="visible";
   
	
    }
    function maxContent(thisDiv,thisImg1,thisImg2)
    {
       	
        document.getElementById(thisDiv).style.display = "block";
	    document.getElementById(thisImg1).style.visibility="visible";
	    document.getElementById(thisImg2).style.visibility="hidden";
    }