function fixpnslinks(lnk1,lnk2)
{
     var searchString = document.location.search;
     pnsLinks = new Array(lnk1,lnk2);
     
     for (x in pnsLinks)
     {
         newLink = document.getElementById(pnsLinks[x]).getAttribute('href') + searchString;
         document.getElementById(pnsLinks[x]).setAttribute('href',newLink);
     }
    //alert(searchString);
    

}
function hlSelection(theSelection)
{
    if (document.getElementById('callOut'))
    {
        document.body.removeChild(document.getElementById('callOut'));
    }
    nextSec = Number(theSelection) + 1;
    endDoc = Number(nextSec) + 1;
    //alert(nextSec);
    theWidth = '100';
    var newdiv = document.createElement('div');
    newdiv.setAttribute('id','callOut');
    newdiv.style.width = theWidth + 'px';
    newdiv.style.height = "100px";
    newdiv.style.position = "absolute";
    document.body.appendChild(newdiv);
    theAnchor = getAnchorPosition("example0" + theSelection);
    theAnchorEnd = getAnchorPosition("example0" + nextSec);
    theHeight = theAnchorEnd.y - theAnchor.y - 27 - 15 - 15;
    if (document.getElementById("example0" + endDoc) == null)
    {
        theHeight = Number(theHeight) + 50;
    }
    newdiv.style.top = theAnchor.y - 27 - 15 + 'px';
    newdiv.style.left = (theAnchor.x - theWidth - 5 - 15) + 'px';
    //newdiv.style.height = document.getElementById('example01').offsetHeight + 'px';
    newdiv.style.height = theHeight + 'px';
    arrangeElements(newdiv.offsetHeight + 27 + 15 + 15, theWidth);
    //document.getElementById(theSelection).style.border = 'solid';
    //document.getElementById(theSelection).style.borderThickness = '1px';
    setTimeout("clearCallOut('callOut')",2000);
}

function arrangeElements(theHeight, theWidth)
{
    
    baseSize1 = Math.floor((theHeight-40)/2);
    if ( (baseSize1*2 + 40) < theHeight)
    {
        baseSize2 = baseSize1 + 1;
    }else{
        baseSize2 = baseSize1;
    }
    baseDiv = document.getElementById('callOut');
    var newdiv = document.createElement('div');
    newdiv.style.width = theWidth + 'px';
    newdiv.style.height = '10px';
    newdiv.style.position = "relative";
    newdiv.style.backgroundImage = "url('skins/Skin_1/images/upperArm.jpg')";
    newdiv.style.fontSize = "0px";
    baseDiv.appendChild(newdiv);
    
    var newdiv = document.createElement('div');
    newdiv.style.width = theWidth + 'px';
    newdiv.style.height = baseSize1 + 'px';
    newdiv.style.position = "relative";
    newdiv.style.backgroundImage = "url('skins/Skin_1/images/midBar.jpg')";
    baseDiv.appendChild(newdiv);
    
    baseDiv = document.getElementById('callOut');
    var newdiv = document.createElement('div');
    newdiv.style.width = theWidth + 'px';
    newdiv.style.height = '20px';
    newdiv.style.position = "relative";
    newdiv.style.backgroundImage = "url('skins/Skin_1/images/midPoint.jpg')";
    baseDiv.appendChild(newdiv);
    
    var newdiv = document.createElement('div');
    newdiv.style.width = theWidth + 'px';
    newdiv.style.height = baseSize2 + 'px';
    newdiv.style.position = "relative";
    newdiv.style.backgroundImage = "url('skins/Skin_1/images/midBar.jpg')";
    baseDiv.appendChild(newdiv);
    
     var newdiv = document.createElement('div');
    newdiv.style.width = theWidth + 'px';
    newdiv.style.height = '10px';
    newdiv.style.position = "relative";
    newdiv.style.fontSize = "0px";
    newdiv.style.backgroundImage = "url('skins/Skin_1/images/lowerArm.jpg')";
    baseDiv.appendChild(newdiv);
}
function clearCallOut(theDiv)
{
    document.body.removeChild(document.getElementById(theDiv));
}
function hlEnt(theEnt,lnkID)
{
    if (document.getElementById(theEnt).style.textDecoration != 'underline' )
    {
        document.getElementById(theEnt).style.textDecoration='underline';
        document.getElementById(lnkID).style.cursor='pointer';
    }else{
        document.getElementById(theEnt).style.textDecoration='';
        document.getElementById(lnkID).style.cursor='default';
    }
}



