function toggle(div_id) {
	var el = document.getElementById(div_id);
	if ( el.style.display == 'none' ) {	el.style.display = 'block';}
	else {el.style.display = 'none';}
}

function blanket_size(popUpDivVar) {
	if (typeof window.innerWidth != 'undefined') {
		viewportheight = window.innerHeight;
	} else {
		viewportheight = document.documentElement.clientHeight;
	}
	if ((viewportheight > document.body.parentNode.scrollHeight) && (viewportheight > document.body.parentNode.clientHeight)) {
		blanket_height = viewportheight;
	} else {
		if (document.body.parentNode.clientHeight > document.body.parentNode.scrollHeight) {
			blanket_height = document.body.parentNode.clientHeight;
		} else {
			blanket_height = document.body.parentNode.scrollHeight;
		}
	}
	var blanket = document.getElementById('blanket');
	blanket.style.height = blanket_height + 'px';
	var popUpDiv = document.getElementById(popUpDivVar);
	popUpDiv_height=blanket_height/2-150;//150 is half popup's height
	popUpDiv.style.top = popUpDiv_height + 'px';
}

function window_pos(popUpDivVar) {
	if (typeof window.innerWidth != 'undefined') {
		viewportwidth = window.innerHeight;
	} else {
		viewportwidth = document.documentElement.clientHeight;
	}
	if ((viewportwidth > document.body.parentNode.scrollWidth) && (viewportwidth > document.body.parentNode.clientWidth)) {
		window_width = viewportwidth;
	} else {
		if (document.body.parentNode.clientWidth > document.body.parentNode.scrollWidth) {
			window_width = document.body.parentNode.clientWidth;
		} else {
			window_width = document.body.parentNode.scrollWidth;
		}
	}
	var popUpDiv = document.getElementById(popUpDivVar);
	window_width=window_width/2-150;//150 is half popup's width
	popUpDiv.style.left = window_width + 'px';
}

function popup(windowname) {
	blanket_size(windowname);
	window_pos(windowname);
	toggle('blanket');
	toggle(windowname);		
}


var http = createRequestObject();
function createRequestObject() {
   var objAjax;
   var browser = navigator.appName;
   if(browser == "Microsoft Internet Explorer"){
      objAjax = new ActiveXObject("Microsoft.XMLHTTP");
   }else{
      objAjax = new XMLHttpRequest();
   }
   return objAjax;
}

//UPLOADING STARTS HERE
function RemovePhoto() {
   var RmvName=document.getElementById("ProfilePhotoName").value;
   http.open('get','includes/ajaxaction.php?act=remove123&Name='+RmvName);
   http.onreadystatechange = updateupload;
   http.send(null);
   return false;
}

function updateupload(){
   if(http.readyState == 4){
      document.getElementById('ProfileImage').innerHTML = http.responseText;
   }
}

//UPLOADING ENDS HERE
function RemoveUpdPhoto(id,name) {
   http.open('get','includes/ajaxaction.php?act=rmv&id='+id+ '&name='+ name);
   http.onreadystatechange = updatephoto;
   http.send(null);
   return false;
}

function updatephoto(){
   if(http.readyState == 4){
      document.getElementById('ItemImage').innerHTML = http.responseText;
   }
}
function pagingsmystuff(PageNo,Page){
  //if(Page = "STUF"){
  	   var memid=document.getElementById("memid").value;
	   http.open('get','includes/ajaxaction.php?act=del&PageNo='+PageNo+'&memid='+memid);
	   http.onreadystatechange = delstuffphoto;
	   http.send(null);
	   return false;
  //}
}
function delstuffphoto1(){
   if(http.readyState == 4){
	  document.getElementById('delstuff').innerHTML = http.responseText;
	}
}
//To Remove Item From My Stuff
function RemoveStuffItem(memid) {
	idValues=document.ItemList.idValues.value;
	PageNo=document.ItemList.PageNo.value;
	http.open('get','includes/ajaxaction.php?act=del&idValues='+idValues+'&PageNo='+PageNo+'&memid='+memid);
    http.onreadystatechange = delstuffphoto;
    http.send(null);
    return false;
}
function delstuffphoto(){
   if(http.readyState == 4){
      document.getElementById("confirmdeldiv").style.display="none";
	  document.getElementById('delstuff').innerHTML = http.responseText;
	}
}


function getNewContent(){
   var itemtype=document.getElementById("itemtype").value;
   http.open('get','includes/ajaxaction.php?id=category&item='+itemtype);
   http.onreadystatechange = updateNewContent;
   http.send(null);
   return false;
}
//FILTER MEMBER NAMES FOR COMPOSE MAIL BOX
function getUserNameFilter(){
   var memberto=document.getElementById("memberto").value;
   if(memberto != ""){
	    document.getElementById("updateFilterDiv").style.display="";		
		http.open('get','includes/ajaxaction.php?act=UserFilter&Word='+memberto);
   		http.onreadystatechange = updateFilter;
   		http.send(null);
   }
   return false;
}

//WITH DRAWBID FROM SUBMITTED BIDS PAGE
function WithDrawBid() {
   idValues=document.BIDSSUBMITTED.idValues.value;
   http.open('get','includes/ajaxaction.php?action=removeBid&id='+idValues);
   http.onreadystatechange = updateWithDrawBidDiv;
   http.send(null);
   return false;
}
function updateWithDrawBidDiv(){
   if(http.readyState == 4){
      hidealert();
	  document.getElementById('BidsISubmitted').innerHTML = http.responseText;
   }
}
function pagingsbidsireceived(PageNo,Page){
  if(Page = "BIDSR"){
	   http.open('get','includes/ajaxaction.php?action=removeBid&id='+idValues+'&PageNo='+PageNo);
	   http.onreadystatechange = updateWithDrawBidDiv;
	   http.send(null);
	   return false;
  }
}

//SAVE SEARCH
//
function SaveSearchRetrive(MemID,SearchWord,CATEGORYID,SUBCATEGORY,SIZE,COLOR,BRAND,CONDITION,ITEMTYPE1,ITEMTYPE2,ITEMTYPE3,ITEMTYPE4,LOOKINGFOR){
   http.open('get','includes/ajaxaction.php?act=SaveSearch&MemID='+ MemID + '&SearchWord='+ SearchWord + '&CATEGORY='+ CATEGORYID + '&SUBCATEGORY='+ SUBCATEGORY+ '&SIZE='+ SIZE + '&COLOR='+ COLOR + '&BRAND='+ BRAND + '&CONDITION='+ CONDITION + '&I1='+ ITEMTYPE1 + '&I2='+ ITEMTYPE2 + '&I3='+ ITEMTYPE3 + '&I4='+ ITEMTYPE4 + '&LOOKINGFOR='+ LOOKINGFOR);
   http.onreadystatechange = updateSaveSearch;
   http.send(null);
   return false;
}
//GET CATEGORIES WITH OUT SUBCATEGORIES
function SaveSearch(MemID,SearchWord,id){
	
   var CATEGORY = 0;var SUBCATEGORY = 0;var SIZE = 0;var COLOR = 0;var BRAND = 0;var CONDITION = 0;var LOOKINGFOR =0;
   var ITEMTYPE = "";
   var ITEMTYPE1 = "";
   var ITEMTYPE2 = "";
   var ITEMTYPE3 = "";
   var ITEMTYPE4 = "";
   var CATEGORYID = "";
   if(id == "true"){
	   if(document.AddItem.CATEGORY.value != 0){
		   CATEGORY = document.AddItem.CATEGORY.value;
		   CATEGORYARR = CATEGORY.split("@");
		   CATEGORYID = CATEGORYARR[0];
		   if(CATEGORYARR[1] == "true"){
				SUBCATEGORY = document.AddItem.SUBCATEGORY.value;
		   }
	   }
	   if(document.AddItem.SIZE.value != 0){
			SIZE = document.AddItem.SIZE.value;
	   }
	   if(document.AddItem.COLOR.value != 0){
			COLOR = document.AddItem.COLOR.value;
	   }
	   if(document.AddItem.BRAND.value != 0){
			BRAND = document.AddItem.BRAND.value;
	   }
	   if(document.AddItem.CONDITION.value != 0){
			CONDITION = document.AddItem.CONDITION.value;
	   }
	   if(document.AddItem.LOOKINGFOR.value != 0){
			LOOKINGFOR = document.AddItem.LOOKINGFOR.value;
	   }
	   if(document.AddItem.ITEMTYPE1.checked == true){
			ITEMTYPE1 = document.AddItem.ITEMTYPE1.value;
	   }
	   if (document.AddItem.ITEMTYPE2.checked == true){
			ITEMTYPE2 = document.AddItem.ITEMTYPE2.value;
	   }
	   if (document.AddItem.ITEMTYPE3.checked == true){
			ITEMTYPE3 = document.AddItem.ITEMTYPE3.value;
	   }
	   if (document.AddItem.ITEMTYPE4.checked == true){
			ITEMTYPE4 = document.AddItem.ITEMTYPE4.value;
	   }
   }
   
   http.open('get','includes/ajaxaction.php?act=SaveSearch&MemID='+ MemID + '&SearchWord='+ SearchWord + '&CATEGORY='+ CATEGORYID + '&SUBCATEGORY='+ SUBCATEGORY+ '&SIZE='+ SIZE + '&COLOR='+ COLOR + '&BRAND='+ BRAND + '&CONDITION='+ CONDITION + '&I1='+ ITEMTYPE1 + '&I2='+ ITEMTYPE2 + '&I3='+ ITEMTYPE3 + '&I4='+ ITEMTYPE4 + '&LOOKINGFOR='+ LOOKINGFOR);
   http.onreadystatechange = updateSaveSearch;
   http.send(null);
   return false;
}
function updateSaveSearch(){
   if(http.readyState == 4){
	  //document.getElementById('UDATE').innerHTML = http.responseText;
	  document.getElementById("STATUS").style.display="";
	  document.getElementById('STATUSTEXT').innerHTML = http.responseText;
   }
}
//GET CATEGORIES WITH OUT SUBCATEGORIES
function getCategory(dropdown,DDName,div,selected){
   http.open('get','includes/ajaxaction.php?DropDown=' + dropdown + '&DDName='+ DDName + '&Sel='+ selected);
   http.onreadystatechange = updateNewContent;
   http.send(null);
   return false;
}
function updateNewContent(){
   if(http.readyState == 4){
      document.getElementById('CATEGORYDIV1').innerHTML = http.responseText;
	  
   }
}

