rand_image_size_a=new Array("468","60"); 
rand_image_a=new Array("http://www.dangdang.com/LIANMENG/lianmeng1.gif","http://www.cydf.org/images/banner/dol%20bar.gif","http://www.wholing.com/wplog/wholingadbar.gif");
rand_href_a=new Array("http://www.dangdang.com/?from=P-105713","http://www.cydf.org/gb/donationol/index.htm","http://www.wholing.com/");


rand_image_size_b=new Array("468","60"); 
rand_image_b=new Array("http://www.dangdang.com/LIANMENG/lianmeng1.gif","http://www.cydf.org/images/banner/dol%20bar.gif","http://www.wholing.com/wplog/wholingadbar.gif");
rand_href_b=new Array("http://www.dangdang.com/?from=P-105713","http://www.cydf.org/gb/donationol/index.htm","http://www.wholing.com/");

rand_image_size_c=new Array("120","60"); 
rand_image_c=new Array();
rand_href_c=new Array();


rand_image_size_d=new Array("88","31"); 
rand_image_d=new Array();
rand_href_d=new Array();


rand_image_size_e=new Array("113","48"); 
rand_image_e=new Array();
rand_href_e=new Array();


rand_image_size_f=new Array("116","44"); 
rand_image_f=new Array();
rand_href_f=new Array();


	
RAND_HREF=new Array(rand_href_a,rand_href_b,rand_href_c,rand_href_d,rand_href_e,rand_href_f);
RAND_IMAGE=new Array(rand_image_a,rand_image_b,rand_image_c,rand_image_d,rand_image_e,rand_image_f);
RAND_IMAGE_SIZE=new Array(rand_image_size_a,rand_image_size_b,rand_image_size_c,rand_image_size_d,rand_image_size_e,rand_image_size_f);
	
	
	count=new Array();
	n=new Array();

	var startpos=0;
	var c_temp=0;
	var cookiestring=document.cookie;
	
	var expires=new Date();
	expires.setTime(expires.getTime()+24*60*60*365*1000);
	tim=expires.toGMTString();
	if (cookiestring.indexOf("count",0)==-1)
	{
		for (i=0;i<RAND_HREF.length;i++)
		{
			document.cookie="count"+i+"=0"+";expires="+tim;
		}
	}

	function build(temp)
	{
		var exp=new Date();
		exp.setTime(exp.getTime()+24*60*60*365*1000);
		tim=exp.toGMTString();
		cookiestring=document.cookie;
		for (i=0;i<cookiestring.length;i++)
		{	
			startpos=cookiestring.indexOf("count",startpos+c_temp);
			if (startpos==-1) 
				break;
			var seppos=cookiestring.indexOf("=",startpos);
			var endpos=cookiestring.indexOf(";",startpos);
			if(endpos==-1)
				endpos=cookiestring.length;
			count[c_temp]=cookiestring.substring(seppos+1,endpos); 
			//alert(cookiestring.substring(seppos+1,cookiestring.length));
			//alert("cookiestring:"+cookiestring+" "+"c_temp="+c_temp+" "+"count["+c_temp+"]="+count[c_temp]+" "+seppos+" "+endpos);
			c_temp++;
		}
		rand=count[temp];
		document.write("<a href='"+RAND_HREF[temp][rand]+"' target='_blank'><img src='"+RAND_IMAGE[temp][rand]+"' width='"+RAND_IMAGE_SIZE[temp][0]+"' height='"+RAND_IMAGE_SIZE[temp][1]+"' border='0'></a>");		
		count[temp]++;
		if (count[temp]==RAND_HREF[temp].length) count[temp]=0;
		document.cookie="count"+temp+"="+count[temp]+";expires="+tim;
	}

