function GetADinfo(tid,htmlid,w,s)
{ 
 var url ='/GetAD.aspx';
 var pars ='tid='+tid;
 var myAjax = new Ajax.Request(url,{method: 'get', parameters: pars, onComplete:showResponse}); 

function showResponse(originalRequest)
{
	
var cc = originalRequest.responseText;
  var xmlDoc;
  try
  {
 	 xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
  }
  catch(e)
  {
  xmlDoc = document.implementation.createDocument("text/xml", "", null);
  }
  xmlDoc.async=false;
  xmlDoc.loadXML(cc);
  var xmlnode=xmlDoc.selectSingleNode("//ds");
  var html="";  
  for(i=0;i<xmlnode.childNodes.length;i++)
  {  
  html="<a href=\""+xmlnode.childNodes.item(i).getAttribute('url')+"\" target=\"_blank\" ><img src=\""+xmlnode.childNodes.item(i).getAttribute('files')+"\" border=0 width=\""+w+" height=\""+s+"\" alt=\""+xmlnode.childNodes.item(i).getAttribute('title')+"\"></a>";  
  }
 

  $(htmlid).innerHTML=html       
    
 
}
}

function GetADinfoForFlash(tid,htmlid,w,s)
{ 
 var url ='/GetADForFlash.aspx';
 var pars ='tid='+tid;
 var myAjax = new Ajax.Request(url,{method: 'get', parameters: pars, onComplete:showResponse}); 

function showResponse(originalRequest)
{
	
var cc = originalRequest.responseText;

  var xmlDoc;
  try
  {
 	 xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
  }
  catch(e)
  {
  xmlDoc = document.implementation.createDocument("text/xml", "", null);
  }
  xmlDoc.async=false;
  xmlDoc.loadXML(cc);
  var xmlnode=xmlDoc.selectSingleNode("//ds");
  var html="";
  var focus_width=740;
  var focus_height=80;
  var text_height=0;  
  var swf_height = focus_height+text_height;
  var pics="";
  var links="";
  var texts="";

  for(i=0;i<xmlnode.childNodes.length;i++)
  {
	  pics+=xmlnode.childNodes.item(i).getAttribute('files')+'|';
	  links+=xmlnode.childNodes.item(i).getAttribute('url')+'|';
	  texts+=xmlnode.childNodes.item(i).getAttribute('title')+'|';
	 
  }
 
  html+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="/Js/Swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">'
  html+='<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="/Js/Swf.swf"><param name="quality" value="high"><param name="bgcolor" value="#ffffff">';
  html+='<param name="menu" value="false"><param name=wmode value="opaque">';
  html+='<param name="FlashVars" value="pics='+pics.substring(0,pics.length-1)+'&links='+links.substring(0,links.length-1)+'&texts='+texts.substring(0,texts.length-1)+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">';
  html+='<embed src="/Js/Swf.swf" wmode="opaque" FlashVars="pics='+pics.substring(0,pics.length-1)+'&links='+links.substring(0,links.length-1)+'&texts='+texts.substring(0,texts.length-1)+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#ffffff" quality="high" width="'+ focus_width +'" height="'+ focus_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';  
  document.getElementById(htmlid).innerHTML=html;    
    
 
}
}