var changeRate = 20000;
var retriggerDelay = 3000;
var anim=0;
var timerID=null;
//var hostname = "http://www.nimayatechnologies.com";
//var hostname = "file://C:/Prabhavatsite2";
var hostname = "http://www.prabhavat.com";

var banners = 
	[
		"<font color='#504d4c'>Implemented SHINE application based on HIPAA standards and .NET technologies for a leading healthcare technology services provider. With this application we can able to provide an efficient way of handling transcription business and we can increase revenues.  <a style='cursor:hand;' id='shine' onclick='openPdfLink()'>read on</a></font>",
		"<font color='#504d4c'>Designed and delivered CustomerGrid(TM) product on J2EE technologies to integrate data across diverse functional systems. Offshore development of the product resulted in significant cost savings for the client.. <a style='cursor:hand;' id='cgProd' onclick='openPdfLink()'>read on</a></font>",
		"<font color='#504d4c'>Designed and delivered InSync product on .NET technologies to manage the end user data (also called reference data) in data warehouses.Our agile development process allowed client to refine the product rapidly based on the customer feedback on incremental deliverables. <a id='inSync' style='cursor:hand;' onclick='openPdfLink()'>read on</a></font>",
		"<font color='#504d4c'>Implemented SPEF application on J2EE technologies for helping our client with special pricing evaluation process. With this application answers are automatically analyzed by eliminating manual calculations and we can increase revenues. <a style='cursor:hand;' id='spef' onclick='openPdfLink()'>read on</a></font>",
		"<font color='#504d4c'>Integrated Salesforce, QuickBooks and Customer Online Portal for a client to provide a seemless flow of information across different systems in the organization.With this customer quote request is immediately responded by sales representative. <a style='cursor:hand;' id='sysIntegration' onclick='openPdfLink()'>read on</a></font>",
		"<font color='#504d4c'>Migrated a J2EE application to Resource Oriented Computing platform to significantly improve system performance and future software enhancements capability.With this cost of adding new features is reduced and performance is improved more than 50%. <a style='cursor:hand;' id='roc' onclick='openPdfLink()'>read on</a></font>"
	]
var i = Math.ceil(Math.random() * banners.length)-1;
var play=1;

function pauseBanner()
{	if (timerID != null)
	{	clearTimeout(timerID);
		timerID = null;
	}
	target = document.getElementById('rotate-control');
	target.src=hostname+"/images/play.png";
	play=0;
}

function playBanner()
{
	if (timerID == null)
	{	rotateBanner();
	}
	target = document.getElementById('rotate-control');
	target.src=hostname+"/images/pause.png";
	play=1;
}

function togglePlay()
{	
	if(play==1)
	{	pauseBanner();
	}
	else
	{	playBanner();
	}
}

function advanceBanner()
{	pauseBanner();
	anim=6;
	playBanner();
}

function updateAnim()
{	target = document.getElementById('rotate-anim');
	target.src=hostname+"/images/"+anim+"bar.png";
	anim++
}

function updateBanner()
{	target = document.getElementById('banner');
	if (target != null )
	{	target.innerHTML=banners[i];
		if(i<banners.length-1)
		{  i++;
		}
		else
		{ i=0;
		}
	}
	anim=0;
}

function rotateBanner()
{	
	if(anim==6)
	{	updateBanner();
	}
	updateAnim();
	timerID = setTimeout('rotateBanner()', changeRate/6);
}


