ok, if you are new to javascript you might be wondering how you can use a variable from within a function into an outside part of your whole scripts.

i also wondered about this, because usually i would declare a variable like this within the javascript code in html page:

javascript code:
<script" language="javascript">
function Showit(){
var String = 'My String';

}
alert(String);
</script>


if i ran the code above, it would not show 'My String' so what you need to do is remove the var part so the script would look like this instead:

javascript code:
<script" language="javascript">
function Showit(){
String = 'My String';

}
alert(String);
</script>