Hello all I am new to these forums. I have looked about and see many helpful people here and have seen many people inneed of help. I am having a problem however with a simple (seemingly) script that I wrote. Here is is. I keep geting a syntax error dunno why because I am pretty sure the script is written properly
Can anyone here help me try to figure out what's wrong?. I've been debugging this and going at it for the past two days. Dunno wtf is going on.
Code:
<script language=\"javascript\">
function normify(img)
{
if(document.images)
{
var image_norm = eval(img + \"_norm.src\");
document[img].src = image_norm;
}
}
function greenify(img)
{
if(document.images)
{
var image_hovered = eval(img + \"_hovered.src\");
document[img].src = image_hovered;
}
}
if(document.images)
{
var im_pics = new Array(\"home\", \"files\", \"about\", \"links\", \"samba\", \"cups\", \"webmin\", \"phpmyadmin\", \"phpsurveyor\", \"phpnuke\", \"sugarcrm\");
for(var i=0; i < im_pics.length; ++i)
{
im_pics[i]_norm = new Image()
im_pics[i]_hovered = new Image()
im_pics[i]_norm.src = \"admin/pics/im_pics[i] + \".png\"\";
im_pics[i]_hovered.src = \"admin/pics/im_pics[i] + \"-green.png\"\";
}
}
</script>
Can anyone here help me try to figure out what's wrong?. I've been debugging this and going at it for the past two days. Dunno wtf is going on.