var picUrl="#";
var pictures1 = new Array();
var url1 = new Array();
var pat=base+"/upload/firstPage/";
var number =0; 
var changeflag=false;
function change() { 
var maxLoops = pictures1.length; 
ad1.filters.blendTrans.apply(); 
document.getElementById("ad1").src = pat+pictures1[number]; 
if(url1[number]!=null&&url1[number]!=""){
	if(url1[number].toLowerCase().indexOf("http://")==-1){
		document.getElementById("ad1a").href=base+"/pages/wellcome/"+url1[number];
	}else{
		document.getElementById("ad1a").href=url1[number];
	}
}else{
	
document.getElementById("ad1a").removeAttribute("href");
}
ad1.filters.blendTrans.play(); 
if (number < (maxLoops-1)) {
number++; 
} else { 
number = 0;
changeflag=true;
} 
setTimeout("change()", 6000); 
} 
  var   b=1;   
  var   c=true;   
  function   fade(){   
  
  if(c){   
  b++;   
  }   
  if(b==100){   
  b--;   
  c=false;  
  }   
  if(b==10){   
  b++;   
  c=true;   
  }   
  if(c==false){   
  b--;   
  }   
  ad1.filters.alpha.opacity=0*1+b;   
  setTimeout("fade()",50);   
  }   
function findall(){
var show=document.getElementById("picture_show");
	firstPageHelper.findAllFirstPicturesByPosition(function(data){
	
	
		if(data==""||data==null||data.length==0){
		
			show.innerHTML="<img src=\""+base+"/pages/wellcome/images/w_r7_c7.jpg\" name='ad1'  id='ad1' border='0'></img>";
		}else
		if(data.length==1&&data[0].type==0){
		
			if(data[0].swfName==null ||data[0].swfName == "" || data[0].swfName == ""){
				show.innerHTML="<img src=\""+base+"/pages/wellcome/images/w_r7_c7.jpg\" name='ad1'  id='ad1' border='0' style='filter: blendTrans(duration=2)'></img>";
			
			}else{
				show.innerHTML="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='600' height='235'><param name='movie' value='"+base+"/upload"+"/firstPage/"+data[0].swfName+"' width='300' height='200' /><param name='quality' value='high' /><embed id='basemap_img' src='"+base+"/uploadimg"+"/firstPage/"+data[0].swfName+"' width='534' height='173' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash'></embed></object>";
			}
		}else{
		
		if(data.length!=1){
			
			if(data[0].picUrl!=null&&data[0].picUrl!=""){
					if(data[0].picUrl.toLowerCase().indexOf("http://")==-1){
						picUrl=base+"pages/wellcome/"+data[0].picUrl;
					}else{
						picUrl=data[0].picUrl;
					}
					show.innerHTML="<a href='"+picUrl+"' id=\"ad1a\" style=\"cursor:hand\" target=\"_blank\"><img src=\""+base+"/upload/firstPage/"+data[0].picName+"\" name='ad1'  id='ad1' border='0' width='600' height='235' style='filter: blendTrans(duration=2)'></img></a>"; 
				}else{
					show.innerHTML="<a href='#' id=\"ad1a\" style=\"cursor:hand\" target=\"_blank\"><img src=\""+base+"/upload/firstPage/"+data[0].picName+"\" name='ad1'  id='ad1' border='0' width='600' height='235' style='filter: blendTrans(duration=2)'></img></a>"; 
				}
			
			
		
			for(var i=0; i<data.length; i++) {
				pictures1[pictures1.length]=data[i].picName;
			}
			for(var i=0; i<data.length; i++) {
			
				url1[url1.length]=data[i].picUrl;
			}
			change();
		}else{
				
			if(data[0].picUrl!=null&&data[0].picUrl!=""){
					if(data[0].picUrl.toLowerCase().indexOf("http://")==-1){
						picUrl=base+"pages/wellcome/"+data[0].picUrl;
					}else{
						picUrl=data[0].picUrl;
					}
					show.innerHTML="<a href='"+picUrl+"' id=\"ad1a\" style=\"cursor:hand\" target=\"_blank\"><img src=\""+base+"/upload/firstPage/"+data[0].picName+"\" name='ad1'  id='ad1' border='0' width='600' height='235' style=\"filter:alpha(opacity=0)\" ></img></a>"; 
				}else{
					show.innerHTML="<a href='#' id=\"ad1a\" style=\"cursor:hand\" target=\"_blank\"><img src=\""+base+"/upload/firstPage/"+data[0].picName+"\" name='ad1'  id='ad1' border='0' width='600' height='235' style=\"filter:alpha(opacity=0)\" ></img></a>"; 
				}
			
			
			fade();
		}
		}
		
	});
}
