// first=true; to open first box on load, first=false; to have them all closed
var first = false;
// height of the faq item when closed
var rowHeight = 75;

var colHeight = 0; var ocolHeight = 0; var boxHeight = 0; var curHeight = 0; var ocurHeight = 0; var obj; var objo; var oid = -1; var oacc = 0; var timer; var timer2; var cid; var cacc; var allclosed = true; var imBusy = false;
// functions that deal with opening a box
function openbox(acc, id, img) {
    
    id = ($(img).parent().prevAll(".faqli").length) - 1;
    if (imBusy == false) {
        imBusy = true;
        obj = myFaqs[acc].faqAmount[id];
        boxHeight = obj.faqItem[0];
        colHeight = obj.qHeight[0];
        curHeight = colHeight;
        cid = id;
        if (oacc != acc) { oacc = acc; closeOld(acc, id); }
        if (id != oid && allclosed == false) { closeBox(acc, oid); } else { imBusy = false; }
        if ((obj.offsetHeight - 1) <= rowHeight) {
            allclosed = false;
            //obj.ansHide[0].style.display='block';
            //obj.className += " faqlion";
            openAni();
        }
        else { allclosed = true; objo = obj; ocolHeight = colHeight; closeBox(acc, oid); }
    }
}
function openAni() { timer = setInterval("moveDown();", 5); }
function moveDown() {
    if (curHeight < boxHeight) { curHeight = curHeight + 10; obj.style.height = curHeight + "px"; }
    else { clearInterval(timer); obj.style.height = boxHeight + "px"; oid = cid; }
}
function closeOld(acc, id) {
    var faqlength = myFaqs[acc].faqAmount.length
    for (i = 0; i < faqlength; i++) {
        if (myFaqs[acc].faqAmount[i].ansHide[0].style.display == 'block') { oid = i; closeBox(acc, oid); }
    }

}
// functions that deal with closing a box
function closeBox(acc, oid) {
    objo = myFaqs[acc].faqAmount[oid];
    ocolHeight = objo.qHeight[0];
    ocurHeight = objo.faqItem[0];
    //objo.ansHide[0].style.display='none'; 
    //objo.className=objo.className.replace(new RegExp(" faqlion\\b"), "");
    closeAni();
}
function closeAni() { timer2 = setInterval("moveUp();", 5); }
function moveUp() {
    if (ocurHeight > ocolHeight) { ocurHeight = ocurHeight - 10; objo.style.height = ocurHeight + "px"; }
    else { clearInterval(timer2); objo.style.height = ocolHeight + "px"; imBusy = false; }
}
// get heights for each box both open(=faqItem) and closed(=qHeight), close all boxes and if required, open the first (var first=true;) or any specific box using #[number] in the url
var myFaqs = new Array(); var faqItem = new Array(); var qHeight = new Array(); var faqAmount; var ansAmount; var ansHide = new Array();
function boAccordion() {
    var myBlocks = new Array();
    myBlocks = document.getElementsByTagName("ul");
    var stopit = myBlocks.length;
    for (var i = 0; i < stopit; i++) {
        if (myBlocks[i].className == "faqContainer") {
            myFaqs.push(myBlocks[i]);
        }
    }
    var stopit2 = myFaqs.length;
    //alert(stopit2);
    for (var i = 0; i < stopit2; i++) {
        myFaqs[i].myFaqBlocks = myFaqs[i].getElementsByTagName("li");
        var stopit3 = myFaqs[i].myFaqBlocks.length;
        myFaqs[i].faqAmount = new Array();
        for (var h = 0; h < stopit3; h++) {
            if (myFaqs[i].myFaqBlocks[h].className == "faqli") {
                myFaqs[i].faqAmount.push(myFaqs[i].myFaqBlocks[h]);
            }
        }
        myFaqs[i].ansAmount = myFaqs[i].getElementsByTagName("blockquote");
        var stopit4 = myFaqs[i].faqAmount.length;
        for (var j = 0; j < stopit4; j++) {
            myFaqs[i].faqAmount[j].faqItem = new Array();
            myFaqs[i].faqAmount[j].ansHide = new Array();
            myFaqs[i].faqAmount[j].qHeight = new Array();
            myFaqs[i].faqAmount[j].faqItem.push(myFaqs[i].faqAmount[j].offsetHeight);
            myFaqs[i].faqAmount[j].ansHide.push(myFaqs[i].ansAmount[j]);
            myFaqs[i].faqAmount[j].qHeight.push(rowHeight);
            //myFaqs[i].faqAmount[j].ansHide[0].style.display='none'; 			
            myFaqs[i].faqAmount[j].style.height = myFaqs[i].faqAmount[j].qHeight[0] + "px";
        }
        myFaqBlocks = null;
    }
    myBlocks = null;
    // Close all tabs, now all accordions have loaded
    hideTabs();
}

