function checkAvailabe()
{	
	var uName = document.regFrm.userName.value;
	if(uName != "") {
		document.getElementById('checkImg').style.display = 'block';	
		setTimeout("doSomeThing()",500);
	}
	
}

function doSomeThing()
{
	var uName = document.regFrm.userName.value;
	if(uName != "") {
		xajax_userNameAvailable(uName);
	}
	document.getElementById('checkImg').style.display = 'none';
}

function checkPassword()
{
	var psd = document.regFrm.password.value;
	if(psd != "") {
		xajax_passStrength(psd);
	}

}

//this fun ic call from auction detail page 
function ajax_placeMyBid(idItem,aucType)
{		
	
	//document.getElementById('buy').style.display = 'block';
	xajax_placeMyBid(idItem,aucType);
	
	if(document.aucDetFrm.bidIndicator.value == 1){	
		
		if(aucType == 3){	
			document.getElementById('retail').style.display = 'block';
			document.getElementById('buyHidden').style.display = 'block';
			setTimeout("toggleMyHiddenAuction()",6000);
		}
	}

}

function toggleMyHiddenAuction()
{
	document.getElementById('retail').style.display = 'none';
	document.getElementById('buyHidden').style.display = 'none';
	document.aucDetFrm.bidIndicator.value = 0;
}

function ajax_placeBid(itemId,itemNum,aucType)
{	
	//retailPrice = document.getElementById('retail_'+itemId).innerHTML;
	//alert(retailPrice);
	if(itemId != "") {
		//alert("there");
		xajax_placeActualBid(itemId,itemNum,aucType)
	}

} 

function ajax_placeHiddenBid(itemId)
{
	xajax_placeHiddenBid(itemId);
	
	//if(document.getElementById('HidbidIndicator'+itemId).value == 1){
		
		document.getElementById('Hidretail_'+itemId).style.display = 'block';
		
		document.getElementById('Hidbuy'+itemId).style.display = 'block';
		document.getElementById('Hiddummy'+itemId).style.display = 'none';
		setTimeout("toggleHiddenAuction("+itemId+")",6000);			
				
	//}

}
function toggleHiddenAuction(itemId)
{
	document.getElementById('Hiddummy'+itemId).style.display = 'block';
	document.getElementById('Hidbuy'+itemId).style.display = 'none';
	document.getElementById('Hidretail_'+itemId).style.display = 'none';
	document.getElementById('HidbidIndicator'+itemId).value = 0;
	
}



function checkLogin(id,iId)
{
	if(id != ""){
		document.getElementById('ll'+iId).style.display = 'block';
	}else{
		document.getElementById('ll'+iId).style.display = 'none';
		document.getElementById('ntl'+iId).style.display = 'block';
	}
}

function removeCheck(iId) {
	document.getElementById('ll'+iId).style.display = 'block';
	document.getElementById('ntl'+iId).style.display = 'none';
}

function checkLoginFromDetail(id)
{
	if(id != ""){
		document.getElementById('ll').style.display = 'block';
	}else{
		document.getElementById('ll').style.display = 'none';
		document.getElementById('ntl').style.display = 'block';
	}
}

function removeCheckFromDetail() {
	document.getElementById('ll').style.display = 'block';
	document.getElementById('ntl').style.display = 'none';
}


function ajax_displayAuction()
{
	xajax_displayAuction();	
}

function ajax_updateAuctionValue(strUserNames,strUserIds)
{	//alert(strUserIds);
	xajax_updateAuctionValue(strUserNames,strUserIds);
}

function ajax_bidHistory(oldName)
{	
	//alert(price);
	xajax_bidHistory(oldName);
}

//this is toggle image at auction detail page
function toggleImage(imgName)
{	
	document.getElementById('itemImg').src="itemImage/"+imgName;		
}

//code after bis is closed
function ajax_closeAuction(item,num,aucType)
{
	//alert("In  javascript here");
	xajax_closeAuction(item,num,aucType)
}

//fun for buy it now operation
function ajax_buyNow(itemId)
{
	if(confirm('Are you sure you want to buy this item?')){
		//winPrice = document.getElementById('price'+itemId).innerHTML;
		xajax_buyNow(itemId);
	}
}

function ajax_HiddenbuyNow(itemId,whomAdd)
{
	if(confirm('Are you sure you want to buy this item?')){				
		xajax_HiddenbuyNow(itemId,whomAdd);
	}

}

function ajax_myBuyNow(itemId,whomAdd)
{
	if(confirm('Are you sure you want to buy this item?')){
		xajax_myBuyNow(itemId,whomAdd,'');
	}	
}

function ajax_closeMyAuction()
{
	//alert(aucTyp);
	//xajax_closeMyAuction();
}

//this fun is call from mySellItem page when user take auction
function takeAction(itemId,selectAucType)
{	
	document.sellItemFrm.selectItem.value = itemId;
	document.sellItemFrm.selectAucType.value = selectAucType;
	document.sellItemFrm.submit();
}


function ajax_getValue()
{
	xajax_getValue();
}

function hideUserName()
{
	
	document.lgnFrm.userName.value = '';
}
function hidePass()
{
	document.lgnFrm.password.value = '';
}

function ajax_autoBidderActive(item)
{
/*	var autoBid = document.getElementById('autoBidderDetail_'+item).value;
	var len = autoBid.length;	
	//alert(len);

	//alert(document.getElementById('autoBidderDetail_'+item).value);
	
	//alert(document.getElementById('countAutoBidder_'+item).innerHTML);
*/
	
	xajax_autoBidderActive(item);

}

function ajax_updateActiveAuctionPrice()
{
	//alert("here");
	xajax_updateActiveAuctionPrice();
}

function ajax_updateActiveMyAuction(id)
{
//	alert(id);
	xajax_updateActiveMyAuction(id);
}

function ajax_gotoPay(itemId)
{
	// this is the price which we are going to use to sell this item
	var price = document.getElementById('priceId'+itemId).innerHTML;
	//alert(price);
	xajax_gotoBuy(itemId,price);
}

function ajax_gotoMyPay(itemId)
{
	// this is the price which we are going to use to sell this item
	var price = document.getElementById('priceId').innerHTML;
	//alert(price);
	xajax_gotoMyBuy(itemId,price);
}


function confirmMyItemDelete(delId)
{
	
	if (confirm("Are you sure, you want to delete this Item permanently?")) {
		window.location = 'mySellItem.php?action=delete&id='+delId
	}
}

function ajax_loadAuctions()
{
	xajax_loadFirstTime();
}