function opacity(id, opacStart, opacEnd, millisec, gfxID, displayTime, doRepeat, repeatID, currentGfxID, byPass) {
    //speed for each frame
    
    var speed = Math.round(millisec / 100);
    var timer = 0;
    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
    
        if ( repeatID == Number(document.getElementById('lastRepeatID').value) )
            {
            if (document.getElementById('currentProdImg'))
            {
                checkLinks(1,document.getElementById('currentProdImg').value);
            }
            //disableLinks();
            document.getElementById('gfxTrans').value = '45';
            for(i = opacStart; i >= opacEnd; i--) {
                setTimeout("changeOpac(" + i + ",'" + id + "'," + "'" + gfxID +"'," + opacStart + "," + opacEnd + "," + millisec + "," + displayTime + "," + doRepeat + "," + repeatID + "," + currentGfxID + "," + byPass +")",(timer * speed));
                timer++;
            }
        }
        

    } else if(opacStart < opacEnd) {
        //disableLinks();

        document.getElementById('gfxTrans').value = '45';

        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "'," + "'" + gfxID +"'," + opacStart + "," + opacEnd + "," + millisec + "," + displayTime + "," + doRepeat + "," + repeatID + "," + currentGfxID + "," + byPass + ")",(timer * speed));
            timer++;
        }
        
    }
}

//change the opacity for different browsers
function changeOpac(opacity, id, gfxID, startFade, endFade, fadeTime, displayTime, doRepeat, repeatID, currentGfxID, byPass) {

    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
    if (opacity == 0 && doRepeat == 1)
    {
         //alert(document.getElementById('lastRepeatID').value +", " + repeatID);
         disableBannerLinks();
         getNextGfx(gfxID, startFade, endFade, fadeTime, displayTime, repeatID, currentGfxID, byPass);
    }
    if (opacity == 100 && doRepeat == 2)
    {
        
        if ( location.href.indexOf("p-") == -1 )
        {

            if (document.getElementById('currentID').value != 1)
            {
                enableBannerLinks();
            }
        }else{
            
            enableBannerLinks();

        }
        if (document.getElementById('currentProdImg'))
        {
            checkLinks(2,document.getElementById('currentProdImg').value);
        }
        document.getElementById('gfxTrans').value = '0';
        if (document.getElementById('nextProdImg'))
        {
            document.getElementById('nextProdImg').value = "none";
        }
        setTimeout("opacity('" + id + "'," + 100 + "," + 0 + "," + fadeTime + "," + gfxID + "," + displayTime + "," + 1 + "," + repeatID + "," + currentGfxID + ")",displayTime);
    }
}
function hoverLink(eleId,newSrc)
{
    document[eleId].src = 'skins/Skin_1/images/' + newSrc + ".jpg";

}
function pointOn(eleId)
{
    document.getElementById(eleId).style.cursor = 'pointer';
}
function pointOff(eleId)
{
    document.getElementById(eleId).style.cursor = '';
}

function pointerOn(eleId)
{
    document.getElementById(eleId).style.cursor = 'pointer';
    document.getElementById(eleId).style.backgroundPosition = '0px';
}
function pointerOff(eleId)
{
    document.getElementById(eleId).style.backgroundPosition = '-16px';
    document.getElementById(eleId).style.cursor = '';
    
}


