// -------------------------------------------------------------
// Copyright (c) 2006 Codejock Software, All Rights Reserved.
// url: http://www.codejock.com
// -------------------------------------------------------------

// imageOn - toggles image to 'On' state indicating mouse over.
function imageOn(imgName) {
  if (document.images) {
    document[imgName].src = eval(imgName + "On.src");
  }
}

// imageOn2 - toggles image to 'On' state indicating mouse over.
function imageOn2(imgName, imgNum) {
  if (document.images) {
    document[imgName].src = eval(imgName + imgNum + "On.src");
  }
}

// imageOff - toggles image to 'Off' state indicating mouse out.
function imageOff(imgName) {
  if (document.images) {
   document[imgName].src = eval(imgName + "Off.src");
  }
}

// imageSwap - swaps image.
function imageSwap(imgName, imgFile) {
  if (document.images) {
    document[imgName].src = imgFile.src;
  }
}

// setBkImage - changes an elements background image.
function setBkImage(id, image) {
  if (image.src.length != 0) {
    if (document.layers) {
      document[id].background.src = image.src;
    }
    else if (document.all) {
      document.all[id].style.backgroundImage = 'url(' + image.src + ')';
    }
    else if (document.getElementById) {
      document.getElementById(id).style.backgroundImage = 'url(' + image.src + ')';
    }
  }
}


// writelivelink - creates a link to the interactive demo if ActiveX is enabled
function writelivelink(htmlbefore, linkname, htmlafter) {
     if ("ActiveXObject" in window) { 
       document.write(htmlbefore + linkname + "live/" + htmlafter);
     } 
     else 
     { 
       document.write(htmlbefore + linkname + htmlafter);
     }
}

// writelivemessage - displays a message to enable ActiveX or use IE for live tour
function writelivemessage(htmlbefore, link1, link2, htmlafter) {
     if ("ActiveXObject" in window) { 
       document.write(htmlbefore + "" + link1 + "2" + link2 + "" + htmlafter);
     } 
     else 
     { 
       document.write("<p>" + link1 + link2 + "</p>");
     }
}

function writelinewithasp(line) {
	document.write(line);
}

// writelink - creates email hyper link that is invisible to webcrawlers
function writelink(emailname, classname) {
  document.write('<a href=\"mailto:'+emailname+'\@codejock.com\"'+'class=\"'+classname+'\">'+emailname+'@codejock.com</a>') ;
}

// writelink2 - creates email hyper link that is invisible to webcrawlers
function writelink2(emailname, classname, title) {
  document.write('<a href=\"mailto:'+emailname+'\@codejock.com\"'+'class=\"'+classname+'\">'+title+'</a>') ;
}

// displayImage - displays an image in a new window
function displayImage(imgURL,iWidth,iHeight) {
  newWindow = window.open('', 'screenShot', 'toolbar=no,scrollbars=0,resizable=0,width=' + iWidth + ',height=' + iHeight) ;
  newWindow.document.writeln('<html>') ;
  newWindow.document.writeln('<head>') ;
  newWindow.document.writeln('<title>Codejock Software Image</title>') ;
  newWindow.document.writeln('</head>') ;
  newWindow.document.writeln('<body style="margin:0px;padding:0px;">') ;
  newWindow.document.writeln('<IMG src="' + imgURL + '" STYLE="position:absolute; left:0px; height:' + iHeight + '; width:' + iWidth + '" />') ;
  newWindow.document.writeln('</body>') ;
  newWindow.document.writeln('</html>') ;
  newWindow.document.close() ;
  newWindow.resizeBy(iWidth-newWindow.document.body.clientWidth,iHeight-newWindow.document.body.clientHeight) ;
  newWindow.focus() ;
}

// displayImageR - displays an image in a new window
function displayImageR(imgURL,iWidth,iHeight) {
  if (iWidth > 1024) {
  	  newWindow = window.open('', 'screenShot', 'toolbar=no,scrollbars=yes,resizable=yes,width=1024,height=768') ;
  }
  else {
  	  newWindow = window.open('', 'screenShot', 'toolbar=no,scrollbars=yes,resizable=yes,width=' + iWidth + ',height=' + iHeight) ;
  };
  newWindow.document.writeln('<html>') ;
  newWindow.document.writeln('<head>') ;
  newWindow.document.writeln('<title>Codejock Software Image</title>') ;
  newWindow.document.writeln('</head>') ;
  newWindow.document.writeln('<body style="margin:0px;padding:0px;">') ;
  newWindow.document.writeln('<IMG src="' + imgURL + '" STYLE="position:absolute; left:0px; height:' + iHeight + '; width:' + iWidth + '" />') ;
  newWindow.document.writeln('</body>') ;
  newWindow.document.writeln('</html>') ;
  newWindow.document.close() ;
  if (iWidth > 1024) {
  	  newWindow.resizeTo(1024,768) ;
  }
  else {
      newWindow.resizeBy(iWidth-newWindow.document.body.clientWidth,iHeight-newWindow.document.body.clientHeight) ;      
  };  
  newWindow.moveTo(0,0) ;  	    
  newWindow.focus() ;
}

// toggleV - toggles layer visibility
function toggleV(nr) {
  if (document.layers) {
    vista = (document.layers[nr].visibility == 'hide') ? 'show' : 'hide'
    document.layers[nr].visibility = vista;
  }
  else if (document.all) {
    vista = (document.all[nr].style.visibility == 'hidden') ? 'visible'  : 'hidden';
    document.all[nr].style.visibility = vista;
  }
  else if (document.getElementById) {
    vista = (document.getElementById(nr).style.visibility == 'hidden') ? 'visible' : 'hidden';
    document.getElementById(nr).style.visibility = vista;
  }
}

// toggleB - toggles display block
function toggleB(nr) {
  if (document.layers) {
    current = (document.layers[nr].display == 'none') ? 'block' : 'none';
    document.layers[nr].display = current;
  }
  else if (document.all) {
    current = (document.all[nr].style.display == 'none') ? 'block' : 'none';
    document.all[nr].style.display = current;
  }
  else if (document.getElementById) {
    vista = (document.getElementById(nr).style.display == 'none') ? 'block' : 'none';
    document.getElementById(nr).style.display = vista;
  }
}

// redir - redirects to new page location.
function redir(url){
  window.location = url;
}

function rediropen(url){
  window.open (url);
}

function showReleaseNotes() {
	newWindow = window.open('Release_Notes.htm','','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=500,height=250');
	newWindow.document.close() ;
}
function showReleaseNotes(releaseNotePath) {
	newWindow = window.open(releaseNotePath,'','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=500,height=250');
	newWindow.document.close() ;
}

