//Product ads array
var theads=new Array();
theads[0]="<a href=\"videopad/vpsetup.exe\"><img src=\"images/slideshow/videopad_ad.jpg\" border=0 height=169></a><div id=learnmore style=\"text-decoration: underline; font-weight: bold; position: absolute; top: 152px; left: 4px;\"><a href=\"videopad/index.html\">Learn more about VideoPad >></a></div>";
theads[1]="<a href=\"capture/debutsetup.exe\"><img src=\"images/slideshow/debut_ad.jpg\" border=0 height=169></a><div id=learnmore style=\"text-decoration: underline; font-weight: bold; position: absolute; top: 152px; left: 4px;\"><a href=\"capture/index.html\">Learn more about Debut >></a></div>";
theads[2]="<a href=\"prism/prismsetup.exe\"><img src=\"images/slideshow/prism_ad.jpg\" border=0 height=169></a><div id=learnmore style=\"text-decoration: underline; font-weight: bold; position: absolute; top: 152px; left: 4px;\"><a href=\"prism/index.html\">Learn more about Prism >></a></div>";
	//Detecting OS
var platform = navigator.platform;
if (platform == "MacIntel") {
theads[2]="<a href=\"prism/prismmaci.zip\"><img src=\"images/slideshow/prism_ad.jpg\" border=0 height=169></a>";
} else if (platform == "MacPPC") {
theads[2]="<a href=\"prism/prismmac.zip\"><img src=\"images/slideshow/prism_ad.jpg\" border=0 height=169></a>";
}

var i = 0;
var timer=true;

//Pausing the slideshow
function pause(){
if (timer == true) {
	timer=false;
	document.getElementById('pause_btn').src="images/slideshow/c_paused.gif";
	}
else if (timer == false) {
	timer=true;
	document.getElementById('pause_btn').src="images/slideshow/c_pause.gif";
	}
}

//Slides scrolling buttons

function previous(){
if (timer == true) {
	timer=false;
	document.getElementById('pause_btn').src="images/slideshow/c_paused.gif";
	}
j=j-1;
if (j < 0){
	j=5;
}
if (j == 0) {
	get_video();
}
if (j == 1) {
	get_business();
}
if (j == 2){
	get_graphics();
}
if (j == 3){
	get_audio();
}
if (j == 4){
	get_utilities();
}
}

function next(){
if (timer == true) {
	timer=false;
	document.getElementById('pause_btn').src="images/slideshow/c_paused.gif";
	}
j=j+1;
if (j > 5){
	j=0;
}
if (j == 0) {
	get_video();
}
if (j == 1) {
	get_business();
}
if (j == 2){
	get_graphics();
}
if (j == 3){
	get_audio();
}
if (j == 4){
	get_utilities();
}
}
	
//Slideshow timer
setTimeout ( "next_category()", 15000 );
var j = 0;

		//Preloading Business Category (we need to preload it here as well - not only after get_video function. Because during the first slideshow cycle get_business actually runs before get_video)
		businessgeneric = new Image(302,169);		
		businessgeneric.src="images/slideshow/business_gen.jpg";		
		businesspic0 = new Image(359,169); 
		businesspic0.src="images/slideshow/accounts_ad.jpg"; 		
		businesspic1 = new Image(359,169); 
		businesspic1.src="images/slideshow/invoice_ad.jpg"; 		
		businesspic2 = new Image(359,169); 
		businesspic2.src="images/slideshow/inventoria_ad.jpg";

