﻿/*
Shadowbox custom script for WDF Production
Tested with Shadowbox v3.0.3

Add Shadowbox lightbox to specific anchors based on specfic classes
*/
    var anchors;
    var i;
    
    //Page detection
    if (document.getElementById('portfolioPage')) {
        //Script runs on the portfolio page
        // Find anchors to modify
        anchors = document.getElementById('portfolioPage').getElementsByTagName('a'), i = anchors.length;

        // Update rel attribute
        while (i--) {
            //anchors[i].rel = "shadowbox;width=852;height=479";
            anchors[i].rel = "shadowbox;width=640;height=360";
        }
    }
    else {
        //Script runs on some other page
        // Find all anchors
        anchors = document.getElementsByTagName('a'), i = anchors.length;

        // Update rel attribute
        while (i--) {
            if (anchors[i].className == 'shadowbox') {
                //anchors[i].rel = "shadowbox;width=852;height=479";
                anchors[i].rel = "shadowbox;width=640;height=360";
            }
            
        }
    }