// footer animation
var timerFoot; var timerFoot2; var footer; var curMargin = -30;
function toggleFooter() {
    footer = document.getElementById('footercontent');
    document.getElementById('footbut').onclick = function() { document.getElementById('blurme').focus(); }
    footer.onmouseover = function() { clearInterval(timerFoot2); timerFoot = setInterval("showFooter();", 5); }
    footer.onmouseout = function() { clearInterval(timerFoot); timerFoot2 = setInterval("hideFooter();", 5); }
}
function showFooter() {
    if (curMargin > -160) {
        curMargin = curMargin - 15;
        footer.style.marginTop = curMargin + 'px';
        footer.style.height = -curMargin + 'px';
    } else { clearInterval(timerFoot); footer.style.marginTop = '-160px'; footer.style.height = '160px'; curMargin = -160; }
}
function hideFooter() {
    if (curMargin < -30) {
        curMargin = curMargin + 15;
        footer.style.marginTop = curMargin + 'px';
        footer.style.height = -curMargin + 'px';
    } else { clearInterval(timerFoot2); footer.style.marginTop = '-30px'; footer.style.height = '30px'; curMargin = -30; }
}

// main menu drop down
var dropstop = 140;
var timerNav; var timerNav2; var navitems; var curHght = 0; var subnav; var subnav2;
function toggleSubmenu() {
    navitems = document.getElementById('navitems');
    subnav = document.getElementById('subnav');
    subnav2 = document.getElementById('subnav2');
    var sfEls = navitems.getElementsByTagName("li");
    var sfElsLength = sfEls.length;
    for (var i = 0; i < sfElsLength; i++) {
        if (sfEls[i].className == "Level1 Dropdown") {
            sfEls[i].droplist = sfEls[i].getElementsByTagName("ul");
            sfEls[i].droplist[0].id = 'drop' + i;
            sfEls[i].onmouseover = function() { clearInterval(timerNav2); subnav.style.display = 'block'; subnav2.style.display = 'block'; timerNav = setInterval("showSubnav();", 5); document.getElementById(this.droplist[0].id).style.display = 'block'; }
            sfEls[i].onmouseout = function() { clearInterval(timerNav); timerNav2 = setInterval("hideSubnav();", 5); document.getElementById(this.droplist[0].id).style.display = 'none'; }
        }
    }
    //subnav2.onmouseout = function() { clearInterval(timerNav);timerNav2=setInterval("hideSubnav();",5); }
}
function showSubnav() {
    if (curHght < dropstop) {
        curHght = curHght + 20;
        subnav.style.height = curHght + 'px';
        subnav2.style.height = curHght + 'px';
    } else { clearInterval(timerNav); subnav.style.height = dropstop + 'px'; subnav2.style.height = dropstop + 'px'; curHght = dropstop; }
}
function hideSubnav() {
    if (curHght > 0) {
        curHght = curHght - 20;
        subnav.style.height = curHght + 'px';
        subnav2.style.height = curHght + 'px';
    } else { clearInterval(timerNav2); subnav.style.height = '0px'; subnav2.style.height = '0px'; curHght = 0; subnav.style.display = 'none'; subnav2.style.display = 'none'; }
}

