<!--

//////// FIELDS /////////////
var d=document;

//temp object
d.tmp=new Object();
d.tmp.cust=0;
d.tmp.debuggers=null;
d.tmp.range=new Array();

//image object
d.img=new Object();

//customers object
d.cust=new Object();

d.cust.arr=new Array();

d.cust.arr[0]=new Array();
d.cust.arr[0][0]="Nick Vitovitch, Program Manager, HP";
d.cust.arr[0][1]="Choosing Elementool made a lot of sense, given the distributed nature of the project, and the fact that we had several outside vendors involved. Elementool offers the flexibility we needed to create records and reports that met our needs.";

d.cust.arr[1]=new Array();
d.cust.arr[1][0]="Weston Morris, Project Manager, Unisys";
d.cust.arr[1][1]="Elementool has paid for itself in terms of savings of time and expense without even considering all the other benefits. The time we spend in the process of finding, tracking, correcting and reporting on defects is greatly reduced with Elementool.";

d.cust.arr[2]=new Array();
d.cust.arr[2][0]="Peter Jin, Director of IT, QA and Release, TicketsNow";
d.cust.arr[2][1]="TicketsNow tried various bug tracking tools but found them cumbersome and expensive. The thing that separates Elementool from the rest is the ease of use. This tool takes me just a few minutes to update issues, create new users, update forms and run reports.";

d.cust.arr[3]=new Array();
d.cust.arr[3][0]="James Kelleher, CEO, Generis Knowledge Management";
d.cust.arr[3][1]="Elementool has been integral in tracking which product releases new enhancements end up in. This detailed tracking and reporting allows us to accurately plan release timetables and keep our customers well informed.";

d.cust.arr[4]=new Array();
d.cust.arr[4][0]="Martin Weinberg, Senior Account Manager, eCity Interactive";
d.cust.arr[4][1]="Using Elementool has allowed eCity to improve their QA testing process. Nothing slips through the cracks. Because it’s all in a database, every issue is addressed in an organized way.";

d.cust.arr[5]=new Array();
d.cust.arr[5][0]="Tony Ricci, Quality Assurance Manager, Auto-Graphics, Inc.";
d.cust.arr[5][1]="Elementool's product, in comparison, is better than most we researched. We have faith in Elementool to continue improving the software; their track record shows that they have been responsive and professional.";


d.cust.timerObj;
d.cust.timerNum=9000;
//d.cust.scroll=1;
//d.cust.h=100;
//d.cust.start=150;
d.tmp.cust=0;


///////////  FUNCTION ///////////////////

//PROTOTYPE 

function setRange()
{

var r=100/this.length;

var tmpr=0;
	for(n=0;n<this.length;n++)
	{
		if(!this[n][0])
		{
		this[n]=new Array();
		this[n][0]="";
		}
	var tmp1=this[n].length;
	this[n][tmp1]=new Object();
	this[n][tmp1].min=tmpr;
	tmpr+=r;
	this[n][tmp1].cur=tmpr;
	this[n][tmp1].max=tmpr;
	
	}

}

Array.prototype.setRange=setRange;



// IMAGE BLOCK

//set image in buffer
function placeRollImages()
{
//var dbody=d.getElementsByTagName("BODY")[0];
var tmparr=d.getElementsByTagName("IMG");
	for(ia=0;ia<tmparr.length;ia++)
	{
	var tmpi=tmparr[ia];
	tmpi.roll=tmpi.getAttribute('roll');
		if(tmpi.roll)
		{
		d.img[tmpi.name]=new Array();
		d.img[tmpi.name][0]=new Image();
		d.img[tmpi.name][0].src=tmpi.src;
		d.img[tmpi.name][1]=new Image();
		d.img[tmpi.name][1].src=getNewSrc(tmpi.src,tmpi.roll);
		}
	}
}


//rollover image, over
function rollImgOver(arg)
{
	if(arg&&d.img&&d.img[arg.name]&&d.img[arg.name][1])
	arg.src=d.img[arg.name][1].src;
	//alert(arg.name);
	//alert(document.img[arg.name][1].src);
}

//rollover image, out
function rollImgOut(arg)
{
	if(arg&&d.img&&d.img[arg.name]&&d.img[arg.name][0])
	arg.src=d.img[arg.name][0].src;
	//alert(arg.name);
}


// CALCULATE BLOCK