function next_category(){
if (timer == false) {
	setTimeout ( "next_category()", 15000 );
	return;
	}
j=j+1;
if (j > 5){
	j=0;
}
if (j == 0) {
	get_video();
	
		//Preloading Business Category)
		businessgeneric = new Image(302,169);		
		businessgeneric.src="images/slideshow/business_gen.jpg";		
		businesspic0 = new Image(359,169); 
		businesspic0.src="images/slideshow/accounts_ad.jpg"; 		
		businesspic1 = new Image(359,169); 
		businesspic1.src="images/slideshow/invoice_ad.jpg"; 		
		businesspic2 = new Image(359,169); 
		businesspic2.src="images/slideshow/inventoria_ad.jpg";
	}
	
	if (j == 1) {
	get_business();
	
		//Preloading Graphics Category
		graphicsgeneric = new Image(302,169);		
		graphicsgeneric.src="images/slideshow/graphics_gen.jpg";		
		graphicspic0 = new Image(359,169); 
		graphicspic0.src="images/slideshow/photostage_ad.jpg"; 		
		graphicspic1 = new Image(359,169); 
		graphicspic1.src="images/slideshow/pixillion_ad.jpg"; 		
		graphicspic2 = new Image(359,169); 
		graphicspic2.src="images/slideshow/photopad_ad.jpg";
	}
if (j == 2){
	get_graphics();
	
		//Preloading Audio Category
		audiogeneric = new Image(302,169);		
		audiogeneric.src="images/slideshow/audio_gen.jpg";		
		audiospic0 = new Image(359,169); 
		audiospic0.src="images/slideshow/recordpad_ad.jpg"; 		
		audiopic1 = new Image(359,169); 
		audiopic1.src="images/slideshow/wavepad_ad.jpg"; 		
		audiopic2 = new Image(359,169); 
		audiopic2.src="images/slideshow/switchpad_ad.jpg";
	}
if (j == 3){
	get_audio();
		//Preloading Utilities Category
		utilitiesgeneric = new Image(302,169);		
		utilitiesgeneric.src="images/slideshow/utilities_gen.jpg";		
		utilitiespic0 = new Image(359,169); 
		utilitiespic0.src="images/slideshow/verbose_ad.jpg"; 		
		utilitiespic1 = new Image(359,169); 
		utilitiespic1.src="images/slideshow/burn_ad.jpg"; 		
		utilitiespic2 = new Image(359,169); 
		utilitiespic2.src="images/slideshow/ftp_ad.jpg";
	}
	
if (j == 4){
	get_utilities();
		//Preloading Video Category
		utilitiesgeneric = new Image(302,169);		
		utilitiesgeneric.src="images/slideshow/video_gen.jpg";		
		utilitiespic0 = new Image(359,169); 
		utilitiespic0.src="images/slideshow/videopad_ad.jpg"; 		
		utilitiespic1 = new Image(359,169); 
		utilitiespic1.src="images/slideshow/debut_ad.jpg"; 		
		utilitiespic2 = new Image(359,169); 
		utilitiespic2.src="images/slideshow/prism_ad.jpg";
	}
setTimeout ( "next_category()", 10000 );
}


function select_none(){
document.getElementById('vid_s').style.visibility = "hidden";
document.getElementById('bus_s').style.visibility = "hidden";
document.getElementById('gr_s').style.visibility = "hidden";
document.getElementById('aud_s').style.visibility = "hidden";
document.getElementById('ut_s').style.visibility = "hidden";

document.getElementById('vh').style.color = "#4a4a4a";
document.getElementById('bh').style.color = "#4a4a4a";
document.getElementById('gh').style.color = "#4a4a4a";
document.getElementById('ah').style.color = "#4a4a4a";
document.getElementById('uh').style.color = "#4a4a4a";
}

//Slideshow categories

function get_video(){
j=0
select_none();
document.getElementById('vid_s').style.visibility = "visible";
document.getElementById('vh').style.color = "#2f55b1";
document.getElementById('ad_gen').innerHTML="<a href=\"software/video.html\"><img src=\"images/slideshow/video_gen.jpg\" border=0 alt=\"Video Software\" height=169></a>";
theads[0]="<a href=\"videopad/vpsetup.exe\"><img src=\"images/slideshow/videopad_ad.jpg\" border=0 height=169></a><div id=learnmore style=\"text-decoration: underline; font-weight: bold; position: absolute; top: 152px; left: 4px;\"><a href=\"videopad/index.html\">Learn more about VideoPad >></a></div>";
theads[1]="<a href=\"capture/debutsetup.exe\"><img src=\"images/slideshow/debut_ad.jpg\" border=0 height=169></a><div id=learnmore style=\"text-decoration: underline; font-weight: bold; position: absolute; top: 152px; left: 4px;\"><a href=\"capture/index.html\">Learn more about Debut >></a></div>";
	//Detecting OS
	var platform = navigator.platform;
	if (platform == "MacIntel") {
	theads[2]="<a href=\"prism/prismmaci.zip\"><img src=\"images/slideshow/prism_ad.jpg\" border=0 height=169></a>";
	} else if (platform == "MacPPC") {
	theads[2]="<a href=\"prism/prismmac.zip\"><img src=\"images/slideshow/prism_ad.jpg\" border=0 height=169></a>";
	} else {
	theads[2]="<a href=\"prism/prismsetup.exe\"><img src=\"images/slideshow/prism_ad.jpg\" border=0 height=169></a><div id=learnmore style=\"text-decoration: underline; font-weight: bold; position: absolute; top: 152px; left: 4px;\"><a href=\"prism/index.html\">Learn more about Prism >></a></div>";
	}
i=i+1;
if (i > 2){
	i=0;
	}
document.getElementById('ad_prod').innerHTML= theads[i];
}

