/*  Description : - stop roll image on mouse over and continue on mouse out */
var path = "image/thr/";
var pic = new Array();
var url = new Array();

pic[0] = path + "01.logo_dotarai.png";
url[0] = "http://www.dotarai.com";
pic[1] = path + "02.logo_ecomsiam.png";
url[1] = "http://www.ecomsiam.com";
pic[2] = path + "03.logo_tarad.png";
url[2] = "http://www.tarad.com";
pic[3] = path + "04.logo_netdesign.png";
url[3] = "http://www.netdesignhost.com";
// -----------------------------------------------------------------Set 1
pic[4] = path + "05.logo_servertoday.png";
url[4] = "http://www.servertoday.com";
pic[5] = path + "06.logo_siamservices.png";
url[5] = "http://www.siamservices.com";
pic[6] = path + "07.logo_express.png";
url[6] = "http://www.expressdata.co.th";
pic[7] = path + "08.logo_siamsoft.png";
url[7] = "http://www.thaidomainregister.com/";
// -----------------------------------------------------------------Set 2
pic[8] = path + "09.logo_etns.png";
url[8] = "http://www.etnshost.com/";
pic[9] = path + "10.logo_netway.png";
url[9] = "http://www.netway.co.th";
pic[10] = path + "11.logo_thaihosting.png";
url[10] = "http://www.hosting.co.th";
pic[11] = path + "12.logo_thaitumweb.png";
url[11] = "http://www.thaitumweb.com";
// -----------------------------------------------------------------Set 3
pic[12] = path + "13.logo_chaiyo.png";
url[12] = "http://www.chaiyohosting.com";
pic[13] = path + "14.logo_porar.png";
url[13] = "http://www.porar.com";
pic[14] = path + "15.logo_proclick.png";
url[14] = "http://www.proclick.co.th";
pic[15] = path + "16.logo_netservice.png";
url[15] = "http://www.netservice.co.th";
// -----------------------------------------------------------------Set 4
pic[16] = path + "17.logo_cjworld.png";
url[16] = "http://www.cjworld.co.th";
pic[17] = path + "18.logo_thaihostsave.png";
url[17] = "http://www.thaihostsave.com";
pic[18] = path + "19.logo_smile.png";
url[18] = "http://www.jotdomain.com";
pic[19] = path + "20.logo_makewebeasy.png";
url[19] = "http://www.makewebeasy.com";
// -----------------------------------------------------------------Set 5
pic[20] = path + "21.logo_thaidomainhosting.png";
url[20] = "http://www.thaidomainhosting.com";
pic[21] = path + "22.logo_ine.png";
url[21] = "http://www.ine.co.th";
pic[22] = path + "23.logo_thesystem.png";
url[22] = "http://www.thesystem.co.th";
pic[23] = path + "24.logo_thaiweb.png";
url[23] = "http://www.thaiweb.co.th";
// -----------------------------------------------------------------Set 6
pic[24] = path + "25.logo_mnet.png";
url[24] = "http://www.mnet.co.th";
// replace prajin
pic[25] = path + "01.logo_dotarai.png";
url[25] = "http://www.dotarai.com";
pic[26] = path + "27.logo_quickserv.png";
url[26] = "http://www.quickserv.co.th";
pic[27] = path + "28.logo_aplus_ready.png";
url[27] = "http://www.aplusready.com";
// -----------------------------------------------------------------Set 7
pic[28] = path + "29.logo_asis.png";
url[28] = "http://www.asis.co.th";
pic[29] = path + "30.logo_thaiinternic.png";
url[29] = "http://www.thaiinternic.com";
pic[30] = path + "31.logo_cityvariety.png";
url[30] = "http://www.cityvariety.co.th/";
pic[31] = path + "32.logo_la.png";
url[31] = "http://www.displaythai.com/";
// -----------------------------------------------------------------Set 8
pic[32] = path + "33.logo_gitex.png";
url[32] = "http://www.gitex.co.th";
pic[33] = path + "34.logo_icmyhost.png";
url[33] = "http://www.ic-myhost.com";
pic[34] = path + "35.logo_lotushosting.png";
url[34] = "http://www.hostinglotus.com";
pic[35] = path + "36.logo_pathosting.png";
url[35] = "http://www.pathosting.co.th";
// -----------------------------------------------------------------Set 9
pic[36] = path + "37.logo_2fellows.png";
url[36] = "http://www.2fellows.com";
pic[37] = path + "38.logo_pasworld.png";
url[37] = "http://www.pasworld.co.th";
pic[38] = path + "39.logo_nineweb.png";
url[38] = "http://www.nineweb.co.th";
pic[39] = path + "40.logo_koro.png";
url[39] = "http://www.koro.biz/";
// -----------------------------------------------------------------Set 10
pic[40] = path + "41.logo_jinet.png";
url[40] = "http://www.ji-net.com";
pic[41] = path + "42.logo_opstech.png";
url[41] = "http://www.opstech.co.th";
pic[42] = path + "43.logo_ibiz.png";
url[42] = "http://www.ibiznetwork.com";
pic[43] = path + "44.logo_issp.png";
url[43] = "http://www.issp.co.th";
// -----------------------------------------------------------------Set 11
pic[44] = path + "45.logo_timesmedia.png";
url[44] = "http://www.timesmedia.co.th/";
pic[45] = path + "46.logo_thevista.png";
url[45] = "http://www.siam2web.com/v2/web-home.asp";
pic[46] = path + "47.logo_csloxinfo.png";
url[46] = "http://www.csloxinfo.com/";
pic[47] = path + "48.logo_nexsolution.png";
url[47] = "http://www.naxsolution.com/";
// -----------------------------------------------------------------Set 12
pic[48] = path + "49.logo_uih.png";
url[48] = "http://www.uih.co.th/";
pic[42] = path + "43.logo_ibiz.png";
url[42] = "http://www.ibiznetwork.com";
pic[22] = path + "23.logo_thesystem.png";
url[22] = "http://www.thesystem.co.th";
pic[9] = path + "10.logo_netway.png";
url[9] = "http://www.netway.co.th";
//-----------------------------------------------------------------Set 13

