﻿
var unts_breadcrumb = ""; // Holds the default breadcrumb text whenever UNTS Online is loaded.


// JScript File
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function ShowNotes()
{
    window.open('Notes.aspx?index=&flag=',null,'scrollbars=yes,status=no')
    return false;
}
function ShowAllDeclarataions()
{
    window.open('DeclarationList.aspx',null,'width = 550,scrollbars=yes,status=no')
    return false;
}
function ShowNote(str)
{
    var index = str.split(",");
    window.open('Notes.aspx?index='+ index[0]+'&flag=',null,'scrollbars=yes,status=no')
    return false;
}
function ShowDeclarations(str,sub,chapter,treaty)
{
    str = encodeURI(str);
    var path ='../Pages/Declarations.aspx?index='+ str ;
 	document.getElementById('ctl00_ContentPlaceHolder1_ifrm').style.display='block';
	document.getElementById('ctl00_ContentPlaceHolder1_hlkFrameClose').style.display='block';
	//document.getElementById('ctl00_ContentPlaceHolder1_ifrm').style.height  = '300px';
	document.getElementById('ctl00_ContentPlaceHolder1_ifrm').src = path;
	if(document.getElementById('divNotes').style.display!='block' )
	{
	    document.getElementById('divNotes').style.display='none'
	}
	
	return true;
}

function ShowAll()
{
    if(document.getElementById('ctl00_ContentPlaceHolder1_divFlag').value =="1")
    {
	    //document.getElementById('ctl00_ContentPlaceHolder1_lnkNote').style.display='none';
	    //document.getElementById('ctl00_ContentPlaceHolder1_lnkDec').style.display='none';
	    document.getElementById('divAll').style.display='block';
	    document.getElementById('divNotes').style.display='block'; 
	}
	return true;
}
function FillIFrame(str,strIndex)
{        
    var index = str.split(",");
    var path ='../Pages/Notes.aspx?index='+ index[0] +'&noresize=yes&flag=Y';
	document.getElementById('ifrm').style.display='block';
	document.getElementById('hlkFrameClose').style.display='block';
	document.getElementById('ifrm').src = path;
	window.location.href ='Declarations.aspx?index='+ strIndex+'#EndNotes';
	
	return false;
}
function FillIFrameAll(str)
{        
    var index = str.split(",");
    var path ='../Pages/Notes.aspx?index='+ index[0] +'&noresize=yes&flag=Y';
	document.getElementById('ifrm').style.display='block';
	document.getElementById('hlkFrameClose').style.display='block';
	document.getElementById('ifrm').src = path;
	window.location.href ='DeclarationList.aspx#EndNotes';
	
	return false;
}

function CloseFrame()
{
    document.getElementById('ifrm').style.display='none';   
    document.getElementById('hlkFrameClose').style.display='none';
    return false;
}


function CloseDecFrame()
{
    document.getElementById('ctl00_ContentPlaceHolder1_ifrm').style.display='none';   
    document.getElementById('ctl00_ContentPlaceHolder1_hlkFrameClose').style.display='none';
    //document.getElementById('ctl00_ContentPlaceHolder1_lnkNote').style.display='block';
	//document.getElementById('ctl00_ContentPlaceHolder1_lnkDec').style.display='block';	
    return false;
}

function CloseOnChange()
{       
	document.getElementById('divAll').style.display='none';
	document.getElementById('divNotes').style.display='none'; 
    return false;
}
function ShowDetails(objid)
{
    window.open('showDetails.aspx?objid='+ objid,null,'scrollbars=auto,status=no')
    return false;
}

function ShowActionDetails(objid)
{
    window.open('showActionDetails.aspx?objid='+ objid,null,'scrollbars=auto,status=no')
    return false;
}

