You are including 2 copies of jQuery. Don’t do that; it is likely your problem.
In the first block, you are including 3 scripts, the first of which is jQuery:
// from Google CDN
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
In your second block you are again including jQuery:
// From local
<script type="text/javascript" src="https://stackoverflow.com/questions/18769142/scripts/jquery.js"></script>
You should only include the library once, and if the local copy is anything like the one you’re pulling from Google, they are both woefully out-of-date.
2
solved How do I have two javascripts to work on a page? [closed]