//
// This method gets called on the event of mouseover and mouseout on a row. It focus the row on the event of
// mouseover and gets back the row's  color on the event of mouseout.
//
function mouseOverRowColor(source, mouseInOut)
{
	if(source != null && source != undefined)
	{
		if(mouseInOut == 'IN')
		{
			source.style.color="#FF8306";
		}
		else
		{
			if((source.rowcount)%2 == 0)
			{
				source.style.color="#000000";
			}
			else
			{
				source.style.removeAttribute('color');
			}
		}
	}
}
//
//
//
function openRelatedLinks(obj)
{
	if(obj.id == 'productDevelopment')
	{
		document.location.replace("/services/productdevelopment.asp");
	}
	else if(obj.id == 'applicationDevelopment')
	{
		document.location.replace("/services/applictiondevelopment.asp");
	}
	else if(obj.id == 'systemsIntegration')
	{
		document.location.replace("/services/systemintegration.asp");
	}
	else if(obj.id == 'systemsMigration')
	{
		document.location.replace("/services/systemmigration.asp");
	}
	else if(obj.id == 'netkernelPlatform')
	{
		document.location.replace("/technology/Netkernel.asp");
	}
	else if(obj.id == 'javaPlatform')
	{
		document.location.replace("/technology/java.asp");
	}
	else if(obj.id == 'dotnetPlatform')
	{
		document.location.replace("/technology/dotnet.asp");
	}
	else if(obj.id == 'webservices')
	{
		document.location.replace("/technology/webservices.asp");
	}
	else if(obj.id == 'ajaxToolkits')
	{
		document.location.replace("/technology/ajax.asp");
	}
	else if(obj.id == 'salesforseSdk')
	{
		document.location.replace("/technology/salesforce.asp");
	}
	else if(obj.id == 'quickbooksSdk')
	{
		document.location.replace("/technology/quickbooks.asp");
	}
	else if(obj.id == 'netricsSdk')
	{
		document.location.replace("/technology/netrics.asp");
	}
	else if(obj.id == 'databaseProgramming')
	{
		document.location.replace("/technology/database.asp");
	}
	else if(obj.id == 'datawarehouse')
	{
		document.location.replace("/technology/datawarehouse.asp");
	}
}
//
//
//
function openPdfLink()
{
	var obj = event.srcElement;
	if(obj.id == 'cgProd')
	{
		window.open(hostname+'/pdf/CustomerGrid Case Study1.pdf' , 'nimaya'); 
	}
	else if (obj.id == 'inSync')
	{
		window.open(hostname+'/pdf/InSync Case Study1.pdf' , 'nimaya');  
	}
	else if (obj.id == 'spef')
	{
		window.open(hostname+'/pdf/SPEF Case Study1.pdf' , 'nimaya'); 
	}
	else if (obj.id == 'shine')
	{
		window.open(hostname+'/pdf/Shine Case Study.pdf' , 'nimaya'); 
	}
	else if (obj.id == 'roc')
	{
		window.open(hostname+'/pdf/PrabhavatROC1.pdf' , 'nimaya'); 
	}
	else if (obj.id == 'sysIntegration')
	{
		window.open(hostname+'/pdf/System Integrations case study.pdf' , 'nimaya');  
	}
}
//
//
function openHTML()
{
	var obj = event.srcElement;
	if(obj.id == 'MichaelQuote')
	{
		var url=hostname+'/customers/CustomerQuotes.html#MichaelQuote';
		self.location=url;
	}
	else if(obj.id == 'RandolphKahleQuote')
	{
		var url=hostname+'/customers/CustomerQuotes.html#RandolphKahleQuote';
		self.location=url;
	}
}
//
function createUserInfoForm()
{
	var loadUrl = 'http://www.prabhavat.com'+'/others/enquiryform.html';
	var sFeatures="height= 450px, width= 500px, top= 200px, left= 250px, edge= Raised, center= Yes, help= No, resizable= No, status= No, scroll= yes,titlebar= yes,toolbar= No"
	//window.showModalDialog(loadUrl, 'enquiryForm',sFeatures);
	window.open(loadUrl, 'enquiryForm',sFeatures);
}

//
//Script to Change Quotes.
//
var changeTimeRate = 20000;
var quoteTimerID=null;

var quotes = 
	[
		"<font color='#504d4c'>Prabhavat is a trusted product development partner of Nimaya, functioning as a seamless extension of our own development and professional.. <a href='#' onclick='javascript:openHTML();' id='MichaelQuote'>more..</a><p><font style='padding-left:125px;'>&nbsp;-  <b>Michael Del Rosso</b></font><br/><font style='padding-left:155px;'>&nbsp;&nbsp;  CEO, Nimaya.   </p></font></font>",
		"<font color='#504d4c'>Prabhavat Solutions stepped in and helped us complete a customer development project for a customer by developing and testing several NetKernel modules. <a  href='#' onclick='javascript:openHTML();' id='RandolphKahleQuote'>more</a><p><font style='padding-left:137px;'>&nbsp;-  <b>Randolph Kahle</b></font><br/><font style='padding-left:25px;'> Director of Marketing, 1060 Research.   </p></font></font>"
	]
