var imgWidth=478;
var imgHeight=271;             //Í¼Æ¬¸ß
var textFromHeight=0;
var textStyle="texttitle";
var textLinkStyle="texttitle";
var buttonLineOn="#f60";
var buttonLineOff="#000";
var TimeOut=5000;
var imgUrl=new Array(); 
var imgLink=new Array();
var imgtext=new Array();
var imgAlt=new Array();
var adNum=0;

document.write('<style type="text/css">');
document.write('#focuseFrom{width:'+(imgWidth)+';margin: 0px; padding:0px;height:'+(imgHeight+textFromHeight)+'px; overflow:hidden;}');
document.write('#txtFrom{height:'+textFromHeight+'px;line-height:'+textFromHeight+'px;width:'+imgWidth+'px;overflow:hidden;}');
document.write('#imgTitle{width:'+imgWidth+';top:-'+(textFromHeight+14)+'px;height:18px}');
document.write('</style>');
document.write('<div id="focuseFrom">');

imgUrl[1]='guanggao/1.jpg';
imgtext[1]='';
imgLink[1]='';
imgAlt[1]='Rush Items';

imgUrl[2]='guanggao/2.jpg';
imgtext[2]='<a href="advanced_search_result.php?keywords=recommended" target="_blank" </a>';
imgLink[2]='advanced_search_result.php?keywords=recommended';
imgAlt[2]='Recommended Items';

imgUrl[3]='guanggao/3.jpg';
imgtext[3]='<a href="best.php" target="_blank" </a>';
imgLink[3]='best.php';
imgAlt[3]='Best Sellers';

//imgUrl[4]='12/guangao-001a.gif';
//imgtext[4]='<a href="index.php" target="_blank" </a>';
//imgLink[4]='http://www.blossompromotions.com/';
//imgAlt[4]='blossom promotions';

//imgUrl[5]='12/guangao-001.gif';
//imgtext[5]='<a href="index.php" target="_blank" </a>';
//imgLink[5]='http://www.blossompromotions.com/';
//imgAlt[5]='blossom promotions';

//imgUrl[6]='images/06.jpg';
//imgtext[6]='<a href="index.asp" target="_blank" </a>';
//imgLink[6]='index.asp';
//imgAlt[6]='blossom promotions';

function changeimg(n)
{
adNum=n;
window.clearInterval(theTimer);
adNum=adNum-1;
nextAd();
}
function goUrl(){
window.open(imgLink[adNum],'_blank');
}
//NetScape begin
if (navigator.appName == "Netscape")
{
document.write('<style type="text/css">');
document.write('.buttonDiv{height:4px;width:21px;}');
document.write('</style>');
function nextAd(){
if(adNum<(imgUrl.length-1))adNum++;
else adNum=1;
theTimer=setTimeout("nextAd()", TimeOut);
document.images.imgInit.src=imgUrl[adNum];
document.images.imgInit.alt=imgAlt[adNum];	
document.getElementById('focustext').innerHTML=imgtext[adNum];
document.getElementById('imgLink').href=imgLink[adNum];
}
document.write('<img src="'+imgUrl[1]+'" name="imgInit" width='+imgWidth+' height='+imgHeight+' border=1 alt="'+imgAlt[1]+'" class="imgClass"><div id="txtFrom"><span id="focustext" class="'+textStyle+'">'+imgtext[1]+'</span></div>')
document.write('<div id="imgTitle">');
document.write('<div id="imgTitle_down">');
// number button code begin
for(var i=1;i<imgUrl.length;i++){document.write('<a href="javascript:changeimg('+i+')" class="button" style="cursor:hand" title="'+imgAlt[i]+'">'+i+'</a>');}
// number button code end
document.write('</div>');
document.write('</div>');
document.write('</div>');
nextAd();
}
//NetScape end
//IE end
else
{
var count=0;
for (i=1;i<imgUrl.length;i++) {
if( (imgUrl[i]!="") && (imgLink[i]!="")&&(imgtext[i]!="")&&(imgAlt[i]!="") ) {
count++;
} else {
break;
}
}
function playTran(){
if (document.all)
imgInit.filters.revealTrans.play();		
}
var key=0;
function nextAd(){
if(adNum<count)adNum++ ;
else adNum=1;
if( key==0 ){
key=1;
} else if (document.all){
imgInit.filters.revealTrans.Transition=23;
imgInit.filters.revealTrans.apply();
playTran();
}
document.images.imgInit.src=imgUrl[adNum];
document.images.imgInit.alt=imgAlt[adNum];	
document.getElementById('link'+adNum).style.background=buttonLineOn;
for (var i=1;i<=count;i++)
{
if (i!=adNum){document.getElementById('link'+i).style.background=buttonLineOff;}
}	
focustext.innerHTML=imgtext[adNum];
theTimer=setTimeout("nextAd()", TimeOut);
}
document.write('<a target=_self href="javascript:goUrl()"><img style="FILTER: revealTrans(duration=1,transition=5);" src="javascript:nextAd()" width='+imgWidth+' height='+imgHeight+' border=0 vspace="0" name=imgInit class="imgClass"></a><br>');
document.write('<div id="txtFrom"><span id="focustext" class="'+textStyle+'"></span></div>');
document.write('<div id="imgTitle">');
document.write(' <div id="imgTitle_down"> <a class="trans"></a>');
// number button code begin
for(var i=1;i<imgUrl.length;i++){document.write('<a id="link'+i+'"  href="javascript:changeimg('+i+')" class="button" style="cursor:hand" title="'+imgAlt[i]+'" onFocus="this.blur()">'+i+'</a>');}
// number button code end
document.write('</div>');
document.write('</div>');
document.write('</div>');
document.write('</div>');
}
//IE end