function ShowNoteAll()
{
    //document.getElementById('ctl00_ContentPlaceHolder1_lnkNote').style.display='none';
    //document.getElementById('ctl00_ContentPlaceHolder1_lnkDec').style.display='none';
	document.getElementById('divNotes').style.display='block';     
}
function ShowNoteAll_LON()
{
    //document.getElementById('ctl00_ContentPlaceHolder1_lnkNote').style.display='none';
    //document.getElementById('ctl00_ContentPlaceHolder1_lnkDec').style.display='none';
	//document.getElementById('divNotesAll').style.display='block';     
}

function Print(blocks,strHeading)
	{
		var prtContent = "<table border='0' cellspacing='0' cellpadding='0'><tr><td align='center'>"+ strHeading+"<p></td></tr><tr><td style='border:none'>";
		
		
		for(var i = 0 ; i < blocks.length; i++)
		{
		    prtContent+=document.getElementById(blocks[i]).innerHTML;
		    prtContent+="</td></tr>";
		    
		    if(i < blocks.length - 1)
		        prtContent+= "<td style='border:none'><tr>";
		    		
		}
		
		prtContent+="</table>";
		
		var my_window= window.open ("", "mywindow1","status=1,width=550,height=300,scrollbars=yes");		
		var WinPrint = window.open('','','left=2000,top=2000,width=1,height=1,toolbar=0,scrollbars=0,status=1');
		var htmlhead = '<html><head><link href="../Css/print.css" rel="stylesheet" type="text/css" /></head><body>';
		var htmlfooter = '</body></html>';
		var WinPrintInnerHTML = htmlhead + prtContent + htmlfooter;
		my_window.document.open();
		my_window.document.write(WinPrintInnerHTML);		
		my_window.document.close();
		my_window.focus();		
		my_window.print();
		my_window.close();
	}
	
