/* Copyright Never die. EveryThing On MyCOOLs ! ! !  http : // www.mycools.in.th / */  

var arrayLength_2 = 0; 
var currentIndex_2 = 0; 
var pageArray_2 = new Array(); 
var x_2 = 0; 
var t_2 ; 
var timeout_2 = 5000; 
var theImage_2 = new Array(); 

function slidebars2(ImageList, LinkList, width, height) {
document.write('<div style="width:'+width+'px; height:'+height+'px;">'); 
theImage_2 = ImageList; arrayLength_2 = theImage_2.length; currentIndex_2 = Math.floor(Math.random() * arrayLength_2); x_2 = 0; 
for(j = 0; j < arrayLength_2; j ++ ) { 
pageArray_2.push("xpage" + j); 
document.write('<div style="display: block;" id="xpage'+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_2((currentIndex_2 + arrayLength_2 - 1) % arrayLength_2);" src="'+fullurl+'images/slide_asset/back.gif" /></td>'); 
for(j = 0; j < arrayLength_2; j ++ ) { 
	var seq = parseInt(j + 1); 
	document.write('<td width="19"><img width="19" height="26" border="0" id="xmyImage'+j+'" alt="1" '); 
	document.write('onClick="displayImage_2('+j+');" src="'+fullurl+'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_2((currentIndex_2+1) % arrayLength_2);" src="'+fullurl+'images/slide_asset/next.gif" /></td>'); 
document.write('</tr></tbody></table></div>'); 
document.write('</div>'); displayImage_2(currentIndex_2); 
} 

function displayImage_2(i) { 
	clearTimeout(t_2); 
	orimage_2(); 
	var blockName; 
	var node ; 
	for(j = 0; j < arrayLength_2; j ++ ) { 
		blockName = pageArray_2[j]; 
		node = document.getElementById(blockName); 
		node.style.display = "none"; 
	} 
	blockName = pageArray_2[i]; 
	node = document.getElementById(blockName); 
	var seq = parseInt(i + 1); 
	document.getElementById("xmyImage" + (i)).src = fullurl+"images/slide_asset/f_" + seq + ".gif"; 
	node.style.display = "block"; 
	currentIndex_2 = i; var next = (parseInt(i + 1) < arrayLength_2) ? parseInt(i + 1) : 0; t_2 = setTimeout("displayImage_2(" + next + ")", timeout_2); 
}

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