// Blank logo
// pic[x] = path+"logo_blank.png";
// url[x] = "";
var seqslides = new Array();
// Set Path to Image plus optional URL ("" for no URL):
seqslides[0] = [pic[0], url[0], pic[1], url[1], pic[2], url[2], pic[3], url[3]];
seqslides[1] = [pic[4], url[4], pic[5], url[5], pic[6], url[6], pic[7], url[7]];
seqslides[2] = [pic[8], url[8], pic[9], url[9], pic[10], url[10], pic[11], url[11]];
seqslides[3] = [pic[12], url[12], pic[13], url[13], pic[14], url[14], pic[15], url[15]];
seqslides[4] = [pic[16], url[16], pic[17], url[17], pic[18], url[18], pic[19], url[19]];
seqslides[5] = [pic[20], url[20], pic[21], url[21], pic[22], url[22], pic[23], url[23]];
seqslides[6] = [pic[24], url[24], pic[25], url[25], pic[26], url[26], pic[27], url[27]];
seqslides[7] = [pic[28], url[28], pic[29], url[29], pic[30], url[30], pic[31], url[31]];
seqslides[8] = [pic[32], url[32], pic[33], url[33], pic[34], url[34], pic[35], url[35]];
seqslides[9] = [pic[36], url[36], pic[37], url[37], pic[38], url[38], pic[39], url[39]];
seqslides[10] = [pic[40], url[40], pic[41], url[41], pic[42], url[42], pic[43], url[43]];
seqslides[11] = [pic[44], url[44], pic[45], url[45], pic[46], url[46], pic[47], url[47]];
seqslides[11] = [pic[48], url[48], pic[42], url[42], pic[22], url[22], pic[9], url[9]];