function cycleGfx(callerID)
{
    
    if (document.getElementById('gfxTrans').value != '45')
    {

    defaultVals = swfDefaults();
    
    displayTime = defaultVals[0];
    fadeTime = defaultVals[1];
    totalGfx = defaultVals[2];
    byPass = 45;
    
    if (document.getElementById('gfxClickRight'))
    {
        if ( callerID == 0)
        {
            if ( Number(document.getElementById('currentID').value) > 1 )
            {
                theCurrentID = Number(document.getElementById('currentID').value) - 1;
            }else{
                theCurrentID = totalGfx;
            }
        }else{
           if ( Number(document.getElementById('currentID').value) < 4 )
            {
                theCurrentID = Number(document.getElementById('currentID').value) + 1;
            }else{
                theCurrentID = 1;
            }
        }
    }else{
    
        theCurrentID = callerID;
        checkLinks(3,callerID);
    }
    document.getElementById('currentID').value = theCurrentID;
    if ( Number(document.getElementById('lastRepeatID').value) < 100 )
    {

        repeatID = Number(document.getElementById('lastRepeatID').value) + 1;
    }else{

        repeatID = 1;
    }

    document.getElementById('lastRepeatID').value = repeatID;
    opacity('bannerGfx', 100, 0, fadeTime, theCurrentID, displayTime, 1, repeatID, theCurrentID, byPass);
    }
    
    
}
function bannerLink()
{
    if (document.getElementById('currentBannerLocal').value == 'wirestrapCat')
    {
        bannerLinks = new Array('p-23-wirestrap-professional.aspx','p-22-wirestrap.aspx','p-22-wirestrap.aspx');
    }else{
        bannerLinks = new Array('p-25-garment-grips.aspx','p-23-wirestrap-professional.aspx','p-26-affix-it-strips.aspx');
    }
    currentBanner = document.getElementById('currentID').value;
    if (currentBanner > 1)
    {
        window.location = bannerLinks[Number(currentBanner - 2)];
    }
    
}
function bannerList()
{
    bannerId = new Array('gfxClickRight','gfxClickLeft','gfxClickMid');
    return bannerId;
}
function disableBannerLinks()
{
    if (document.getElementById('theBannerLink'))
    {
        document.getElementById('theBannerLink').removeAttribute('href');
    }
    if (document.getElementById('gfxClickRight'))
    {
    bannerId = bannerList()
    for (x in bannerId)
    {
        document.getElementById(bannerId[x]).removeAttribute('href');
    }
    }
}
function enableBannerLinks()
{
    if (document.getElementById('theBannerLink'))
    {
        document.getElementById('theBannerLink').setAttribute('href', "javascript:bannerLink()");
    }
    if (document.getElementById('gfxClickRight'))
    {
    bannerId = bannerList()
    for (x in bannerId)
    {
        document.getElementById(bannerId[x]).setAttribute('href', "javascript:bannerLink()");
    }
    }
}
function hideStat()
{
    self.status='';
    return true;
}


/*  Buy now hover buttons.... */