// lightview style pop up
var pid;
function hidePop() { document.getElementById('bopop').style.visibility = 'hidden'; document.getElementById('popinfo').style.display = 'none'; ie6Form('visible'); }
function showPop(nid) {
    if (document.getElementById('bopop').style.visibility == 'visible') { hidePop(); }
    getPageSize();
    document.getElementById('fade').style.height = pageHeight;
    document.getElementById('popinfo').style.display = 'block';
    document.getElementById('bopop').style.visibility = 'visible';
    pid = nid;
    ie6Form('hidden');
}
var pageWidth, pageHeight;
function getPageSize() {
    var xScroll, yScroll;
    if (window.innerHeight && window.scrollMaxY) { xScroll = window.innerWidth + window.scrollMaxX; yScroll = window.innerHeight + window.scrollMaxY; }
    else if (document.body.scrollHeight > document.body.offsetHeight) { xScroll = document.body.scrollWidth; yScroll = document.body.scrollHeight; }
    else { xScroll = document.body.offsetWidth; yScroll = document.body.offsetHeight; }
    var windowWidth, windowHeight;
    if (self.innerHeight) {	// all except Explorer
        if (document.documentElement.clientWidth) { windowWidth = document.documentElement.clientWidth; }
        else { windowWidth = self.innerWidth; }
        windowHeight = self.innerHeight;
    }
    else if (document.documentElement && document.documentElement.clientHeight) { windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; }
    else if (document.body) { windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; }
    if (yScroll < windowHeight) { pageHeight = windowHeight; } else { pageHeight = yScroll; }
    if (xScroll < windowWidth) { pageWidth = xScroll; } else { pageWidth = windowWidth; }
    return [pageWidth, pageHeight];
}

function ie6Form(state) {
    if (document.all) {
        var version = /MSIE \d+.\d+/; var brwsr = navigator.appVersion.match(version);
        if (("" + brwsr).indexOf("6") > 0) {
            var frmInput = new Array(); frmInput = document.getElementsByTagName("input"); var stop1 = frmInput.length;
            for (var i = 0; i < stop1; i++) { frmInput[i].style.visibility = state; }
            var frmSelect = new Array(); frmSelect = document.getElementsByTagName("select"); var stop2 = frmSelect.length;
            for (var i = 0; i < stop2; i++) { frmSelect[i].style.visibility = state; }
            var frmTextarea = new Array(); frmTextarea = document.getElementsByTagName("textarea"); var stop3 = frmTextarea.length;
            for (var i = 0; i < stop3; i++) { frmTextarea[i].style.visibility = state; }
        }
    }
}
// ONLY USE THIS IF THE IFRAME CONTENT IS HOSTED ON THE SAME SERVER
moz = document.getElementById && !document.all;
mozHeightOffset = 20;