function updateNewContentADSE(){
   if(http.readyState == 4){
      document.getElementById('CATEGORY').innerHTML = http.responseText;
	  
   }
}

function getCategoryWithSubcateUpdate(selected,kepsel){
   selected = "";
   NoShow = "";
   if(document.updateitem.ITEMTYPE1.checked == true){
   		selected = "1000074";
   }
   if(document.updateitem.ITEMTYPE2.checked == true){
		if(selected != "")		{
			selected = selected+",";
		}
   		selected = selected+"1000075";
   }
   if(document.updateitem.ITEMTYPE3.checked == true){
   		if(selected != "")		{
			selected = selected+",";
		}		
		selected = selected+"1000076";
   }
   if(document.updateitem.ITEMTYPE4.checked == true){
   		if(selected != "")		{
			selected = selected+",";
		}		
		selected = selected+"1000077";
   }
   
   if(selected == ""){
   	   NoShow  = "NO";
   }
   
   http.open('get','includes/ajaxaction.php?act=listcategories&sel='+ selected +'&kepsel=' +kepsel+'&Show='+NoShow);
   http.onreadystatechange = updateNewContent;  //UPDATE SAME DIV TAG FOR
   http.send(null); 
   return false;
} 

//GET CATEGORIES WITH OUT SUBCATEGORIES
function getCategoryWithSubcate(selected,kepsel){
   
   selected = "";
   NoShow = "";
   if(document.AddItem.ITEMTYPE1.checked == true){
   		selected = "1000074";
   }
   if(document.AddItem.ITEMTYPE2.checked == true){
		if(selected != "")		{
			selected = selected+",";
		}
   		selected = selected+"1000075";
   }
   if(document.AddItem.ITEMTYPE3.checked == true){
   		if(selected != "")		{
			selected = selected+",";
		}		
		selected = selected+"1000076";
   }
   if(document.AddItem.ITEMTYPE4.checked == true){
   		if(selected != "")		{
			selected = selected+",";
		}		
		selected = selected+"1000077";
   }
   
   if(selected == ""){
   	   NoShow  = "NO";
   }
   
   http.open('get','includes/ajaxaction.php?act=listcategories&sel='+ selected +'&kepsel=' +kepsel+'&Show='+NoShow);
   http.onreadystatechange = updateNewContent;  //UPDATE SAME DIV TAG FOR
   http.send(null); 
   
   return false;
} 

//GET UPDATE ITEM
function getUpdateItemContent1(ITEM_TYPE,CATEGORY,SUBCATEGORY,SIZE,BRAND){
   selected = "";
   NoShow = "";
   if(document.updateitem.ITEMTYPE1.checked == true){
   		selected = "1000074";
   }
   if(document.updateitem.ITEMTYPE2.checked == true){
		if(selected != "")		{
			selected = selected+",";
		}
   		selected = selected+"1000075";
   }
   if(document.updateitem.ITEMTYPE3.checked == true){
   		if(selected != "")		{
			selected = selected+",";
		}		
		selected = selected+"1000076";
   }
   if(document.updateitem.ITEMTYPE4.checked == true){
   		if(selected != "")		{
			selected = selected+",";
		}		
		selected = selected+"1000077";
   }
   if(selected == ""){
   	   NoShow  = "NO";
   }
   http.open('get','includes/ajaxaction.php?act=getupdate1&ITEM_TYPE='+ selected +'&CATEGORY=' +CATEGORY+'&SUBCATEGORY='+SUBCATEGORY+'&SIZE='+SIZE+'&BRAND='+BRAND+'&Show='+NoShow);
   http.onreadystatechange = updateItemContent;  //UPDATE SAME DIV TAG FOR
   http.send(null); 
   return false;
} 

//GET CATEGORIES FOR ADVANCE SEARCH
function getCategoryForAdvanceSearch(selected,kepsel){
   selected = "";
   NoShow = "";
   if(document.AddItem.ITEMTYPE1.checked == true){
   		selected = "1000074";
   }
   if(document.AddItem.ITEMTYPE2.checked == true){
		if(selected != "")		{
			selected = selected+",";
		}
   		selected = selected+"1000075";
   }
   if(document.AddItem.ITEMTYPE3.checked == true){
   		if(selected != "")		{
			selected = selected+",";
		}		
		selected = selected+"1000076";
   }
   if(document.AddItem.ITEMTYPE4.checked == true){
   		if(selected != "")		{
			selected = selected+",";
		}		
		selected = selected+"1000077";
   }
   
   if(selected == ""){
   	   NoShow  = "NO";
   }
   
   http.open('get','includes/ajaxaction.php?act=listcategoriesForsearch&sel='+ selected +'&kepsel=' +kepsel+'&Show='+NoShow);
   http.onreadystatechange = updateNewContentAdvanceSearch;  //UPDATE SAME DIV TAG FOR
   http.send(null); 
   return false;
} 
function updateNewContentAdvanceSearch(){
   if(http.readyState == 4){
      document.getElementById('CATEGORYY').innerHTML = http.responseText;
	  
   }
}
function updateItemContent(){
   if(http.readyState == 4){
      var html = http.responseText.split("@@");
	  if(html[1] == "<select name='SUBCATEGORY' class='content' onChange=getSize('SIZE',this.value,'SIZESPAN','')><option value='no'>Select Sub Category</option></select>"){
	     document.getElementById('SUBCATEGORYDIV').innerHTML = "<select name='SUBCATEGORY' disabled><option value='0'>No Sub Category</option></select>";
	  	 document.getElementById('redstarid').innerHTML = "&nbsp;";
	  }
	  else{
	  	 document.getElementById('SUBCATEGORYDIV').innerHTML = html[1];
		 document.getElementById('redstarid').innerHTML = "<font color='#FF0000'>*</font>";
	  }
	  document.getElementById('CATEGORYDIV1').innerHTML = html[0];
	  
      document.getElementById('SIZESPAN').innerHTML = html[2];
	  //document.getElementById('BRANDSPAN').innerHTML = html[3];
   }
}

//GET CATEGORIES WITH OUT SUBCATEGORIES
function getSubCategory1(selcate){
	var data = selcate.split("@");
	if(data[1] == "true"){
		document.getElementById('redstarid').innerHTML = "<font color='#FF0000'>*</font>";
		getSubCategory(data[0]);
	}
	else{
	    document.getElementById('SUBCATEGORYDIV').innerHTML = "<select name='SUBCATEGORY'  disabled><option value='0'>No Sub Category</option></select>";
		document.getElementById('redstarid').innerHTML = "&nbsp;";
		getSize('SIZE',data[0],'SIZESPAN','');
	}
}
function getSubCategory(selcate){
   http.open('get','includes/ajaxaction.php?act=listsubcate&selcate='+ selcate);
   http.onreadystatechange = updateSubCategory;
   http.send(null);
   return false;
}

//GET SUBCATEGORY FOR SEARCH
function getSubCategoryForSearch(selcate){
   http.open('get','includes/ajaxaction.php?act=listsubcateForSearch&selcate='+ selcate);
   http.onreadystatechange = updateSubCategoryForSearch;
   http.send(null);
   return false;
}
//GET CATEGORIES FOR SEARCH
function getSubCategoryForSearch1(selcate){
	
	var data = selcate.split("@");
	if(data[1] == "true"){
		getSubCategoryForSearch(data[0]);
	}
	else{
	    document.getElementById('SUBCATEGORYSEARCH').innerHTML = "<select name='SUBCATEGORYAJAX'  disabled><option value='0'>No Sub Category</option></select>";
		getSizeForSearch('SIZE',data[0],'SIZESPAN','');
	}
}
function updateSubCategory(){
	if(http.readyState == 4){
      document.getElementById('SUBCATEGORYDIV').innerHTML = http.responseText;
   }
}
function updateSubCategoryForSearch(){
	if(http.readyState == 4){
      document.getElementById('SUBCATEGORYSEARCH').innerHTML = http.responseText;
   }
}

