///图片翻页广告组件
///  Transform
///

var Transfrom_imgInit;
var Transfrom_imgWidth=200;              //图片宽
var Transfrom_imgHeight=200;             //图片高
var Transfrom_textFromHeight=50;         //焦点字框高度 (单位为px)
var Transfrom_textStyle="Transfrom_texttitle";           //焦点字class style (不是连接class)
var Transfrom_textLinkStyle="Transfrom_texttitle";    //焦点字连接class style
var Transfrom_buttonLineOn="#f60";           //button下划线on的颜色
var Transfrom_buttonLineOff="#000";          //button下划线off的颜色
var Transfrom_theTimer;                  //定义TIMER定时器
var Transfrom_TimeOut=5000;              //每张图切换时间 (单位毫秒);

var Transfrom_imgUrl=new Array(); 
var Transfrom_imgLink=new Array();
var Transfrom_imgtext=new Array();
var Transfrom_imgAlt=new Array();
var Transfrom_adNum=0;

///
///    样式表制定

document.write('<style type="text/css">');


document.write('#Transfrom_imgButtonPanel {padding:0;filter: alpha(opacity=40);-moz-opacity:0.4;opacity:0.6; background:#cccccc;left: 2px; OVERFLOW: hidden; position: relative; text-align:left;}');
document.write('#Transfrom_imgButtonPanel_down {vertical-align:middle;padding:2px 0;text-align:right;height:100%;}');
document.write('.Transfrom_imgClass {BORDER: #fff 2px solid; cursor:pointer}');
document.write('#Transfrom_txtFrom {VERTICAL-ALIGN:middle; padding: 2px 0 0 0; text-align:left;overflow:hidden;}');
document.write('.Transfrom_texttitle {color: #C10001;width:200px;vertical-align:middle;line-heignt:12px;font-size:12px;overflow:hidden;white-space:normal;word-break:break-all;}');
document.write('A.Transfrom_button {PADDING-TOP: 2px; PADDING-BOTTOM: 2px; PADDING-RIGHT: 7px; padding-left: 7px; BACKGROUND: #7b7b63; MARGIN: 0px; FONT: bold 9px sans-serif; border: #fff 1px solid; text-decoration: none;color: #ffffff; font-family: sans-serif;height:10px;}');
document.write('A.Transfrom_button:link     {	border: #fff 1px solid;color: #ffffff; font-family: sans-serif; background-color: #000000; text-decoration: none}');
document.write('A.Transfrom_button:visited {	border: #fff 1px solid;color: #ffffff; font-family: sans-serif; background-color: #000000; text-decoration: none}');
document.write('A.Transfrom_button:hover  {	border: #f00 2px solid;color: #ffffff; font-family: sans-serif; background-color: #ffffff;    text-decoration: none}');
//document.write('.Transfrom_trans {filter: progid:DXImageTransform.Microsoft.Alpha(startX=0, startY=0, finishX=100, finishY=100,style=1,opacity=0,finishOpacity=40); WIDTH: 90px; background-color: #000}');
document.write('</style>');

///

//焦点字框高度样式表 开始
document.write('<style type="text/css">');
document.write('#Transfrom_focuseFrom{width:'+(Transfrom_imgWidth+2)+'px;margin: 0px; padding:0px;height:'+(Transfrom_imgHeight+Transfrom_textFromHeight)+'px; overflow:hidden;}');
document.write('#Transfrom_txtFrom{height:'+Transfrom_textFromHeight+'px;width:'+Transfrom_imgWidth+'px;}');
document.write('#Transfrom_imgButtonPanel{width:'+Transfrom_imgWidth+'px;top:-'+(Transfrom_textFromHeight+20)+'px;height:20px}');
document.write('</style>');
//焦点字框高度样式表 结束

///初始化数组变量 imgUrl

Transfrom_imgUrl[1]='/Advertise/ad1/images/200912lg.jpg';
Transfrom_imgtext[1]='2009常熟市冬季大型人才交流会暨常熟理工学院校园招聘会';
Transfrom_imgLink[1]='http://www.csrcsc.com/zhuangquZP/20080903/top32.aspx';
Transfrom_imgAlt[1]='2009常熟市冬季大型人才交流会暨常熟理工学院校园招聘会';

Transfrom_imgUrl[2]='/Advertise/ad1/images/2009xyzp.jpg';
Transfrom_imgtext[2]='校园招聘征集参会企业信息';
Transfrom_imgLink[2]='http://www.csrcsc.com/home/information.aspx?ID=RJsIPI6I';
Transfrom_imgAlt[2]='校园招聘征集参会企业信息';

Transfrom_imgUrl[3]='/Advertise/ad1/images/20103yuezp.jpg';
Transfrom_imgtext[3]='2010年3月系列人才交流会';
Transfrom_imgLink[3]='http://www.csrcsc.com/home/information.aspx?ID=OJXJFK3KQJDI8BBK';
Transfrom_imgAlt[3]='2010年3月系列人才交流会';



document.write('<div id="Transfrom_focuseFrom">');

function Transfrom_changeimg(n)
{
	Transfrom_adNum=n;
	window.clearInterval(Transfrom_theTimer);
	Transfrom_adNum=Transfrom_adNum-1;
	Transfrom_nextAd();
}