function buyNowGlobals()
{
    theGlobals = new Array(50,2);
    return theGlobals;
}
function buyNowInit(theId,theType)
{
    
    if (ieCheck() != 1)
    {
        //thePlaceHolder = document.getElementById(theId + "PlaceHolder").value;
        theGlobals = buyNowGlobals();
        if (theType == 1)
        {
            startPoint = 2;
        }else{
        
            startPoint = Number(theGlobals[1]) - 1;

        }
        setTimeout("inflateBuyNow('" + theId + "'," + theGlobals[0] + "," + theGlobals[1] + "," + startPoint + "," + theType + ")", 0);
    }
}
function inflateBuyNow(theId,waitTime,maxIterations,theStage, theType)
{
   
     //<SPAN id=buyNow01 title="" style="DISPLAY: inline-block; FILTER: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://devel.wirestrap.com/skins/skin_1/images/orderNow01Trans.png', sizingMethod='scale'); WIDTH: 133px; HEIGHT: 24px"></SPAN>
    if (Number(theStage) < 10)
    {
        theGfxNum = "0" + theStage;
    }else{
        theGfxNum = theStage;
    }
    document[theId].src="skins/Skin_1/images/orderNow" + theGfxNum + "Trans.png";
    if (theType == 1)
    {
       if( theStage < maxIterations )
       {
        //alert('theType');
        theStage = Number(theStage) + 1;
        setTimeout("inflateBuyNow('" + theId + "'," + waitTime + "," + maxIterations + "," + theStage + "," + theType + ")", waitTime);
       }
    }else{
       if(theStage > 1)
       {
           theStage = Number(theStage) - 1;
        setTimeout("inflateBuyNow('" + theId + "'," + waitTime + "," + maxIterations + "," + theStage + "," + theType + ")", waitTime);
       }
    }
    
    /*if (theType == 1 && theStage < maxIterations)
    {
        theStage = Number(theStage) + 1;
        setTimeout("inflateBuyNow('" + theId + "'," + waitTime + "," + maxIterations + "," + theStage + "," + theType + ")", waitTime);
    }
     else if (theType == 2 && theStage > 0)
    {
        theStage = Number(theStage) - 1;
        setTimeout("inflateBuyNow('" + theId + "'," + waitTime + "," + maxIterations + "," + theStage + "," + theType + ")", waitTime);
    }*/

}
function ieCheck()
{
    isOldIE = 0;
    var theBrowser=navigator.appVersion.toLowerCase();
    if ( theBrowser.indexOf('msie') != -1 )
    {
        tmpVar = theBrowser.split('msie');
        tmpVar1 = tmpVar[1].split(';');
        theVersion = tmpVar1[0].split('.');
        if ( theVersion[0] < 7 )
        {
            isOldIE = 1;
            //alert(theVersion[0]);
        }
    }
    return isOldIE;
}

/*  ------------------------  */

/*  Cat Image Functions... */


function catOver(theId)
{
    alert(theId);
}

/*  ---------------------  */

