// JavaScript Document
function scrollObject(main, width, height, direct, pause, speed) {
  var self = this;
  this.main = main;
  this.width = width;
  this.height = height;
  this.direct = direct;
  this.pause = pause;
  this.speed = Math.max(1.001, Math.min((direct == "up" || direct == "down") ? height : width, speed));
  this.block = new Array();
  this.blockprev = this.offset = 0;
  this.blockcurr = 1;
  this.mouse = false;
  this.scroll = function() {
    if (!document.getElementById) return false;
    this.main = document.getElementById(this.main);
    while (this.main.firstChild) this.main.removeChild(this.main.firstChild);
    this.main.style.overflow = "hidden";
    this.main.style.position = "relative";
    this.main.style.width = this.width + "px";
    this.main.style.height = this.height + "px";
    for (var x = 0; x < this.block.length; x++) {
      var table = document.createElement('table');
          table.cellPadding = table.cellSpacing = table.border = "0";
          table.style.position = "absolute";
          table.style.left = table.style.top = "0px";
          table.style.width = this.width + "px";
          table.style.height = this.height + "px";
          table.style.overflow = table.style.visibility = "hidden";
        var tbody = document.createElement('tbody');
          var tr = document.createElement('tr');
            var td = document.createElement('td');
                td.innerHTML = this.block[x];
              tr.appendChild(td);
            tbody.appendChild(tr);
          table.appendChild(tbody);
      this.main.appendChild(this.block[x] = table);
    }
    if (this.block.length > 1) {
      this.main.onmouseover = function() { self.mouse = true; }
      this.main.onmouseout = function() { self.mouse = false; }
      setInterval(function() {
        if (!self.offset && self.scrollLoop()) self.block[self.blockcurr].style.visibility = "visible";
      }, this.pause);
    } this.block[this.blockprev].style.visibility = "visible";
  }
  this.scrollLoop = function() {
    if (!this.offset) {
      if (this.mouse) return false;
      this.offset = (this.direct == "up" || this.direct == "down") ? this.height : this.width;
    } else this.offset = Math.floor(this.offset / this.speed);
    if (this.direct == "up" || this.direct == "down") {
      this.block[this.blockcurr].style.top = ((this.direct == "up") ? this.offset : -this.offset) + "px";
      this.block[this.blockprev].style.top = ((this.direct == "up") ? this.offset - this.height : this.height - this.offset) + "px";
    } else {
      this.block[this.blockcurr].style.left = ((this.direct == "left") ? this.offset : -this.offset) + "px";
      this.block[this.blockprev].style.left = ((this.direct == "left") ? this.offset - this.width : this.width - this.offset) + "px";
    }
    if (!this.offset) {
      this.block[this.blockprev].style.visibility = "hidden";
      this.blockprev = this.blockcurr;
      if (++this.blockcurr >= this.block.length) this.blockcurr = 0;
    } else setTimeout(function() { self.scrollLoop(); }, 30);
    return true;
  }
}
    var scroll1 = new scrollObject("portfolio",450, 160, "left", 5000, 1.15);
    scroll1.block[0] = "<table border='0' cellpadding='0' cellspacing='0'><tr><td><img src='images/portfolio/portfolio_bcmarines_th.jpg' border='0'/></td><td style='padding-left:10px;' align='justify'>BC Marine Services is a marine surveying and consultancy company in Eritrea.</td></tr><tr><td align='center'><a style='color:#39C;' href='http://www.bc-marine.com/' target='_blank'>BC Marine</a></td></tr></table>";
    scroll1.block[1] = "<table border='0' cellpadding='0' cellspacing='0'><tr><td><img src='images/portfolio/portfolio_beecon_th.jpg' border='0'/></td><td style='padding-left:10px;' align='justify'>BEECON offers strategic solutions to organizations from a start-up to well-established organization.</td></tr><tr><td align='center'><a style='color:#39C' href='http://www.beeconadvisors.com/' target='_blank'>Beecon Advisors</a></td></tr></table>";
    scroll1.block[2] = "<table border='0' cellpadding='0' cellspacing='0'><tr><td><img src='images/portfolio/portfolio_brisk_th.jpg' border='0'/></td><td style='padding-left:10px;' align='justify'>Corporate website for  B'Risk Corporate Services. An organization dedicated to improving business processes of its clients' organizations world wide.</td></tr><tr><td align='center'><a style='color:#39C' href='http://www.briskservices.com/' target='_blank'>bRisk Services</a></td></tr></table>";
    scroll1.block[3] = "<table border='0' cellpadding='0' cellspacing='0'><tr><td><img src='images/portfolio/portfolio_cid_th.jpg' border='0'/></td><td style='padding-left:10px;' align='justify'>Online Store front for sale of customized branded t-shirts for corporate companies and individuals.</td></tr><tr><td align='center'><a style='color:#39C' href='http://www.corporateidentitee.com/' target='_blank'>Corporate Identitee</a></td></tr></table>";
    scroll1.block[4] = "<table border='0' cellpadding='0' cellspacing='0'><tr><td><img src='images/portfolio/portfolio_helikx_th.jpg' border='0'/></td><td style='padding-left:18px;' align='justify'>Helikx is a multifaceted institute promoting individual competence by synergising Intellectual, Emotional and Social Skills to Individuals, Corporate, Education Institutions and people with Learning Disability.</td></tr><tr><td align='center'><a style='color:#39C' href='http://www.helikx.com/' target='_blank'>Helikx Special Learning School</a></td></tr></table>";
    scroll1.block[5] = "<table border='0' cellpadding='0' cellspacing='0'><tr><td><img src='images/portfolio/portfolio_pennalam_th.jpg' border='0'/></td><td style='padding-left:10px;' align='justify'>PENN NALAM provides low-priced diagnostics, diagnosis and treatment of cancer for the women belonging to middle and lower strata of society.</td></tr><tr><td align='center'><a style='color:#39C' href='http://www.pennalam.org' target='_blank'>Pennalam</a></td></tr></table>";
    scroll1.block[6] = "<table border='0' cellpadding='0' cellspacing='0'><tr><td><img src='images/portfolio/portfolio_rsagencies_th.jpg' border='0'/></td><td style='padding-left:10px;' align='justify'>R.S.Agencies has been a house hold name for genuine products from leading brands such as Kajaria, Somany, Nitco, etc.</td></tr><tr><td align='center'><a style='color:#39C' href='http://www.rsagencies.in/' target='_blank'>R S Agencies</a></td></tr></table>";
    scroll1.block[7] = "<table border='0' cellpadding='0' cellspacing='0'><tr><td><img src='images/portfolio/portfolio_sripms_th.jpg' border='0'/></td><td style='padding-left:10px;' align='justify'>A place where Institutions, Parents, Students and general visitor can know about their needed information respectively. The key points are Student's Results, Fees details, Teacher details, Timetable and many more.</td></tr><tr><td align='center'><a style='color:#39C' href='http://www.sripmsnursing.com/' target='_blank'>SRIPMS Nursing</a></td></tr></table>";
    scroll1.block[8] = "<table border='0' cellpadding='0' cellspacing='0'><tr><td><img src='images/portfolio/portfolio_sripmscop_th.jpg' border='0'/></td><td style='padding-left:10px;' align='justify'>Web platform to enable the College to stay connected with  stake holders Students, Faculty, Parents, Alumni and Recruiting Companies.</td></tr><tr><td align='center'><a style='color:#39C' href='http://www.sripmscop.com/' target='_blank'>SRIPMS College</a></td></tr></table>";
	scroll1.block[9] = "<table border='0' cellpadding='0' cellspacing='0'><tr><td><img src='images/portfolio/portfolio_gvg_th.jpg' border='0'/></td><td style='padding-left:10px;' align='justify'>Web platform to enable the College to stay connected with  stake holders which include Students, Faculty, Parents, Alumni and Recruiting Companies.</td></tr><tr><td align='center'><a style='color:#39C' href='http://www.gvgvc.org/' target='_blank'>G.V.G Vishalakshi College</a></td></tr></table>";
    scroll1.block[10] = "<table border='0' cellpadding='0' cellspacing='0'><tr><td><img src='images/portfolio/portfolio_visa2west_th.jpg' border='0'/></td><td style='padding-left:10px;' align='justify'>Visa2West is owned and managed by a registered relocation services company, based in one of the world's beautiful and historic central European country, the Czech Republic.</td></tr><tr><td align='center'><a style='color:#39C' href='http://www.visa2west.com/' target='_blank'>Visa2West</a></td></tr></table>";
	window.onload = function()
	{
	  scroll1.scroll();
	  initVS4();
	}

