/* Copyright Never die. EveryThing On MyCOOLs ! ! !  http : // www.mycools.in.th / */  
var arrayLength = 0; var currentIndex = 0; var pageArray = new Array(); var x = 0; var t ; var timeout = 5000; 
var theImage = new Array(); 
function slidebars(ImageList, LinkList, width, height) { 
document.write('<div style="width:'+width+'px; height:'+height+'px;">'); 
theImage = ImageList; arrayLength = theImage.length; currentIndex = Math.floor(Math.random() * arrayLength); x = 0; 
for(j = 0; j < arrayLength; j ++ ) { 
pageArray.push("page" + j); 
document.write('<div style="display: block;" id="page'+j+'">'); 
var ext = ImageList[j].split('.'); 
if(ext[ext.length - 1] == "swf"){ 
document.write('<embed src="'+ImageList[j]+'" width="'+width+'" height="'+height+'" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" />'); 
} else{ 
	if(LinkList[j]) { 
	document.write('<a target="_blank" href="'+LinkList[j]+'" align="center">'); 
	document.write('<img src="'+ImageList[j]+'" border="0" width="'+width+'" height="'+height+'"  />'); 
	document.write('</a>'); 
	} else{ 
	document.write('<img src="'+ImageList[j]+'" border="0" width="'+width+'" height="'+height+'"  />'); 
} 
} 
document.write('</div>'); 
} 
document.write('<div align="right" class="featureNavButtPosition" style="margin-top: -27px; height: 40px;">'); 
document.write('<table cellspacing="0" cellpadding="0" border="0"><tbody><tr>'); 
document.write('<td width="16"><img width="16" height="26" border="0" id="prev" alt="Previous Feature" '); 
document.write('onClick="displayImage((currentIndex + arrayLength - 1) % arrayLength);" src="'+ fullurl +'images/slide_asset/back.gif" /></td>'); 
for(j = 0; j < arrayLength; j ++ ) { 
	var seq = parseInt(j + 1); 
	document.write('<td width="19"><img width="19" height="26" border="0" id="myImage'+j+'" alt="1" '); 
	document.write('onClick="displayImage('+j+');" src="images/slide_asset/'+seq+'.gif" /></td>'); 
}
document.write('<td width="17"><img width="17" height="26" border="0" id="next" alt="Next Feature" '); 
document.write('onClick="displayImage((currentIndex+1) % arrayLength);" src="'+ fullurl +'images/slide_asset/next.gif" /></td>'); 
document.write('</tr></tbody></table></div>'); 
document.write('</div>'); displayImage(currentIndex); 
} 

function displayImage(i) { 
	clearTimeout(t); orimage(); var blockName; var node ; 
	for(j = 0; j < arrayLength; j ++ ) { 
		blockName = pageArray[j]; 
		node = document.getElementById(blockName); 
		node.style.display = "none"; 
	} 
	blockName = pageArray[i]; 
	node = document.getElementById(blockName); 
	var seq = parseInt(i + 1); 
	document.getElementById("myImage" + (i)).src = fullurl+"images/slide_asset/f_" + seq + ".gif"; 
	node.style.display = "block"; 
	currentIndex = i; var next = (parseInt(i + 1) < arrayLength) ? parseInt(i + 1) : 0; t = setTimeout("displayImage(" + next + ")", timeout); 
}

function orimage() { 
for(j = 0; j < arrayLength; j ++ ) {
	var seq = parseInt(j + 1); 
		document.getElementById("myImage" + j).src = fullurl+"images/slide_asset/" + seq + ".gif"; 
	} 
} 
