
var featureTitles = []
var featureDescriptions = []
var featureImages = []
var featureLinks = []

var select_red = 12
var select_green = 165
var select_blue = 255

var unselect_red = 125
var unselect_green = 134
var unselect_blue = 130

var feature_title = null
var feature_description = null
var feature_count = 0
var max_feature_count = 10
var numFeatures = 0

featureTitles[numFeatures] = "Slick Viewing"
featureDescriptions[numFeatures] = "Whether in 2D or 3D, your pictures appear with grace and a smoothness that only hardware rendering can achieve, giving your pictures the finesse they deserve."
featureImages[numFeatures] = "screen24"
featureLinks[numFeatures++] = "viewing.html"
featureTitles[numFeatures] = "Ultra Zoom"
featureDescriptions[numFeatures] = "Zoom in to and out of your images effortlessly with your mouse wheel combined with accelerated hardware rendering for silky smooth pixel filtering."
featureImages[numFeatures] = "screen26"
featureLinks[numFeatures++] = "zooming.html"
featureTitles[numFeatures] = "Smooth Rotation"
featureDescriptions[numFeatures] = "Change the orientation of your images smoothly with hardware rendering, and accurately straighten them with high quality multi-tap sampling."
featureImages[numFeatures] = "screen34"
featureLinks[numFeatures++] = "straightening.html"
featureTitles[numFeatures] = "Slide Show"
featureDescriptions[numFeatures] = "Show off your images with several different kinds of supremely smooth slide show, both in 2D and 3D, along with manual keyboard control."
featureImages[numFeatures] = "screen27"
featureLinks[numFeatures++] = ""
featureTitles[numFeatures] = "Thumbnails"
featureDescriptions[numFeatures] = "Superbly filtered, high resolution thumbnails that are generated quietly in the background as you view your images, and stored away for swift future retrieval."
featureImages[numFeatures] = "screen28"
featureLinks[numFeatures++] = "thumbnails.html"
featureTitles[numFeatures] = "Raw Power"
featureDescriptions[numFeatures] = "Load your camera's raw images and tune their conversion with our excellent RAW processing module; based on the popular DCRAW software tool."
featureImages[numFeatures] = "screen33"
featureLinks[numFeatures++] = "raw_development.html"
featureTitles[numFeatures] = "Accurate Colour Editing"
featureDescriptions[numFeatures] = "Employ advanced algorithms that separate brightness from hue and saturation in order to edit each attribute precisely without adversely affecting the others."
featureImages[numFeatures] = "screen35"
featureLinks[numFeatures++] = "brightness.html"
featureTitles[numFeatures] = "EXIF Properties"
featureDescriptions[numFeatures] = "View all of the stock photographic EXIF information for your pictures, with the ability to edit the title, author and comments to be stored alongside your pictures."
featureImages[numFeatures] = "screen25"
featureLinks[numFeatures++] = "exif_properties.html"
featureTitles[numFeatures] = "Brightness / Contrast"
featureDescriptions[numFeatures] = "Flexible options for adjusting the exposure, brightness, contrast and even the gamma of your pictures, all conveniently located on one simple-to-use screen."
featureImages[numFeatures] = "screen51"
featureLinks[numFeatures++] = "contrast.html"
featureTitles[numFeatures] = "Colour Management"
featureDescriptions[numFeatures] = "Optionally hook into Windows Colour Management to accurately edit your images knowing that your monitor is rendering colours as precisely as possible."
featureImages[numFeatures] = "screen38"
featureLinks[numFeatures++] = "colour_management.html"
featureTitles[numFeatures] = "Curve Transformations"
featureDescriptions[numFeatures] = "Transform different attributes of your images precisely with curves from a stock of known algorithmic shapes along with hand-tunable control points."
featureImages[numFeatures] = "screen31"
featureLinks[numFeatures++] = "illumination.html"
featureTitles[numFeatures] = "Tagging"
featureDescriptions[numFeatures] = "Perform batch operations on your images by simply tagging them as you're viewing, and then performing the operation as normal upon the tagged images."
featureImages[numFeatures] = "screen37"
featureLinks[numFeatures++] = "tagging.html"
featureTitles[numFeatures] = "Blink Comparator"
featureDescriptions[numFeatures] = "Whenever you make changes to your images, compare them directly with the original using our blink comparator to ensure that each change is a positive one."
featureImages[numFeatures] = "screen36"
featureLinks[numFeatures++] = "blink_comparator.html"
featureTitles[numFeatures] = "Channels"
featureDescriptions[numFeatures] = "Simple channel control, viewing RGB colours in isolation, just the alpha channel or all in combination; ideal for images destined for games production."
featureImages[numFeatures] = "screen29"
featureLinks[numFeatures++] = "data_channels.html"
featureTitles[numFeatures] = "Intelligent Noise Reduction"
featureDescriptions[numFeatures] = "Reduce the noise in your images with our intelligent algorithms without destroying their fine structures or losing important textural detail."
featureImages[numFeatures] = "screen43"
featureLinks[numFeatures++] = "noise_reduction.html"
featureTitles[numFeatures] = "Precision Pixel Processing"
featureDescriptions[numFeatures] = "Pixels can be stored in accurate high-dynamic-range floating point format for editing, allowing various editing operations without any loss of range or precision."
featureImages[numFeatures] = "screen39"
featureLinks[numFeatures++] = "pixel_precision.html"
featureTitles[numFeatures] = "Resizing"
featureDescriptions[numFeatures] = "Features precise resizing with an intelligent resampling algorithm producing results superior to both bilinear and bicubic filtering when shrinking images."
featureImages[numFeatures] = "screen44"
featureLinks[numFeatures++] = ""
featureTitles[numFeatures] = "Cropping"
featureDescriptions[numFeatures] = "Cropping can be performed completely freehand or controlled more rigidly with aspect ratio locking to fit your pictures perfectly to your frames."
featureImages[numFeatures] = "screen30"
featureLinks[numFeatures++] = "cropping.html"
featureTitles[numFeatures] = "Undo / Redo / Restore"
featureDescriptions[numFeatures] = "Multi-level undo / redo with disk storage to mitigate memory issues, enhanced further with a full image restore from an alternate file location."
featureImages[numFeatures] = "screen45"
featureLinks[numFeatures++] = ""
featureTitles[numFeatures] = "Quick Image Fixes"
featureDescriptions[numFeatures] = "One-click quick fix solutions for correcting image exposure and contrast equalisation, with more to come in the future with colour balance and saturation."
featureImages[numFeatures] = "screen46"
featureLinks[numFeatures++] = ""
featureTitles[numFeatures] = "High Dynamic Range"
featureDescriptions[numFeatures] = "Load your high-dynamic-range images and carefully control their exposure to the screen with our intelligent algorithms - no permanent changes are made."
featureImages[numFeatures] = "screen47"
featureLinks[numFeatures++] = "high_dynamic_range.html"
featureTitles[numFeatures] = "Desktop Background"
featureDescriptions[numFeatures] = "Set an image to be your desktop background, but correctly scaled or cropped to fit your screen size. Oh, and we also colour manage it nicely for you."
featureImages[numFeatures] = "screen48"
featureLinks[numFeatures++] = ""
featureTitles[numFeatures] = "Colour Saturation"
featureDescriptions[numFeatures] = "Easily adjust the saturation and temperature of your colours to bring out their chroma, along with additional controls for more advanced modifications."
featureImages[numFeatures] = "screen49"
featureLinks[numFeatures++] = ""
featureTitles[numFeatures] = "Black & White / Sepia"
featureDescriptions[numFeatures] = "Give your pictures the traditional look, transforming them to black and white or sepia toned, or even some customisable combination of the two."
featureImages[numFeatures] = "screen50"
featureLinks[numFeatures++] = ""
featureTitles[numFeatures] = "Movies"
featureDescriptions[numFeatures] = "Play your movie files as easily as viewing your pictures; move, rotate and scale them just as you would any image using our smooth user interface."
featureImages[numFeatures] = "screen52"
featureLinks[numFeatures++] = "movies.html"
featureTitles[numFeatures] = "Rendering Control"
featureDescriptions[numFeatures] = "Take full control over the subtleties of image rendering by setting the hardware rendering states such as linear filtering and mipmap level bias."
featureImages[numFeatures] = "screen53"
featureLinks[numFeatures++] = ""

