//START LANGUAGE SELECT AND GO 
function changePage(newLoc){
         nextPage = newLoc.options[newLoc.selectedIndex].value
         if (nextPage != ""){
             document.location.href = nextPage
         }
 };
//END LANGUAGE SELECT AND GO 


// This funtion resizes content text when a user clicks on the +/- icons.
function textcontroller(multiplier) {
         switch (multiplier) {
         case 1:
         document.getElementById('alpha-inner').style.fontSize = "1em";         
         var links,i;
         links=document.getElementsByTagName('a');
         for(i in links)
         {
         if(/leftsublink/.test(links[i].className)) {
         links[i].style.fontSize = "12px";
         }
         }         
         break;
         case 2:
         document.getElementById('alpha-inner').style.fontSize = "1.1em";
         var links,i;
         links=document.getElementsByTagName('a');
         for(i in links)
         {
         if(/leftsublink/.test(links[i].className)) {
         links[i].style.fontSize = "1.1em";
         }
         }
         break;
         case 3:
         document.getElementById('alpha-inner').style.fontSize = "1.3em";
         var links,i;
         links=document.getElementsByTagName('a');
         for(i in links)
         {
         if(/leftsublink/.test(links[i].className)) {
         links[i].style.fontSize = "1.3em";
         }
         }         break;
   } 
};