function updatePrice(priceList,theIndex,theList,theDestination,productName)
{
    imgPos = new Array('0','-192','-384','-576','-768','-960');
    document.getElementById('productPicture').style.backgroundPosition=imgPos[theIndex]+'px';
    var productPrice;
    fullList = priceList.split("&nbsp;");
    theList1=fullList[document.getElementById(theList).selectedIndex].split("</span>");
    theList2=theList1[0].split("$");
    productPrice = theList2[1];
    document.getElementById(theDestination).innerHTML = "$" + productPrice;
}
function moPlink(theID,theAction)
{
    
    var currentID = document.getElementById('currentProdImg').value;
    var clickID = document.getElementById('nextProdImg').value;
    if (currentID != theID && clickID != theID)
    {
        if (theAction == 1)
        {
            
            document.getElementById(theID).style.backgroundPosition = '-17px';
        }else if (theAction == 2)
        {
            document.getElementById(theID).style.backgroundPosition = '0px';
        }else if (theAction == 3)
        {
            document.getElementById(theID).style.backgroundPosition = '-34px';
        }
    }
}
function checkLinks(theMode,theID)
{
    strID = theID.split("pView");
    //alert(strID[1]);
    if (theMode == 1)
    {
        //alert('test');
        document.getElementById(theID).setAttribute('href',"javascript:cycleGfx('" + strID[1] + "')");
        document.getElementById(theID).style.backgroundPosition = "0px";
    }else if (theMode == 2)
    {
       //alert('fade-in');
       document.getElementById(theID).removeAttribute('href');
       document.getElementById(theID).style.backgroundPosition = "-17px";
    }else{
        document.getElementById('nextProdImg').value = "pView" + theID;
        document.getElementById("pView" + theID).removeAttribute('href');
        document.getElementById("pView" + theID).style.backgroundPosition = "-17px";
    }
}
function productLnk(theID, theMode)
{
    if (theMode == 1)
    {
        document.getElementById(theID + 'Txt').style.color = "#4776BD";
        document.getElementById(theID + 'Img').style.backgroundPosition = "-16px";
    }else{
        document.getElementById(theID + 'Txt').style.color = "#000000";
        document.getElementById(theID + 'Img').style.backgroundPosition = "0px";
    }
}
function appLnk(theID, theMode)
{
    if (theMode == 1)
    {
        document.getElementById(theID + 'Txt').style.color = "#4776BD";
        document.getElementById(theID + 'Txt').style.textDecoration = "underline";
        document.getElementById(theID).style.backgroundColor = "#4776BD";
        document.getElementById(theID).style.cursor = "pointer";
    }else{
        document.getElementById(theID + 'Txt').style.color = "#000000";
        document.getElementById(theID + 'Txt').style.textDecoration = "none";
        document.getElementById(theID).style.backgroundColor = "gray";
        document.getElementById(theID).style.cursor = "none";
    }
}
function checkAnchor(theID)
{
    if (theID=="PrivacyPolicy")
    {
        window.location.hash='privacy';
    }
    else if (theID=='TermsofUse')
    {
        window.location.hash='tou';
    }

}
function noFlash()
{
    var alternateContent = '<span style="font-size:13px"><BR><BR><BR> OOPS!<BR>'
	+ 'This content requires the Adobe Flash Player. '
	+ '<a href=http://www.adobe.com/go/getflash/>Get Flash</a></span>';
    return alternateContent;
}
function hasFlash()
{
    var flashContent = '<object width="220" height="190"><param name="movie" value="http://www.youtube.com/v/VJZne4c08OE&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/VJZne4c08OE&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="220" height="190"></embed></object>'
    return flashContent;
}
function hvrLink(theID,theDisp)
{

    if(theDisp=='2')
    {
        //document.getElementById(theID).style.textDecoration = "underline";
        document.getElementById(theID).style.color = "#166B41";
        document.getElementById(theID + "Btn").style.backgroundPosition = "-140px";
        
    }else if(theDisp=='1'){
        //document.getElementById(theID).style.textDecoration = "none";
        document.getElementById(theID).style.color = "#000000";
        document.getElementById(theID + "Btn").style.backgroundPosition = "0px";
    }else if(theDisp=='3'){
        document.getElementById(theID + "Btn").style.backgroundPosition = "-280px";
    }else if(theDisp=='4'){
        document.getElementById(theID + "Btn").style.backgroundPosition = "-0px";
        document.getElementById(theID).style.color = "#000000";
    }
}



function minmLink(theID,theDisp)
{
    if(theDisp=='2')
    {
        document.getElementById(theID + "Btn").style.backgroundPosition = "-145px";
    }else if(theDisp=='1'){
        document.getElementById(theID + "Btn").style.backgroundPosition = "0px";
    }else if(theDisp=='3'){
        document.getElementById(theID + "Btn").style.backgroundPosition = "-290px";
    }else if(theDisp=='4'){
        document.getElementById(theID + "Btn").style.backgroundPosition = "-0px";
    }
}



function getPrice(thePrice,theID)
{
    rawPrice = thePrice.split(">");
    thePrice=rawPrice[1]
    rawPrice=thePrice.split("<");
    //document.write(rawPrice[0]);
    document.getElementById(theID).innerHTML = "<span style='font-size:18px;color:#A60000;font-weight:bold'>" + rawPrice[0]; + "</span>";
    //document.getElementById(theID).innerHTML="TEST"
}

function boldMenu(theItem,clearOld)
{
    linkIDs = new Array('productLink22','productLink23','productLink25','productLink26','catLink13');
    if (document.getElementById(theItem))
    {
        document.getElementById(theItem).style.fontWeight = 'bold';
        document.getElementById(theItem).style.textDecoration = 'none';
       // document.getElementById(theItem).removeAttribute('href');
    }
    if (clearOld == 2)
    {
        for (x in linkIDs)
        {
            if (document.getElementById(linkIDs[x]) && theItem != linkIDs[x])
            {
                document.getElementById(linkIDs[x]).style.fontWeight = 'normal';
                document.getElementById(linkIDs[x]).style.textDecoration = 'underline';
            }
        }
    }else{
        document.getElementById(theItem).removeAttribute('href');
    }
}

