var prox;
var proy;
var proxc;
var proyc;
function ssimg(id,xx,yy){/*--打开--*/
var r = document.getElementById(id);
r.style.width = xx+"px";
r.style.height = yy+"px";
}
function show(id,ll,tt,xx,yy){/*--打开--*/
clearInterval(prox);
clearInterval(proy);
clearInterval(proxc);
clearInterval(proyc);
var o = document.getElementById(id);
o.style.backgroundPosition="left 0px";
o.style.display = "block";
o.style.width = "1px";
o.style.height = "1px"; 
o.style.left=ll;
o.style.top=tt;
o.style.filter="alpha(opacity=90)";
//o.style.borderbottom="4px solid #666";
//o.style.borderright="2px solid #999";
prox = setInterval(function(){openx(o,xx,yy)},10);
} 
function openx(o,x,y){/*--打开x--*/
var cx = parseInt(o.style.width);
if(cx < x)
{
   o.style.width = (cx + Math.ceil((x-cx)/5)) +"px";
}
else
{
   clearInterval(prox);
   proy = setInterval(function(){openy(o,y)},10);
}
} 
function openy(o,y){/*--打开y--*/ 
var cy = parseInt(o.style.height);
if(cy < y)
{
   o.style.height = (cy + Math.ceil((y-cy)/5)) +"px";
}
else
{
   clearInterval(proy);   
}
} 
function closeed(id,ll,tt,xx,yy){/*--关闭--*/
clearInterval(prox);
clearInterval(proy);
clearInterval(proxc);
clearInterval(proyc); 
var o = document.getElementById(id);
o.style.filter="opacity:1;";
if(o.style.display == "block")
{
   proyc = setInterval(function(){closey(o,ll,tt,xx,yy)},10);   
} 
} 
function closey(o,ll,tt,xx,yy){/*--关闭y--*/ 
var cy = parseInt(o.style.height);
if(cy > yy)
{
   o.style.height = (cy - Math.ceil(cy/5)) +"px";
}
else
{
   clearInterval(proyc);  
o.style.height=yy+"px";  
o.style.backgroundPosition="left "+yy+"px";
o.style.top=tt;
   proxc = setInterval(function(){closex(o,ll,xx)},10);
}
} 
function closex(o,ll,xx){/*--关闭x--*/
var cx = parseInt(o.style.width);
if(cx > xx)
{
   o.style.width = (cx - Math.ceil(cx/5)) +"px";
}
else
{
   clearInterval(proxc);
o.style.width =xx+"px";
o.style.left=ll;
   //o.style.display = "none";
}
} 
/*-------------------------鼠标拖动---------------------*/ 
var od = document.getElementById("fld"); 
var dx,dy,mx,my,mouseD;
var odrag;
var isIE = document.all ? true : false;
document.onmousedown = function(e){
var e = e ? e : event;
if(e.button == (document.all ? 1 : 0))
{
   mouseD = true;   
}
}
document.onmouseup = function(){
mouseD = false;
odrag = "";
if(isIE)
{
   od.releaseCapture();
   od.filters.alpha.opacity = 70;
}
else
{
   window.releaseEvents(od.MOUSEMOVE);
   od.style.opacity = 1;
} 
}
//function readyMove(e){ 
od.onmousedown = function(e){
odrag = this;
var e = e ? e : event;
if(e.button == (document.all ? 1 : 0))
{
   mx = e.clientX;
   my = e.clientY;
   od.style.left = od.offsetLeft + "px";
   od.style.top = od.offsetTop + "px";
   if(isIE)
   {
    od.setCapture();    
    od.filters.alpha.opacity = 70;
   }
   else
   {
    window.captureEvents(Event.MOUSEMOVE);
    od.style.opacity = 0.5;
   }
   
   //alert(mx);
   //alert(my);
   
} 
}
document.onmousemove = function(e){
var e = e ? e : event;
//alert(mrx);
//alert(e.button); 
if(mouseD==true && odrag)
{ 
   var mrx = e.clientX - mx;
   var mry = e.clientY - my; 
   od.style.left = parseInt(od.style.left) +mrx + "px";
   od.style.top = parseInt(od.style.top) + mry + "px";   
   mx = e.clientX;
   my = e.clientY;
   
}
}