//function for calculate
function showCost()
{
var tmpcount = parseInt(d.getElementById("iTeamMembers").value);
	if(!isNaN(tmpcount))
	{
	tmpcount=Math.abs(tmpcount);
	d.getElementById('totalcost').innerHTML=(tmpcount*40*34);
	d.getElementById('totalhrs').innerHTML=(tmpcount*34);
	d.getElementById('dailycost').innerHTML=(tmpcount*40*34/20);
	d.getElementById('dailyhrs').innerHTML=(tmpcount*34/20);
	d.getElementById("iTeamMembers").value=tmpcount;
	}
	else
	{
	d.getElementById("iTeamMembers").value='number, please';
	//d.getElementById("iTeamMembers").focus();
	d.getElementById("iTeamMembers").select();
	}
}


////////////// CUSTOMERS ROTATION BLOCK


function setCustomer(arg)
{
	if(!arg)
	{
		d.getElementById("custName").innerHTML=d.cust.arr[arg][0];
		d.getElementById("custText").innerHTML=d.cust.arr[arg][1];
		d.tmp.cust=arg;
	}
}


function getCustomerNum(arg)
{
var tmpget=null;
	if(!isNaN(arg))
	{
	var tmpcur=d.cust.arr;
		for(n=0;n<tmpcur.length;n++)
		{
			if((n!=d.tmp.cust)&&(arg>=tmpcur[n][2].min)&&(arg<=tmpcur[n][2].cur))
			{
			tmpget=tmpcur[n];
			tmpcur[n][2].cur=tmpcur[n][2].min;
			d.tmp.cust=n;
			}
			else
			{
			
				if(tmpcur[n][2].cur<tmpcur[n][2].max)
				tmpcur[n][2].cur++;
			}
		}
	}
	if(!tmpget)
	return getCustomer();
	else
	return tmpget;
}


function getCustomer()
{
var tmpnum=Math.round(Math.random()*100);
var tmpget=getCustomerNum(tmpnum);
//debuggThis(tmpnum+"<br>"+tmpget);
return tmpget;
}


function rollCustomers()
{
var tmpcust=getCustomer();

	if((tmpcust)&&(d.getElementById("custName")))
	{
		d.getElementById("custName").innerHTML=tmpcust[0];
		d.getElementById("custText").innerHTML=tmpcust[1];
	}
}

function timerCustomers()
{
d.cust.timerObj=setInterval("rollCustomers()",d.cust.timerNum);
}



//function-helpers

function getNameFromSrc(arg)
{
	if((arg)&&(String(arg)!="undefined"))
	{
	var tmp1=String(arg).split("/");
	return tmp1[tmp1.length-1];
	}
return null;
}

//get src for image
function getNewSrc(arg1,arg2)
{
	if(((arg1)&&(String(arg1)!="undefined"))&&((arg2)&&(String(arg2)!="undefined")))
	{
	var tmp1=String(arg1).split("/");
	tmp1[tmp1.length-1]=String(arg2);
	return tmp1.join("/");	
	}
}

function debuggThis(arg)
{
	if((d.tmp.debuggers)&&(arg))
	d.tmp.debuggers.innerHTML=arg;
}

////////////  ONLOAD ////////////////

function UpdateLink(){
            document.getElementById("stumbleuponLink").href += document.location.href;
	document.getElementById("deliciousLink").href += document.location.href;
	document.getElementById("diggLink").href += document.location.href;
        }
function GetReferral(){
                if(typeof(document.location.search)!='undefined'){
                    var tmp = document.location.search.replace("?", "").toLowerCase();
                    var params = tmp.split("&");
                    for(var i=0; i<params.length; i++){
                        if(params[i].indexOf("referral")==0){
                            var value = params[i].split("=");
                            if(value.length==2){
		                        var date = new Date();
		                        date.setTime(date.getTime()+(3650*24*60*60*1000));//10 years from now
		                        var expires = "; expires="+date.toGMTString();                               
                                document.cookie = "ReferralCode=" + value[1] + expires + "; path=/";                              
                                return;
                            }
                        }
                    }
                }
            }



function onLoadActionHome()
{
d.tmp.debuggers=d.getElementById("debugger");
placeRollImages();
d.cust.arr.setRange();
//setCustomer(0);
rollCustomers();
timerCustomers();
UpdateLink();
GetReferral();
//debuggThis(d.tmp.range)
}

function onLoadAction()
{
//d.tmp.debuggers=d.getElementById("debugger");
placeRollImages();
d.cust.arr.setRange();
UpdateLink();
GetReferral();
}


//-->