// This function is used to Submit Step1 form
function submitStep1(frmObj){
	if(frmObj.rd_merchant_type[0].checked == false && frmObj.rd_merchant_type[1].checked == false){
		alert("Please select Merchant");
		return false;
	}
	
	frmObj.action = "add_product_feed_step1_a.php";
	frmObj.submit();
}



// This function is used to move category from one box to another
function move(fbox, tbox) {
	var i = 0;
	var strCatId = "";
	for(i=0;i<fbox.length;i++){
		if(fbox[i].selected){
			if(fbox[i].value != ""){
				var no = new Option();
				no.value = fbox[i].value;
				no.text = fbox[i].text;
				strCatId +=  fbox[i].value + ",";
				tbox.options[tbox.options.length] = no;
		   }
		}
	}
	remove(fbox);
}

// This function is used to move all category from one selection box to another
function moveall(fbox, tbox) {
	n = tbox.options.length;
	var strCatId = "";
	for(var i=0; i<fbox.options.length; i++){
		var no = new Option();
		no.value = fbox.options[i].value;
		no.text = fbox.options[i].text;
		strCatId +=  fbox.options[i].value + ",";
		tbox.options[n + i] = no;
		fbox.options[i].value = "";
	}
	removeall(fbox);
}

function remove(theSel) {
	var selIndex = theSel.selectedIndex;
	if(selIndex != -1){
		for(i=theSel.length-1; i>=0; i--){
			if(theSel.options[i].selected){
				theSel.options[i] = null;
			}
		}
		if (theSel.length > 0){
			theSel.selectedIndex = selIndex == 0 ? 0 : selIndex - 1;
		}
	}	
}

function removeall(box) {
	for(var i=0; i<box.options.length; i++) {
		box.options[i].value = "";
		box.options[i].text = "";
	}
	
	for(var i=box.options.length-1; i>=0; i--) {
		box.options[i].selected=true;
		box.remove(box.selectedIndex);
	}
} 


// This function is used to save the comment
function joinGroup(iGroupId){
	var doc = null; 
	if (typeof window.ActiveXObject != 'undefined' ) 
	{ 
		doc = new ActiveXObject("Microsoft.XMLHTTP"); 
	} 
	else 
	{ 
		doc = new XMLHttpRequest(); 
	}	
	
     doc.open("GET", "join_group_a.php?iGroupId=" + iGroupId,false);
	 doc.send(null);
	 
	 	if(doc.responseText)
	alert(doc.responseText);	 
	 
}








