﻿//
// GENERAL
//
function Start()
{	
	StartRotators();
	PreloadImages();
}
//
// URL BASED LOGIC
//
function Display(Page)
{
	switch(Page)
	{
		case 'features':
		  ShowOne();
		  break;		  
		case 'pictures':
		  ShowTwo();
		  break;		  
		case 'awards':
		  ShowThree();
		  break;		  
		case 'testimonials':
		  ShowFive();
		  break;		  
		case 'requirements':
		  ShowSix();
		  break;
		  
		default:
		  // value entered is not here, hack?
	}
}
//
// NAVIGATION
//

function HideAllLayers()
{
	// Default the colors
	document.getElementById("OneLink").style.color= "#972f3e";
	document.getElementById("TwoLink").style.color= "#972f3e";
	document.getElementById("ThreeLink").style.color= "#972f3e";
	/*document.getElementById("FourLink").style.color= "#972f3e";*/
	document.getElementById("FiveLink").style.color= "#972f3e";
	document.getElementById("SixLink").style.color= "#972f3e";
				
	// Hide the layers
	/**/
	document.getElementById("OneLayer").style.display = "none";
	document.getElementById("TwoLayer").style.display = "none";
	document.getElementById("ThreeLayer").style.display = "none";
	/*document.getElementById("FourLayer").style.display = "none";*/
	document.getElementById("FiveLayer").style.display = "none";
	document.getElementById("SixLayer").style.display = "none";

	document.getElementById("OneLayer").style.visibility = "hidden";
	document.getElementById("TwoLayer").style.visibility = "hidden";
	/*document.getElementById("ThreeLayer").style.visibility = "hidden";
	document.getElementById("FourLayer").style.visibility = "hidden";*/
	document.getElementById("FiveLayer").style.visibility = "hidden";
	document.getElementById("SixLayer").style.visibility = "hidden";
	// Hide the image descrptions
	//HideProductLayers();	
}

function ShowOne()
{
	// features
	
	HideAllLayers();
	document.getElementById("OneLayer").style.visibility = "visible";
	document.getElementById("OneLayer").style.display = "block";
	document.getElementById("OneLink").style.color= "#595959";
}

function ShowTwo()
{
	// pictures
	pageTracker._trackPageview('/Squidge/Goals/OnSchedule/pictures.html');
	HideAllLayers();
	document.getElementById("TwoLayer").style.visibility = "visible";
	document.getElementById("TwoLayer").style.display = "block";
	document.getElementById("TwoLink").style.color= "#595959";
}

function ShowThree()
{
	// awards
	HideAllLayers();
	document.getElementById("ThreeLayer").style.visibility = "visible";
	document.getElementById("ThreeLayer").style.display = "block";
	document.getElementById("ThreeLink").style.color= "#595959";
}

function ShowFour()
{
	HideAllLayers();
	document.getElementById("FourLayer").style.visibility = "visible";
	document.getElementById("FourLayer").style.display = "block";
	document.getElementById("FourLink").style.color= "#595959";
}

function ShowFive()
{
	// testimonials
	HideAllLayers();
	document.getElementById("FiveLayer").style.visibility = "visible";
	document.getElementById("FiveLayer").style.display = "block";
	document.getElementById("FiveLink").style.color= "#595959";
}

function ShowSix()
{
	// requirements
	HideAllLayers();
	document.getElementById("SixLayer").style.visibility = "visible";
	document.getElementById("SixLayer").style.display = "block";
	document.getElementById("SixLink").style.color= "#595959";
}

//
// ROTATORS
//
function StartRotators(){
	// Slogan rotator
	StartSloganRotator(4000);
	// Feature rotator
	////StartFeatureRotator(4000);
	// Award rotator
	StartAwardRotator(1000);
	// Testimonial rotator
	StartTestimonialRotator(4000);
}


