/****
*	Javascript specific for the auction details page
*/
function styleChange( idName ){
	var x;
	
	if ((x=document.getElementById(idName))!=null){

		x.className = "rowhover"
	}
}

function rowSwitch( rowName, idName ){
	
	//alert(rowName)
	//alert(idName)
	if ((x=document.getElementById(idName))!=null){
		if (rowName == "row1"){
			x.className = "row1"
		}else{
			x.className = "row2"
		}
	}

}

function bid_minimum(bid, textId){
		
	if ((x=document.getElementById(textId))!=null){
		x.value = bid
		
		return true
	}
	return false;
}

function imgswap(targetId, imgpath, rowId, secName){
	
	styleChange( rowId );
	imgSection = secName + 'img_title';
	if ((imgtitle=document.getElementById(imgSection))!=null){
		imgtitle.innerHTML =rowId;
	}
	
	if ((tarId=document.getElementById(targetId))!=null){
		tarId.src=imgpath
	}
}

function featureImageSwap(targetId, imgpath){
		
	if ((tarId=document.getElementById(targetId))!=null){
		tarId.src=imgpath
	}
}

var xmlhttp=false; 

//if (!xmlhttp && typeof XMLHttpRequest!='undefined') { 
//  xmlhttp = new XMLHttpRequest(); 
//} 

if (window.XMLHttpRequest) {
	xmlhttp = new XMLHttpRequest(); 
}else{
	xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}

	//this.timerID = setInterval(function () { thisObj.get(true); }, interval);
function refrech_if_bidchange(script_url) { 
	//alert(script_url);
    xmlhttp.open("GET", script_url); 
    xmlhttp.onreadystatechange = function() { 
      if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { 
      resRefresh = xmlhttp.responseText; 
      
      //alert(resRefresh);
	      if(resRefresh == 1){
	      //	var sURL = unescape(window.location.pathname);
	      	window.location.reload( true );
	      }else{
	
	      }
      } 
    } 
    xmlhttp.send(null); 
} 

function bid_loop(id, curr_bid){
	window.setInterval( "refrech_if_bidchange('/classes/class.bidAjax.php?id="+id+"&bid="+curr_bid+"');", 15000); 
}