var imgarray = new Array();
var maxvalue = 0;
imgarray[0]="";
imgarray[1]="";
imgarray[2]="";
imgarray[3]="";
imgarray[4]="";

var textarray = new Array();
textarray[0]="";
textarray[1]="";
textarray[2]="";
textarray[3]="";
textarray[4]="";

var hometextarray = new Array();
hometextarray[0]="";

var homeimgarray = new Array();
homeimgarray[0]="";
homeimgarray[1]="";
homeimgarray[2]="";
homeimgarray[3]="";

var j=0;
var k=0;
function offerpop(programName,width,height)
{

    var temp ="toolbar=no,location=no,status=no,scrollbars=yes,resizable=yes,top=50,left=300,width=700,height=700";

    displayWindow=window.open(programName,"displayWindow",temp) ;
}

function homeAnimation()
{
    if(k == maxvalue) {
        k=0;
    }
    if(k<maxvalue)
    {
        blendimage('blenddiv','blendimage',homeimgarray[k],800);
        document.getElementById('imgTxt').innerHTML=hometextarray[j];
        document.homeform.h1.value=homeimgarray[k];
        k++;
        afterImage();
    }
}

function afterImage()
{
    window.setTimeout("homeAnimation()", 4000);
}


function seeMore()
{
    if(j>=maxvalue)
    {
        j=0;
    }
    else
    {
        j++;
    }
        javascript:blendimage('blenddiv','blendimage',imgarray[j],500);
    document.getElementById('imgTxt').innerHTML=textarray[j];
    document.homeform.h1.value=imgarray[j];
}

function imgValue()
{
    imgName=opener.document.homeform.h1.value;
    document.getElementById('im').src = imgName;
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}

function blendimage(divid, imageid, imagefile, millisec) {
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //set the current image as background
    //document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")";

    //make image transparent
    changeOpac(0, imageid);
    //make new image
    document.getElementById(imageid).src = imagefile;
    //fade in image
    for(i = 0; i <= 100; i++) {
        setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed));
        timer++;
    }
}


function showPortfolioImage()
{
    document.homeform.action="JavaScript:offerpop('imgDisplay.html',571,375)";
    document.homeform.submit();
}
