// The below are for countyInddetail.jsp file
function showHideItems(myItem, myButton){

    //this is the ID of the hidden item
    var myitem = document.getElementById(myItem);


    //this is the ID of the plus/minus button image
    var mybutton = document.getElementById(myButton);


    if (myitem.style.display != "none") {
    //items are currently displayed, so hide them

    myitem.style.display = "none";

    swapImage(mybutton,"plus");
    }
    else {

    //items are currently hidden, so display them
    myitem.style.display = "block";

    swapImage(mybutton,"minus");
    }
    }


//function to swap an image based on its current state
function swapImage(myImage, state) {

if (state == "minus") {

myImage.src = "images/minus.gif";
}

else {
myImage.src = "images/plus.gif";
}

}



// The below are for countyIndsubdetail.jsp file

function showorhide(idlong, idshort, idlink)
   {
   if (document.getElementById(idlong).style.display == "none")
   {
document.getElementById(idlink).value="Collapse Description";
document.getElementById(idlong).style.display = "block";
   document.getElementById(idshort).style.display="none";
   }
   else
   {
   document.getElementById(idlink).value="Expand Description";
   document.getElementById(idlong).style.display="none";
   document.getElementById(idshort).style.display = "block";
   }
   }


//eskills validation javascripts
function occtitle_validate()
 {
 var thegroup = document.getElementById("availtitles");
  var val = 0;
 for(n=0; n<thegroup.options.length; n++)
 {
   if(thegroup.options[n].selected)
  {
     val++;
   }
  }

  if(val == 0)
  {
   alert("You have to select an occupational title.");
   return false;
   }
  return true;
  }

 /* jQuery functions begin here - used in the Reemployment main page displaying occupation titles */

 $(function()  {
	$("div.subtitle").hide();

	 $("a.maingroup").click(function()  {

	 var answer = $("#a" + $(this).attr('id'));
		 answer.slideToggle("fast");
  });

$("#openAll").click(function() {
    $("div.subtitle").each(function() {
      $(this).slideDown("fast");
    });
  });

  $("#closeAll").click(function() {
    $("div.subtitle").slideUp("fast");
  });

 });


function TB_closeCallBack(){
window.location.reload(true);
}



/* jquery dialog boxes for Occupational projection metro, nonmetro definitions in full and custom reports*/
// increase the default animation speed to exaggerate the effect
$.fx.speeds._default = 1000;
$(function() {
    $('#dialog1').dialog({
        autoOpen: false,
        show: 'blind',
        hide: 'explode'
    });

    $('#opener1').click(function() {
        $('#dialog1').dialog('open');
        return false;
    });
});

  $(function() {
    $('#dialog2').dialog({
        autoOpen: false,
        show: 'blind',
        hide: 'explode'
    });

    $('#opener2').click(function() {
        $('#dialog2').dialog('open');
        return false;
    });
});


$(function() {
    $('#dialog3').dialog({
        autoOpen: false,
        show: 'blind',
        hide: 'explode'
    });

    $('#opener3').click(function() {
        $('#dialog3').dialog('open');
        return false;
    });
});


 $(function() {
    $('#dialog4').dialog({
        autoOpen: false,
        show: 'blind',
        hide: 'explode'
    });

    $('#opener4').click(function() {
        $('#dialog4').dialog('open');
        return false;
    });
});

 $(function() {
    $('#dialog5').dialog({
        autoOpen: false,
        show: 'blind',
        hide: 'explode'
    });

    $('#opener5').click(function() {
        $('#dialog5').dialog('open');
        return false;
    });
});

 $(function() {
    $('#dialog6').dialog({
        autoOpen: false,
        show: 'blind',
        hide: 'explode'
    });

    $('#opener6').click(function() {
        $('#dialog6').dialog('open');
        return false;
    });
});

 $(function() {
    $('#dialog7').dialog({
        autoOpen: false,
        show: 'blind',
        hide: 'explode'
    });

    $('#opener7').click(function() {
        $('#dialog7').dialog('open');
        return false;
    });
});


$(function() {
    $('#dialog8').dialog({
        autoOpen: false,
        show: 'blind',
        hide: 'explode'
    });

    $('#opener8').click(function() {
        $('#dialog8').dialog('open');
        return false;
    });
});


$(function() {
    $('#bigdialog1').dialog({
            autoOpen: false,
             position: 'top',
            width: 600,
            show: 'blind',
            hide: 'explode'
        });


    $('#bigopener1').click(function() {
        $('#bigdialog1').dialog('open');
        return false;
    });
 });

 $(function() {
    $('#stars').dialog({
            autoOpen: false,
            position: 'top',
            width: 600,
            hide: 'explode',
            modal: 'true',
            buttons: {
                 Print: function() {
                  $('#stars').jqprint();

                }}

        });


    $('#starrating1').click(function() {
        $('#stars').dialog('open');
        return false;
    });
     $('#starrating2').click(function() {
       $('#stars').dialog('open');
        return false;
    });
});

$(function() {
    $('#bigdialog2').dialog({
        autoOpen: false,
        position: 'top',
        width: 600,
        show: 'blind',
        hide: 'explode'
    });

    $('#bigopener2').click(function() {
        $('#bigdialog2').dialog('open');
        return false;
    });
});













