<script language="JavaScript1.2">
function home_detail()
{
setTimeout("get_details('<?=$pids?>')",500);

}

function get_details(pids)
{ 
	url= "<?=_BASEURL_?>/ajax_frame_detail.php";	
	check_detail(url,pids);	
}
function check_detail(strURL,pids) { //alert(pids);
    var xmlHttpReq = false;
    var self = this;
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq && self.xmlHttpReq.readyState == 4) {
            updatepage(self.xmlHttpReq.responseText,pids);
        }
    }
    self.xmlHttpReq.send(getquery(pids));
}

function getquery(pids) {   
    qstr = 'pids=' + pids ;  	
	return qstr;
	
}

function updatepage(str,pids)
{ 

	document.getElementById("product_detail").innerHTML = str;
	  <? 
	   $parr = explode(",",$pids);
	   for($a=0; $a < count($parr)-1;$a++)
	   { ?>	  
	  document.getElementById("price_index_page_<?=$parr[$a]?>").innerHTML="" + document.frm.price_<?=$parr[$a]?>.value;	 
	  document.getElementById("winner_index_page_<?=$parr[$a]?>").innerHTML=document.frm.bider_<?=$parr[$a]?>.value;
	  
	  if(document.frm.new_<?=$parr[$a]?>.value == '1')
	  {
	  document.getElementById("price_index_page_<?=$parr[$a]?>").style.background='#cc0000';	 
	  document.frm.new_<?=$parr[$a]?>.value='0';
	  }
	  else
	  {
	  document.getElementById("price_index_page_<?=$parr[$a]?>").style.background='';	 
	  }
	  if(document.frm.diff_<?=$parr[$a]?>.value >= 1)
	  {
	  document.getElementById("button_finished_index_page_<?=$parr[$a]?>").style.display='';
	  document.getElementById("counter_index_page_<?=$parr[$a]?>").innerHTML=calc_counter_from_time22(document.frm.diff_<?=$parr[$a]?>.value); 
	  }
	  else
	  bid_ended(<?=$parr[$a]?>);
	  
	 <? } ?>
	
	
	start_looping();
	
}
function start_looping()
{
setTimeout("get_details('<?=$pids?>')",250);
}


</script>