// This file is for functions that will need to be adjusted for each site they're put on.

var a = '<div class="quote">';
var b = '</div><div class="author">&#8211; ';
var c = '</div>';
var quotes = new Array;
var curquote = -1;
var quotebox_visible = 0;
if(location.pathname == '/filechucker/')
{

	quotes.push(a + "I can't tell you how much grief FileChucker has saved me.&nbsp; I use the program to do technical support on my database software and I can have clients upload their databases.&nbsp; This used to be next-to-impossible and now it's a snap.&nbsp; Great Product!" + b + "Mike M." + c);
	quotes.push(a + "I've done quite a bit of looking, and your products are certainly standouts.&nbsp; I'm looking forward to using them." + b + "Alex S." + c);
	quotes.push(a + "This is by far the most superb file management script I have ever encountered.&nbsp; The performance and functionality of this script are only matched by its priceless simplicity.&nbsp; Thanks!!" + b + "Greg T." + c);
	quotes.push(a + "FileChucker is awesome!&nbsp; I've been looking for a solution like this for a long time." + b + "Nathanael E." + c);
	quotes.push(a + "Thank you for your excellent service." + b + "Dick K." + c);
	quotes.push(a + "The work, the thought and the organization you put into this is incredible." + b + "Bruce C." + c);
	quotes.push(a + "Just one word: Fantastic.&nbsp; 10-minute job to plug [FileChucker] into my app, and it now works a treat.&nbsp; It's through the hard work by people like yourselves that make my job so much easier.&nbsp; Congratulations on an outstanding product... Many many thanks." + b + "Sean F." + c);
	quotes.push(a + "Very good script, continue to upgrade this!" + b + "Julien T." + c);
	quotes.push(a + "I looked all over trying to find a simple cgi script. I found that filechucker was by far the best. If you have issues with your hosting service's PHP.INI max upload size then this is the way to go. Looking forward to future enhancements." + b + "Bob C." + c);
	quotes.push(a + "We love your products.&nbsp; Keep up the great work!!" + b + "James P." + c);
	quotes.push(a + "Hi, I just ordered filechucker and I'd like to express to you how awesome/solid/useful I find this script!&nbsp; I searched around for a lot of upload/filemanager scripts, but didn't really find what I was looking for until I stumbled upon FileChucker." + b + "Greg T." + c);
	quotes.push(a + "Nice script, it's saving the day on our project." + b + "Aaron W." + c);
	quotes.push(a + "I just wanted to say that yours is the first product that I've tested so far that hasn't failed on handling uploads. This is going to work for a print company, so they are handling nothing but large files and all the other solutions I've tried so far have not been reliable. So far yours has been 100% successful in my tests." + b + "Kevin H." + c);
	quotes.push(a + "Love your script, it's the best uploading script I've found." + b + "Steve W." + c);
	quotes.push(a + "You have a wonderful product.&nbsp; I have tried a few other upload programs and this by far was the smoothest, fastest, cleanest install yet.&nbsp; I am very impressed with the number of options already included in the program.&nbsp; The notes included in the PREF section were easy to follow and configure.&nbsp; It worked right out of the box." + b + "Richard B." + c);
	quotes.push(a + "Thanks a lot.&nbsp; You have developed a really great tool." + b + "Barry F." + c);
	quotes.push(a + "I got the FileChucker script and all is working as expected.&nbsp; I rarely see such well-written Perl code, at least not of this size. Thank you very much, it's an excellent product!" + b + "Stefan P." + c);
	quotes.push(a + "Congrats on a well-documented, feature-rich product." + b + "Matt D." + c);
	quotes.push(a + "I am loving filechucker - thanks so much; so easy to install / configure / etc.&nbsp; A really great little web app!" + b + "David H." + c);
	quotes.push(a + "FileChucker is working like a dream for uploading large files." + b + "Matt C." + c);
	quotes.push(a + "This is working great... Clients love it.&nbsp; Vendors love it.&nbsp; We love it." + b + "Gerry W." + c);
	quotes.push(a + "The amount of customization in the program is incredible.&nbsp; I was able to integrate it into my existing page layout relatively simply.&nbsp; I was also able to easily customize the look/feel to match the current site." + b + "Jason M." + c);
	quotes.push(a + "I have not seen this good a piece of work before." + b + "Jonathan A." + c);
	quotes.push(a + "Love your product." + b + "Vincent M." + c);
}
else
{
	quotes.push(a + "Our members think your software is fantastic... I would recommend your software and your company to anyone.&nbsp; Thanks for all your help.&nbsp; It has been a pleasure dealing with you." + b + "Tommy A." + c);
	quotes.push(a + "Nice script, it's saving the day on our project." + b + "Aaron W." + c);
	quotes.push(a + "I've done quite a bit of looking, and your products are certainly standouts.&nbsp; I'm looking forward to using them." + b + "Alex S." + c);
	quotes.push(a + "Thank you for your excellent service." + b + "Dick K." + c);
	quotes.push(a + "We love your products.&nbsp; Keep up the great work!!" + b + "James P." + c);
	quotes.push(a + "The work, the thought and the organization you put into this is incredible." + b + "Bruce C." + c);
}

