/*
son of suckerfish menu script from:
http://www.htmldog.com/articles/suckerfish/dropdowns/
 */
 
 sfHover = function() {
if(document.getElementById("nav"))
{
var sfEls = document.getElementById("nav").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=" sfhover";
this.style.zIndex=200; //this line added to force flyout to be above relatively positioned stuff in IE
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
}
}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
/*
Style Sheet Switcher for Large Fonts
http://www.alistapart.com/articles/alternate/
 */
function setActiveStyleSheet(title) {
  var i, a, main;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
  
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
      a.disabled = true;
      if(a.getAttribute("title") == title) 
{
  a.disabled = false;
}
    }
  }
}
function getActiveStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
  }
  return null;
}
function getPreferredStyleSheet() {
  var i, a;
  for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
    if(a.getAttribute("rel").indexOf("style") != -1
       && a.getAttribute("rel").indexOf("alt") == -1
       && a.getAttribute("title")
       ) return a.getAttribute("title");
  }
  return null;
}
function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name) {
  var nameEQ = name + "=";
  var ca = document.cookie.split(';');
  for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
  }
  return null;
}
window.onload = function(e) {
  var cookie = readCookie("style");
  var title = cookie ? cookie : getPreferredStyleSheet();
  setActiveStyleSheet(title);
}
window.onunload = function(e) {
  var title = getActiveStyleSheet();
  createCookie("style", title, 365);
}
var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);
<!--
/****************************************************
     Author: Eric King
     Url: http://redrival.com/eak/index.shtml
     This script is free to use as long as this info is left in
     Featured on Dynamic Drive script library (http://www.dynamicdrive.com)
****************************************************/
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);
win.focus();
}
// -->
// mahes added for printPreview
function printPreview()
{
//alert(window.document.PrintForm.mahes);
//var articleId = window.document.PrintForm.articleId.value;
var myWidth = 750; 
var myHeight = 800; 
var myLeft = (screen.width - myWidth) / 2;
var myTop = (screen.height - myHeight - 15) / 2;
myURL = "/PartnerAdmin/html/portlet/PrintPreview/printPreview.jsp?articleId="+printPreviewArticleId;
myFeatures = 'toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=no,width=' + myWidth + ',height=' + myHeight + ',left=' + myLeft +',top='+ myTop +',scrollbars=yes';
var TheNewWindow = window.open(myURL,'eMail',myFeatures);
}
// mahes added for emailFriend
function eMailFriend()
{	
var myWidth = 750; 
var myHeight = 800; 
var myLeft = (screen.width - myWidth) / 2;
var myTop = (screen.height - myHeight - 15) / 2;
myURL = '/PartnerAdmin/html/portlet/emailFriend/editPage.jsp';
myFeatures = 'toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=no,width=' + myWidth + ',height=' + myHeight + ',left=' + myLeft +',top='+ myTop +',scrollbars=yes';
var TheNewWindow = window.open(myURL,'eMail',myFeatures);
}
// mahes added for Image Library Download Form
function openImageDownload(baseURL,formName,anchorObject)
{
var myWidth = 750; 
var myHeight = 800; 
var myLeft = (screen.width - myWidth) / 2;
var myTop = (screen.height - myHeight - 15) / 2;
var myFeatures = 'toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=no,width=' + myWidth + ',height=' + myHeight + ',left=' + myLeft +',top='+ myTop +',scrollbars=yes';
var urlStringObject = new String(anchorObject.href);
var indexLast = urlStringObject.lastIndexOf("/");
var fileName = urlStringObject.substring(indexLast+1,urlStringObject.length);
var formURL = baseURL + "?FormName="+formName+"&fileName="+fileName;
var imageWindow = window.open(formURL,'IMAGELIBRARY',myFeatures);
imageWindow.focus();
return false;
}
function openOthersDownload(baseURL,formName,anchorObject)
{
var myWidth = 850; 
var myHeight = 800; 
var myLeft = (screen.width - myWidth) / 2;
var myTop = (screen.height - myHeight - 15) / 2;
var myFeatures = 'toolbar=no,location=no,directories=no,status=yes,menubar=no,resizable=no,width=' + myWidth + ',height=' + myHeight + ',left=' + myLeft +',top='+ myTop +',scrollbars=yes';
//	var urlStringObject = new String(anchorObject.href);
//	var indexLast = urlStringObject.indexOf("/portal");
//	var fileName = urlStringObject.substring(indexLast,urlStringObject.length);
var fileName = anchorObject;
var formURL = baseURL + "?FormName="+formName+"&fileName="+fileName;
var downloadWindow = window.open(formURL,'IMAGELIBRARY',myFeatures);
downloadWindow.focus();
return false;
}
function PressRelease(myURL) {
NewWindow(myURL,'PressRelease', 750, 800, 'yes','center');
}
function PopUpWindowOthers(myURL) {
NewWindow(myURL,'', 850, 800, 'yes','center');
return false;
}