function StartAwardRotator(NewInterval)
{		
	function getNextImage()
	{		
		image_index = (image_index+1) % NumberOfImages ;
			
		//var new_image = get_ImageItemLocation(image_list[image_index]);
		//CurrentPicture  = image_list[image_index];
		
		return(image_list[image_index]);
	}
	
	function rotateImage()
	{
		var new_image = getNextImage();
		document["RotatingAwardImage"].src = new_image;
	}
		
	// Set variables
	var Interval = NewInterval;
	var image_index = 0;
	image_list = new Array();
	// Set files
	var FolderURL = "http://www.squidgesoftware.com/Squidge/Product/OnSchedule/Images/Awards/";
	image_list[image_index++] = FolderURL + "BS4D_clean.png";
	image_list[image_index++] = FolderURL + "downbroad_award_5.gif";
	image_list[image_index++] = FolderURL + "eurodownload_listed.png";
	image_list[image_index++] = FolderURL + "free safe soft.gif";
	image_list[image_index++] = FolderURL + "down64_award5.jpg";
	image_list[image_index++] = FolderURL + "softtester5stars.gif";

	image_list[image_index++] = FolderURL + "soft20.gif";
	image_list[image_index++] = FolderURL + "8844download.gif";
	image_list[image_index++] = FolderURL + "x64.gif";
	image_list[image_index++] = FolderURL + "top4download.gif";
	image_list[image_index++] = FolderURL + "top4downloadclean.gif";
	image_list[image_index++] = FolderURL + "efreedownload.gif";

	image_list[image_index++] = FolderURL + "gearsclean.jpg";
	image_list[image_index++] = FolderURL + "gears5stars.jpg";
	
	image_list[image_index++] = FolderURL + "freevistafiles.png";
	image_list[image_index++] = FolderURL + "freevistafilesaward.png";
	
	image_list[image_index++] = FolderURL + "fileclusterclean.gif";
	image_list[image_index++] = FolderURL + "fileguru5stars.gif";

	image_list[image_index++] = FolderURL + "bestvistadownloadscompatible.png";
	image_list[image_index++] = FolderURL + "bestvistadownloads5stars.gif";
	image_list[image_index++] = FolderURL + "sharewareplaza5star.gif";
	image_list[image_index++] = FolderURL + "BS4D_rate5.png";
	
	image_list[image_index++] = FolderURL + "softpedia_clean_award.gif";

	image_list[image_index++] = FolderURL + "5stars.gif";
	image_list[image_index++] = FolderURL + "download30005stars_rating.gif";
	image_list[image_index++] = FolderURL + "editorschoice.gif";
	image_list[image_index++] = FolderURL + "shareaward.gif";
	image_list[image_index++] = FolderURL + "sharewareriver5.gif";
	image_list[image_index++] = FolderURL + "yankeedownloadbest.png";
	image_list[image_index++] = FolderURL + "yankeedownloadcool.png";
	
	image_list[image_index++] = FolderURL + "FDMuserchoice.gif";
	
	image_list[image_index++] = FolderURL + "download2pc_award.png";
	
	image_list[image_index++] = FolderURL + "topshareware_4.gif";
	image_list[image_index++] = FolderURL + "topsharwarecert.png";
	image_list[image_index++] = FolderURL + "adware-spyware-checked2150.gif";
	image_list[image_index++] = FolderURL + "adware-spyware-checked150.gif";

	image_list[image_index++] = FolderURL + "download4a5stars_award.gif";
	image_list[image_index++] = FolderURL + "soft32downloadaward_On Schedule.png";
	
	image_list[image_index++] = FolderURL + "download3000rating5.png";
	image_list[image_index++] = FolderURL + "filecluster5star_award2.gif";
	image_list[image_index++] = FolderURL + "d3000_pickoftheweek.gif";
	
	image_list[image_index++] = FolderURL + "5cup-award.gif";
	
	
	image_list[image_index++] = FolderURL + "fibredownload5stars.png";
	image_list[image_index++] = FolderURL + "findmysoftOn Schedule_award2.png";
	image_list[image_index++] = FolderURL + "freetrialsoftEditor's Choice.png";
	image_list[image_index++] = FolderURL + "freetrialsoftFive Stars.png";
	
	image_list[image_index++] = FolderURL + "ivertechstar5Award.gif";
	image_list[image_index++] = FolderURL + "Qweas5stars.gif";
	image_list[image_index++] = FolderURL + "Qweassafe.gif";
	image_list[image_index++] = FolderURL + "shareup_logo_5.gif";
	image_list[image_index++] = FolderURL + "sofotex5stars.gif";
	image_list[image_index++] = FolderURL + "soft_go_clean_award.gif";
	image_list[image_index++] = FolderURL + "softgo4stars.gif";
	image_list[image_index++] = FolderURL + "softpicksnet4stars.gif";
	image_list[image_index++] = FolderURL + "vistafiles-published.gif";
	
	image_list[image_index++] = FolderURL + "windows7compatibleaward.png";
	image_list[image_index++] = FolderURL + "windows7downloadaward_5.png";
	image_list[image_index++] = FolderURL + "windows7downloadaward_listed.png";
	
	image_list[image_index++] = FolderURL + "padlibraryclean.gif";
	image_list[image_index++] = FolderURL + "downloadsofts5stars.png";
	image_list[image_index++] = FolderURL + "brothersoft_editors pick.gif";



		
	var NumberOfImages = image_list.length;
	
	rotateImage();
	var timer = setInterval(rotateImage, Interval);
}

