﻿function writeEmailLink(){
    tr = "info"
    bg = "@"
    ff = "supremecreative"
    ji = "co.uk"
    document.write("<a href='mailto:" + tr + bg + ff + "." + ji + "'>" + tr + bg + ff + "." + ji + "</a>")
}



/*these are the functions that do the javascript version of the workbar.  You will need to update these when you add new work to the site.*/
function displayPage(whichPage) {
    var maxPage = 7

    for (g = 1; g <= maxPage; g++) {
        document.getElementById("images" + g).style.display = "none"
    }
    document.getElementById("images" + whichPage).style.display = "block"
    if (whichPage == 1) {
        document.getElementById("leftBut").style.display = "none"
    } else {
        document.getElementById("leftBut").style.display = "block"
    }
    if (whichPage == maxPage) {
        document.getElementById("rightBut").style.display = "none"
    } else {
        document.getElementById("rightBut").style.display = "block"
    }
}

var currentPage = 1
function moveLeftRt(movingRight) {
    if (movingRight) {
        currentPage++
    } else {
        currentPage--
    }
    displayPage(currentPage)
}

function writeJobLink(jobNum, inWorkPage) {
    var returnStr = ""
    if (inWorkPage) {
        returnStr = "<a href='javaScript:selectWorkExampleFromJavascriptVersion(" + jobNum + ")'><img src='flash/jobImages/job" + jobNum + ".jpg' border='0' /></a>"
    } else {
        returnStr = "<a href='work.aspx?job" + jobNum + "'><img src='flash/jobImages/job" + jobNum + ".jpg' border='0' /></a>"
    }
    return returnStr
}
function selectWorkExampleFromJavascriptVersion(jobNum) {
    selectWorkExample("job" + jobNum)
}

function randOrd() {
    return (Math.round(Math.random()) - 0.5);
} 

