
// Copyright (C) 2007 Aaron Merriman, AaronMerriman.com. All rights reserved.

var port_info = new Array(0,"www.aeropharmaceuticals.com~Aero Pharmaceuticals~ ~ ~XHTML / CSS / JavaScript / PHP",
                            "www.heliocare.com~Heliocare~ ~ ~XHTML / CSS / JavaScript / PHP",
                            "www.cigargold.com~Cigar Gold~ ~ ~XHTML / CSS / JavaScript / PHP",
                            "www.melvillecapital.com~Melville Capital~ ~ ~XHTML / CSS / JavaScript / PHP",
                            "www.fpcnational.com~FPC National~ ~ ~XHTML / CSS / JavaScript / PHP",
                            "www.corofitness.com~Coro Fitness~ ~ ~XHTML / CSS / JavaScript / PHP",
                            "www.4windstours.com~4 Winds Tours~ ~ ~XHTML / CSS / JavaScript / PHP",
                            "www.fundingcash.com~Structured Asset Funding~ ~ ~XHTML / CSS / JavaScript / PHP",
                            "www.gmsgroup.com~GMS Group~ ~ ~XHTML / CSS / JavaScript / PHP",
                            "www.minyanville.com~Minyanville~ ~ ~XHTML / CSS / JavaScript / PHP"),

    port_cap =  new Array(),
    img_val =   0,
    cap_val =   0,
    cap_type =  0,
    port_now =  0,
    anim_val =  0,
    port_img =  "",
    port_bkgd = "",
    port_prg =  false;

function move_element() {
 document.getElementById('pf_image').style.left = img_val + "px";
 img_val += -40;
 document.getElementById('pf_cap_01').style.top = cap_val + "px";
 document.getElementById('pf_cap_02').style.top = cap_val + "px";
 cap_val += -10;
}

function move_port() {
 if (img_val > -370) { move_element(); } else {
  clearInterval(anim_val);
  img_val = -370;
  cap_val = -95;
  move_element();
  document.getElementById('pf_image').innerHTML = port_img;
  build_cap(1);
  img_val = 0;
  cap_val = 0;
  move_element();
  port_prg = false;
 }
}

function build_cap(build_val) {
 if (cap_type == 1) { document.getElementById('pf_cap_0' + build_val).innerHTML = "<div id=\"pf_cap_tools\">" + port_cap[4] + "</div><div id=\"pf_cap_title\">" + port_cap[1] + "<br />" + port_cap[0] + "</div><p>" + port_cap[2] + " <i>" + port_cap[3] + "</i></p>"; } else {
 document.getElementById('pf_cap_0' + build_val).innerHTML = "<div id=\"pf_cap_tools\">" + port_cap[3] + "</div><div id=\"pf_cap_title\">" + port_cap[0] + "<br /><span id=\"pf_cap_type\">" + port_cap[1] + "</span></div><p>" + port_cap[2] + "</p>"; }
}

function build_img(build_val) {
 port_bkgd = "images/" + build_val + ".jpg";
 return("<img src=\"" + port_bkgd + "\" height=\"292\" width=\"335\" />");
}

function show_port(port_num,port_pos) {
 document.getElementById('portfolio').blur();
 if (port_prg != true && port_pos != port_now) {
  var tmp_val = port_pos;
  if (tmp_val < 10) { tmp_val = "0" + tmp_val; }
  switch(port_num) {
   case 1:
    port_cap = port_info[port_pos].split("~");
    port_img = "<a href=\"http://" + port_cap[0] + "\" target=\"top\">" + build_img("Website_" + tmp_val) + "</a>";
    port_cap[0] = "<a href=\"http://" + port_cap[0] + "\" target=\"top\">" + port_cap[0] + "</a>";
    cap_type = 1;
    break;
  }
  build_cap(2);
  document.getElementById('pf_image').style.background = "transparent url('" + port_bkgd + "') no-repeat right top";
  port_now = port_pos;
  port_prg = true;
  anim_val = setInterval('move_port()',17);
 }
}