function Transfrom_goUrl()
{
	window.open(Transfrom_imgLink[Transfrom_adNum],'_blank');
}

//NetScape开始
if (navigator.appName == "Netscape")
{

	function Transfrom_nextAd(){
			if(Transfrom_adNum<(Transfrom_imgUrl.length-1))
				Transfrom_adNum++;
			else Transfrom_adNum=1;

		Transfrom_theTimer=setTimeout("Transfrom_nextAd()", Transfrom_TimeOut);

			Transfrom_imgInit = document.getElementById("Transfrom_imgInit");

			Transfrom_imgInit.src=Transfrom_imgUrl[Transfrom_adNum];
			Transfrom_imgInit.alt=Transfrom_imgAlt[Transfrom_adNum];	
			document.getElementById('Transfrom_imgLink').href=Transfrom_imgLink[Transfrom_adNum];
			document.getElementById('Transfrom_focustext').innerHTML=Transfrom_imgtext[Transfrom_adNum];
		}

	document.write('<a id="Transfrom_imgLink" href="'+Transfrom_imgLink[1]+'" target="_blank"><img src="'+Transfrom_imgUrl[1]+'" id="Transfrom_imgInit" width='+Transfrom_imgWidth+' height='+Transfrom_imgHeight+' border="1" alt="'+Transfrom_imgAlt[1]+'" class="Transfrom_imgClass"></a>');
	document.write('<div id="Transfrom_txtFrom"><span id="Transfrom_focustext" class="'+Transfrom_textStyle+'"></span></div>');
	document.write('<div id="Transfrom_imgButtonPanel">');
	document.write('<div id="Transfrom_imgButtonPanel_down">');

	//数字按钮代码开始
	for(var i=1;i<Transfrom_imgUrl.length;i++)
	{
		document.write('<a href="javascript:Transfrom_changeimg('+i+')" class="Transfrom_button" style="cursor:pointer" title="'+Transfrom_imgAlt[i]+'">'+i+'</a>');  //FF下用cursor: pointer 替代 cursor:pointer
	}

	//数字按钮代码结束
	document.write('</div>');
	document.write('</div>');
	document.write('</div>');
	
	Transfrom_nextAd();
}//NetScape结束
else  //IE开始
{
	var count=0;
	for (i=1;i<Transfrom_imgUrl.length;i++) 
	{
		if( (Transfrom_imgUrl[i]!="") && (Transfrom_imgLink[i]!="")&&(Transfrom_imgtext[i]!="")&&(Transfrom_imgAlt[i]!="") ) 
		{
			count++;
		} 
		else
		{
			break;
		}
	}

	function Transfrom_playTran(){
		if (document.all)
			Transfrom_imgInit.filters.revealTrans.play();		
		}

	var key=0;
	function Transfrom_nextAd(){
		
			Transfrom_imgInit = document.getElementById("Transfrom_imgInit");  //显示图片的id
		
		if(Transfrom_adNum<count) 
			Transfrom_adNum++ ;
		else 
			Transfrom_adNum=1;
		if( key==0 ){
			key=1;
		} else if (document.all)
		{
			
			Transfrom_imgInit.filters.revealTrans.Transition=23;
			Transfrom_imgInit.filters.revealTrans.apply();
			Transfrom_playTran();
		}

		Transfrom_imgInit.src=Transfrom_imgUrl[Transfrom_adNum];   //
		Transfrom_imgInit.alt=Transfrom_imgAlt[Transfrom_adNum];	
		document.getElementById('Transfrom_link'+Transfrom_adNum).style.background=Transfrom_buttonLineOn;
	
		for (var i=1;i<=count;i++)
		{
			if (i!=Transfrom_adNum)
			{
				document.getElementById('Transfrom_link'+i).style.background=Transfrom_buttonLineOff;
			}
		}	
		document.getElementById('Transfrom_focustext').innerHTML=Transfrom_imgtext[Transfrom_adNum];
		Transfrom_theTimer=setTimeout("Transfrom_nextAd()", Transfrom_TimeOut);
	}

	document.write('<div id="Transfrom_imageShow"');
	document.write('<a target="_self" href="#"><img style="filter: revealTrans(duration=1,transition=5);" src="javascript:Transfrom_nextAd()" width="'+Transfrom_imgWidth+'" height="'+Transfrom_imgHeight+'"  border="0" onclick="Transfrom_goUrl()" vspace="0" id="Transfrom_imgInit" class="Transfrom_imgClass"></a>');
	document.write('</div>');
	document.write('<div id="Transfrom_txtFrom"><span id="Transfrom_focustext" class="'+Transfrom_textStyle+'"></span></div>');
	document.write('<div id="Transfrom_imgButtonPanel">');
	document.write(' <div id="Transfrom_imgButtonPanel_down">');  //<a class="Transfrom_trans"></a>

	//数字按钮代码开始
	for(var i=1;i<Transfrom_imgUrl.length;i++)
	{
		document.write('<a id="Transfrom_link'+i+'"  href="javascript:Transfrom_changeimg('+i+')" class="Transfrom_button" style="cursor:pointer" title="'+Transfrom_imgAlt[i]+'" onFocus="this.blur()">'+i+'</a>');
	}
	//数字按钮代码结束
	document.write('</div>');
    document.write('</div>');
	document.write('</div>');
	
	Transfrom_nextAd();

}
//IE结束