function clickThrough(theID){
    var api = $("div.scrollable").scrollable({api: true});
    //api.next();
    //alert(api.getSize());
    //alert(api.getIndex());
    if (theID == 'lnkUp')
    {
        if(api.getIndex() == 0)
        {
            lastPos = (api.getSize() - 1);
            api.seekTo(lastPos);
        }else{
            api.prev();
        }
    }else{
        lastPos = (api.getSize() - 1);
        if ( api.getIndex() == lastPos)
        {
            api.seekTo(0);
        }else{
            api.next();
        }
    }
}
function naviMouseOver(theID,lnkID,thePos,theCursor)
{
    document.getElementById(lnkID).style.cursor=theCursor;
    document.getElementById(theID).style.backgroundPosition = '0' + ' ' + thePos + 'px';
}
function naviClick(theID,thePos)
{
    document.getElementById(theID).style.backgroundPosition = '0' + ' ' + thePos + 'px';
}
function hlProduct(id, width, height, left, top, popleft, poptop, poptext, lines, side) {
    theElements = new Array('a1hl','a2hl','a3hl','a4hl','a5hl','a6hl','a7hl','a8hl','a9hl','a10hl','a11hl','a12hl','a13hl','a14hl','a15hl');
    for (x in theElements)
    {
        if (document.getElementById(theElements[x]))
        {
            removeHl(theElements[x]);
        }
    }
    isOldIE = 0;
    var theBrowser=navigator.appVersion.toLowerCase();
    if ( theBrowser.indexOf('msie') != -1 )
    {
        tmpVar = theBrowser.split('msie');
        tmpVar1 = tmpVar[1].split(';');
        theVersion = tmpVar1[0].split('.');
            
        if ( theVersion[0] < 7 )
        {
            isOldIE = 1;
            //alert(theVersion[0]);
        }
    }
    //alert(id);
    popwidth = '145px';
    popheight = '64px';
    txtwidth = '105px';

    if (lines == 2)
    {
        txtheight='34px';
        txtTop='17px';
        txtAlign='left';
    }else{
        txtheight='19px';
        txtTop='23px';
        txtAlign='center';
    }
    var newdiv = document.createElement('div');
    var newpop = document.createElement('div');
    newdiv.setAttribute('id', id);
    newpop.setAttribute('id', id + 'pop');
    if (width) {
        //alert('width');
        newdiv.style.width = width;
    }
    if (height) {
        newdiv.style.height = height;
    }
    newpop.style.height = popheight;
    newpop.style.width = popwidth;
    
    newdiv.style.marginTop = top;
    newdiv.style.marginLeft = left;
    newpop.style.marginTop = poptop;
    newpop.style.marginLeft = popleft;
    //newdiv.style.background = 'blue';
    newdiv.style.border = "none";
    //if ( isOldIE == 1 )
    //document.getElementById(theDiv).innerHTML = "<span style=\"width:270px;height:185px;display:inline-block;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/products/" + theAnch + "Pop.png');\"><img style=\"filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);\" src=\"img/products/" + theAnch + "Pop.png\" width=\"270\" height=\"185\" border=\"0\" alt=\"\"></span>";
    if ( isOldIE == 1)
    {
        newdiv.innerHTML = "<span style=\"width:" + popwidth + ";height:" + popheight + ";display:inline-block;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/" + id + ".png');\"><img style=\"filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);\" src=\"img/" + id + ".png\" border=\"0\" alt=\"\"></span>";   
    }else{
        newdiv.innerHTML = "<img src='img/" + id + ".png' />";
    }
    
    
    if ( isOldIE == 1 )
    {
        newpop.innerHTML = "<div style='width:" + popwidth +";height:" + popheight + ";position:absolute'><span style=\"width:" + popwidth + ";height:" + popheight + ";display:inline-block;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='img/popup" + side + ".png');\"><img style=\"filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);\" src=\"img/popup" + side + ".png\" border=\"0\" alt=\"\"></span></div><div style='width:" + txtwidth +";height:" + txtheight + ";position:absolute;font-size:12px;margin-left:17px;margin-top:"+ txtTop + ";text-align:"+ txtAlign +"'>" + poptext + "</div>";
    }else{
        newpop.innerHTML = "<div style='width:" + popwidth +";height:" + popheight + ";position:absolute'><img src='img/popup" + side + ".png' /></div><div style='width:" + txtwidth +";height:" + txtheight + ";position:absolute;font-size:12px;margin-left:17px;margin-top:"+ txtTop + ";text-align:"+ txtAlign +"'>" + poptext + "</div>";
    }
    
    //newdiv.style.display = 'none';
    //newpop.style.display = 'none';
    document.getElementById('productImage').appendChild(newdiv);
    document.getElementById('productPop').appendChild(newpop);
    
    //initElements = new Array(id,id + 'pop');
    //for (x in initElements)
    //{
    //    alert(initElements[x]);
    //    changeOpac(0,initElements[x]);
    //    document.getElementById(initElements[x]).style.display = 'block';
    //    opacity(initElements[x], 0, 100, 160, 1, 1000, 0, 0, 0);
    //}
}
function removeHl(theID)
{
    //alert(theID);
    theElements = new Array('a1hl','a2hl','a3hl','a4hl','a5hl','a6hl','a7hl','a8hl','a9hl','a10hl','a11hl','a12hl','a13hl','a14hl','a15hl');
    
    var d = document.getElementById('productImage');
    var d2 = document.getElementById('productPop');
    if (document.getElementById(theID))
    {
        var olddiv = document.getElementById(theID);
        var oldpop = document.getElementById(theID + 'pop');
    }else{
        for (x in theElements)
        {
            if (document.getElementById(theElements[x]))
            {
                theID = theElements[x];
                var olddiv = document.getElementById(theID);
                var oldpop = document.getElementById(theID + 'pop');
            }
        }
    }
    d.removeChild(olddiv);
    d2.removeChild(oldpop);
}
function tsMouseOver(theID){
    document.getElementById(theID).style.cursor='pointer';
    theWidth = document.getElementById(theID).offsetWidth + 'px';
    document.getElementById(theID).style.backgroundPosition = "-" + theWidth;
}
function tsMouseOut(theID){
    document.getElementById(theID).style.backgroundPosition = "0px";
}
function tsMouseClick(theID){
    theWidth = document.getElementById(theID).offsetWidth;
    theWidth = (theWidth * 2);
    document.getElementById(theID).style.backgroundPosition = "-" + theWidth + 'px';
    
}
function checkIE(){
    var isOldIE = 0;
    var theBrowser=navigator.appVersion.toLowerCase();
    if ( theBrowser.indexOf('msie') != -1 ){
        tmpVar = theBrowser.split('msie');
        tmpVar1 = tmpVar[1].split(';');
        theVersion = tmpVar1[0].split('.');
        if ( theVersion[0] < 7 ){
            isOldIE = 1;
        }
    }
    return isOldIE;
}
function fixIE6(theIMG, theWidth, theHeight, theSizing){
    var sizingMethod = 'scale';
    var newImg = new Image();
    newImg.src = theIMG;
    if (theSizing){
        sizingMethod = theSizing;
    }
    if (theWidth){
        var width=theWidth;
        var height=theHeight;
    }else{
        var height = newImg.height;
        var width = newImg.width;
    }
    var innerCode = "<span style=" + '"' + "width:"+ width + "px;height:" + height +"px;display:inline-block;border:none;font-size:0px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + theIMG + "',sizingMethod='"+sizingMethod+"');" + '"' + "></span>";
    return innerCode;
        
}
function contactUsBoxLinkIn(){
    document.getElementById('contactUsBox').style.color='#50712B';
    document.getElementById('contactUsBoxContainer').style.cursor='pointer';
}
function contactUsBoxLinkOut(){
    document.getElementById('contactUsBox').style.color='#000000';
    document.getElementById('contactUsBoxContainer').style.cursor='none';
}