function StartSloganRotator(NewInterval)
{		
	function getNextSlogan()
	{		
		slogan_index = (slogan_index+1) % NumberOfSlogans;
					
		return(slogan_list[slogan_index]);
	}
	
	function rotateSlogan()
	{
		var new_text = getNextSlogan();
		document.getElementById("SloganText").innerHTML = new_text;
	}
		
	// Set variables
	var Interval = NewInterval;
	var slogan_index = 0;
	slogan_list = new Array();
	// Set Slogans
	slogan_list[slogan_index++] = "Organise your life, easily.";
	slogan_list[slogan_index++] = "Keeps track of what you don't.";
	slogan_list[slogan_index++] = "Life's complex, On Schedule's Simple. Simple.";
	slogan_list[slogan_index++] = "Have somebody else manage your schedule, On Schedule.";
	slogan_list[slogan_index++] = "Stay On Schedule with On Schedule";
	slogan_list[slogan_index++] = "Beautiful, perfect, effortless, complete. On Schedule";
	slogan_list[slogan_index++] = "Got an active Schedule? On Schedule will keep it that way, active.";
	slogan_list[slogan_index++] = "Too busy to read this? Click 'Download' & you're done, you're On Schedule.";
		
	var NumberOfSlogans = slogan_list.length;
	
	rotateSlogan();
	var timer = setInterval(rotateSlogan, Interval);
}

function StartTestimonialRotator(NewInterval)
{		
	function getNextTestimonial()
	{		
		testimonial_index = (testimonial_index+1) % NumberOfTestimonials;
					
		return(testimonial_list[testimonial_index]);
	}
	
	function rotateTestimonial()
	{
		var new_text = getNextTestimonial();
		document.getElementById("TestimonialText").innerHTML = "\"" + new_text + "\"";
	}
		
	// Set variables
	var Interval = NewInterval;
	var testimonial_index = 0;
	testimonial_list = new Array();
	// Set Testimonials
	testimonial_list[testimonial_index++] = "I considered lot's of todo list applications but choose this one because of it's Free upgrades, I couldn't find another company that did that. Well done";
	testimonial_list[testimonial_index++] = "Schedule and to-do lists, why hasn't anyone thought of this before?";
	testimonial_list[testimonial_index++] = "Literally saves me time every day.";
	testimonial_list[testimonial_index++] = "The reminder feature is really handy, I use it for all my kids birthdays!";
	testimonial_list[testimonial_index++] = "Real reliable program, use it extensively without a crash.";
	testimonial_list[testimonial_index++] = "I'm 'On Schedule' too, :)";
		
	var NumberOfTestimonials = testimonial_list.length;
	
	rotateTestimonial();
	var timer = setInterval(rotateTestimonial, Interval);
}