function writeWorkBar(inWorkPage) {

    var dispOrderArray = new Array()
    for (g = 0; g < 21; g++) {
        dispOrderArray[g] = g + 1
    }
    
    dispOrderArray.sort(randOrd);

    var returnStr = ""
    returnStr += "<div style='width:923px; height:170px;'>"

    returnStr += "<table cellpadding='0' cellspacing='0' style='width:923px'>"
    returnStr += "  <tr>"
    returnStr += "      <td style='width:100px; text-align:right;' valign='top'>"
    returnStr += "          <div id='leftBut'>"
    returnStr += "              <a href='javaScript:moveLeftRt(0)'><img src='images/arrowLeft.png' border='0' /></a>"
    returnStr += "          </div>"
    returnStr += "      </td>"
    returnStr += "  <td style='padding:0 20px 0 20px;'>"

    returnStr += "      <div id='images1'>"
    returnStr += "          <div class='workImageFrame'>"
    returnStr += "              <div class='workImage'>"
    returnStr += "                  " + writeJobLink(dispOrderArray[0], inWorkPage)
    returnStr += "              </div>"
    returnStr += "          </div>"
    returnStr += "          <div class='workImageFrame'>"
    returnStr += "              <div class='workImage'>"
    returnStr += "                  " + writeJobLink(dispOrderArray[1], inWorkPage)
    returnStr += "              </div>"
    returnStr += "          </div>"
    returnStr += "          <div class='workImageFrame'>"
    returnStr += "              <div class='workImage'>"
    returnStr += "                  " + writeJobLink(dispOrderArray[2], inWorkPage)
    returnStr += "              </div>"
    returnStr += "          </div>"
    returnStr += "      </div>"

    returnStr += "      <div id='images2'>"
    returnStr += "          <div class='workImageFrame'>"
    returnStr += "              <div class='workImage'>"
    returnStr += "                  " + writeJobLink(dispOrderArray[3], inWorkPage)
    returnStr += "              </div>"
    returnStr += "          </div>"
    returnStr += "          <div class='workImageFrame'>"
    returnStr += "              <div class='workImage'>"
    returnStr += "                  " + writeJobLink(dispOrderArray[4], inWorkPage)
    returnStr += "              </div>"
    returnStr += "          </div>"
    returnStr += "          <div class='workImageFrame'>"
    returnStr += "              <div class='workImage'>"
    returnStr += "                  " + writeJobLink(dispOrderArray[5], inWorkPage)
    returnStr += "              </div>"
    returnStr += "          </div>"
    returnStr += "      </div>"

    returnStr += "      <div id='images3'>"
    returnStr += "          <div class='workImageFrame'>"
    returnStr += "              <div class='workImage'>"
    returnStr += "                  " + writeJobLink(dispOrderArray[6], inWorkPage)
    returnStr += "              </div>"
    returnStr += "          </div>"
    returnStr += "          <div class='workImageFrame'>"
    returnStr += "              <div class='workImage'>"
    returnStr += "                  " + writeJobLink(dispOrderArray[7], inWorkPage)
    returnStr += "              </div>"
    returnStr += "          </div>"
    returnStr += "          <div class='workImageFrame'>"
    returnStr += "              <div class='workImage'>"
    returnStr += "                  " + writeJobLink(dispOrderArray[8], inWorkPage)
    returnStr += "              </div>"
    returnStr += "          </div>"
    returnStr += "      </div>"

    returnStr += "      <div id='images4'>"
    returnStr += "          <div class='workImageFrame'>"
    returnStr += "              <div class='workImage'>"
    returnStr += "                  " + writeJobLink(dispOrderArray[9], inWorkPage)
    returnStr += "              </div>"
    returnStr += "          </div>"
    returnStr += "          <div class='workImageFrame'>"
    returnStr += "              <div class='workImage'>"
    returnStr += "                  " + writeJobLink(dispOrderArray[10], inWorkPage)
    returnStr += "              </div>"
    returnStr += "          </div>"
    returnStr += "          <div class='workImageFrame'>"
    returnStr += "              <div class='workImage'>"
    returnStr += "                  " + writeJobLink(dispOrderArray[11], inWorkPage)
    returnStr += "              </div>"
    returnStr += "          </div>"
    returnStr += "      </div>"



    returnStr += "      <div id='images5'>"
    returnStr += "          <div class='workImageFrame'>"
    returnStr += "              <div class='workImage'>"
    returnStr += "                  " + writeJobLink(dispOrderArray[12], inWorkPage)
    returnStr += "              </div>"
    returnStr += "          </div>"
    returnStr += "          <div class='workImageFrame'>"
    returnStr += "              <div class='workImage'>"
    returnStr += "                  " + writeJobLink(dispOrderArray[13], inWorkPage)
    returnStr += "              </div>"
    returnStr += "          </div>"
    returnStr += "          <div class='workImageFrame'>"
    returnStr += "              <div class='workImage'>"
    returnStr += "                  " + writeJobLink(dispOrderArray[14], inWorkPage)
    returnStr += "              </div>"
    returnStr += "          </div>"
    returnStr += "      </div>"



    returnStr += "      <div id='images6'>"
    returnStr += "          <div class='workImageFrame'>"
    returnStr += "              <div class='workImage'>"
    returnStr += "                  " + writeJobLink(dispOrderArray[15], inWorkPage)
    returnStr += "              </div>"
    returnStr += "          </div>"
    returnStr += "          <div class='workImageFrame'>"
    returnStr += "              <div class='workImage'>"
    returnStr += "                  " + writeJobLink(dispOrderArray[16], inWorkPage)
    returnStr += "              </div>"
    returnStr += "          </div>"
    returnStr += "          <div class='workImageFrame'>"
    returnStr += "              <div class='workImage'>"
    returnStr += "                  " + writeJobLink(dispOrderArray[17], inWorkPage)
    returnStr += "              </div>"
    returnStr += "          </div>"
    returnStr += "      </div>"



    returnStr += "      <div id='images7'>"
    returnStr += "          <div class='workImageFrame'>"
    returnStr += "              <div class='workImage'>"
    returnStr += "                  " + writeJobLink(dispOrderArray[18], inWorkPage)
    returnStr += "              </div>"
    returnStr += "          </div>"
    returnStr += "          <div class='workImageFrame'>"
    returnStr += "              <div class='workImage'>"
    returnStr += "                  " + writeJobLink(dispOrderArray[19], inWorkPage)
    returnStr += "              </div>"
    returnStr += "          </div>"
    returnStr += "          <div class='workImageFrame'>"
    returnStr += "              <div class='workImage'>"
    returnStr += "                  " + writeJobLink(dispOrderArray[20], inWorkPage)
    returnStr += "              </div>"
    returnStr += "          </div>"
    returnStr += "      </div>"
    
    returnStr += "  </td>"
    returnStr += "  <td style='width:100px; text-align:left;' valign='top'>"
    returnStr += "      <div id='rightBut'>"
    returnStr += "          <a href='javaScript:moveLeftRt(1)'><img src='images/arrowRt.png' border='0' /></a>"
    returnStr += "      </div>"
    returnStr += "  </td>"

    
    returnStr += "</table>"

    returnStr += "</div>"
    
    return returnStr

}