function PrintMTDSGDetails()
{
   
    
    var objBlocks = new Array();
    
    objBlocks[0] = "headerbox";
    objBlocks[1] = "participants";
    objBlocks[2] = "specialtbl";
    objBlocks[3] = "divAll";
    objBlocks[4] = "divNotes";
    //var blocks = objBlocks;
    var strHeading = "";
    var mydate=new Date()
    var dayarray=new Array ("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
    var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")
    var daym=mydate.getDate()
    var year=mydate.getYear()
        if (year < 1000)
        year+=1900
        var dt = new Date();
        var day=mydate.getDay()
        var month=mydate.getMonth()
        var ctime= dt.toLocaleTimeString();
        var cdate= dayarray[day]+", "+daym+" "+montharray[month]+" "+year+" "+ctime
    strHeading = "Today is " + cdate    
    
    
    var prtContent = "<table border='0' cellspacing='0' cellpadding='0'><tr><td align='center'>"+ strHeading+"<p></td></tr><tr><td style='border:none'>";
		
		
		for(var i = 0 ; i < objBlocks.length; i++)
		{
		    prtContent+=document.getElementById(objBlocks[i]).innerHTML;
		    prtContent+="</td></tr>";
		    
		    
		    if(i < objBlocks.length - 1)
		        prtContent+= "<td style='border:none'><tr>";		    		
		}
		
		prtContent+="</table>";
		
		var my_window= window.open ("", "mywindow1","status=1,width=550,height=300,scrollbars=yes");		
		//var WinPrint = window.open('','','left=2000,top=2000,width=1,height=1,toolbar=0,scrollbars=0,status=1');
		var htmlhead = '<html><head><link href="../Css/print.css" rel="stylesheet" type="text/css" /></head><body>';
		var htmlfooter = '</body></html>';
		var WinPrintInnerHTML = htmlhead + prtContent + htmlfooter;
		my_window.document.open();
		my_window.document.write(WinPrintInnerHTML);		
		my_window.document.close();
		my_window.focus();		
		my_window.print();
		my_window.close();
		
	return true;
    
   
}	


function PrintLonDetails()
{
    var heading = document.getElementById('ctl00_ContentPlaceHolder1_lblSubChapter').innerHTML;    
    var objBlocks = new Array();    
    objBlocks[0] = "headerbox";
    objBlocks[1] = "participants";      
    Print(objBlocks,"&nbsp;");
    return false;
}

function UntsSearch()
{ 
    window.print();
    window.close();
    return true;
}
function OpenTemp()
{
    window.open('Temp.aspx',null,'width = 550,scrollbars=yes,status=no')
    return true;
}
function LONSearch()
{ 
    window.print();
    window.close();
    return true;
}
function OpenLONTemp()
{
    window.open('LONTemp.aspx',null,'width = 550,scrollbars=yes,status=no')
    return true;
}
function OnClickpopularName(labeltext)
{
    document.getElementById('ctl00_ContentPlaceHolder1_tc1').className="activebtn";
    document.getElementById('ctl00_ContentPlaceHolder1_Div1').className="";

    document.getElementById('ctl00_ContentPlaceHolder1_tc2').className="inactivebtn";
    document.getElementById('ctl00_ContentPlaceHolder1_Div2').className="inactivetab";

    document.getElementById('ctl00_ContentPlaceHolder1_tc3').className="inactivebtn";
    document.getElementById('ctl00_ContentPlaceHolder1_Div3').className="inactivetab";

    document.getElementById('ctl00_ContentPlaceHolder1_tc4').className="inactivebtn";
    document.getElementById('ctl00_ContentPlaceHolder1_Div4').className="inactivetab";
    
    document.getElementById('ctl00_ContentPlaceHolder1_Tc7').className="inactivebtn";
    document.getElementById('ctl00_ContentPlaceHolder1_Div7').className="inactivetab";
    
    document.getElementById('keyword').style.display = 'none'; 
    document.getElementById('Name').style.display = 'block'; 
    document.getElementById('PopularNameList').style.display = 'block';
    document.getElementById('Participants').style.display = 'none';   
    document.getElementById('ctl00_ContentPlaceHolder1_tabid').value = "1";
    document.getElementById('Options_2').style.display = 'none'; 
    document.getElementById('options_').style.display = 'none'; 
    
    ModifyBreadCrumb2(labeltext);
}

function OnClickTitle(labeltext)
{
    document.getElementById('ctl00_ContentPlaceHolder1_tc1').className="inactivebtn";
    document.getElementById('ctl00_ContentPlaceHolder1_Div1').className="inactivetab";

    document.getElementById('ctl00_ContentPlaceHolder1_tc2').className="activebtn";
    document.getElementById('ctl00_ContentPlaceHolder1_Div2').className="";

    document.getElementById('ctl00_ContentPlaceHolder1_tc3').className="inactivebtn";
    document.getElementById('ctl00_ContentPlaceHolder1_Div3').className="inactivetab";

    document.getElementById('ctl00_ContentPlaceHolder1_tc4').className="inactivebtn";
    document.getElementById('ctl00_ContentPlaceHolder1_Div4').className="inactivetab";
    
     document.getElementById('ctl00_ContentPlaceHolder1_tc7').className="inactivebtn";
    document.getElementById('ctl00_ContentPlaceHolder1_Div7').className="inactivetab";
    
     document.getElementById('keyword').style.display = 'block';
    document.getElementById('Name').style.display = 'none';
    document.getElementById('PopularNameList').style.display = 'none';
    document.getElementById('Participants').style.display = 'none';
    document.getElementById('ctl00_ContentPlaceHolder1_tabid').value = "2";
    document.getElementById('Options_2').style.display = 'block';
    document.getElementById('options_').style.display = 'none'; 
    ModifyBreadCrumb2(labeltext);
}

function OnClickParticipants(labeltext)
{
    document.getElementById('ctl00_ContentPlaceHolder1_tc1').className="inactivebtn";
    document.getElementById('ctl00_ContentPlaceHolder1_Div1').className="inactivetab";

    document.getElementById('ctl00_ContentPlaceHolder1_tc2').className="inactivebtn";
    document.getElementById('ctl00_ContentPlaceHolder1_Div2').className="inactivetab";

    document.getElementById('ctl00_ContentPlaceHolder1_tc3').className="activebtn";
    document.getElementById('ctl00_ContentPlaceHolder1_Div3').className="";

    document.getElementById('ctl00_ContentPlaceHolder1_tc4').className="inactivebtn";
    document.getElementById('ctl00_ContentPlaceHolder1_Div4').className="inactivetab";
    
     document.getElementById('ctl00_ContentPlaceHolder1_tc7').className="inactivebtn";
    document.getElementById('ctl00_ContentPlaceHolder1_Div7').className="inactivetab";
    
     document.getElementById('keyword').style.display = 'none';
    document.getElementById('Name').style.display = 'none';
    document.getElementById('PopularNameList').style.display = 'none';
    document.getElementById('Participants').style.display = 'block'; 
    document.getElementById('Options_2').style.display = 'none'; 
    document.getElementById('options_').style.display = 'block'; 
    document.getElementById('ctl00_ContentPlaceHolder1_tabid').value = "3";   
    ModifyBreadCrumb2(labeltext);
}

function ModifyBreadCrumb2(labeltext)
{
    var breadcrumb = document.getElementById('ctl00_SiteMapPath1');
    
    if(unts_breadcrumb == "")
    {
        unts_breadcrumb = breadcrumb.innerHTML ;
    }
    
    //breadcrumb.innerHTML = unts_breadcrumb +  '';    
    //breadcrumb.innerHTML = unts_breadcrumb +  '<span style="color:#5D7B9D;font-family:Arial;font-size:Small;font-weight:bold;"> → </span><span style="color:#333333;">'+labeltext+'</span>';    
}

function ModifyBreadCrumb(labeltext)
{
    var breadcrumb = document.getElementById('ctl00_SiteMapPath1');
    
    if(unts_breadcrumb == "")
    {
        unts_breadcrumb = breadcrumb.innerHTML ;
    }
    
    breadcrumb.innerHTML = unts_breadcrumb +  '<span style="color:#5D7B9D;font-family:Arial;font-size:Small;font-weight:bold;"> → </span><span style="color:#333333;">'+labeltext+'</span>';    
    
}

function ShowHeader()
{
    document.getElementById('header').style.display = 'block';
}


function ShowMenusinFullTextMS()
{
     document.getElementById('UntcOnline').style.display='none'
     document.getElementById('MsDatabase').style.display='block'
}
function ShowMenusinFullTextLON()
{
     document.getElementById('UntcOnline').style.display='none'
     document.getElementById('MsDatabase').style.display='none'
      document.getElementById('LON').style.display='block'
}
function ShowMenusinFullTextCI()
{
     document.getElementById('UntcOnline').style.display='none'
     document.getElementById('MsDatabase').style.display='none'
     document.getElementById('LON').style.display='none'
     document.getElementById('CI').style.display='block'
}
function ShowMenusinFullTextCN()
{
     document.getElementById('UntcOnline').style.display='none'
     document.getElementById('MsDatabase').style.display='none'
     document.getElementById('LON').style.display='none'
     document.getElementById('CI').style.display='none'
     document.getElementById('CN').style.display='block'
}
function ShowMenusinFullTextCTC()
{
     document.getElementById('UntcOnline').style.display='none'
     document.getElementById('MsDatabase').style.display='none'
     document.getElementById('LON').style.display='none'
     document.getElementById('CI').style.display='none'
     document.getElementById('CN').style.display='none'
     document.getElementById('CTC').style.display='block'
}
function ShowMenusinFullTextUN()
{
     document.getElementById('UntcOnline').style.display='none'
     document.getElementById('MsDatabase').style.display='none'
     document.getElementById('LON').style.display='none'
     document.getElementById('CI').style.display='none'
     document.getElementById('CN').style.display='none'
     document.getElementById('CTC').style.display='none'
     document.getElementById('UN').style.display='block'
}