function GSDScrollToId(theElementID)
{
    document.getElementById(theElementID).scrollIntoView();    
}

var testimonyTips2 =
{
	m_id: new String(),
	m_FadeOut: 255,
	m_FadeIn: 0,
	m_Fade: 0,
	m_FadeStep: 3,
	m_FadeWait: 15600,
	m_bFadeOut: true,
	m_iFadeInterval: null,
	m_elem: null,
	m_arrFadeMax: 0,
	m_index: 0,
    m_testimonyArray: new Array(),
    AddTestimony: function(testimony)
    {
        this.m_testimonyArray.push(testimony);
    },
    Increment: function()
    {
        this.m_index++;
       // if(this.m_index > this.m_arrFadeMax)
      //      this.m_index = 0;
            
        this.m_FadeOut = 255;
        this.m_FadeIn = 0;
        this.m_Fade = 0;
        this.m_bFadeOut = true;
        this.m_arrFadeMax = 0;

		this.m_iFadeInterval = setInterval(this.fade_ontimer, 10);
		this.setFadeText();

        
    },
	Start: function(id)
	{
		try
		{
	        this.id = id;
			this.m_elem = document.getElementById(id);
			this.m_arrFadeMax = this.m_testimonyArray.length - 1;
			this.m_iFadeInterval = setInterval(this.fade_ontimer, 10);
			
			this.setFadeText();
		}
		catch(e)
		{
			//alert(e)
		}
	},
	setFadeText: function () 
	{
		if(this.m_elem)
		{
			//alert(this.m_testimonyArray[this.m_index])
	  		this.m_elem.innerHTML = '<p  style="clear: right !important">' + this.m_testimonyArray[this.m_index] + '</p>' ;
            //$("div").ellipsis();
var p=$('#fader p');
var divh=$('#fader').height();
while ($(p).outerHeight()>divh) {
    $(p).text(function (index, text) {
        return text.replace(/\W*\s(\S)*$/, '...');
    });
}

            //testimonyTips2.autoEllipseText(this.m_elem, this.m_testimonyArray[this.m_index], this.m_elem.width);
            
		}
	},
	fade_ontimer: function() 
	{
		//alert('timer function    ' +  testimonyTips2.m_elem)
		try
		{
			if(testimonyTips2.m_bFadeOut) 
			{
	    		testimonyTips2.m_Fade += testimonyTips2.m_FadeStep;
	    		if(testimonyTips2.m_Fade > testimonyTips2.m_FadeOut) 
	    		{
	      			testimonyTips2.m_index++;
	      			if(testimonyTips2.m_index > testimonyTips2.m_arrFadeMax)
	        			testimonyTips2.m_index = 0;
	  				testimonyTips2.setFadeText();
	  				testimonyTips2.m_bFadeOut = false;
	      		}
			} 
			else 
			{
				testimonyTips2.m_Fade -= testimonyTips2.m_FadeStep;
				if(testimonyTips2.m_Fade < testimonyTips2.m_FadeIn) 
				{
	  				clearInterval(testimonyTips2.m_iFadeInterval);
	  				setTimeout(testimonyTips2.Faderesume, testimonyTips2.m_FadeWait);
	  				
	  				testimonyTips2.m_bFadeOut = true;
				}
			}

			if((testimonyTips2.m_Fade < testimonyTips2.m_FadeOut) && (testimonyTips2.m_Fade > testimonyTips2.m_FadeIn))
			{
				 testimonyTips2.m_elem.style.color = "#" + testimonyTips2.ToHex(testimonyTips2.m_Fade);
			}
		}
		catch(e)
		{
			//alert(e);
		}
	},
	Faderesume: function() 
	{
  		testimonyTips2.m_iFadeInterval = setInterval(testimonyTips2.fade_ontimer, 10);
	},
	ToHex: function(strValue) 
	{
  		try 
  		{
    		var result= (parseInt(strValue).toString(16));
			while(result.length != 2)
            	result= ("0" +result);
    		result = result + result + result;
    		return result.toUpperCase();
  		}
  		catch(e)
  		{
 			//alert(e);
  		}
	}
}

/*******************************************************************************
Email functions to hide email address from spambots.
*******************************************************************************/

function email_gigasoft()
{	var name0 = "send us your requirements";
	var name1 = "support";
	var name2 = "GigaSoftDevelopment";
	var name3 = "com";
	var addr1 = name1 + "@" + name2 + "." + name3;

	var x1 = "gigasoftpeople";
	var x2 = "gmail";
	var x3 = "com";
	var addr2 = x1 + "@" + x2 + "." + x3;
	
	var y1 = "deborah.development";
	var y2 = "gmail";
	var y3 = "com";
	var addr3 = y1 + "@" + y2 + "." + y3;
	
	var full = "mail" + "to:" + addr1 + ',' + addr2 + ',' + addr3;
	
	document.write(name0.link(full));
}