function resize_iframe() {
    document.getElementById("sizeframe").height = 100; // required for Moz bug, value can be "", null, or integer 
    document.getElementById('sizeframe').height = window.frames["sizeframe"].document.body.scrollHeight + (moz ? mozHeightOffset : 0);
}
// Tabs code
var obj = 0; var oid = 0; var otb = 0; var myTabs = new Array(); var myTabitems = new Array(); var myTabitem = new Array(); var myTabContent = new Array(); var myLists = new Array();
function showTabContent(tab) {
    tb = tab.obj; id = tab.nr;
    if (myTabs[tb].oid != -1) { myTabs[tb].myTabContent[myTabs[tb].oid].style.display = 'none'; myTabs[tb].myTabitem[myTabs[tb].oid].className -= " active"; }
    myTabs[tb].myTabContent[id].style.display = 'block'; myTabs[tb].myTabitem[id].className += " active"; myTabs[tb].oid = id;
}
function boTabs() {
    var myBlocks = new Array();
    myBlocks = document.getElementsByTagName("div");
    var stopit = myBlocks.length;
    for (var g = 0; g < stopit; g++) {
        if (myBlocks[g].className == "tabs") {
            myTabs.push(myBlocks[g]);
        }
    }
    var stopit2 = myTabs.length;
    for (var i = 0; i < stopit2; i++) {
        myTabs[i].myLists = myTabs[i].getElementsByTagName("ul");
        if (myTabs[i].myLists[0].className == "tabs clr") {
            myTabs[i].myTabitems = myTabs[i].myLists[0].getElementsByTagName("li");
        }
        var stopit3 = myTabs[i].myTabitems.length;
        myTabs[i].obj = i;
        myTabs[i].myTabitem = new Array();
        myTabs[i].myTabContent = new Array();
        for (var j = 0; j < stopit3; j++) {
            myTabs[i].myTabitem.push(myTabs[i].myTabitems[j]);
            myTabs[i].myTabitem[j].nr = j;
            myTabs[i].myTabitem[j].obj = i;
            myTabs[i].myTabitem[j].onclick = function() {
                showTabContent(this);
            };
        }
        var myTabDivs = myTabs[i].getElementsByTagName("div");
        var myTabDivsLength = myTabDivs.length;
        for (var j = 0; j < myTabDivsLength; j++) {
            if (myTabDivs[j].className == "tabcontent") {
                myTabs[i].myTabContent.push(myTabDivs[j]);
            }
        }
        myTabs[i].myTabitem[0].className += " active";
        //myTabs[i].myTabContent[0].style.display = 'block';
        myTabs[i].oid = 0;
        myTabDivs = null;
    }
    myBlocks = null;
    // Call Accordion function after making the tabs
    boAccordion();
}
function hideTabs() {
    var mtl = myTabs[0].myTabContent.length;
    for (i = 1; i <= mtl; i++) {
        myTabs[0].myTabContent[i].style.display = 'none';
    }
}
$(document).ready(function () {
    $(".wl").mouseenter(function (ev) {
        $("#tooltipmsg").css("top", (ev.pageY - 130)).css("left", (ev.pageX + 10));
    });
});
var popfirst = true;
// tool tip code
function showtip(e, message) {
    $("#tooltipmsg").html(message).show();   
}
function hidetip() { var m; m = document.getElementById('tooltipmsg'); m.style.display = "none"; }

// agenda pop up/tool tip
var waitforit;
function popProds(message) {
    clearTimeout(waitforit);
    var m = document.getElementById('tooltipagenda');
    m.innerHTML = myProdInfo[message].Content; m.style.display = "block";
    xb.addEvent(m, 'mouseleave', hideprod, false);
}
function showprod(e, message) {
    hideprod(); var x = 0; var y = 0; var m; var h; if (!e)
        var e = window.event; if (e.pageX || e.pageY) { x = e.pageX; y = e.pageY; }
    else if (e.clientX || e.clientY) { x = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; y = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; }
    m = document.getElementById('tooltipagenda'); m.style.top = y + 6 + "px";
    var messageHeigth = (message.length / 20) * 10 + 25; if ((e.clientY + messageHeigth) > 510) { m.style.top = y - messageHeigth + "px"; }
    var xp = document.getElementById('page').offsetWidth;
    if ((x + 266) < xp) { m.style.left = x + 6 + "px"; } else if ((x - 266) < 0) { m.style.left = 0 + "px"; } else { m.style.left = x - 266 + "px"; }
    waitforit = setTimeout('popProds(' + message + ')', 500);
}
function hideprod() { var m; m = document.getElementById('tooltipagenda'); m.style.display = "none"; }

// Month Selector

// items visible when scroller does not move
var nitemsshown = 14;
// width of each item within the scroller
var nmyitem = 80;
// choose step speed of carousel
var nstep = 2;
// next button image
var nnextImage = { FileName: 'images/month_next.gif', Width: 10, Height: 30 };
// previous button image
var nprevImage = { FileName: 'images/month_prev.gif', Width: 10, Height: 30 };