//GET SIZE FOR CATEGORY OR SUBCATEGORY
function getSize(dropdown,DDName,div,selected){
   http.open('get','includes/ajaxaction.php?act=size&sel='+ DDName);
   http.onreadystatechange = updateSize;
   http.send(null);
   return false;
} 
//GET SIZE FOR CATEGORY OR SUBCATEGORY FOR SEARCH
function getSizeForSearch(dropdown,DDName,div,selected){
   http.open('get','includes/ajaxaction.php?act=sizeForSearch&sel='+ DDName);
   http.onreadystatechange = updateSize;
   http.send(null);
   return false;
}
function updateSize(){
   if(http.readyState == 4){
      var html = http.responseText.split("@");
      document.getElementById('SIZESPAN').innerHTML = html[0];
   }
}

//GET BRAND FOR CATEGORY OR SUBCATEGORY
function getBrand(test,selected){
   http.open('get','includes/ajaxaction.php?act=brand&sel='+ selected);
   http.onreadystatechange = updateBrand;
   http.send(null);
   return false;
}
function updateBrand(){
   if(http.readyState == 4){
      document.getElementById('BRANDSPAN').innerHTML = http.responseText;
   }
}

function displaycategory(desc){
   http.open('get','includes/ajaxaction.php?desc=' + desc + '&categoryshow='+ 1);
   http.onreadystatechange = updatedisplaycategory;
   http.send(null);
   return false;
}
//SAVE RATING
function doRating(Rate,value){
	document.TradeFormRT.TRADE.value=document.getElementById("trade"+value).value;
	TradeId = document.getElementById("trade"+value).value;
	document.TradeFormRT.RATE.value=Rate;
	//document.TradeFormRT.submit();
	http.open('get','includes/ajaxaction.php?act=Rating&Rating=' + Rate + '&TradeId='+ TradeId+'&val='+value);
    http.onreadystatechange = Updatesmiley;
    http.send(null);
    return false;
}
function Updatesmiley(){
	if(http.readyState == 4){
	  var html = http.responseText.split("@@");
	  spanid = html[0];
	  spanid = parseInt(spanid);
      document.getElementById('SMILEYDIV'+spanid).innerHTML = html[1];
   }
}
//UPDATE TRADE STATUS FROM TRADE PAGE
function doSubmit(value){
	
	// commented code makes delivery confirmation required - Ibe 1/3/2009
	//if(document.getElementById("delconfirm"+value).value == ""){
	//	document.getElementById("DeliveryConfirm").style.display="block";
	//	return false;
	//}else{
		
		document.TradeForm.TRADE.value=document.getElementById("tradeA"+value).value;
		TRADEID = document.getElementById("tradeA"+value).value;
		document.TradeForm.BID.value=document.getElementById("bids"+value).value;
		BIDID = document.getElementById("bids"+value).value;
		document.TradeForm.SHIPSTATUS.value=document.getElementById("shipstatus"+value).value;
		SHIPSTATUS = document.getElementById("shipstatus"+value).value;
		document.TradeForm.DELCONFIRM.value=document.getElementById("delconfirm"+value).value;
		DELCONFIRM = document.getElementById("delconfirm"+value).value;
		
		document.getElementById('DELSTATUS'+TRADEID).innerHTML = "";
		http.open('get','includes/ajaxaction.php?act=UpdateStatus&TradeID=' + TRADEID + '&BidID='+ BIDID +'&ShipStatus='+SHIPSTATUS+'&DelConfirm='+DELCONFIRM);
		http.onreadystatechange = UpdateDelStatus;
		http.send(null);
		return false;
	//}
}
function UpdateDelStatus(){
	if(http.readyState == 4){
	  var html = http.responseText.split("@@");
	  spanid = html[0];
	  spanid = parseInt(spanid);
      //document.getElementById('DELSTATUS'+spanid).innerHTML = html[1];
	  document.getElementById("STATUS").style.display="block";
	  document.getElementById('STATUSTEXT').innerHTML = "Shipping Information Saved";
	 //document.getElementById('STATUSTEXT').innerHTML = http.responseText;
   }
}

//UPDATE TRADE RECEIVING STATUS AND FEED BACK FROM TRADE PAGE
function doSubmitSO(value){
	//if(document.getElementById("RCVstatus"+value).value == 1){
	if(document.getElementById("feedback"+value).value == ""){
		document.getElementById("EnterFeedback").style.display="block";
		document.getElementById("content").innerHTML="Enter feedback text";
		return false;
	}else{
		document.TradeFormSO.TRADE.value=document.getElementById("trade"+value).value;
		TradeID = document.getElementById("trade"+value).value;		
		document.TradeFormSO.FEEDBACK.value=document.getElementById("feedback"+value).value;
		FeedBack = document.getElementById("feedback"+value).value;
		document.TradeFormSO.RECVSTATUS.value=document.getElementById("RCVstatus"+value).value;
		RCVstatus = document.getElementById("RCVstatus"+value).value;
		
		http.open('get','includes/ajaxaction.php?act=UpdateReceiveStatus&TradeID=' + TradeID + '&FeedBack='+ FeedBack +'&RCVstatus='+RCVstatus);
		
		http.onreadystatechange = UpdateRevFeedback;
		http.send(null);
	}
	//}
	//else{
	//	document.getElementById("EnterFeedback").style.display="block";
	//	document.getElementById("content").innerHTML="You can enter feedback after receiving the product(s)";
	//}
}
function UpdateRevFeedback(){
	if(http.readyState == 4){
	  var html = http.responseText.split("@@");
	  spanid = html[0];
	  spanid = parseInt(spanid);
	  document.getElementById("STATUS").style.display="block";
	  document.getElementById('STATUSTEXT').innerHTML = "Feedback was Posted";
   }
}

//Add To FavoriteUser From Item Details Page
function AddtoFavoriteUser(MemID){
	http.open('get','includes/ajaxaction.php?act=AddtoFavoriteUser&MemID=' + MemID);
	http.onreadystatechange = UpdateAddtoFavorite;
	http.send(null);
}

function UpdateAddtoFavorite(){
	if(http.readyState == 4){
     // document.getElementById('UpdateAddtoFavoriteDiv').innerHTML = http.responseText;
	  document.getElementById("STATUS").style.display="block";
	  document.getElementById('STATUSTEXT').innerHTML = http.responseText;
   }
}

//Sends a test email to the current logged in user
function SendTestEmail(MemID){
	http.open('get','includes/ajaxaction.php?act=SendTestEmail&MemID=' + MemID);
	http.onreadystatechange = UpdateSendTestEmail;
	http.send(null);
}

function UpdateSendTestEmail(){
	if(http.readyState == 4){
     // document.getElementById('UpdateAddtoFavoriteDiv').innerHTML = http.responseText;
	  document.getElementById("STATUS").style.display="block";
	  document.getElementById('STATUSTEXT').innerHTML = http.responseText;
   }
}

//Update Selected Items In Place Bid Page
function showselected(ImageName,value1,itemid){
	//alert(document.getElementById('valueone').value);
	//val = document.getElementById('valueone').value;
	http.open('get','includes/ajaxaction.php?act=ADDSELECTED&ImageName=' + ImageName + '&value='+value1+'&item='+itemid);
	http.onreadystatechange = UpdateSelectedImage;
	http.send(null);
}
function UpdateSelectedImage(){
	if(http.readyState == 4){
      document.getElementById('SelectedImages').innerHTML = http.responseText;
   }
}
function showInbox(DelIds,PageNo,Mode){
	if(DelIds == "Multiple"){
		DelIds = document.inboxfrm.idValues.value;
	}
	if(DelIds == "Single"){
		DelIds = document.inboxfrm.delgifvalue.value;
	}
	http.open('get','includes/ajaxaction.php?act=SHOWINBOX&PageNo=' + PageNo + '&Mode='+Mode+'&DelIds='+DelIds);
	http.onreadystatechange = UpdateInbox123;
	http.send(null);
}
function UpdateInbox123(){
	
	if(http.readyState == 4){
	   var html = http.responseText.split("@@$$");
      document.getElementById('UpdateInboxHeader').innerHTML = html[0];
	  document.getElementById('UpdateInboxDiv').innerHTML = html[1];
   }
}
//UPDATEING PAGE OTHERS TEXTBOX
function showothersize(value){
	if(value == "101"){
		document.getElementById("errortxtO1").style.display="block";
		document.getElementById("othsizetextbox").style.display="block";
	}else{
		document.getElementById("errortxtO1").style.display="none";
		document.getElementById("othsizetextbox").style.display="none";
	}
}
function showothercolor(value){
	if(value == "101"){
		document.getElementById("errortxtO2").style.display="block";
		document.getElementById("othcolortextbox").style.display="block";
	}else{
		document.getElementById("errortxtO2").style.display="none";
		document.getElementById("othcolortextbox").style.display="none";
	}
}

function showotherbrand(value){
	if(value == "101"){
		document.getElementById("errortxtO3").style.display="block";
		document.getElementById("othbrandtextbox").style.display="block";
	}else{
		document.getElementById("errortxtO3").style.display="none";
		document.getElementById("othbrandtextbox").style.display="none";
	}
}
//
function divmessage(id)
{
   http.open('get','includes/ajaxaction.php?msgid=' + id + '&showid='+ 1);
   http.onreadystatechange = displaymsgdiv;
   http.send(null);
   return false;
}