// Set pause between each image display (2000=2 second):
var slidedelay = 5000;
// Set how many images to show at once (must be less than total # of images above):
var slidestoreveal = 1;
// Specify code to insert between each slide (ie: "<br />" to insert a line break and create a vertical layout) "" for none (or horizontal):
var slideseparater = "";
// Set optional link target to be added to all images with a link:
var optlinktarget = "secwindow";
// Set image border width:
var imgborderwidth = 1;
// Set opacity value of each image when it's "dimmed", and when it's not,
// respectively (1=100% opaque/normal).
// Change 0.2 to 0 to completely hide image when it's dimmed:
var opacityvalues = [1, 1];
// /No need to edit beyond here///
function processimgcode(theimg) {
	var imghtml = "";

	imghtml = '<table width="100%" border="0" align="center" cellpadding="0" cellspaficing="0">' + '<tr height="90">' + '<td width="230" align="center">';

	if(theimg[1] != "") {
		imghtml += '<a href="' + theimg[1] + '" target="' + optlinktarget + '">';
	}
	imghtml += '<img src="' + theimg[0] + '" height="90" border="' + imgborderwidth + '" style="border: 1px solid grey; filter:alpha(opacity=' + (opacityvalues[0] * 100) + ');-moz-opacity:' + opacityvalues[0] + '" />';
	if(theimg[1] != "") {
		imghtml += '</a>';
	}

	imghtml += '</td>' + '<td width="230" align="center">';

	if(theimg[3] != "") {
		imghtml += '<a href="' + theimg[3] + '" target="' + optlinktarget + '">';
	}
	imghtml += '<img src="' + theimg[2] + '" height="90" border="' + imgborderwidth + '" style="border: 1px solid grey;filter:alpha(opacity=' + (opacityvalues[0] * 100) + ');-moz-opacity:' + opacityvalues[0] + '" />';
	if(theimg[3] != "") {
		imghtml += '</a>';
	}

	imghtml += '</td>' + '</tr>' + '<tr height="10">' + '<td>' + '</td>' + '</tr>' + '<tr height="90">' + '<td width="230" align="center">';

	if(theimg[5] != "") {
		imghtml += '<a href="' + theimg[5] + '" target="' + optlinktarget + '">';
	}
	imghtml += '<img src="' + theimg[4] + '" height="90" border="' + imgborderwidth + '" style="border: 1px solid grey;filter:alpha(opacity=' + (opacityvalues[0] * 100) + ');-moz-opacity:' + opacityvalues[0] + '" />';
	if(theimg[5] != "") {
		imghtml += '</a>';
	}

	imghtml += '</td>' + '<td width="230" align="center">';
	if(theimg[7] != "") {
		imghtml += '<a href="' + theimg[7] + '" target="' + optlinktarget + '">';
	}
	imghtml += '<img src="' + theimg[6] + '" height="90" border="' + imgborderwidth + '" style="border: 1px solid grey;filter:alpha(opacity=' + (opacityvalues[0] * 100) + ');-moz-opacity:' + opacityvalues[0] + '" />';
	if(theimg[7] != "") {
		imghtml += '</a>';
	}

	imghtml += '</td>' + '</tr>' + '</table>';
	return imghtml;
}

// var to track current slide (total: slidestoreveal)
var curslide = 1;
// var to track current image (total: seqslides.length)
var curimgindex = 0;
// boolean to indicate whether this is the first cycle
var isfirstcycle = 1;

if(document.getElementById) {
	for(i = 0; i < slidestoreveal; i++) {
		document.write('<span id="seqslide' + i + '" class="seqslidestyle">' + processimgcode(seqslides[i]) + '</span>' + slideseparater);
	}
	curimgindex = slidestoreveal;
	illuminateslide(0, opacityvalues[1]);
}

function illuminateslide(slideindex, amt) {
	var slideobj = document.getElementById("seqslide" + slideindex).getElementsByTagName("IMG")[0];
	if(slideobj.filters) {
		slideobj.filters.alpha.opacity = amt * 100;
	} else if(slideobj.style.MozOpacity) {
		slideobj.style.MozOpacity = amt;
	}
}

function displayit() {
	if(curslide < slidestoreveal) {
		if(!isfirstcycle) {
			changeimage(curslide);
		}
		illuminateslide(curslide, opacityvalues[1]);
		curslide++;
	} else {
		isfirstcycle = 0;
		for(i = 0; i < slidestoreveal; i++) {
			illuminateslide(i, opacityvalues[0])
		}

		changeimage(0);
		illuminateslide(0, opacityvalues[1]);
		curslide = 1;
	}
}

function changeimage(slideindex) {
	document.getElementById("seqslide" + slideindex).innerHTML = processimgcode(seqslides[curimgindex]);
	curimgindex++;
	if(curimgindex >= seqslides.length) {
		curimgindex = 0;
	}
}

var iv;
function pause() {
	clearInterval(iv);
}

function play() {
	iv = setInterval("displayit()", slidedelay);
}

if(document.getElementById) {
	iv = setInterval("displayit()", slidedelay);
}