function get_business(){
j=1
select_none();
document.getElementById('bus_s').style.visibility = "visible";
document.getElementById('bh').style.color = "#2f55b1";

document.getElementById('ad_gen').innerHTML="<a href=\"software/business.html\"><img src=\"images/slideshow/business_gen.jpg\" border=0 alt=\"Business Software\" height=169></a>";
theads[2]="<a href=\"inventory/invsetup.exe\"><img src=\"images/slideshow/inventoria_ad.jpg\" border=0 height=169></a><div id=learnmore style=\"text-decoration: underline; font-weight: bold; position: absolute; top: 152px; left: 4px;\"><a href=\"inventory/index.html\">Learn more about Inventoria >></a></div>";
	//Detecting OS
	var platform = navigator.platform;
	if (platform == "MacIntel") {
	theads[0]="<a href=\"accounting/accountsmaci.zip\"><img src=\"images/slideshow/accounts_ad.jpg\" border=0 height=169></a>";
	theads[1]="<a href=\"invoice/invoicemaci.zip\"><img src=\"images/slideshow/invoice_ad.jpg\" border=0 height=169></a>";
	} else if (platform == "MacPPC") {
	theads[0]="<a href=\"accounting/accountsmac.zip\"><img src=\"images/slideshow/accounts_ad.jpg\" border=0 height=169></a>";
	theads[1]="<a href=\"invoice/invoicemac.zip\"><img src=\"images/slideshow/invoice_ad.jpg\" border=0 height=169></a>";
	} else {
	theads[0]="<a href=\"accounting/easetup.exe\"><img src=\"images/slideshow/accounts_ad.jpg\" border=0 height=169></a><div id=learnmore style=\"text-decoration: underline; font-weight: bold; position: absolute; top: 152px; left: 4px;\"><a href=\"accounting/index.html\">Learn more about Express Accounts >></a></div>";
	theads[1]="<a href=\"invoice/eisetup.exe\"><img src=\"images/slideshow/invoice_ad.jpg\" border=0 height=169></a><div id=learnmore style=\"text-decoration: underline; font-weight: bold; position: absolute; top: 152px; left: 4px;\"><a href=\"invoice/index.html\">Learn more about Express Invoice >></a></div>";
	}
document.getElementById('ad_prod').innerHTML= theads[i];
}

function get_graphics(){
j=2
select_none();
document.getElementById('gr_s').style.visibility = "visible";
document.getElementById('gh').style.color = "#2f55b1";
document.getElementById('ad_gen').innerHTML="<a href=\"software/graphics.html\"><img src=\"images/slideshow/graphics_gen.jpg\" border=0 alt=\"Graphics Software\"></a>";
theads[0]="<a href=\"slideshow/pstagesetup.exe\"><img src=\"images/slideshow/photostage_ad.jpg\" border=0></a><div id=learnmore style=\"text-decoration: underline; font-weight: bold; position: absolute; top: 152px; left: 4px;\"><a href=\"slideshow/index.html\">Learn more about Photostage >></a></div>";
theads[1]="<a href=\"imageconverter/pixsetup.exe\"><img src=\"images/slideshow/pixillion_ad.jpg\" border=0></a><div id=learnmore style=\"text-decoration: underline; font-weight: bold; position: absolute; top: 152px; left: 4px;\"><a href=\"imageconverter/index.html\">Learn more about Pixillion >></a></div>";
theads[2]="<a href=\"photoeditor/ppadsetup.exe\"><img src=\"images/slideshow/photopad_ad.jpg\" border=0></a><div id=learnmore style=\"text-decoration: underline; font-weight: bold; position: absolute; top: 152px; left: 4px;\"><a href=\"photopad/index.html\">Learn more about PhotoPad >></a></div>";
document.getElementById('ad_prod').innerHTML= theads[i];
}