function getContactAdd(){
   	if(document.getElementById("usecontact").checked==true){
   		var id=1;
	}
	else{
		var id=0;
   	}
   	http.open('get','includes/ajaxaction.php?showid=' + id + '&test='+1);
   	http.onreadystatechange = updateContactAdd;
   	http.send(null);
   	return false;
}
function getContactShipAdd(){
 	if(document.getElementById("useshipcontact").checked==true){
		var id=1;
	}
	else{
		var id=0;
	}
    http.open('get','includes/ajaxaction.php?showid=' + id + '&test='+2);
    http.onreadystatechange = updateContactShipAdd;
    http.send(null);
    return false;
}

function getUsernametext()
{
   var id=document.getElementById("USERID").value;
  
   if(document.getElementById("USERID").value.length==0){
		document.getElementById("USERID").style.border="1px solid #FF0000";
		document.getElementById("errortxt2").style.color="red";
		
	}
	
	else{
		document.getElementById("USERID").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt2").style.color="#494F53";
	}
	
	if(document.getElementById("USERID").value.length==0){
		document.getElementById("mandatorydiv").style.display="block";
		return false;
	}
	
	else{
	document.getElementById("mandatorydiv").style.display="none";
	contentdiv(1);
    document.getElementById("savingprocessuser").style.display="block";
	http.open('get','includes/ajaxaction.php?userid=' + id + '&editid='+ 1);
    http.onreadystatechange = displayusrdiv;
    http.send(null);
    return false;
	}
}
function displayusrdiv(){
	if(http.readyState == 4){
		//document.getElementById('SHOW1').style.display="block";
		//document.getElementById('EDIT1').style.display="none";
		document.getElementById('usernametxt').innerHTML =  http.responseText;
		document.getElementById("savingprocessuser").style.display="none";
		ShowField("15");
   	}
}
function getPasswordtext()
{
   var error = "";
   var id=document.getElementById("PASSWORD").value;
   if(document.getElementById("PASSWORD").value.length==0){
		document.getElementById("PASSWORD").style.border="1px solid #FF0000";
		document.getElementById("errortxt3").style.color="red";
		error = "PASSWORD";
	}
	else if(document.getElementById("PASSWORD").value.length<6){
		document.getElementById("PASSWORD").style.border="1px solid #FF0000";
		document.getElementById("errortxt3").style.color="red";
		error = "PASSWORD";
	}
	else{
		document.getElementById("PASSWORD").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt3").style.color="#7F9DB9";
	}
	
	if(document.getElementById("CPASSWORD").value.length==0){
		document.getElementById("CPASSWORD").style.border="1px solid #FF0000";
		document.getElementById("errortxt3").style.color="red";
		error = "PASSWORD";
	}
	else if(document.getElementById("CPASSWORD").value.length<6){
		document.getElementById("CPASSWORD").style.border="1px solid #FF0000";
		document.getElementById("errortxt3").style.color="red";
		error = "PASSWORD";
	}
	else{
		document.getElementById("CPASSWORD").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt3").style.color="#7F9DB9";
	}
	
	
	if((document.getElementById("PASSWORD").value != document.getElementById("CPASSWORD").value)){
		document.getElementById("PASSWORD").style.border="1px solid #FF0000";
		document.getElementById("CPASSWORD").style.border="1px solid #FF0000";
		document.getElementById("errortxt3").style.color="red";
		document.getElementById("errortxt3").style.color="red";
		error = "PASSWORD";	
	}
	else{
		document.getElementById("CPASSWORD").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt3").style.color="#494F53";
		document.getElementById("PASSWORD").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt3").style.color="#494F53";
	}
	
	if(error == ""){
		document.getElementById("mandatorydiv").style.display="none";
		contentdiv(1);
        document.getElementById("savingprocessuser").style.display="block";
		http.open('get','includes/ajaxaction.php?userid=' + id + '&editid='+ 2);
		http.onreadystatechange = displaypassdiv;
		http.send(null);
		return false;
	}
	else{
	    document.getElementById("mandatorydiv").style.display="block";
		return false;
	}
}

function displaypassdiv(){
if(http.readyState == 4){
	  //document.getElementById('SHOW2').style.display="block";
	  //document.getElementById('EDIT2').style.display="none";
	  document.getElementById("CPASSWORD").value="";
	  document.getElementById('passtxt').innerHTML = http.responseText;
	  document.getElementById("savingprocessuser").style.display="none";
	  ShowField("15");
	}
}

function getSecrettext()
{
   var id=document.getElementById("SECRETQ").value;
   if(document.getElementById("SECRETQ").value.length==0){
		document.getElementById("SECRETQ").style.border="1px solid #FF0000";
		document.getElementById("errortxt4").style.color="red";
		
	}
	else{
		document.getElementById("SECRETQ").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt4").style.color="#494F53";
	}
	if(document.getElementById("SECRETQ").value.length==0){
		document.getElementById("mandatorydiv").style.display="block";
		return false;
	}
	else{
	document.getElementById("mandatorydiv").style.display="none";
	contentdiv(1);
    document.getElementById("savingprocessuser").style.display="block";
    http.open('get','includes/ajaxaction.php?userid=' + id + '&editid='+ 3);
    http.onreadystatechange = displaysecretdiv;
    http.send(null);
	return false;
	}
   
}

function getSecretAnswertext(){
	var id=document.getElementById("SECRETA").value;
	if(document.getElementById("SECRETA").value.length==0){
		document.getElementById("SECRETA").style.border="1px solid #FF0000";
		document.getElementById("errortxt11").style.color="red";
		
	}
	else{
		document.getElementById("SECRETA").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt11").style.color="#494F53";
	}
	if(document.getElementById("SECRETA").value.length==0){
		document.getElementById("mandatorydiv").style.display="block";
		return false;
	}
	else{
	document.getElementById("mandatorydiv").style.display="none";
	contentdiv(1);
    document.getElementById("savingprocessuser").style.display="block";
	http.open('get','includes/ajaxaction.php?userid=' + id + '&editid='+ 11);
    http.onreadystatechange = displaysecretansdiv;
    http.send(null);
    return false;
	}
}

function emailcheck(email){
  			var emailvalue = email;
			var lstr=emailvalue.length;

			var dotindex=emailvalue.indexOf(".");
			var mytool_array=emailvalue.split("@");
			var mailid = mytool_array[0];
			var domain = mytool_array[1];
			var arrlength = mytool_array.length;
			if(arrlength == 2){
			
				var idlength=mailid.length;
				var domainlength = domain.length;
				var domaindotindex=domain.indexOf(".");
				var diff = domainlength - domaindotindex;
				if ((diff < 2)&&(diff > 1))
				{
					return 02;
				}
				if(!((domaindotindex >= 2) && (emailvalue.indexOf("@") > 0)))
				{
					return 02;			
				}
			}
			else
			{
				return 02;		
			}
			return 01;
}

function getEmailtext()
{
	
   var id=document.getElementById("EMAIL").value;
    var error = "";
   if(document.getElementById("EMAIL").value.length==0){
		document.getElementById("EMAIL").style.border="1px solid #FF0000";
		document.getElementById("errortxt5").style.color="red";
		error = "EMAIL";
	}
	else if(emailcheck(document.getElementById("EMAIL").value)==02){
		
		document.getElementById("EMAIL").style.border="1px solid #FF0000";
		document.getElementById("errortxt5").style.color="red";
		error = "EMAIL";
		
	}
	else{
		document.getElementById("EMAIL").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt5").style.color="#494F53";
	}
  
	if(error == ""){
	document.getElementById("mandatorydiv").style.display="none";
	contentdiv(2);
    document.getElementById("savingprocesscontact").style.display="block";
    http.open('get','includes/ajaxaction.php?userid=' + id + '&editid='+ 4);
    http.onreadystatechange = displayemaildiv;
    http.send(null);
    return false;
   }
   else{
	    document.getElementById("mandatorydiv").style.display="block";
		return false;
	}
	
}

function getCountrytext()
{
	
   var id=document.getElementById("COUNTRY").value;
   var error = "";
   
   if(document.getElementById("COUNTRY").value.length==0){
		document.getElementById("COUNTRY").style.border="1px solid #FF0000";
		document.getElementById("errortxt15").style.color="red";
		error = "EMAIL";
	}
	else{
		document.getElementById("COUNTRY").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt15").style.color="#494F53";
	}
  
	if(error == ""){
	document.getElementById("mandatorydiv").style.display="none";
	contentdiv(2);
    document.getElementById("savingprocesscontact").style.display="block";
    http.open('get','includes/ajaxaction.php?userid=' + id + '&editid='+ 14);
    http.onreadystatechange = displaycountrydiv;
    http.send(null);
    return false;
   }
   else{
	    document.getElementById("mandatorydiv").style.display="block";
		return false;
	}
	
}