function PreloadFeatureImages()
{ //v3.0
  	var d=document;
  
	d.feature_images=new Array();
	
	var i,j=0;

	for(i=0; i<numFeatures; i++)
	{
		d.feature_images[j]=new Image;
		d.feature_images[j++].src="/images/features/" + featureImages[i] + ".png"
		d.feature_images[j]=new Image;
		d.feature_images[j++].src="/images/features/" + featureImages[i] + "_hover.png"
	}
}

function FeatureImageHTML(imageFile, imageLink, imageName, imageDescription)
{
	var sourceImage = "/images/features/" + imageFile + ".png"
	var hoverImage = "/images/features/" + imageFile + "_hover.png"
	var string = ""
	
	if (imageLink == "")
	{
		string = "<img src='" + sourceImage + "' alt='" + imageDescription + "' name='" + imageName + "' width='166' height='135' border='0' id='" + imageName + "' />"
	}
	else
	{
		string = "<a href='" + imageLink + "' onmouseout='SwapButton.RestoreImage()' onmouseover=\"SwapButton.SwapImage('" + imageName + "','','" + hoverImage + "',1)\">"
		string += "<img src='" + sourceImage + "' alt='" + imageDescription + "' name='" + imageName + "' width='166' height='135' border='0' id='" + imageName + "' /></a>"
	}
	
	return string;
}

function SetupFeatureFade(featureTitle, featureDescription)
{
	feature_title = featureTitle
	feature_description = featureDescription

	feature_count = max_feature_count
	
	UpdateFeatureFade()
}

function DecToHex(rgb)
{
	var char = "0123456789ABCDEF"
	
	return String(char.charAt(Math.floor(rgb / 16))) + String(char.charAt(rgb - (Math.floor(rgb / 16) * 16)))
}

function RGB2HTML(red, green, blue)
{
	var hexColor = DecToHex(red) + DecToHex(green) + DecToHex(blue)

    return hexColor
}

function UpdateFeatureFade()
{
	var count = feature_count / max_feature_count
	
	var red = Math.floor((select_red * count) + (unselect_red * (1 - count)))
	var green = Math.floor((select_green * count) + (unselect_green * (1 - count)))
	var blue = Math.floor((select_blue * count) + (unselect_blue * (1 - count)))

	feature_title.style.color = "#" + RGB2HTML(red, green, blue)
	feature_description.style.color = "#" + RGB2HTML(red, green, blue)

	if (feature_count > 0)
	{
		setTimeout("UpdateFeatureFade()", 150)
	}

	feature_count--;
}