var nmyThumbs = new Array(); var nainnerDiv; var nanxt; var naprv;
var nmybox; var nmyleft; var ntheleft; var ntimer;
function boGetMonths() {
    if (myMonths.length > 0 && document.getElementById('nainner')) {
        nainnerDiv = document.getElementById('nainner');
        // set the next and previous buttons
        if (document.getElementById('nanxt')) {
            nanxt = document.getElementById('nanxt');
            var nxtImg = document.createElement("DIV");
            nxtImg.innerHTML = '<img onmouseover="nmoveOn();" onmouseout="clearInterval(ntimer);nshowButtons(ntheleft);" src="/images/spacer.gif" width="' + nprevImage.Width + '" height="' + nprevImage.Height + '" />'
            nanxt.appendChild(nxtImg);
        }
        if (document.getElementById('naprv')) {
            naprv = document.getElementById('naprv');
            var prvImg = document.createElement("DIV");
            prvImg.innerHTML = '<img onmouseover="nmoveBack();" onmouseout="clearInterval(ntimer);nshowButtons(ntheleft);" src="/images/spacer.gif" width="' + nprevImage.Width + '" height="' + nprevImage.Height + '" />'
            naprv.appendChild(prvImg);
        }
        // generate thumbnails
        var myMonthsLength = myMonths.length;
        for (var i = 0; i < myMonthsLength; i++) {
            var newDiv = document.createElement("DIV");
            newDiv.className += "mthumb";
            if (myMonths[i].Hasitems == 1) {
                newDiv.innerHTML = '<a href="' + myMonths[i].Url + '">' + myMonths[i].Month + '</a>';
            } else if (myMonths[i].Hasitems == 2) {
                newDiv.innerHTML = '<a href="' + myMonths[i].Url + '">' + myMonths[i].Month + '</a>';
                newDiv.className += " mact";
            } else if (myMonths[i].Hasitems == 0 && myMonths[i].Month > 0) {
                newDiv.innerHTML = '<div class="myear">' + myMonths[i].Month + '</div>';
            } else { newDiv.innerHTML = '<div class="nonact">' + myMonths[i].Month + '</div>'; }
            nainnerDiv.appendChild(newDiv);
            nmyThumbs.push(newDiv);
        }
        nmoveinplace();
    }
}
function nmoveinplace() {
    if (document.getElementById('nainner')) {
        
        document.getElementById('nainner').style.left = '0px';
        var i = nmyThumbs;
        nmybox = -(((i.length - 1) * nmyitem) - (nitemsshown * nmyitem));
        var actlft = 0;
        var il = i.length;
        
        for (x = 0; x < il; x++) {

            if (i[x].className == 'mthumb mact') { actlft = -((x - 1) * nmyitem); }
        }
        if (true || actlft > -(nmyitem * nitemsshown)) {
            document.getElementById('nainner').style.left = actlft + 'px';
        } else { document.getElementById('nainner').style.left = -(nmyitem * nitemsshown) + 'px'; }
        nmyleft = document.getElementById('nainner').style.left;
        ntheleft = parseInt(nmyleft);
        nshowButtons(ntheleft);
    }
}
// next button functionality
function nmoveOn() {
    //alert(ntheleft+','+nmybox);
    if (ntheleft >= nmybox + nmyitem) { ntimer = setInterval("nmoveLeft();", 5); }
}
function nmoveLeft() {
    if (ntheleft >= (nmybox - nmyitem)) { ntheleft = ntheleft - nstep; document.getElementById('nainner').style.left = (ntheleft + 'px'); }
    else { clearInterval(ntimer); nshowButtons(ntheleft); }
}
// previous button functionality
function nmoveBack() {
    if (ntheleft <= 0) { ntimer = setInterval("nmoveRight();", 5); }
}
function nmoveRight() {
    if (ntheleft <= 0) { ntheleft = ntheleft + nstep; document.getElementById('nainner').style.left = (ntheleft + 'px'); }
    else { clearInterval(ntimer); nshowButtons(ntheleft); }
}
// show buttons functionality
function nshowButtons(ntheleft) {
    if (nmybox > ntheleft) {
        nanxt.style.backgroundImage = 'url(/images/spacer.gif)';
        nanxt.style.cursor = 'default';
        naprv.style.backgroundImage = 'url(/images/month_prev.gif)';
        naprv.style.cursor = 'pointer';
    } else if (ntheleft >= 0) {
        nanxt.style.backgroundImage = 'url(/images/month_next.gif)';
        nanxt.style.cursor = 'pointer';
        naprv.style.backgroundImage = 'url(/images/spacer.gif)';
        naprv.style.cursor = 'default';
    } else {
        nanxt.style.backgroundImage = 'url(/images/month_next.gif)';
        nanxt.style.cursor = 'pointer';
        naprv.style.backgroundImage = 'url(/images/month_prev.gif)';
        naprv.style.cursor = 'pointer';
    }
}