function getAddresstext()
{
   var id1=document.getElementById("CFIRSTNAME").value;
   var id2=document.getElementById("CLASTNAME").value;
   var id3=document.getElementById("CADDRESS1").value;
   var id4=document.getElementById("CADDRESS2").value;
   var id5=document.getElementById("CCITY").value;
   var id6=document.getElementById("state").value;
   var id7=document.getElementById("CZIP").value;
   var id8=document.getElementById("CPHONEBOOK").value;
   
   id1 = id1.replace("#","-");
   id2 = id2.replace("#","-");
   id3 = id3.replace("#","-");
   id4 = id4.replace("#","-");
   id5 = id5.replace("#","-");
   id6 = id6.replace("#","-");
   id7 = id7.replace("#","-");
   
   var error="";
   if(document.getElementById("CFIRSTNAME").value.length==0){
		document.getElementById("CFIRSTNAME").style.border="1px solid #FF0000";
		document.getElementById("errortxt6").style.color="red";
		error="ADDRESS";
	}else {
		document.getElementById("CFIRSTNAME").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt6").style.color="#494F53";
	}
	
	if(document.getElementById("CLASTNAME").value.length==0){
		document.getElementById("CLASTNAME").style.border="1px solid #FF0000";
		document.getElementById("errortxt6").style.color="red";
		error="ADDRESS";
	}else {
		document.getElementById("CLASTNAME").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt6").style.color="#494F53";
	}

	if(document.getElementById("CADDRESS1").value.length==0){
		document.getElementById("CADDRESS1").style.border="1px solid #FF0000";
		document.getElementById("errortxt6").style.color="red";
		error="ADDRESS";
	}else {
		document.getElementById("CADDRESS1").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt6").style.color="#494F53";
	}
	
	if(document.getElementById("CCITY").value.length==0){
		document.getElementById("CCITY").style.border="1px solid #FF0000";
		document.getElementById("errortxt6").style.color="red";
		error="ADDRESS";
	}else {
		document.getElementById("CCITY").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt6").style.color="#494F53";
	}
	
	
	if(document.getElementById("state").value.length==0){
		document.getElementById("state").style.border="1px solid #FF0000";
		document.getElementById("errortxt6").style.color="red";
		error="ADDRESS";
	}else {
		document.getElementById("state").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt6").style.color="#494F53";
	}
	
	
	if(document.getElementById("CZIP").value.length==0){
		document.getElementById("CZIP").style.border="1px solid #FF0000";
		document.getElementById("errortxt6").style.color="red";
		error="ADDRESS";
	}
	else if(validateZIP(document.getElementById("CZIP").value)==false){
		document.getElementById("CZIP").style.border="1px solid #FF0000";
		document.getElementById("errortxt6").style.color="red";
		error="ADDRESS";
	}
	else {
		document.getElementById("CZIP").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt6").style.color="#494F53";
	}
	
	 if(document.getElementById("CPHONEBOOK").value.length==0){
		document.getElementById("CPHONEBOOK").style.border="1px solid #FF0000";
		document.getElementById("errortxt6").style.color="red";
		error="ADDRESS";
	}else {
		document.getElementById("CPHONEBOOK").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt6").style.color="#494F53";
	}
	
	if(error==""){
			
		document.getElementById("mandatorydiv").style.display="none";
		contentdiv(2);
        document.getElementById("savingprocesscontact").style.display="block";
		http.open('get','includes/ajaxaction.php?userid1=' + id1 + '&userid2=' + id2 + '&userid3=' + id3 + '&userid4=' + id4 + '&userid5=' + id5 + '&userid6=' + id6 + '&userid7=' + id7 + '&userid8=' + id8 + '&editid=5');
		http.onreadystatechange = displayadddiv;
		http.send(null);
		return false;
	}
	else{
	    document.getElementById("mandatorydiv").style.display="block";
		return false;
	}
	
}
function getShippingtext()
{
  
   var id3=document.getElementById("SADDRESS1").value;
   var id4=document.getElementById("SADDRESS2").value;
   var id5=document.getElementById("SCITY").value;
   var id6=document.getElementById("stateship").value;
   var id7=document.getElementById("SZIP").value;
   var id8=document.getElementById("SPHONEBOOK").value;
   
   id3 = id3.replace("#","-");
   id4 = id4.replace("#","-");
   id5 = id5.replace("#","-");
   id6 = id6.replace("#","-");
   id7 = id7.replace("#","-");
   
   var error="";
	if(document.getElementById("SADDRESS1").value.length==0){
		document.getElementById("SADDRESS1").style.border="1px solid #FF0000";
		document.getElementById("errortxt7").style.color="red";
		error = "ADDRESS";
	}else {
		document.getElementById("SADDRESS1").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt7").style.color="#494F53";
	}
	
	if(document.getElementById("SCITY").value.length==0){
		document.getElementById("SCITY").style.border="1px solid #FF0000";
		document.getElementById("errortxt7").style.color="red";
		error = "ADDRESS";
	}else {
		document.getElementById("SCITY").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt7").style.color="#494F53";
	}
	
	
	if(document.getElementById("stateship").value.length==0){
		document.getElementById("stateship").style.border="1px solid #FF0000";
		document.getElementById("errortxt7").style.color="red";
		error = "ADDRESS";
	}else {
		document.getElementById("stateship").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt7").style.color="#494F53";
	}
	
	
	if(document.getElementById("SZIP").value.length==0){
		document.getElementById("SZIP").style.border="1px solid #FF0000";
		document.getElementById("errortxt7").style.color="red";
		error = "ADDRESS";
	}
	else if(validateZIP(document.getElementById("SZIP").value)==false){
		document.getElementById("SZIP").style.border="1px solid #FF0000";
		document.getElementById("errortxt7").style.color="red";
		error = "ADDRESS";
	}
	else {
		document.getElementById("SZIP").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt7").style.color="#494F53";
	}
	
	if(document.getElementById("SPHONEBOOK").value.length==0){
		document.getElementById("SPHONEBOOK").style.border="1px solid #FF0000";
		document.getElementById("errortxt7").style.color="red";
		error = "ADDRESS";
	}else {
		document.getElementById("SPHONEBOOK").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt7").style.color="#494F53";
	}
	
   if(error==""){
	   document.getElementById("mandatorydiv").style.display="none";
	   contentdiv(2);
       document.getElementById("savingprocesscontact").style.display="block";
	   http.open('get','includes/ajaxaction.php?userid1=' + 1 + '&userid2=' + 2 + '&userid3=' + id3 + '&userid4=' + id4 + '&userid5=' + id5 + '&userid6=' + id6 + '&userid7=' + id7 + '&userid8=' + id8 + '&editid='+ 6);
	   http.onreadystatechange = displayshipadddiv;
	   http.send(null);
	   return false;
   }
     else{
	    document.getElementById("mandatorydiv").style.display="block";
		return false;
	}
   
}
function getShippingtextFromPlaceBid(itemid)
{
   var id3=document.getElementById("SADDRESS1").value;
   var id4=document.getElementById("SADDRESS2").value;
   var id5=document.getElementById("SCITY").value;
   var id6=document.getElementById("stateship").value;
   var id7=document.getElementById("SZIP").value;
   var id8=document.getElementById("SPHONEBOOK").value;
  
   id3 = id3.replace("#","-");
   id4 = id4.replace("#","-");
   id5 = id5.replace("#","-");
   id6 = id6.replace("#","-");
   id7 = id7.replace("#","-");
   
   var error="";
	if(document.getElementById("SADDRESS1").value.length==0){
		document.getElementById("SADDRESS1").style.border="1px solid #FF0000";
		document.getElementById("errortxt7").style.color="red";
		error = "ADDRESS";
	}else {
		document.getElementById("SADDRESS1").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt7").style.color="#494F53";
	}
	
	if(document.getElementById("SCITY").value.length==0){
		document.getElementById("SCITY").style.border="1px solid #FF0000";
		document.getElementById("errortxt7").style.color="red";
		error = "ADDRESS";
	}else {
		document.getElementById("SCITY").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt7").style.color="#494F53";
	}
	
	
	if(document.getElementById("stateship").value.length==0){
		document.getElementById("stateship").style.border="1px solid #FF0000";
		document.getElementById("errortxt7").style.color="red";
		error = "ADDRESS";
	}else {
		document.getElementById("stateship").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt7").style.color="#494F53";
	}
	if(document.getElementById("SZIP").value.length==0){
		document.getElementById("SZIP").style.border="1px solid #FF0000";
		document.getElementById("errortxt7").style.color="red";
		error = "ADDRESS";
	}
	else if(validateZIP(document.getElementById("SZIP").value)==false){
		document.getElementById("SZIP").style.border="1px solid #FF0000";
		document.getElementById("errortxt7").style.color="red";
		error = "ADDRESS";
	}
	else {
		document.getElementById("SZIP").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt7").style.color="#494F53";
	}
	
	if(document.getElementById("SPHONEBOOK").value.length==0){
		document.getElementById("SPHONEBOOK").style.border="1px solid #FF0000";
		document.getElementById("errortxt7").style.color="red";
		error = "ADDRESS";
	}else {
		document.getElementById("SPHONEBOOK").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt7").style.color="#494F53";
	}
	
   if(error==""){
	   document.getElementById("mandatorydiv").style.display="none";
	   contentdiv(2);
       document.getElementById("savingprocesscontact").style.display="block";
	   http.open('get','includes/ajaxaction.php?userid1=' + 1 + '&userid2=' + 2 + '&userid3=' + id3 + '&userid4=' + id4 + '&userid5=' + id5 + '&userid6=' + id6 + '&userid7=' + id7 + '&userid8=' + id8 + '&itemid=' + itemid + '&editid='+ 66);
	   http.onreadystatechange = displayshipadddiv_pb;
	   http.send(null);
	   return false;
   }
     else{
	    document.getElementById("mandatorydiv").style.display="block";
		return false;
	}
}
function displayshipadddiv_pb(){
if(http.readyState == 4){
      var html = http.responseText.split("@@");
      document.getElementById('shipaddtxt').innerHTML = html[0];
	  document.getElementById('placebidlinkdiv').innerHTML = html[1];
	  document.getElementById("savingprocesscontact").style.display="none";
	  ShowField("15");
   }
}
function getShippingtextFromReceivedBid(itemid)
{
   var id3=document.getElementById("SADDRESS1").value;
   var id4=document.getElementById("SADDRESS2").value;
   var id5=document.getElementById("SCITY").value;
   var id6=document.getElementById("stateship").value;
   var id7=document.getElementById("SZIP").value;
   var id8=document.getElementById("SPHONEBOOK").value;
   
   id3 = id3.replace("#","-");
   id4 = id4.replace("#","-");
   id5 = id5.replace("#","-");
   id6 = id6.replace("#","-");
   id7 = id7.replace("#","-");
   
   var error="";
	if(document.getElementById("SADDRESS1").value.length==0){
		document.getElementById("SADDRESS1").style.border="1px solid #FF0000";
		document.getElementById("errortxt7").style.color="red";
		error = "ADDRESS";
	}else {
		document.getElementById("SADDRESS1").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt7").style.color="#494F53";
	}
	
	if(document.getElementById("SCITY").value.length==0){
		document.getElementById("SCITY").style.border="1px solid #FF0000";
		document.getElementById("errortxt7").style.color="red";
		error = "ADDRESS";
	}else {
		document.getElementById("SCITY").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt7").style.color="#494F53";
	}
	
	
	if(document.getElementById("stateship").value.length==0){
		document.getElementById("stateship").style.border="1px solid #FF0000";
		document.getElementById("errortxt7").style.color="red";
		error = "ADDRESS";
	}else {
		document.getElementById("stateship").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt7").style.color="#494F53";
	}
	if(document.getElementById("SZIP").value.length==0){
		document.getElementById("SZIP").style.border="1px solid #FF0000";
		document.getElementById("errortxt7").style.color="red";
		error = "ADDRESS";
	}
	else if(validateZIP(document.getElementById("SZIP").value)==false){
		document.getElementById("SZIP").style.border="1px solid #FF0000";
		document.getElementById("errortxt7").style.color="red";
		error = "ADDRESS";
	}
	else {
		document.getElementById("SZIP").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt7").style.color="#494F53";
	}
	
	if(document.getElementById("SPHONEBOOK").value.length==0){
		document.getElementById("SPHONEBOOK").style.border="1px solid #FF0000";
		document.getElementById("errortxt7").style.color="red";
		error = "ADDRESS";
	}else {
		document.getElementById("SPHONEBOOK").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt7").style.color="#494F53";
	}
	
   if(error==""){
	   document.getElementById("mandatorydiv").style.display="none";
	   contentdiv(2);
       document.getElementById("savingprocesscontact").style.display="block";
	   http.open('get','includes/ajaxaction.php?userid1=' + 1 + '&userid2=' + 2 + '&userid3=' + id3 + '&userid4=' + id4 + '&userid5=' + id5 + '&userid6=' + id6 + '&userid7=' + id7 + '&userid8=' + id8 + '&itemid=' + itemid + '&editid='+ 67);
	   http.onreadystatechange = displayshipadddiv_rb;
	   http.send(null);
	   return false;
   }
     else{
	    document.getElementById("mandatorydiv").style.display="block";
		return false;
	}
}
function displayshipadddiv_rb(){
if(http.readyState == 4){
      var html = http.responseText.split("@@");
      document.getElementById('shipaddtxt').innerHTML = html[0];
	  document.getElementById('placebidlinkdiv').innerHTML = html[1];
	  document.getElementById("savingprocesscontact").style.display="none";
	  ShowField("15");
   }
}

