evanseb83
07-16-2010, 09:58 PM
When I click the button, the images hide/show in IE, but this doesn't work in Firefox. I've tried JSLint and JavascriptLint, but haven't figured out what the issue is. Any help would be much appreciated!! This is the code below:
<script language="Javascript">
<![CDATA[
function openConsole(docId, attachmentFileName, name) {
if (window.customOpenConsole) {
customOpenConsole(encodeURIComponent(attachmentFileName), name);
} else {
headerFrame = window.parent.parent.frames["Header"];
if (headerFrame != null && headerFrame.openDocLink != null){
headerFrame.openDocAttachment(docId, attachmentFileName, name);
}
}
}
function STGhide()
{
var x=document.getElementsByName("ImageControlZone");
for(j=0;j<x.length;j++)
{
var imgs = x[j].getElementsByTagName('img');
for(i=0;i<imgs.length;i++)
{
imgs[i].style.display="none";
}
}
var link = document.getElementById("ShowHideButton");
//alert(link.innerHTML)
link.innerHTML ="<img alt='' src='img/hideshow/showimage.gif' border='0' onclick='javascript:STGshow();' />";
}
function STGshow()
{
var x=document.getElementsByName("ImageControlZone");
for(j=0;j<x.length;j++)
{
var imgs = x[j].getElementsByTagName('img');
for(i=0;i<imgs.length;i++)
{
imgs[i].style.display="";
}
}
var link = document.getElementById("ShowHideButton");
link.innerHTML ="<img alt='' src='img/hideshow/hideimage.gif' border='0' onclick='javascript:STGhide();' />";
}
function openDocumentLink(externalId, languageId) {
if (window.parent.openDocLink != null) {
window.parent.openDocLink(externalId, languageId);
} else {
headerFrame = window.parent.parent.frames["Header"];
if (headerFrame != null && headerFrame.openDocLink != null)
{
headerFrame.openDocLink(externalId, languageId);
}
else {
setTimeout("openDocumentLink('"+externalId+"','"+languageId+"')",500);
}
}
}
]]>
</script>
<script language="Javascript">
<![CDATA[
function openConsole(docId, attachmentFileName, name) {
if (window.customOpenConsole) {
customOpenConsole(encodeURIComponent(attachmentFileName), name);
} else {
headerFrame = window.parent.parent.frames["Header"];
if (headerFrame != null && headerFrame.openDocLink != null){
headerFrame.openDocAttachment(docId, attachmentFileName, name);
}
}
}
function STGhide()
{
var x=document.getElementsByName("ImageControlZone");
for(j=0;j<x.length;j++)
{
var imgs = x[j].getElementsByTagName('img');
for(i=0;i<imgs.length;i++)
{
imgs[i].style.display="none";
}
}
var link = document.getElementById("ShowHideButton");
//alert(link.innerHTML)
link.innerHTML ="<img alt='' src='img/hideshow/showimage.gif' border='0' onclick='javascript:STGshow();' />";
}
function STGshow()
{
var x=document.getElementsByName("ImageControlZone");
for(j=0;j<x.length;j++)
{
var imgs = x[j].getElementsByTagName('img');
for(i=0;i<imgs.length;i++)
{
imgs[i].style.display="";
}
}
var link = document.getElementById("ShowHideButton");
link.innerHTML ="<img alt='' src='img/hideshow/hideimage.gif' border='0' onclick='javascript:STGhide();' />";
}
function openDocumentLink(externalId, languageId) {
if (window.parent.openDocLink != null) {
window.parent.openDocLink(externalId, languageId);
} else {
headerFrame = window.parent.parent.frames["Header"];
if (headerFrame != null && headerFrame.openDocLink != null)
{
headerFrame.openDocLink(externalId, languageId);
}
else {
setTimeout("openDocumentLink('"+externalId+"','"+languageId+"')",500);
}
}
}
]]>
</script>