function get_audio(){
j=3
select_none();
document.getElementById('aud_s').style.visibility = "visible";
document.getElementById('ah').style.color = "#2f55b1";
document.getElementById('ad_gen').innerHTML="<a href=\"http://www.nch.com.au/software/audio.html\"><img src=\"images/slideshow/audio_gen.jpg\" border=0 alt=\"Audio Software\" height=169></a>";
	//Detecting OS
	var platform = navigator.platform;
	if (platform == "MacIntel") {
	theads[0]="<a href=\"http://www.nch.com.au/recordpad/recordpadmac.zip\"><img src=\"images/slideshow/recordpad_ad.jpg\" border=0 height=169></a>";
	theads[1]="<a href=\"http://www.nch.com.au/components/wavepadmaci.zip\"><img src=\"images/slideshow/wavepad_ad.jpg\" border=0 height=169></a>";
	theads[2]="<a href=\"http://www.nch.com.au/switch/switchmaci.zip\"><img src=\"images/slideshow/switch_ad.jpg\" border=0 height=169></a>";
	} else if (platform == "MacPPC") {
	theads[0]="<a href=\"http://www.nch.com.au/recordpad/recordpadmac.zip\"><img src=\"images/slideshow/recordpad_ad.jpg\" border=0 height=169></a>";
	theads[1]="<a href=\"http://www.nch.com.au/components/wavepadmac.zip\"><img src=\"images/slideshow/wavepad_ad.jpg\" border=0 height=169></a>";
	theads[2]="<a href=\"http://www.nch.com.au/switch/switchmac.zip\"><img src=\"images/slideshow/switch_ad.jpg\" border=0 height=169></a>";
	} else {
	theads[0]="<a href=\"http://www.nch.com.au/recordpad/rpsetup.exe\"><img src=\"images/slideshow/recordpad_ad.jpg\" border=0 height=169></a><div id=learnmore style=\"text-decoration: underline; font-weight: bold; position: absolute; top: 152px; left: 4px;\"><a href=\"http://www.nch.com.au/recordpad/index.html\">Learn more about RecordPad >></a></div>";
	theads[1]="<a href=\"http://www.nch.com.au/wavepad/wpsetup.exe\"><img src=\"images/slideshow/wavepad_ad.jpg\" border=0 height=169></a><div id=learnmore style=\"text-decoration: underline; font-weight: bold; position: absolute; top: 152px; left: 4px;\"><a href=\"http://www.nch.com.au/wavepad/index.html\">Learn more about WavePad >></a></div>";
	theads[2]="<a href=\"http://www.nch.com.au/switch/switchsetup.exe\"><img src=\"images/slideshow/switch_ad.jpg\" border=0 height=169></a><div id=learnmore style=\"text-decoration: underline; font-weight: bold; position: absolute; top: 152px; left: 4px;\"><a href=\"http://www.nch.com.au/switch/index.html\">Learn more about Switch >></a></div>";
	}
document.getElementById('ad_prod').innerHTML= theads[i];
}

function get_utilities(){
j=4
select_none();
document.getElementById('ut_s').style.visibility = "visible";
document.getElementById('uh').style.color = "#2f55b1";
document.getElementById('ad_gen').innerHTML="<a href=\"software/utilities.html\"><img src=\"images/slideshow/utilities_gen.jpg\" border=0 alt=\"Utilities Software\" height=169></a>";
theads[0]="<a href=\"http://www.nch.com.au/verbose/vbsetup.exe\"><img src=\"images/slideshow/verbose_ad.jpg\" border=0 height=169></a><div id=learnmore style=\"text-decoration: underline; font-weight: bold; position: absolute; top: 152px; left: 4px;\"><a href=\"http://www.nch.com.au/verbose/index.html\">Learn more about Verbose >></a></div>";
	//Detecting OS
	var platform = navigator.platform;
	if (platform == "MacIntel") {
	theads[1]="<a href=\"http://www.nch.com.au/components/burnmaci.zip\"><img src=\"images/slideshow/burn_ad.jpg\" border=0 height=169></a>";
	theads[2]="<a href=\"http://www.nchsoftware.com/classic/classicmac.zip\"><img src=\"images/slideshow/ftp_ad.jpg\" border=0 height=169></a>";
	} else if (platform == "MacPPC") {
	theads[1]="<a href=\"http://www.nch.com.au/components/burnmac.zip\"><img src=\"images/slideshow/burn_ad.jpg\" border=0 height=169></a>";
	theads[2]="<a href=\"http://www.nchsoftware.com/classic/classicmac.zip\"><img src=\"images/slideshow/ftp_ad.jpg\" border=0 height=169></a>";
	} else {
	theads[1]="<a href=\"http://www.nch.com.au/burn/burnsetup.exe\"><img src=\"images/slideshow/burn_ad.jpg\" border=0 height=169></a><div id=learnmore style=\"text-decoration: underline; font-weight: bold; position: absolute; top: 152px; left: 4px;\"><a href=\"http://www.nch.com.au/burn/index.html\">Learn more about Express Burn >></a></div>";
	theads[2]="<a href=\"../classic/cftpsetup.exe\"><img src=\"images/slideshow/ftp_ad.jpg\" border=0 height=169></a><div id=learnmore style=\"text-decoration: underline; font-weight: bold; position: absolute; top: 152px; left: 4px;\"><a href=\"classic/index.html\">Learn more about Classic >></a></div>";
	}
document.getElementById('ad_prod').innerHTML= theads[i];
}