function getCreditcardtextClear()
{
   var id1="";
   var id2="";
   var id3="";
   var id4="";
   var id5="";
   document.getElementById("CARDTYPE").value = "";
   document.getElementById("CARDNUM").value = "";
   document.getElementById("expmonth").value = "";
   document.getElementById("expyear").value = "";
   document.getElementById("CARDCCV").value = "";
   
   document.getElementById("BADDRESS1").value = "";
   document.getElementById("BADDRESS2").value = "";
   document.getElementById("BCITY").value = "";
   document.getElementById("statebilling").value = "";
   document.getElementById("BZIP").value = "";
   
   document.getElementById("mandatorydiv").style.display="none";
   contentdiv(3);
   document.getElementById("savingprocessfinancial").style.display="block";
   http.open('get','includes/ajaxaction.php?userid1=' + id1 + '&userid2=' + id2 + '&userid3=' + id3 + '&userid4=' + id4 +  '&userid5=' + id5 + '&editid='+ 67);
   http.onreadystatechange = displaycreditdiv;
   http.send(null);
   return false;
   
}
function getCreditcardtextClear1()
{
   var id1="";
   var id2="";
   var id3="";
   var id4="";
   var id5="";
   document.getElementById("CARDTYPE").value = "";
   document.getElementById("CARDNUM").value = "";
   document.getElementById("expmonth").value = "";
   document.getElementById("expyear").value = "";
   document.getElementById("CARDCCV").value = "";
   document.getElementById("mandatorydiv").style.display="none";
   contentdiv(3);
   document.getElementById("savingprocessfinancial").style.display="block";
   http.open('get','includes/ajaxaction.php?userid1=' + id1 + '&userid2=' + id2 + '&userid3=' + id3 + '&userid4=' + id4 +  '&userid5=' + id5 + '&editid='+ 7);
   http.onreadystatechange = displaycreditdiv;
   http.send(null);
   return false;
   
}
function getCredittext()
{
   var id1=document.getElementById("CARDTYPE").value;
   var id2=document.getElementById("CARDNUM").value;
   var id3=document.getElementById("expmonth").value;
   var id4=document.getElementById("expyear").value;
   var id5=document.getElementById("CARDCCV").value;
   var id6=document.getElementById("BADDRESS1").value;
   var id7=document.getElementById("BADDRESS2").value;
   var id8=document.getElementById("BCITY").value;
   var id9=document.getElementById("statebilling").value;
   var id10=document.getElementById("BZIP").value;
   
   id1 = id1.replace("#","-");
   id2 = id2.replace("#","-");
   id3 = id3.replace("#","-");
   id4 = id4.replace("#","-");
   id5 = id5.replace("#","-");
   id6 = id6.replace("#","-");
   id7 = id7.replace("#","-");
   id8 = id8.replace("#","-");
   id9 = id9.replace("#","-");
   id10 = id10.replace("#","-");
	
	
	if(document.getElementById("CARDTYPE").value.length==0 && document.getElementById("CARDNUM").value.length==0 && document.getElementById("CARDCCV").value.length==0 && document.getElementById("expmonth").value.length==0 && document.getElementById("expyear").value.length==0){
		//document.getElementById("mandatorydiv").style.display="block";
		//return false;
	}else{
		 if(document.getElementById("CARDTYPE").value==0){
			document.getElementById("CARDTYPE").style.border="1px solid #FF0000";
			document.getElementById("errortxt8").style.color="red";
			document.getElementById("errortxt81").style.color="red";
		}else {
			document.getElementById("CARDTYPE").style.border="1px solid #7F9DB9";
			document.getElementById("errortxt8").style.color="#494F53";
			document.getElementById("errortxt81").style.color="#494F53";
		}
		if(document.getElementById("CARDNUM").value.length==0){
			document.getElementById("CARDNUM").style.border="1px solid #FF0000";
			document.getElementById("errortxt8").style.color="red";
			document.getElementById("errortxt82").style.color="red";
		}else {
			document.getElementById("CARDNUM").style.border="1px solid #7F9DB9";
			document.getElementById("errortxt8").style.color="#494F53";
			document.getElementById("errortxt82").style.color="#494F53";
		}
		if(document.getElementById("CARDCCV").value.length==0){
			document.getElementById("CARDCCV").style.border="1px solid #FF0000";
			document.getElementById("errortxt8").style.color="red";
			document.getElementById("errortxt83").style.color="red";
		}else {
			document.getElementById("CARDCCV").style.border="1px solid #7F9DB9";
			document.getElementById("errortxt8").style.color="#494F53";
			document.getElementById("errortxt83").style.color="#494F53";
		}
		if((document.getElementById("CARDCCV").value.length>4) ||(document.getElementById("CARDCCV").value.length<3) ){
			document.getElementById("CARDCCV").style.border="1px solid #FF0000";
			document.getElementById("errortxt8").style.color="red";
			document.getElementById("errortxt83").style.color="red";
		}
		else {
			document.getElementById("CARDCCV").style.border="1px solid #7F9DB9";
			document.getElementById("errortxt8").style.color="#494F53";
			document.getElementById("errortxt83").style.color="#494F53";
		}
		
		if(document.getElementById("expmonth").value==0){
			document.getElementById("expmonth").style.border="1px solid #FF0000";
			document.getElementById("errortxt8").style.color="red";
			document.getElementById("errortxt84").style.color="red";
			
		}else {
			document.getElementById("expmonth").style.border="1px solid #7F9DB9";
			document.getElementById("errortxt8").style.color="#494F53";
			document.getElementById("errortxt84").style.color="#494F53";
		}
		
		
		if(document.getElementById("expyear").value==0){
			document.getElementById("stateship").style.border="1px solid #FF0000";
			document.getElementById("errortxt8").style.color="red";
			document.getElementById("errortxt84").style.color="red";
		}else {
			document.getElementById("expyear").style.border="1px solid #7F9DB9";
			document.getElementById("errortxt8").style.color="#494F53";
			document.getElementById("errortxt84").style.color="#494F53";
		}
		if(document.getElementById("BADDRESS1").value.length==0){
			document.getElementById("BADDRESS1").style.border="1px solid #FF0000";
			document.getElementById("errortxt9").style.color="red";
			document.getElementById("errortxt91").style.color="red";
		}else {
			document.getElementById("BADDRESS1").style.border="1px solid #7F9DB9";
			document.getElementById("errortxt9").style.color="#494F53";
			document.getElementById("errortxt91").style.color="#494F53";
		}
		if(document.getElementById("BCITY").value.length==0){
			document.getElementById("BCITY").style.border="1px solid #FF0000";
			document.getElementById("errortxt9").style.color="red";
			document.getElementById("errortxt93").style.color="red";
		}else {
			document.getElementById("BCITY").style.border="1px solid #7F9DB9";
			document.getElementById("errortxt9").style.color="#494F53";
			document.getElementById("errortxt93").style.color="#494F53";
		}

		if(document.getElementById("statebilling").value==0){
			document.getElementById("statebilling").style.border="1px solid #FF0000";
			document.getElementById("errortxt9").style.color="red";
			document.getElementById("errortxt94").style.color="red";
		}else {
			document.getElementById("statebilling").style.border="1px solid #7F9DB9";
			document.getElementById("errortxt9").style.color="#494F53";
			document.getElementById("errortxt94").style.color="#494F53";
		}
		if(document.getElementById("BZIP").value.length==0){
			document.getElementById("BZIP").style.border="1px solid #FF0000";
			document.getElementById("errortxt9").style.color="red";
			document.getElementById("errortxt95").style.color="red";
		}
		else if(validateZIP(document.getElementById("BZIP").value)==false){
			document.getElementById("BZIP").style.border="1px solid #FF0000";
			document.getElementById("errortxt9").style.color="red";
			document.getElementById("errortxt95").style.color="red";
		}
		else {
			document.getElementById("BZIP").style.border="1px solid #7F9DB9";
			document.getElementById("errortxt9").style.color="#494F53";
			document.getElementById("errortxt95").style.color="#494F53";
		}
		
		if(document.getElementById("CARDTYPE").value==0){
			document.getElementById("mandatorydiv").style.display="block";
			return false;
		}
		if(document.getElementById("CARDNUM").value.length==0){
			document.getElementById("mandatorydiv").style.display="block";
			return false;
		}
		if(document.getElementById("CARDCCV").value.length==0){
			document.getElementById("mandatorydiv").style.display="block";
			return false;
		}
		if(document.getElementById("expmonth").value==0){
			document.getElementById("mandatorydiv").style.display="block";
			return false;
		}
		if(document.getElementById("expyear").value==0){
			document.getElementById("mandatorydiv").style.display="block";
			return false;
		}
		
		if((document.getElementById("CARDCCV").value.length>4) ||(document.getElementById("CARDCCV").value.length<3) ){
			document.getElementById("mandatorydiv").style.display="block";
			return false;
		}
		if(document.getElementById("BADDRESS1").value.length==0){
			document.getElementById("mandatorydiv").style.display="block";
			return false;
		}
		if(document.getElementById("BCITY").value.length==0){
			document.getElementById("mandatorydiv").style.display="block";
			return false;
		}
		if(document.getElementById("statebilling").value.length==0){
			document.getElementById("mandatorydiv").style.display="block";
			return false;
		}
		if(document.getElementById("BZIP").value.length==0){
			document.getElementById("mandatorydiv").style.display="block";
			return false;
		}
		else if(validateZIP(document.getElementById("BZIP").value)==false){
			document.getElementById("mandatorydiv").style.display="block";
			return false;
		}
	}
   document.getElementById("CARDNUM").value = "";
   document.getElementById("mandatorydiv").style.display="none";
   contentdiv(3);
   document.getElementById("savingprocessfinancial").style.display="block";
   http.open('get','includes/ajaxaction.php?userid1=' + id1 + '&userid2=' + id2 + '&userid3=' + id3 + '&userid4=' + id4 +  '&userid5=' + id5 + '&userid6=' + id6 + '&userid7=' + id7 + '&userid8=' + id8 + '&userid9=' + id9 + '&userid10=' + id10 + '&editid='+ 7);
   http.onreadystatechange = displaycreditdiv;
   http.send(null);
   return false;   
}
function getBillingtext()
{
   var id3=document.getElementById("BADDRESS1").value;
   var id4=document.getElementById("BADDRESS2").value;
   
   var id5=document.getElementById("BCITY").value;
   var id6=document.getElementById("statebilling").value;
   var id7=document.getElementById("BZIP").value;
   var error="";
   if(document.getElementById("BADDRESS1").value.length==0){
		document.getElementById("BADDRESS1").style.border="1px solid #FF0000";
		document.getElementById("errortxt9").style.color="red";
		error = "ADDRESS";
		
	}else {
		document.getElementById("BADDRESS1").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt9").style.color="#494F53";
	}
	

	if(document.getElementById("BCITY").value.length==0){
		document.getElementById("BCITY").style.border="1px solid #FF0000";
		document.getElementById("errortxt9").style.color="red";
		error = "ADDRESS";
	}else {
		document.getElementById("BCITY").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt9").style.color="#494F53";
	}
	
	
	
	if(document.getElementById("statebilling").value.length==0){
		document.getElementById("statebilling").style.border="1px solid #FF0000";
		document.getElementById("errortxt9").style.color="red";
		error = "ADDRESS";
	}else {
		document.getElementById("statebilling").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt9").style.color="#494F53";
	}
	
	
	if(document.getElementById("BZIP").value.length==0){
		document.getElementById("BZIP").style.border="1px solid #FF0000";
		document.getElementById("errortxt9").style.color="red";
		error = "ADDRESS";
	}
	else if(validateZIP(document.getElementById("BZIP").value)==false){
		document.getElementById("BZIP").style.border="1px solid #FF0000";
		document.getElementById("errortxt9").style.color="red";
		error = "ADDRESS";
	}
	else {
		document.getElementById("BZIP").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt9").style.color="#494F53";
	}
	
	if(error==""){
	document.getElementById("mandatorydiv").style.display="none";
	contentdiv(3);
    document.getElementById("savingprocessfinancial").style.display="block";
	http.open('get','includes/ajaxaction.php?userid1=' + 1 + '&userid2=' + 2 + '&userid3=' + id3 + '&userid4=' + id4 + '&userid5=' + id5 + '&userid6=' + id6 + '&userid7=' + id7 + '&editid='+ 8);
    http.onreadystatechange = displaybilingdiv;
    http.send(null);
    return false;
    }
    else{
	    document.getElementById("mandatorydiv").style.display="block";
		return false;
	}
  
}
function getPayPaltextClear()
{
   document.getElementById("PAYPAL").value = "";
   document.getElementById("mandatorydiv").style.display="none";
   contentdiv(3);
   document.getElementById("savingprocessfinancial").style.display="block";
   http.open('get','includes/ajaxaction.php?userid=null&editid='+ 9);
   http.onreadystatechange = displaypaypaldiv;
   http.send(null);
   return false;
}
function getPayPaltext()
{
   var id=document.getElementById("PAYPAL").value;
    var error = "";
   if(document.getElementById("PAYPAL").value.length==0){
		document.getElementById("PAYPAL").style.border="1px solid #FF0000";
		document.getElementById("errortxt10").style.color="red";
		error = "PAYPAL";
	}
	else if(emailcheck(document.getElementById("PAYPAL").value)==02){
		document.getElementById("PAYPAL").style.border="1px solid #FF0000";
		document.getElementById("errortxt10").style.color="red";
		error = "PAYPAL";
		
	}
	else{
		document.getElementById("PAYPAL").style.border="1px solid #7F9DB9";
		document.getElementById("errortxt10").style.color="#494F53";
	}
  
	if(error == ""){
	document.getElementById("mandatorydiv").style.display="none";
	contentdiv(3);
    document.getElementById("savingprocessfinancial").style.display="block";
    http.open('get','includes/ajaxaction.php?userid=' + id + '&editid='+ 9);
    http.onreadystatechange = displaypaypaldiv;
    http.send(null);
    return false;
   }
   else{
	    document.getElementById("mandatorydiv").style.display="block";
		return false;
	}
}
function getPreferences()
{
	var open_text_preference="";
	var waist="";
	var length="";
	var shoes="";
	var hip="";
	var chest="";
	
	open_text_preference = document.getElementById("open_text_preference").value;
	waist = document.getElementById("waist").value;
	length = document.getElementById("length").value;
	shoes = document.getElementById("shoes").value;
	hip = document.getElementById("hip").value;
	chest = document.getElementById("chest").value;
	
   contentdiv(4);
   
   document.getElementById("savingprocesspreference").style.display="block";
   
   http.open('get','includes/ajaxaction.php?p1=' +open_text_preference + '&p2=' + waist + '&p3=' + length + '&p4=' + shoes + '&p5=' + hip + '&p6=' + chest + '&editid='+ 125);
   http.onreadystatechange = displayaccountpreferencesdiv;
   http.send(null);
   return false;
}
function getSignuptext()
{
	var id="";
	if(document.getElementById("signupmail").checked==true){
	var id=2;
	}
	else{
	var id=1;
	}
   contentdiv(4);
   document.getElementById("savingprocesspreference").style.display="block";
   http.open('get','includes/ajaxaction.php?userid=' + id + '&editid='+ 10);
   http.onreadystatechange = displaysignupdiv;
   http.send(null);
   return false;
}
function getLegaltext()
{
	var id="";
	if(document.getElementById("LEGALSTATUS").checked==true){
	var id=1;
	}
	else{
	var id=0;
	}
   contentdiv(4);
   document.getElementById("savingprocesspreference").style.display="block";
   http.open('get','includes/ajaxaction.php?userid=' + id + '&editid='+ 12);
   http.onreadystatechange = displaylegaldiv;
   http.send(null);
   return false;
}
function getTradetext()
{
	var id="";
	if(document.getElementById("TRADESTATUS").checked==true){
	var id=1;
	}
	else{
	var id=0;
	}
	contentdiv(4);
   document.getElementById("savingprocesspreference").style.display="block";
   http.open('get','includes/ajaxaction.php?userid=' + id + '&editid='+ 13);
   http.onreadystatechange = displaytradediv;
   http.send(null);
   return false;
}
function contentdiv(divid){

var content = "";
content="<table background='Images/imgalerttop.gif' style='background-repeat: no-repeat;' width='235' height='108' border=0><tr><td colspan='2' height='27'></td></tr><tr><td colspan='2' align='center' height='27' class='content'><img src='Images/Loading.gif' width='150' height='50'></td></tr><tr>";
content = content+"<tr>";
content = content+"<td width='30'></td>";
content = content+"<td align='center' valign='top'>&nbsp;";
content = content+"</td></tr></table>";										

	if(divid==1){
	document.getElementById("savingprocessuser").innerHTML=content;
	}
	if(divid==2){
	document.getElementById("savingprocesscontact").innerHTML=content;
	}
	if(divid==3){
	document.getElementById("savingprocessfinancial").innerHTML=content;
	}
	if(divid==4){
	document.getElementById("savingprocesspreference").innerHTML=content;
	}
}
function swapimagesjs(ItemID,ImageName){
   http.open('get','includes/ajaxaction.php?act=swap&ItemID=' + ItemID + '&ImageName='+ ImageName);
   http.onreadystatechange = swapdiv;
   http.send(null);
   return false;
}
function validateZIP(field) {
/*var valid = "0123456789-";
var hyphencount = 0;

//if (field.length!=5 && field.length!=10) {
//return false;
//}
for (var i=0; i < field.length; i++) {
temp = "" + field.substring(i, i+1);
if (temp == "-") hyphencount++;
if (valid.indexOf(temp) == "-1") {

return false;
}
//if ((hyphencount > 1) || ((field.length==10) && ""+field.charAt(5)!="-")) {

//return false;
  // }
}*/
return true;
}
/*function fieldvalues(){
   
   http.open('get','includes/ajaxaction.php?act=GetUpdatedValues');
    http.onreadystatechange = valdiv;
    http.send(null);
   return false;
}


function getColor(dropdown,DDName,div){
   http.open('get','includes/ajaxaction.php?DropDown=' + dropdown + '&DDName='+ DDName);
   http.onreadystatechange = updateColor;
   http.send(null);
   return false;
}
function getCondition(dropdown,DDName,div){
   http.open('get','includes/ajaxaction.php?DropDown=' + dropdown + '&DDName='+ DDName);
   http.onreadystatechange = updateCondition;
   http.send(null);
   return false;
}
function getBrand(dropdown,DDName,div){
   http.open('get','includes/ajaxaction.php?DropDown=' + dropdown + '&DDName='+ DDName);
   http.onreadystatechange = updateBrand;
   http.send(null);
   return false;
}*/






