﻿// JScript File
/***********************************************
* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Contents for menu 1
var menu1=new Array()
menu1[0]='<a href="Letter.aspx">LETTER FROM PRESIDENT</a>'
menu1[1]='<a href="Overview.aspx">OVERVIEW</a>'
//menu1[2]='<a href="Industries.aspx">INDUSTRIES</a>'
menu1[2]='<a href="Partnerships.aspx">PARTNERSHIPS</a>'

//Contents for menu 2, and so on
var menu2=new Array()
menu2[0]='<a href="PressReleases.aspx">PRESS RELEASES</a>'

var menu3=new Array()
menu3[0]='<a href="CaseStudies.aspx">CASE STUDIES</a>'
//menu3[1]='<a target="new" href="docs/InterlinkTrifold2008.pdf">FLYER PDF</a>'
menu3[1]='<a href="Brochure.aspx">INTERLINK BROCHURE</a>'

//menu3[1]='<a href="#">MEMBERSHIPS</a>'
//menu3[2]='<a href="Partnerships.aspx">PARTNERSHIPS</a>'
//menu3[3]='<a href="#">OTHER LINKS</a>'
//menu3[4]='<a href="#">DOWNLOADS</a>'

var menu4=new Array()
//menu4[0]='<a href="Contacts.aspx">SALES INFORMATION</a>'
menu4[0]='<a href="SalesInformation.aspx">SALES INFORMATION</a>'
menu4[1]='<a href="Support.aspx">CUSTOMER SUPPORT</a>'
//menu4[2]='<a href="mailto:info@thinkinterlink.com?Subject=From thinkinterlink.com web site">SEND EMAIL</a>'
menu4[2]='<a href="ContactUs.aspx">SEND EMAIL</a>'

var menu5=new Array()
menu5[0]='<a href="3PL.aspx">3PL</a>'
menu5[1]='<a href="Automotive.aspx">AUTOMOTIVE</a>'
menu5[2]='<a href="Cosmetics.aspx">COSMETICS</a>'
menu5[3]='<a href="Distribution.aspx">DISTRIBUTION</a>'
menu5[4]='<a href="Electronics.aspx">ELECTRONICS</a>'
menu5[5]='<a href="Food.aspx">FOOD</a>'
menu5[6]='<a href="Manufacturing.aspx">MANUFACTURING</a>'
menu5[7]='<a href="Pharmaceutical.aspx">PHARMACEUTICAL</a>'
menu5[8]='<a href="Retail.aspx">RETAIL</a>'




		
var menu6=new Array()
menu6[0]='<a href="Software.aspx">SOFTWARE</a>'
menu6[1]='<a href="Hardware.aspx">HARDWARE</a>'
menu6[2]='<a href="Training.aspx">TRAINING</a>'
menu6[3]='<a href="Integration.aspx">INTEGRATION</a>'
menu6[4]='<a href="Implementation.aspx">IMPLEMENTATION</a>'
menu6[5]='<a href="SupportOptions.aspx">SUPPORT</a>'
		
var menuwidth='165px' //default menu width
var menubgcolor='yellow'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="no" //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'"; onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
//while (parentEl!=null){
//totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
//parentEl=parentEl.offsetParent;
//}
return totaloffset;
}

function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}


//function dropdownmenu(obj, e, menucontents, menuwidth){
function dropdownmenu(obj, e, menucontents, menuwidth, FudgeFactor){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
//dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.x=getposOffset(obj, "left") + 115
//dropmenuobj.y=getposOffset(obj, "top") + 6
dropmenuobj.y=getposOffset(obj, "top") + 85
//dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
//dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+"px"

//var FudgeFactor = 0;

dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+FudgeFactor+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}




function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu

function blendimage(divid, imageid, imagefile, millisec) { 
    var speed = Math.round(millisec / 100); 
    var timer = 0; 
     
     

    //set the current image as background 
    
    document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")"; 
     
    //make image transparent 
    changeOpac(0, imageid); 
     
    //make new image 
    //document.getElementById(imageid).style.display = "none";
    document.getElementById(imageid).src = imagefile; 
    //document.getElementById(imageid).style.display = "";
    //fade in image 
    for(i = 0; i <= 100; i++) { 
        setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed)); 
        timer++; 
    } 
} 

function changeOpac(opacity, id) { 

    var object = document.getElementById(id).style; 
    object.opacity = (opacity / 100);  
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
} 

var timerID = 0;
var place = 0;
var images=new Array();
images[0] = "images/img1.jpg";
images[1] = "images/img2.jpg";
images[2] = "images/img3.jpg";
images[3] = "images/img4.jpg";

function UpdateTimer() {
if (timerID) {
    clearTimeout(timerID);
}
place++;
if (place == images.length) {
    place = 0;
}
blendimage('blenddiv','blendimage', images[place],800);
if (timerID = 0) {
timerID = setTimeout("UpdateTimer()",5000);
}
}

function chg(img, src) {
    img.src = src
}

function starttimer() {

timerID = setTimeout("UpdateTimer()", 5000);
}

function chgpaul() {
    var pl = document.getElementById("paul");
    var ran_number=Math.floor(Math.random()*5);
    ran_number++;
    pl.src = "images/Webinar" + ran_number + ".jpg"
}




// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header
// NS4-6,IE4-6
// Fade effect only in IE; degrades gracefully

// =======================================
// set the following variables
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000

// Duration of crossfade (seconds)
var crossFadeDuration = 3

// Specify the image files
var Pic = new Array() // don't touch this
// to add more images, just continue
// the pattern, adding to the array below


//Pic[0] = 'images/img1.jpg';
//Pic[1] = 'images/img2.jpg';
//Pic[2] = 'images/img3.jpg';
//Pic[3] = 'images/img4.jpg';

Pic[0] = 'images/2009_homepage_products9191+copy2.jpg';
Pic[1] = 'images/2009_homepage_threeimages8989.jpg';
Pic[2] = 'images/2009_homepage_barcode9026+copy.jpg';
Pic[3] = 'images/2009_homepage_3RFimages9135.jpg';

// =======================================
// do not edit anything below this line
// =======================================

var t
var j = 0
var p = Pic.length

var preLoad = new Array()
for (i = 0; i < p; i++){
   preLoad[i] = new Image()
   preLoad[i].src = Pic[i]
}

function runSlideShow(){
   if (document.all){
      document.images.SlideShow.style.filter="blendTrans(duration=2)"
      document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShow.filters.blendTrans.Apply()      
   }
   document.images.SlideShow.src = preLoad[j].src
   if (document.all){
      document.images.SlideShow.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow()', slideShowSpeed)
}

