var consentMessage = "You are accessing a U. S. Government (USG) Information System (IS) that is provided for";
  consentMessage+="USG-authorized use only.  By using this IS (which includes any device attached to this IS), you";
  consentMessage+="consent to the following conditions: \n\n";

 consentMessage+="The USG routinely intercepts and monitors communications on this IS for purposes including, but not ";
 consentMessage+="limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel ";
 consentMessage+="misconduct (PM), law  enforcement (LE), and counterintelligence (CI) investigations.\n\n";

 consentMessage+="At any time, the USG may inspect and seize data stored on this IS.\n\n";

 consentMessage+="Communications using, or data stored on, this IS are not private, are subject to routine monitoring, ";consentMessage+="interception, and search, and may be disclosed or used for any USG-authorized purpose.\n"

 consentMessage+="This IS includes security measures (e.g., authentication and access controls) to protect USG ";consentMessage+="interests--not for your personal benefit or privacy.\n\n";

 consentMessage+="Notwithstanding the above, using this IS does not constitute consent to PM, LE or CI investigative "; consentMessage+="searching or monitoring of the content of privileged communications, or work product, related to ";consentMessage+="personalrepresentation or services by attorneys, psychotherapists, or clergy, and their ";
consentMessage+=" assistants. Such communications and work product are private and confidential. See User ";
consentMessage+="Agreement for details at \n\nhttp://acpol.army.mil/announcements/user_agreement.html \n";


function confirmConsent(ako)
{
  //alert(ako);
   var r = confirm(consentMessage);
   if(ako && r==true){
      //alert(dcpds_down_message);
     document.location ="https://acpol.army.mil/ako/cpolmain";
   }else if(ako && r == false){
      //alert('this is where ');
      document.location ="http://acpol.army.mil";
   }else if(!ako && r == true){
     return true;
   }
   else{
     // stay here.
   }
}

function popUp() {
 var confirmed = confirmConsent(false);
   if(confirmed)
   {
    //alert(dcpds_down_message);
    window.open("http://acpol.army.mil/pkisso_popup.html",        "PKISSOPopUp",'toolbar=0,location=no,directories=0,status=0,menubar=0,scrollbars=no,resizeable=yes,width=300,height=320');
  }
}


function searchTxt(){
var searchValue = "Site Search";
jQuery(document).ready(function(){
jQuery("#siteSearch").val(searchValue);
jQuery("#siteSearch").focus(
      function(){if(jQuery(this).val() == searchValue)jQuery(this).val('')});
jQuery("#siteSearch").blur(    
      function(){if(jQuery(this).val() == ''){jQuery(this).val(searchValue);}});
});
}

// var rotateSpeed = 5000; // Milliseconds to wait until switching tabs.
var rotateSpeed = 5500; // Milliseconds to wait until switching tabs.
var currentTab = 0; // Set to a different number to start on a different tab.
var numTabs; // These two variables are set on document ready.
var autoRotate;

function openTab(clickedTab) {
   var thisTab = $("#tabbed-box .tabs a").index(clickedTab);
   $("#tabbed-box .tabs li a").removeClass("active");
   $("#tabbed-box .tabs li a:eq("+thisTab+")").addClass("active");
   $("#tabbed-box .tabbed-content").hide();
   $("#tabbed-box .tabbed-content:eq("+thisTab+")").show();
   currentTab = thisTab;
}

function rotateTabs() {
   var nextTab = (currentTab == (numTabs - 1)) ? 0 : currentTab + 1;
   openTab($("#tabbed-box .tabs li a:eq("+nextTab+")"));
}

$(document).ready(function() {
   $(".tabbed-content").equalHeights();
   numTabs = $("#tabbed-box .tabs li a").length;
   $("#tabbed-box .tabs li a").click(function() { 
      openTab($(this)); return false; 
   });
   $("#tabbed-box").mouseover(function(){clearInterval(autoRotate)})
   .mouseout(function(){autoRotate = setInterval("rotateTabs()", rotateSpeed)});
   
   $("#tabbed-box .tabs li a:eq("+currentTab+")").click()
   $("#tabbed-box").mouseout();
   
});






(function($){
	$.fn.topNav = function(){
		var pageRt = $('#site_wrapper').offset().left + $('#site_wrapper').outerWidth();
		$('li.navbtn').each(function(){
			var subNavCols = $('.navCol',this).length;
			var subNavWidth = (195*subNavCols) + 'px';
			var subNavColWidth = (100/subNavCols) + '%';
			$('.topsubnav',this).css({'width':subNavWidth}) + 'px';
			var iFrameHeight = $('div.topsubnav',this).height() + 'px';//for ie6
			$('iframe.topsubnav',this).css({'height':iFrameHeight,'margin-bottom':'-'+iFrameHeight});
		});

		$('li.navbtn').hover(function(){
			var subNavRt = $(this).offset().left + $('div.topsubnav',this).outerWidth();
			var marLeft = pageRt - subNavRt;
			if(parseInt(marLeft) < 0){
				$('.topsubnav',this).css('left',marLeft+'px');
			}
			else{
				$('.topsubnav',this).css('left','0px');
			}
			var ext = $('img', this).attr('src')
			ext = ext.substr(ext.length-5,ext.length);
			$(this).addClass('sfhover');
			$(this).children().children('img').attr('src', function() {return this.src.replace(ext,'o.png');});
			}
		,function(){
			$('.topsubnav',this).css('left','-9999px');	
			$(this).removeClass('sfhover');
			if($(this).hasClass('currentNav')){ext = 'a.png'}else{ext = 'i.png'}
			$(this).children().children('img').attr('src', function() {return this.src.replace(/o.png/,ext);});
			}
		);	
	};
})