var j = Math.ceil(Math.random() * quotes.length)-1;

function updateQuote()
{	
	target = document.getElementById('quote');
	if (target != null )
	{	
		target.innerHTML=quotes[j];
		if(j<quotes.length-1)
		{  
			j++;
		}
		else
		{
			j=0;
		}
	}
}

function rotateQuotes()
{	
	quoteTimerID = setTimeout('rotateQuotes()', changeTimeRate/3);
	updateQuote();
}

// changed code to display banners randomly while page onload and added previous, next buttons to show previous & next  Banners.

//displayBanner function used to display random numbered banner on page loading.
function displayBanner()
{
	bannerId = document.getElementById('banner');
	if (bannerId != null )
	{
		bannerId.innerHTML=banners[i];
		if(i==0)
		{
			document.getElementById('previous').disabled=true;
		}
		else if(i==(banners.length-1))
		{
			document.getElementById('next').disabled=true;
		}
	}
}

// displayNextBanner function used to display next banner. and disable the next button for the last banner
function displayNextBanner()
{
	bannerId = document.getElementById('banner');
	if (bannerId != null )
	{
		if(i==0)
			{
				var previousBanner=document.getElementById('previous');
				if(previousBanner.disabled)
				{
					previousBanner.disabled=false;
				}
			}
		if(i<banners.length-1)
		{ 
			i++;
		}
		if(i==(banners.length-1))
		{ 
			document.getElementById('next').disabled=true;
		}
		bannerId.innerHTML=banners[i];
		
	}
}
// displayPreviousBanner function used to display previous banner. and disable the previous button for the first quote

function displayPreviousBanner()
{
	bannerId = document.getElementById('banner');
	if (bannerId != null )
	{
		if(i==(banners.length-1))
		{
			var nextBanner=document.getElementById('next');
			if(nextBanner.disabled)
			{
				nextBanner.disabled=false;
			}
		}
		if(i<=banners.length-1 && i!=0)
		{ 
			i--;
		}
		if(i==0)
		{ 
			document.getElementById('previous').disabled=true;
		}
		bannerId.innerHTML=banners[i];
	}
}

//  changed code to display banners randomly while page onload and added previous, next buttons to show previous & next  Banners.

//displayBanner function used to display random numbered banner on page loading.

function displayQuote()
{
	quoteId = document.getElementById('quote');
	if (quoteId != null )
	{
		quoteId.innerHTML=quotes[j];
		if(j==0)
		{
			document.getElementById('previousQuoteTD').disabled=true;
		}
		else if(j==(quotes.length-1))
		{
			document.getElementById('nextQuoteTD').disabled=true;
		}
	}
}

// displayNextQuote function used to display next quote. and disable the next button for the last quote 
function displayNextQuote()
{
	quoteId = document.getElementById('quote');
	if (quoteId != null )
	{
		if(j==0)
			{
				var previousQuote=document.getElementById('previousQuoteTD');
				if(previousQuote.disabled)
				{
					previousQuote.disabled=false;
				}
			}
		if(j<quotes.length-1)
		{ 
			j++;
		}
		if(j==(quotes.length-1))
		{ 
			document.getElementById('nextQuoteTD').disabled=true;
		}
		quoteId.innerHTML=quotes[j];
	}
}
// displayPreviousQuote function used to display previous quote. and disable the previous button for the first quote

function displayPreviousQuote()
{
	quoteId = document.getElementById('quote');
	if (quoteId != null )
	{
		if(j==(quotes.length-1))
		{
			var nextQuote=document.getElementById('nextQuoteTD');
			if(nextQuote.disabled)
			{
				nextQuote.disabled=false;
			}
		}
		if(j<=quotes.length-1 && j!=0)
		{ 
			j--;
		}
		if(j==0)
		{ 
			document.getElementById('previousQuoteTD').disabled=true;
		}
		quoteId.innerHTML=quotes[j];
	}
}