function SetPictureLimit(sLimit)
{
	picture.innerHTML=sLimit;
}
function ShowPeitu(nPeitu,nArtid,sImageType)
{
	if(nPeitu==-1)
	{
		document.all("previewimg").src="../systemimage/peitu"+nArtid+"."+sImageType;
		document.all("previewimg").width=150;
		document.all("previewimg").height=60;
	}
	else
		document.all("previewimg").src="../systemimage/peitu"+nPeitu+"s.jpg"
}
function InitPeitu(nPosition,bg)
{
	//var va=new Array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30);
	//var ta=new Array("等待","回首","风雪","风雪","鲜花","鲜花","咖啡","咖啡","饰品","饰品","烛光","烛光","月色","月色","豆子","百花","海边","家室","汉堡","快餐","侯鸟","盼望","玫瑰","清爽","叶子","三叶","阳光","私语","水果","甜蜜");
	var va=new Array("/templets/default/diary/play/bg/01.jpg","/templets/default/diary/play/bg/02.jpg","/templets/default/diary/play/bg/03.jpg","/templets/default/diary/play/bg/04.jpg","/templets/default/diary/play/bg/05.jpg","/templets/default/diary/play/bg/06.jpg","/templets/default/diary/play/bg/07.jpg","/templets/default/diary/play/bg/08.jpg","/templets/default/diary/play/bg/09.jpg","/templets/default/diary/play/bg/10.jpg","/templets/default/diary/play/bg/11.jpg","/templets/default/diary/play/bg/12.jpg","/templets/default/diary/play/bg/13.jpg","/templets/default/diary/play/bg/14.jpg","/templets/default/diary/play/bg/15.jpg","/templets/default/diary/play/bg/16.jpg","/templets/default/diary/play/bg/17.jpg","/templets/default/diary/play/bg/18.jpg","/templets/default/diary/play/bg/19.jpg","/templets/default/diary/play/bg/20.jpg","/templets/default/diary/play/bg/21.jpg","/templets/default/diary/play/bg/22.jpg","/templets/default/diary/play/bg/23.jpg","/templets/default/diary/play/bg/24.jpg","/templets/default/diary/play/bg/25.jpg","/templets/default/diary/play/bg/26.jpg","/templets/default/diary/play/bg/27.jpg","/templets/default/diary/play/bg/28.jpg","/templets/default/diary/play/bg/29.jpg","/templets/default/diary/play/bg/30.jpg","/templets/default/diary/play/bg/31.jpg","/templets/default/diary/play/bg/32.jpg","play/bg/33.jpg");
	var ta=new Array("夕阳桥梁","沙滩少女","心灵翘动","甜蜜一刻","心灵孤独","海边小车","月色清照","候鸟飞翔","美好童年","心灵相伴","童真年代","树林小路","飘进心灵","勇往直前","黄色情结","花言巧语","古堡河畔","思念淡淡","快乐飞起","爱的疑惑","车站情怀","放飞快乐","流星物语","星空夜城","迷失方向","水果滋味","一生一世","花中寄语","黄金海岸","栈桥黄昏","独依窗台","心爱宝宝","秋千之恋");
	var valr=new Array("/templets/default/diary/play/lr/01.jpg","/templets/default/diary/play/lr/02.jpg","/templets/default/diary/play/lr/03.jpg","/templets/default/diary/play/lr/04.jpg","/templets/default/diary/play/lr/05.jpg","/templets/default/diary/play/lr/06.jpg","/templets/default/diary/play/lr/07.jpg","/templets/default/diary/play/lr/08.jpg","/templets/default/diary/play/lr/09.jpg","/templets/default/diary/play/lr/10.jpg","/templets/default/diary/play/lr/11.jpg","/templets/default/diary/play/lr/12.jpg","/templets/default/diary/play/lr/13.jpg","/templets/default/diary/play/lr/14.jpg","/templets/default/diary/play/lr/15.jpg","/templets/default/diary/play/lr/16.jpg","/templets/default/diary/play/lr/17.jpg","/templets/default/diary/play/lr/18.jpg");
	var talr=new Array("林荫小道","萌态宝宝","转角等待","回眸一刻","相背孤独","年华冷漠","独立伊人","友情珍贵","沙滩情怀","低首留恋","感受自然","欢愉人生","大道通天","相拥相偎","脚印串串","朦胧佳人","翘首期盼","回首岁月");
	var vajd=new Array("/templets/default/diary/play/jd/5001.jpg");
	var tajd=new Array("雨中愁绪");
    var bprompt="[精致型]";
	var bbprompt="[宽阔型]";
    var bbbprompt="[左图型]";
	var bbbbprompt="[右图型]";
	var bbbbbprompt="[经典型]";
	var peitu=document.all("zzzbg");
	var op;
	while(peitu.options.length>0)
	{
			peitu.options.remove(0);
	}
	switch(nPosition)
	{
		case 1:
			for(var i=0;i<va.length;i+=1)
			{
				op=document.createElement("OPTION");
				op.value=va[i];
				op.text=bprompt+ta[i];
if(bg==va[i]){op.selected=true;}
				peitu.options.add(op);
			}
			break;		
		case 2:
			for(var i=0;i<va.length;i+=1)
			{
				op=document.createElement("OPTION");
				op.value=va[i];
				op.text=bbprompt+ta[i];
if(bg==va[i]){op.selected=true;}
				peitu.options.add(op);
			}
			break;
		case 3:
			for(var i=0;i<valr.length;i+=1)
			{
				op=document.createElement("OPTION");
				op.value=valr[i];
				op.text=bbbprompt+talr[i];
if(bg==valr[i]){op.selected=true;}
//if(bg==(i+1)){op.selected=true;}
				peitu.options.add(op);
			}
			break;
		case 4:
			for(var i=0;i<valr.length;i+=1)
			{
				op=document.createElement("OPTION");
				op.value=valr[i];
				op.text=bbbbprompt+talr[i];
if(bg==valr[i]){op.selected=true;}
				peitu.options.add(op);
			}
			break;
		case 5:
			for(var i=0;i<vajd.length;i+=1)
			{
				op=document.createElement("OPTION");
				op.value=vajd[i];
				op.text=bbbbbprompt+tajd[i];
if(bg==vajd[i]){op.selected=true;}
				peitu.options.add(op);
			}
			break;
	}
}