function updatedisplaycategory(){
if(http.readyState == 4){
      document.getElementById('categorydiv').innerHTML = http.responseText;
   }
}

function displaymsgdiv(){
if(http.readyState == 4){
      document.getElementById('showmsg').innerHTML = http.responseText;
   }
}

function swapdiv(){
if(http.readyState == 4){
      document.getElementById('swapdiv').innerHTML = http.responseText;
   }
}




function displaysecretdiv(){
if(http.readyState == 4){
	  //document.getElementById('SHOW3').style.display="block";
	  //document.getElementById('EDIT3').style.display="none";
      document.getElementById('secrettxt').innerHTML = http.responseText;
	  document.getElementById("savingprocessuser").style.display="none";
	  ShowField("15");
   }
}
function displaysecretansdiv(){
if(http.readyState == 4){
	  //document.getElementById('SHOW11').style.display="block";
	  //document.getElementById('EDIT11').style.display="none";
      document.getElementById('secretanstxt').innerHTML = http.responseText;
	  document.getElementById("savingprocessuser").style.display="none";
	  ShowField("15");
   }
}

function displayemaildiv(){
if(http.readyState == 4){
	  //document.getElementById('SHOW4').style.display="block";
	  //document.getElementById('EDIT4').style.display="none";
      document.getElementById('emailtxt').innerHTML = http.responseText;
	  document.getElementById("savingprocesscontact").style.display="none";
	  ShowField("15");
   }
}