function findPos(obj)
{
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent)
		{
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

function topOfElement(eID)
{
	var i = findPos(document.getElementById(eID));
	return i[1];
}

function position_quotebox()
{
	if(document.body)
	{
		var disp = '';
		if(navigator.userAgent.indexOf("MSIE 5") > -1 || navigator.userAgent.indexOf("MSIE 6") > -1)
		{
			// IE <7 don't support position:fixed.
			disp = 'block';
		}
		else
		{
			var scrollpos = window.pageYOffset ? window.pageYOffset : document.body.scrollTop ? document.body.scrollTop : document.documentElement.scrollTop;
			if(scrollpos < topOfElement("sitesearch"))
			{
				disp = 'none';
			}
			else
			{
				disp = 'block';
			}
		}
		document.getElementById("quotebox").style.display = disp;
	}
}

function init_quotebox()
{
	display_quote();
	position_quotebox();
	setInterval("rotate_quotebox()", 15000);
}

function rotate_quotebox()
{
	if(document.getElementById("quotebox").style.display == 'none')
		return;
	for(i=90; i>=0; i-=10)
	{
		var delay = (100 - i) * 10;
		setTimeout("set_opacity('quotebox'," + i + ")", delay);
	}
	setTimeout("display_quote()", 1050);
	setTimeout("set_opacity('quotebox',100)", 1060);
}

function display_quote()
{
	curquote++;
	if(curquote >= quotes.length) { curquote = 0; }
	document.getElementById("quotebox-inner").innerHTML = quotes[curquote];
}

function set_opacity(eID,opVal)
{
	var newvalue = opVal == 100 ? opVal : '.' + opVal;
	document.getElementById(eID).style.opacity = newvalue;
}


function schedule_onload_action(newfunc)
{
	var already_scheduled = window.onload;
	if(typeof window.onload != 'function')
	{
		window.onload = newfunc;
	}
	else
	{
		window.onload = function()
		{
			already_scheduled();
			newfunc();
		}
	}
}

function schedule_onresize_action(newfunc)
{
	var already_scheduled = window.onresize;
	if(typeof window.onresize != 'function')
	{
		window.onresize = newfunc;
	}
	else
	{
		window.onresize = function()
		{
			already_scheduled();
			newfunc();
		}
	}
}

function schedule_onscroll_action(newfunc)
{
	var already_scheduled = window.onscroll;
	if(typeof window.onscroll != 'function')
	{
		window.onscroll = newfunc;
	}
	else
	{
		window.onscroll = function()
		{
			already_scheduled();
			newfunc();
		}
	}
}

schedule_onload_action(init_quotebox);
schedule_onresize_action(position_quotebox);
schedule_onscroll_action(position_quotebox);

