function toggle() {
	var ele = document.getElementById("toggleText");
	var text = document.getElementById("displayText");
	if(ele.style.display == "block") {
    		ele.style.display = "none";
		text.innerHTML = "Show fabric sample images";
  	}
	else {
		ele.style.display = "block";
		text.innerHTML = "Hide fabric sample images";
	}
} 


function msieversion()
   {
      var ua = window.navigator.userAgent
      var msie = ua.indexOf ( "MSIE " )

      if ( msie > 0 )      // If Internet Explorer, return a 1
      {   
          return 1
      }    
      else 
      {                // If another browser, return 0
         return 0
      }
   }



function Validator(theForm)                 // used for the contact owner screen to validate input
{
  

  if (theForm.Topic.value == "")
  {
    alert("Please enter a value for the \"Topic\" field. What is the specific topic of this message?");
    theForm.Topic.focus();
    return (false);
  }  


  if (theForm.FirstName.value == "")
  {
    alert("Please enter your first name in the \"First Name\" field.");
    theForm.FirstName.focus();
    return (false);
  }

  if (theForm.FirstName.value.length < 1)
  {
    alert("Please enter your first name in the \"First Name\" field.");
    theForm.FirstName.focus();
    return (false);
  }

  if (theForm.LastName.value == theForm.FirstName.value)
  {
    window.open('http://www.ftc.gov/bcp/edu/microsites/spam/index.html','_self');
    
    return (false);
  }
  
  if (theForm.FirstName.value == theForm.Topic.value)
  {
    window.open('http://www.ftc.gov/bcp/edu/microsites/spam/index.html','_self');
    
    return (false);
  }

  if (theForm.FirstName.value == theForm.Email.value)
  {
    window.open('http://www.ftc.gov/bcp/edu/microsites/spam/index.html','_self');
    
    return (false);
  }
  if (theForm.LastName.value == theForm.Topic.value)
  {
    window.open('http://www.ftc.gov/bcp/edu/microsites/spam/index.html','_self');
    
    return (false);
  }

  if (theForm.LastName.value == theForm.Email.value)
  {
    window.open('http://www.ftc.gov/bcp/edu/microsites/spam/index.html','_self');
    
    return (false);
  }
  
  if (theForm.LastName.value.length < 1)
  {
    alert("Please enter your last name in the \"Last Name\" field.");
    theForm.LastName.focus();
    return (false);
  }

  if (theForm.Email.value == "")
  {
    alert("Please enter a value for the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Email.value.length < 1)
  {
    alert("Please enter an email address in the \"Email\" field.");
    theForm.Email.focus();
    return (false);
  }

  if (theForm.Subject.value != "")
  {
    
    window.open('http://www.ftc.gov/bcp/edu/microsites/spam/index.html','_self');
    return (false);
  }
    
  theForm.MsgSub.value = "To Jeanette (" + theForm.sChk.value + "): " + theForm.Topic.value;
    
  return (true);

}

hs.Expander.prototype.onMouseOut = function (sender) {
  if (this.custom.closeIt == 'yes') {
      sender.close();
  }
}



hs.Expander.prototype.onMouseOver = function () {
  if (this.custom.focusIt == 'yes') { 
      this.focus();
  }
}


hs.Expander.prototype.onBeforeExpand = function (sender, e) {

 if (this.custom.closeParent == 'yes') {    // close parent window?
    parent.window.hs.close();  
 }

}


hs.Expander.prototype.onAfterExpand = function (sender, e) {
  
// this function will display product code in the expander
// overlay IF displayName is turned on for that expander 

 if (this.custom.displayName == 'yes') {      // display name in overlay of image?
 
  
   // assign the offset based on browser type (ie had problems)
   
  if (msieversion() == 1)   // for IE browser version
  {
    var offsetOverlay = 0
  }
  else
  {
    var offsetOverlay = 20    // all other browsers
  }

   
   // create a new DOM element
   var divOverlay = document.createElement('div');

   // add a class name to allow CSS styling
   divOverlay.className = "highslide-overlay";

   // use the thumbnail's alt attribute as inner HTML
   divOverlay.innerHTML = sender.thumb.alt;

   // optional: set full width based on the image size minus the CSS padding
   divOverlay.style.width = (sender.x.span - offsetOverlay) +'px';

   // attatch it to this hs.Expander instance and add some options
   sender.createOverlay( { overlayId: divOverlay, position: "top left", 
      hideOnMouseOut: true, opacity: 0.7 } );
 }
 
}