function displaycountrydiv(){
if(http.readyState == 4){
	  //document.getElementById('SHOW4').style.display="block";
	  //document.getElementById('EDIT4').style.display="none";
      document.getElementById('countrytxt').innerHTML = http.responseText;
	  document.getElementById("savingprocesscontact").style.display="none";
	  ShowField("15");
   }
}


function displayadddiv(){
if(http.readyState == 4){
	  //document.getElementById('SHOW5').style.display="block";
	  //document.getElementById('EDIT5').style.display="none";
	  document.getElementById('addtxt').innerHTML = http.responseText;
	  document.getElementById("savingprocesscontact").style.display="none";
      ShowField("15");
	 
	  
   }
}
function displayshipadddiv(){
if(http.readyState == 4){
      //document.getElementById('SHOW6').style.display="block";
	  //document.getElementById('EDIT6').style.display="none";
      document.getElementById('shipaddtxt').innerHTML = http.responseText;
	  document.getElementById("savingprocesscontact").style.display="none";
	  ShowField("15");
   }
}
function displaycreditdiv(){
if(http.readyState == 4){
	  //document.getElementById('SHOW7').style.display="block";
	  //document.getElementById('EDIT7').style.display="none";
	  var html = http.responseText.split("@@");
	 
	  document.getElementById('METHOD').innerHTML = html[1];
      document.getElementById('credittxt').innerHTML = html[0];
	  document.getElementById("savingprocessfinancial").style.display="none";
	  ShowField("15");
   }
}
function displaybilingdiv(){
if(http.readyState == 4){
	  //document.getElementById('SHOW8').style.display="block";
	 // document.getElementById('EDIT8').style.display="none";
      document.getElementById('bilingtxt').innerHTML = http.responseText;
	  document.getElementById("savingprocessfinancial").style.display="none";
	  ShowField("15");
   }
}
function displaypaypaldiv(){
if(http.readyState == 4){
	  //document.getElementById('SHOW9').style.display="block";
	  //document.getElementById('EDIT9').style.display="none";
	  var html = http.responseText.split("@@");
	  document.getElementById('METHOD').innerHTML = html[1];
      document.getElementById('paypaltxt').innerHTML = html[0];
	  document.getElementById("savingprocessfinancial").style.display="none";
	  ShowField("15");
   }
}
function displaysignupdiv(){
if(http.readyState == 4){
	  //document.getElementById('SHOW10').style.display="block";
	  //document.getElementById('EDIT10').style.display="none";
      document.getElementById('signuptxt').innerHTML = http.responseText;
	  document.getElementById("savingprocesspreference").style.display="none";
	  ShowField("15");
   }
}
// profile
function displayaccountpreferencesdiv(){
if(http.readyState == 4){
      document.getElementById('preferences').innerHTML = http.responseText;
	  document.getElementById("savingprocesspreference").style.display="none";
	  HideField();
   }
}

function displaylegaldiv(){
if(http.readyState == 4){
	  //document.getElementById('SHOW12').style.display="block";
	  //document.getElementById('EDIT12').style.display="none";
      document.getElementById('legaltxt').innerHTML = http.responseText;
	  document.getElementById("savingprocesspreference").style.display="none";
	  ShowField("15");
   }
}
function displaytradediv(){
if(http.readyState == 4){
	  //document.getElementById('SHOW13').style.display="block";
	  //document.getElementById('EDIT13').style.display="none";
	  
      document.getElementById('tradetxt').innerHTML = http.responseText;
	  document.getElementById("savingprocesspreference").style.display="none";
	  ShowField("15");
	  
   }
}
function updateContactAdd(){
   if(http.readyState == 4){
   		document.getElementById('contactadd').innerHTML = http.responseText;
   }
}
function updateContactShipAdd(){
	if(http.readyState == 4){
    	document.getElementById('contactshipadd').innerHTML = http.responseText;
   	}
}

/*function valdiv(){
if(http.readyState == 4){
      document.getElementById('valuediv').innerHTML = http.responseText;
	 
   }
}

function updateColor(){
   if(http.readyState == 4){
      document.getElementById('COLORSPAN').innerHTML = http.responseText;
   }
}
function updateCondition(){
   if(http.readyState == 4){
      document.getElementById('CONDITIONSPAN').innerHTML = http.responseText;
   }
}
function updateBrand(){
   if(http.readyState == 4){
      document.getElementById('BRANDSPAN').innerHTML = http.responseText;
   }
}
*/