function StartFeatureRotator(NewInterval)
{		
	function getNextFeature()
	{		
		feature_index = (feature_index+1) % NumberOfFeatures;
					
		return(feature_list[feature_index]);
	}
	
	function rotateFeature()
	{
		var new_text = getNextFeature();
		document.getElementById("FeatureText").innerHTML = "- " + new_text;
	}
		
	// Set variables
	var Interval = NewInterval;
	var feature_index = 0;
	feature_list = new Array();
	// Set Slogans
	feature_list[feature_index++] = "Schedule events";
	feature_list[feature_index++] = "Set reminders for those events";
	feature_list[feature_index++] = "Create multiple schedules";
	feature_list[feature_index++] = "Quickly create to-do lists";
	feature_list[feature_index++] = "Your schedule and todo list work together";
	feature_list[feature_index++] = "Password protection";
	feature_list[feature_index++] = "Colour coordinate events/items";
		
	var NumberOfFeatures = feature_list.length;
	
	rotateFeature();
	var timer = setInterval(rotateFeature, Interval);
}


//
// PRELOAD IMAGES
//
function preload() {
 	var brochure = new Array();
 	var pics = preload.arguments;
 	var dir = '/Squidge/Product/Onschedule/Images/' // path to images
 	for (i=0;i<pics.length;i++) {
  		brochure[i] = new Image();
  		brochure[i].src = dir + pics[i] + '.png'; // change file extension, if necessary.
 		// uncomment next line for testing; click OK to continue loop and cancel to break
 		//if(!confirm(brochure[i].src)) break;
 	}
}


var SmallScreenshots = new Array('Screenshots/editinganevents','Screenshots/editinganitems','Screenshots/justlistss','Screenshots/mains','Screenshots/MissedEventss', 'Screenshots/optionss', 'Screenshots/passwordprompts',  'Screenshots/rightclicks', 'Screenshots/weekviews','Screenshots/justscheduless');
	
var LargeScreenshots = new Array('Screenshots/editinganeventl','Screenshots/editinganiteml','Screenshots/justlistsl','Screenshots/mainl', 'Screenshots/MissedEventsl', 'Screenshots/optionsl', 'Screenshots/password promptl', 'Screenshots/rightclickl', 'Screenshots/weekviewl','Screenshots/justschedulesl');
//var MediumScreenshots = new Array('Screenshots/editinganeventl','Screenshots/editinganevents','Screenshots/editinganiteml','Screenshots/editinganitems','Screenshots/justlistsl','Screenshots/justlistss','Screenshots/justschedules','Screenshots/justscheduless','Screenshots/main','Screenshots/mainl','Screenshots/mains', 'Screenshots/MissedEventsl', 'Screenshots/MissedEventss', 'Screenshots/optionsl', 'Screenshots/optionss', 'Screenshots/password promptl', 'Screenshots/passwordprompts', 'Screenshots/rightclickl', 'Screenshots/rightclicks', 'Screenshots/weekviewl', 'Screenshots/weekviews');
var ScreenshotComments = new Array('Edit events quickly, without navigating away to an edit page',
									'Edit items effortlessly, on the list',
									'View only Lists',
									'Manage your schedules & lists simultaneously', 
									'Consolodate any missed events', 
									'Configure On Schedule to suit You specifically', 
									'Secure password protection for On Schedule files', 
									'Colour co-ordinate your schedule', 
									'View your schedule how you want, day view or week view',
									'View only Schedules');

function PreloadImages()
{
	// Screenshots
	preload(SmallScreenshots);
}
//
// SCREENSHOT DISPLAY
//
//var gPictureNumber = 1;
			
function ClickedThumbnail(PictureNumber){
	ChangeBigPictureTo(PictureNumber);
	ChangeTextTo(PictureNumber);
}

function ChangeBigPictureTo(NewNumber){
	document.getElementById("MainScreenshot").src = "/Squidge/Product/OnSchedule/Images/" + LargeScreenshots[NewNumber] + ".png";
	gPictureNumber = NewNumber;
}
function ChangeTextTo(NewNumber){
	document.getElementById("ScreenshotCaptionText").innerHTML = ScreenshotComments[NewNumber];
}
function HideProductLayers()
{
	for (LayerCount = 1; LayerCount < 12; LayerCount++)
	{
		document.getElementById(LayerCount).style.visibility = "hidden";
		document.getElementById(LayerCount).style.display = "none";
	}
}
function ShowProductImageLayer(LayerNumber)
{
	document.getElementById(LayerNumber).style.visibility = "visible";
	document.getElementById(LayerNumber).style.display = "block";
}
function BigPictureClicked(){
	//alert(gPictureNumber);
}	