//START JQUERY INSTANITATION BLOCK
$(document).ready(function(){

$('#marqueepanel').jqm();

//JQUERY IMAGE SWAP FOR HEADER NAV
$('img#imgHow').hover(function() {
	$(this).attr("src","/2010census/img/globalnav_on_how.png");
		}, function() {
	$(this).attr("src","/2010census/img/globalnav_off_how.png");
});

$('img#imgWhy').hover(function() {
	$(this).attr("src","/2010census/img/globalnav_on_why.png");
		}, function() {
	$(this).attr("src","/2010census/img/globalnav_off_why.png");
});

$('img#imgPrivi').hover(function() {
	$(this).attr("src","/2010census/img/globalnav_on_privacy.png");
		}, function() {
	$(this).attr("src","/2010census/img/globalnav_off_privacy.png");
});

$('img#imgInvolved').hover(function() {
	$(this).attr("src","/2010census/img/globalnav_on_involved.png");
		}, function() {
	$(this).attr("src","/2010census/img/globalnav_off_involved.png");
});

//Start carousel code
jQuery('#slider-stage').carousel('#previous', '#next');
jQuery('#viewport').carousel('.simplePrevious', '.simpleNext');
//End carousel code

//START SHOW/HIDE FOR EASY PROBLEMS/QUESTIONS I MAY HAVE
$(function() {
    $(".accordion").accordion({header: 'h4', active: false, autoHeight: false});
});
// END SHOW/HIDE FOR EASY PROBLEMS/QUESTIONS I MAY HAVE

// START SEARCH BOX DEFAULT VALUE SWITCHER
$('.default-value').each(function() {
    var default_value = this.value;
    $(this).css('color', '#666');
    $(this).focus(function() {
        if(this.value == default_value) {
            this.value = '';
            $(this).css('color', '#333');
        }
    });
    $(this).blur(function() {
        if(this.value == '') {
            $(this).css('color', '#666');
            this.value = default_value;
        }
    });
});
// END SEARCH BOX DEFAULT VALUE SWITCHER

// START TOOL TIPS
// About The Form Page
$("a#censusform").qtip({
   content: '<a href="/2010census/how/interactive-form.php"><img src="/2010census/img/2010form.jpg" width="332" height="405" alt="2010 Census Form" title="Click to view 2010 Census Form" /></a>',
   position: {
      corner: {tooltip:'leftMiddle',target:'rightMiddle'},     
      adjust: {x:5,y:0}},
      style: { 
      width: 355,
      height:400,
      background:'#ffffff',
      color:'#333333',
      textAlign: 'left',
      border: {radius:2,border:2,color:'#a9cde3'},
      tip: 'leftMiddle'
},
   show:{when:{ event:'click'},delay:0}, 
   hide:{when:{ event:'unfocus'},delay:2}
});
// About The Form Page
$("a#envelopefront").qtip({
    content:'<img src="../img/return_envelope_front.png" width="512" height="310" alt="Census return envelope (front) graphic" />',
    position:{
      corner:{tooltip:'bottomMiddle',target:'topMiddle'},     
      adjust:{x:5,y:0}},
      style:{ 
      width:535,
      height:330,
      padding:10,
      background:'#ffffff',
      color:'#333333',
      textAlign: 'left',
      border:{radius:2,border:2,color:'#a9cde3'},
      tip:'bottomMiddle'
},
   show:{when:{ event:'click'},delay:0}, 
   hide:{when:{ event:'unfocus'}
  }
});
$("a#envelopeback").qtip({
   content: '<img src="/2010census/img/return_envelope_back.png" width="506" height="380" alt="Census return envelope (back) graphic" />',
   position:{
      corner:{tooltip:'bottomMiddle',target:'topMiddle'},     
      adjust:{x:5,y:0}},
      style:{ 
      width:530,
      height:400,
      padding:10,
      background:'#ffffff',
      color:'#333333',
      textAlign: 'left',
      border:{radius:2,border:2,color:'#a9cde3'},
      tip:'bottomMiddle'
},
   show:{when:{ event:'click'},delay:0}, 
   hide:{when:{ event:'unfocus'}
  }
});
// Census Oath Overlay
$("p a.oath").qtip({
   content: '<p class="aligncenter"><strong>Census Oath of Non-Dislcosure</strong></p><p>When hired to work for the Census Bureau, employees must sign a Sworn Affidavit of Nondisclosure.</p> <p>This obligates those hired to accept the responsibility of keeping all Title 13 data confidential. This constitutes a lifetime obligation, continuing even if you are no longer affiliated with the Census Bureau.</p><p class="aligncenter">"I will not disclose any information contained in the schedules, lists, or statements obtained for or prepared by the Census Bureau to any person or persons either during or after employment."</p><p>Under federal law, the penalty for unlawful disclosure is a fine of not more than $250,000 or imprisonment for not more than 5 years, or both.</p>',
   position: {
      corner: {tooltip:'bottomMiddle',target:'topMiddle'},     
      adjust: {x:5,y:0}},
      style: { 
      padding:15,
      width:350,
      height:300, 
      background:'#ffffff',
      color:'#000000',
      textAlign: 'left',
      border: {radius:2,border:2,color:'#a9cde3'},
      tip: 'bottomMiddle'
},
   show:{when:{ event:'click'},delay:0}, 
   hide:{when:{ event:'unfocus'},delay:2}
});
// Title 13 Overlay
$("p a.title13").qtip({
   content: '<p class="aligncenter"><strong>Title 13</strong></p><p>Sec. 221. Refusal or neglect to answer questions; false answers</p><p>(a) Whoever, being over eighteen years of age refuses or willfully neglects, when requested by the Secretary, or by any other authorized officer or employee of the Department of Commerce or bureau or agency   thereof acting under the instructions of the Secretary or authorized officer, to answer, to the best of his knowledge, any of the questions on any schedule submitted to him in connection with any census or survey provided for by subchapters I, II, IV, and V of chapter 5 of this title, applying to himself or to the family to which he belongs or is related, or to the farm or farms of which he or his family is the occupant, shall be fined not more than $100.</p><p>(b) Whoever, when answering questions described in subsection (a) of this section, and under the conditions or circumstances described in such subsection, willfully gives any answer that is false, shall be fined not more than $500. (c) Notwithstanding any other provision of this title, no person shall be compelled to disclose information relative to his religious beliefs or to membership in a religious body.</p>',
   position: {
      corner: {tooltip:'bottomMiddle',target:'topMiddle'},     
      adjust: {x:5,y:0}},
      style: { 
      padding:15,
      width:350,
      height:300, 
      overflow:'auto',
      background:'#ffffff',
      color:'#000000',
      textAlign: 'left',
      border: {radius:2,border:2,color:'#a9cde3'},
      tip: 'bottomMiddle'
},
   show:{when:{ event:'click'},delay:0}, 
   hide:{when:{ event:'unfocus'},delay:2}
});

// Title 13 Overlay
$("p a.title13full").qtip({
   content: '<p class="aligncenter"><strong>Sections 9 and 214 of Title 13</strong></p><p><strong>Sec. 9. Information as confidential; exception</strong></p><p>(a) Neither the Secretary, nor any other officer or employee of the Department of Commerce or bureau or agency thereof, or local government census liaison may, except as provided in section 8 or 16 or chapter 10 of this title or section 210 of the Departments of Commerce, Justice, and State, the Judiciary, and Related Agencies Appropriations Act, 1998.(1)</p><ol><li>Use the information furnished under the provisions of this title for any purpose other than the statistical purposes for which it is supplied; or</li><li>Make any publication whereby the data furnished by any particular establishment or individual under this title can be identified; or</li><li>Permit anyone other than the sworn officers and employees of the Department or bureau or agency thereof to examine the individual reports. No department, bureau, agency, officer, or employee of the Government, except the Secretary in carrying out the purposes of this title, shall require, for any reason, copies of census reports which have been retained by any such establishment or individual. Copies of census reports, which have been so retained, shall be immune from legal process, and shall not, without the consent of the individual or establishment concerned, be admitted as evidence or used for any purpose in any action, suit, or other judicial or administrative proceeding.</li> </ol><p>(b) The provisions of subsection (a) of this section relating to the confidential treatment of data for particular individuals and establishments, shall not apply to the censuses of governments provided for by subchapter III of chapter 5 of this title, nor to interim current data provided for by subchapter IV of chapter 5 of this title as to the subjects covered by censuses of governments, with respect to any information obtained therefore that is compiled from, or customarily provided in, public records.</p><hr /><p><strong>Sec. 214. Wrongful disclosure of information</strong></p><p>Whoever, being or having been an employee or staff member referred to in subchapter II of chapter 1 of this title, having taken and subscribed the oath of office, or having sworn to observe the limitations imposed by section 9 of this title, or whoever, being or having been a census liaison within the meaning of section 16(2) of this title, publishes or communicates any information, the disclosure of which is prohibited under the provisions of section 9 of this title, and which comes into his possession by reason of his being employed (or otherwise providing services) under the provisions of this title, shall be fined not more than $5,000 or imprisoned not more than 5 years, or both.</p><hr /><p>1. The Census Address List Improvement Act of 1994, P.L. 103-430 amends section 9(a) by inserting "or local government census liaison" and adding references to section 16. P.L. 105-119, the Departments of Commerce, Justice, and State, the Judiciary, and Related Agencies Appropriations Act, 1998, adds the reference to section 210.</p><p>2. The Census Address List Improvement Act of 1994 (P.L. 103-430) amends section 214 making references to section 16 and census liaisons.</p>',
      position: {
      corner: {tooltip:'bottomMiddle',target:'topMiddle'},     
      adjust: {x:5,y:0}},
      style: { 
      padding:15,
      width:350,
      height:300, 
      overflow:'auto',
      background:'#ffffff',
      color:'#000000',
      textAlign: 'left',
      border: {radius:2,border:2,color:'#a9cde3'},
      tip: 'bottomMiddle'
},
   show:{when:{ event:'click'},delay:0}, 
   hide:{when:{ event:'unfocus'},delay:2}
});

// START LANGUAGE SELECTOR PANELS
// HOME PAGE
$("div#langselector_home").qtip({
   content: '<a href="/2010census/languages/" title="Language Name" >Language Name</a>',
   position:{
      corner:{tooltip:'topRight',target:'bottomRight'},     
      adjust:{x:-50,y:-18}},
      style:{ 
      width:400,
      height:300, 
      background:'#ffffff',
      color:'#333333',
      textAlign: 'left',
      border: {radius:2,border:2,color:'#c9cdd0'}
    },
   show:{when:{ event:'mouseover'},delay:0}, 
   hide:{when:{ event:'unfocus'}}
 });
// ON ALL LEFT NAVS
$("div#langselector").qtip({
   content: '<a href="/2010census/languages/">Language Page</a>',
   position: {
      corner: {tooltip:'topLeft',target:'bottomLeft'},
      adjust: {x:15,y:-3}},
      style: { 
      width:400,
      height:300,      
      background:'#ffffff',
      color:'#333333',
      textAlign: 'left',
      border: {radius:2,border:2,color:'#c9cdd0'}
     },
   show:{when:{ event:'click'},delay:0}, 
   hide:{when:{ event:'unfocus'}}

 });
// LANGUAGE PAGE SELECTOR
$("div#langselector_langpage").qtip({
   content:'<a href="/2010census/languages/">Language Page</a>',
   position:{
      corner:{tooltip:'topRight',target:'bottomRight'},
      adjust:{x:-15,y:-3}},
      style:{ 
      width:400,
      height:300,     
      background:'#ffffff',
      color:'#333333',
      textAlign:'left',
      border: {radius:2,border:2,color:'#c9cdd0'}},
   show:{when:{ event:'click'},delay:0}, 
   hide:{when:{ event:'unfocus'}}

 });
// INLINE SELECTOR SETTINGS
$("div#langselector_inline").qtip({
   content: '<a href="/2010census/languages/">Language Page</a>',
   position: {
      corner: {tooltip:'topLeft',target:'bottomLeft'},
      adjust: {x:0,y:-3}},
      style: { 
      width:400,
      height:300,      
      background:'#ffffff',
      color:'#333333',
      textAlign: 'left',
      border: {radius:2,border:2,color:'#c9cdd0'}
     },
   show:{when:{ event:'click'},delay:0}, 
   hide:{when:{ event:'unfocus'}}

 });

// END LANGUAGE SELECTOR PANELS

// START ADD THIS INFUSION CODE
// ADDS THE SHARE THIS TOOL BAR BASED ON BROWSER TYPE/VERSION
if ($.browser.msie && $.browser.version.substr(0,1)<7) {
   // FOR IE6
  // $("div#addthis").html("<div class='floatleft'><a class='addthis_button' //href='http://www.addthis.com/bookmark.php?v=250&amp;pub=xa-4a9c49de0232f5b4'><img //src='http://s7.addthis.com/static/btn/sm-share-en.gif' width='83' height='16' alt='Bookmark and Share' //style='border:0;'/></a></div><div class='addthis_separator floatleft' style='margin:0 3px 0 //5px;'>|</div><div id='textcontroller' class='floatleft'><a //href='javascript:textcontroller(1);' class='textexamplesmall' title='Normal Text'>A</a><a //href='javascript:textcontroller(2);' class='textexamplemedium' title='Large Text'>A</a><a //href='javascript:textcontroller(3);' class='textexamplelarge' title='Larger Text'>A</a>//</div>")     

$("div#addthis").html("<div class='floatleft'><a class='addthis_button' href='http://addthis.com/bookmark.php?v=250&amp;username=uscensusbureau'><img src='http://s7.addthis.com/static/btn/sm-share-en.gif' width='83' height='16' alt='Bookmark and Share' style='border:0;'/></a></div><div class='addthis_separator floatleft' style='margin:0 3px 0 5px;'>|</div><div id='textcontroller' class='floatleft'><a href='javascript:textcontroller(1);' class='textexamplesmall' title='Normal Text'>A</a><a href='javascript:textcontroller(2);' class='textexamplemedium' title='Large Text'>A</a><a href='javascript:textcontroller(3);' class='textexamplelarge' title='Larger Text'>A</a></div>")     



   }else{
   // FOR ALL OTHER BROWSERS
  $("div#addthis").html("<div class='addthis_toolbox addthis_default_style'><a class='addthis_button_print' style='color:#0066cc;text-decoration:none;' title='Print'> &nbsp;Print</a><span class='addthis_separator'>|</span><a class='addthis_button_compact' style='color:#0066cc;text-decoration:none;' title='Share this page'>Share this page</a><span class='addthis_separator'>|</span><div id='textcontroller'><a href='javascript:textcontroller(1);' class='textexamplesmall' title='Normal Text'>A</a><a href='javascript:textcontroller(2);' class='textexamplemedium' title='Large Text'>A</a><a href='javascript:textcontroller(3);' class='textexamplelarge' title='Larger Text'>A</a></div></div>")
};
// END ADD THIS INFUSION CODE

});
//END JQUERY INSTANITATION BLOCK