// Agenda cross highlighting
// handling mouseover and mouseout events without event bubbling
var xb = {
    evtHash: [],
    ieGetUniqueID: function(_elem) {
        if (_elem === window) { return 'theWindow'; }
        else if (_elem === document) { return 'theDocument'; }
        else { return _elem.uniqueID; }
    },
    addEvent: function(_elem, _evtName, _fn, _useCapture) {
        if (typeof _elem.addEventListener != 'undefined') {
            if (_evtName == 'mouseenter') { _elem.addEventListener('mouseover', xb.mouseEnter(_fn), _useCapture); }
            else if (_evtName == 'mouseleave') { _elem.addEventListener('mouseout', xb.mouseEnter(_fn), _useCapture); }
            else { _elem.addEventListener(_evtName, _fn, _useCapture); }
        }
        else if (typeof _elem.attachEvent != 'undefined') {
            var key = '{FNKEY::obj_' + xb.ieGetUniqueID(_elem) + '::evt_' + _evtName + '::fn_' + _fn + '}';
            var f = xb.evtHash[key];
            if (typeof f != 'undefined') { return; }
            f = function() { _fn.call(_elem); };
            xb.evtHash[key] = f;
            _elem.attachEvent('on' + _evtName, f);
            // attach unload event to the window to clean up possibly IE memory leaks
            window.attachEvent('onunload', function() { _elem.detachEvent('on' + _evtName, f); });
            key = null;
            //f = null;   /* DON'T null this out, or we won't be able to detach it */
        } else { _elem['on' + _evtName] = _fn; }
    },
    removeEvent: function(_elem, _evtName, _fn, _useCapture) {
        if (typeof _elem.removeEventListener != 'undefined') { _elem.removeEventListener(_evtName, _fn, _useCapture); }
        else if (typeof _elem.detachEvent != 'undefined') {
            var key = '{FNKEY::obj_' + xb.ieGetUniqueID(_elem) + '::evt' + _evtName + '::fn_' + _fn + '}';
            var f = xb.evtHash[key];
            if (typeof f != 'undefined') {
                _elem.detachEvent('on' + _evtName, f);
                delete xb.evtHash[key];
            }
            key = null;
            //f = null;   /* DON'T null this out, or we won't be able to detach it */
        }
    },
    mouseEnter: function(_pFn) {
        return function(_evt) {
            var relTarget = _evt.relatedTarget;
            if (this == relTarget || xb.isAChildOf(this, relTarget)) { return; }
            _pFn.call(this, _evt);
        }
    },
    isAChildOf: function(_parent, _child) {
        if (_parent == _child) { return false };
        while (_child && _child != _parent) { _child = _child.parentNode; }
        return _child == _parent;
    }
};

var prodblock; var curid;
function highlight(aid) {
    curid = aid;
    prodblock = document.getElementById(aid);
    xb.addEvent(prodblock, 'mouseenter', enterProd, false);
    xb.addEvent(prodblock, 'mouseleave', leaveProd, false);
}
function enterProd() {
    var myDays = new Array();
    var myLeftAgenda = document.getElementById('agendaviewleft').getElementsByTagName("li");
    var stopit = myLeftAgenda.length;
    for (var g = 0; g < stopit; g++) {
        if (myLeftAgenda[g].className == 'clr ' + curid) { myDays.push(myLeftAgenda[g]); }
    }
    var stopit2 = myDays.length;
    for (var g = 0; g < stopit2; g++) { myDays[g].className += ' act'; }
}
function leaveProd() {
    var myDays = new Array();
    var myLeftAgenda = document.getElementById('agendaviewleft').getElementsByTagName("li");
    var stopit = myLeftAgenda.length;
    for (var g = 0; g < stopit; g++) {
        if (myLeftAgenda[g].className == 'clr ' + curid + ' act') { myDays.push(myLeftAgenda[g]); }
    }
    var stopit2 = myDays.length;
    for (var g = 0; g < stopit2; g++) {
        myDays[g].className = '';
        myDays[g].className += 'clr ' + curid;
    }
}

function highlightImg(aid) {
    var prodimg = document.getElementById(aid + 'img');
    prodimg.style.borderColor = '#000000';
}
function lowlightImg(aid) {
    var prodimg = document.getElementById(aid + 'img');
    prodimg.style.borderColor = '#ffffff';
}


$(document).ready(function() {
    ResizeAgendaImages();
});

var ResizeAgendaImages = function() {
    $(".prodimages a:nth-child(1)").css({ height: '77px', width: '77px' })
    $(".prodimages a:nth-child(1) > img").css({ height: '77px', width: '77px' })
    $(".prodimages a:nth-child(2)").css({ marginTop: '15px', height: '62px', width: '62px', marginLeft: '15px' })
    $(".prodimages a:nth-child(2) > img").css({ marginTop: '15px', height: '62px', width: '62px' })
    $(".prodimages a:nth-child(3)").css({ marginTop: '26px', height: '51px', width: '51px', marginLeft: '11px' })
    $(".prodimages a:nth-child(3) > img").css({ marginTop: '26px', height: '51px', width: '51px' })
    $(".prodimages a:nth-child(4)").css({ marginTop: '37px', height: '40px', width: '40px', marginLeft: '11px' })
    $(".prodimages a:nth-child(4) > img").css({ marginTop: '37px', height: '40px', width: '40px' })


}


var Bestel = function (esroid) {

    $.ajax({
        url: "/WishList.asmx/DoGetGUID",
        data: "{}",
        success: function (msg) {

            if (msg != null) {
                var guid;
                if (msg != null) {
                    guid = msg.d;
                }
            }
            if (guid != "") {
                BestelFinal(esroid, guid);
            }
            else {
                BestelFinal(esroid, '');
            }
        },
        error: function (xhr, desc, exceptionobj) {
            // alert('[error] : getGUID | desc: ' + desc + '|  exception obj: ' + exceptionobj);
            var url = 'https://tickets3.basicorange.com/KoninklijkeSchouwburg_Live/loader.asp?target=hall.asp%3Fevent%3D' + esroid + '%26language%3D2&t=' + guid
            javascript: top.document.location.href = url;
        }
    });

}


var BestelFinal = function (esroid, guid) {
    var url = 'https://tickets3.basicorange.com/KoninklijkeSchouwburg_Live/loader.asp?target=hall.asp%3Fevent%3D' + esroid + '%26language%3D2&t=' + guid
    javascript: top.document.location.href = url;
}


$(document).ready(function () {
    if ($("ul li.Level2").length > 6) {
        $("li.Dropdown:first ul").css("paddingRight", "0px").css("width", "500px").addClass("clr");
        $("li.Dropdown:first ul li.Level2:even").css("width", "120px").css("float", "left").addClass("fixarrow");
        $("li.Dropdown:first ul li.Level2:odd").css("width", "210px").css("float", "left").addClass("fixarrow");
    }
    if ($("ul.newseason li.Level2").length > 6) {
        $("li.Dropdown ul.newseason").css("paddingRight", "0px").css("width", "500px").addClass("clr");
        $("li.Dropdown ul.newseason li.Level2:even").css("width", "120px").css("float", "left").addClass("fixarrow");
        $("li.Dropdown ul.newseason li.Level2:odd").css("width", "210px").css("float", "left").addClass("fixarrow");
    }
});
