





var xmlAddCategoryHttp = null;

var xmlLoadCategoryHttp = null;

var xmlUpdateCategoryHttp = null;

var xmlDeleteCategoryHttp = null;

var xmlStatusCategoryHttp = null;



var xmlAddProductHttp = null;

var xmlUpdateProductHttp = null;

var xmlLoadProductsHttp = null;

var xmlDeleteProductHttp = null;

var xmlStatusProductHttp = null;



var xmlAddHeadingHttp = null;

var xmlloadHeadingHttp = null;

var xmlEditHeadingHttp = null;

var xmlUpdateHeadingHttp = null;

var xmlDeleteHeadingHttp = null;

var xmlProductHeadingHttp = null;

var xmlAddServiceHttp = null;

var xmlLoadServiceHttp = null;

var xmlEditServiceHttp = null;

var xmlDeleteServiceHttp = null;

var xmlAddVideoHttp = null;

var xmlLoadVideosHttp = null;

var xmlDeleteVideoHttp = null;

var xmlUsersListHttp = null;

var xmlSearchProductListHttp = null;

var glbHeadingData = "";



var xmlAddNavigationMenuHttp = null;

var xmlLoadMenusHttp = null;

var xmlUpdateMenuHttp = null;

var xmlDeleteMenuHttp = null;

var xmlStatusMenusHttp = null;



var xmlAddIndexDataHttp = null;

var xmlLoadIndexHttp = null;

var xmlUpdateIndexHttp = null;

var xmlDeleteIndexHttp = null;

var xmlStatusIndexHttp = null;



var xmlAddBirthdayProgramHttp = null;

var xmlLoadBirhtdayProgramHttp = null;

var xmlUpdateBirthdayProgramHttp = null;

var xmlDeleteBirthdayProgramHttp = null;

var xmlStatusBirthdayProgramHttp = null;







var xmlAddTestimonialHttp = null;

var xmlLoadTestimonialHttp = null;

var xmlUpdateTestimonialHttp = null;

var xmlDeleteTestimonialHttp = null;

var xmlStatusTestimonialHttp = null;



var xmlAddSubCategoryHttp = null;

var xmlLoadSubCategoryHttp = null;

var xmlUpdateSubCategoryHttp = null;

var xmlDeleteSubCategoryHttp = null;

var xmlStatusSubCategoryHttp = null;



var xmlProductBoxCheckHttp = null;

var xmlAddCartHttp = null;

var xmlLoadShopListHttp = null;

var xmlLoadShopHttp = null;

var xmlDeleteCartHttp = null;



var xmlUserTestimonialHttp = null;



var xmlCardDetailHttp = null;



var xmlBirthdaySumissionHttp = null;



var xmlProductBoxAllDataHttp = null;

function AddHeading(divName) {

	//alert(divName);

	if(document.getElementById(divName).style.display=="none") {

	document.getElementById(divName).style.display="inline";

		if(document.getElementById("editheading").style.display = "inline") {

			document.getElementById("editheading").style.display = "none";

		}

	} else {

	document.getElementById(divName).style.display="none";

	}

}



function AddCategory(divName) {

	//alert(divName);

	if(document.getElementById(divName).style.display=="none") {

	document.getElementById(divName).style.display="inline";

		if(document.getElementById("editcategory").style.display = "inline") {

			document.getElementById("editcategory").style.display = "none";

		}

	} else {

	document.getElementById(divName).style.display="none";

	}

}



function showProductType(value) {

    //alert(value);

try{

    if(value=="Mobiles") {

        document.getElementById("mobiles").style.display = "inline";

        document.getElementById("accessories").style.display = "none";

    }

    if(value=="Accessories") {

        document.getElementById("mobiles").style.display = "none";

        document.getElementById("accessories").style.display = "inline";

    }

}catch(e){

    alert(e.discription);

}

}





function showCategoryType(value) {

	try {

	 var url = "php/load.mobile.models.php?catid="+value;

	//alert(url);

		xmlCategoryTypeHttp = GetXmlHttpObject();

		xmlCategoryTypeHttp.onreadystatechange = stateCategoryType;

		xmlCategoryTypeHttp.open("GET",url,true);

		xmlCategoryTypeHttp.send(null);

		//document.getElementById("").innerHTML = "<img src=images/.gif>";

	} catch(e) {

	alert(e.discription);

	}

}



function stateCategoryType() {

	try {

		if(xmlCategoryTypeHttp.readyState==4 || xmlCategoryTypeHttp.readyState=="complete") {

			try{

				//document.getElementById("").innerHTML = "";

			var result = xmlCategoryTypeHttp.responseText;

				//alert(result);

			document.getElementById("mobilemodels").innerHTML = result;

			} catch(e) {

				alert(e.description + " My Error");	

			  }

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function showMobileType(mobileId) {

	try {

	 var url = "php/load.search.product.php?mobileId="+mobileId;

	//alert(url);

		xmlMobileTypeHttp = GetXmlHttpObject();

		xmlMobileTypeHttp.onreadystatechange = stateMobileType;

		xmlMobileTypeHttp.open("GET",url,true);

		xmlMobileTypeHttp.send(null);

		//document.getElementById("").innerHTML = "<img src=images/.gif>";

	} catch(e) {

	alert(e.discription);

	}

}

function stateMobileType() {

	try {

		if(xmlMobileTypeHttp.readyState==4 || xmlMobileTypeHttp.readyState=="complete") {

			try{

				//document.getElementById("").innerHTML = "";

			var result = xmlMobileTypeHttp.responseText;

				//alert(result);

				document.getElementById("LoadProductsResult").style.display = "none";

				document.getElementById("mobileslist").style.display = "inline";

				document.getElementById("mobileslist").innerHTML = result;

				//document.getElementById("searchresult").innerHTML = result;

				//document.getElementById("searchresult").style.display = "inline";

			} catch(e) {

				alert(e.description + " My Error");	

			  }

		}

	}

	catch(e) {

	alert(e.description);

	}

}





function searchProductList() {

	try {

	var url = "php/load.search.product.php?searchdata="+document.getElementById("searchbox").value+"&catid=" +document.getElementById("categoryid").value;

	//alert(url);

		xmlSearchProductListHttp = GetXmlHttpObject();

		xmlSearchProductListHttp.onreadystatechange = stateSearchProduct;

		xmlSearchProductListHttp.open("GET",url,true);

		xmlSearchProductListHttp.send(null);

		//document.getElementById("listproducts").innerHTML = "<img src=images/product-loader.gif>";

	} catch(e) {

	alert(e.discription);

	}

}



function stateSearchProduct() {

	try {

		if(xmlSearchProductListHttp.readyState==4 || xmlSearchProductListHttp.readyState=="complete") {

			try{

				//document.getElementById("listproducts").innerHTML = "";

			var result = xmlSearchProductListHttp.responseText;

				//alert(result);

				document.getElementById("LoadProductsResult").style.display = "none";

				document.getElementById("searchresult").innerHTML = result;

				document.getElementById("searchresult").style.display = "inline";

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}





function validateForm(formName,extValue,recordid) {

	//alert(formName);

	//alert(recordid);

var errResultData = "";

var errdata = "";

var queryString = "";

var totElement = formName.length;

//document.getElementById("result").innerHTML = "";



	if(formName.name=="purchaseproduct") {

		//if(document.getElementById("travel_cpolicy").value == "2")  {

		extValue += "personalize_text";

		//}

	}

	if(formName.name=="purchaseownproduct") {

		//if(document.getElementById("travel_cpolicy").value == "2")  {

		extValue += "personalize_text";

		//}

	}

	

	for(i=0;i<totElement;i++){

		var element = formName.elements[i];

		//alert(element.id);

	//	if(element.id!="h_heading[]" && element.id!="service[]") {

			if(extValue.search(element.id)==-1) {

			switch(element.type) {

			case "text":

				if(element.value=="") {

					//alert("err");

					document.getElementById(element.id + "_err").innerHTML = "<font color=red>Required</font>";

					errdata += element.id + ",";

				} else {

					document.getElementById(element.id + "_err").innerHTML = "";

					queryString += element.id + "=" + element.value + "&";

					var myval = element.id;

					if(myval.search("email")!=-1 || myval.search("mail")!=-1) {

						if(isNotEmail(element.value)) {

								document.getElementById(element.id+"_err").innerHTML=" Not valid Email!!";

								errdata += element.id + ",";

						}

					}

				}

			break;

			case "password":

				if(element.value=="") {

					document.getElementById(element.id + "_err").innerHTML = "<font color=red>Required</font>";

					errdata += element.id + ",";

				} else {

					document.getElementById(element.id + "_err").innerHTML = "";

					queryString += element.id + "=" + element.value + "&";

				}

			break;

			case "select-one":

				//alert(element.value);

				if(element.value=="") {

					document.getElementById(element.id + "_err").innerHTML = "<font color=red>Required</font>";

					errdata += element.id + ",";

				} else {

					document.getElementById(element.id + "_err").innerHTML = "";

					queryString += element.id + "=" + element.value + "&";

				}

			break;

			case "textarea":

				//alert(element.value);

				if(element.value=="") {

					document.getElementById(element.id + "_err").innerHTML = "<font color=red>Required</font>";

					errdata += element.id + ",";

				} else {

					document.getElementById(element.id + "_err").innerHTML = "";

					queryString += element.id + "=" + element.value + "&";

				}

			break;

			case "file":

				if(element.value=="") {

					document.getElementById(element.id + "_err").innerHTML = "<font color=red>Required</font>";

					errdata += element.id + ",";

				} else {

					document.getElementById(element.id + "_err").innerHTML = "";

					//queryString += element.id + "=" + element.value + "&";

				}

			break;

			case "hidden":

			//alert(document.getElementById(element.id).value);

				if(element.id=="productid" || element.id=="imagename" || element.id=="menuid" || element.id=="product_for" || element.id=="purchaseamount") {

				queryString += element.id + "=" + element.value + "&";

				}

			break;

			default:

				

			break;

			}

		} else {

			queryString += element.id + "=" + element.value + "&";

		}

	 // }

	}

	



				

//alert(errdata);

	

		if(errdata.length==0) {

		//alert("Correct");

				

				if(formName.name=="addcategory") {

				//glbData = formName.name;

				//var myurl = "php/add.categories.php?" + queryString + "&type=" + glbData;

				var myurl = "php/add.categories.php?" + queryString;

				//alert(myurl);

				xmlAddCategoryHttp = GetXmlHttpObject();

				xmlAddCategoryHttp.onreadystatechange = stateAddCategory;

				xmlAddCategoryHttp.open("GET",myurl,true);

				xmlAddCategoryHttp.send(null);

				//document.getElementById("loader").style.visibility = "visible";

				}

				

				if(formName.name=="addsubcategory") {

				var myurl = "php/add.subcategory.php?" + queryString;

				//alert(myurl);

				xmlAddSubCategoryHttp = GetXmlHttpObject();

				xmlAddSubCategoryHttp.onreadystatechange = stateAddSubCategory;

				xmlAddSubCategoryHttp.open("GET",myurl,true);

				xmlAddSubCategoryHttp.send(null);

				//document.getElementById("loader").style.visibility = "visible";

				}

				

				if(formName.name=="addmenu") {

				var myurl = "php/add.navigation.menu.php?" + queryString;

				//alert(myurl);

				xmlAddNavigationMenuHttp = GetXmlHttpObject();

				xmlAddNavigationMenuHttp.onreadystatechange = stateAddNavigationMenu;

				xmlAddNavigationMenuHttp.open("GET",myurl,true);

				xmlAddNavigationMenuHttp.send(null);

				//document.getElementById("loader").style.visibility = "visible";

				}

				

				/*if(formName.name=="editcaregorylist") {

				var myurl = "php/update.categories.php?" + queryString + "&recordid=" + recordid;

				alert(myurl);

				xmlUpdateCategoryHttp = GetXmlHttpObject();

				xmlUpdateCategoryHttp.onreadystatechange = stateUpdateCategory;

				xmlUpdateCategoryHttp.open("GET",myurl,true);

				xmlUpdateCategoryHttp.send(null);

				//document.getElementById("loader").style.visibility = "visible";

				}*/

				

				if(formName.name=="productmaster") {

				  try {

					//alert("hi");

					var buttonValue = document.getElementById("actionType").value;

					if(buttonValue=="add") {

					var myurl = "php/add.products.php?" + queryString;

					//alert(myurl);

					}

					if(buttonValue=="edit") {

					var myurl = "php/update.products.php?" + queryString + "&heading=" + headingData;

					//alert(myurl);

					}	

						xmlAddProductHttp = GetXmlHttpObject();

						xmlAddProductHttp.onreadystatechange = stateAddProduct;

						xmlAddProductHttp.open("GET",myurl,true);

						xmlAddProductHttp.send(null);

				//document.getElementById("loader").style.visibility = "visible";

				  } catch(e) {

					alert(e.discription + "Initial Err");

					}

				} 

				

				if(formName.name=="editproduct") {

				//glbData = formName.name;

				//alert(formName.name);

				//alert(queryString);

				var myurl = "php/update.product.php?" + queryString;

			//alert(myurl);

				xmlUpdateProductHttp = GetXmlHttpObject();

				xmlUpdateProductHttp.onreadystatechange = stateUpdateProduct;

				xmlUpdateProductHttp.open("GET",myurl,true);

				xmlUpdateProductHttp.send(null);

				//document.getElementById("loader").style.visibility = "visible";

				}

				

				if(formName.name=="editmenu") {

				//glbData = formName.name;

				//alert(formName.name);

				//alert(queryString);

				var myurl = "php/update.menu.php?" + queryString +"menuid=" +recordid;

			//	alert(myurl);

				xmlUpdateMenuHttp = GetXmlHttpObject();

				xmlUpdateMenuHttp.onreadystatechange = stateUpdateMenu;

				xmlUpdateMenuHttp.open("GET",myurl,true);

				xmlUpdateMenuHttp.send(null);

				//document.getElementById("loader").style.visibility = "visible";

				}

				

				if(formName.name=="editindex") {

				//glbData = formName.name;

				//alert(formName.name);

				//alert(queryString);

				var myurl = "php/update.index.php?" + queryString;

				//alert(myurl);

				xmlUpdateIndexHttp = GetXmlHttpObject();

				xmlUpdateIndexHttp.onreadystatechange = stateUpdateIndex;

				xmlUpdateIndexHttp.open("GET",myurl,true);

				xmlUpdateIndexHttp.send(null);

				//document.getElementById("loader").style.visibility = "visible";

				}

				

				if(formName.name=="editbirthday") {

				//glbData = formName.name;

				//alert(formName.name);

				//alert(queryString);

				var myurl = "php/update.birthday.offer.php?" + queryString;

				//alert(myurl);

				xmlUpdateBirthdayProgramHttp = GetXmlHttpObject();

				xmlUpdateBirthdayProgramHttp.onreadystatechange = stateUpdateBirthdayProgram;

				xmlUpdateBirthdayProgramHttp.open("GET",myurl,true);

				xmlUpdateBirthdayProgramHttp.send(null);

				//document.getElementById("loader").style.visibility = "visible";

				}

				

				if(formName.name=="edittestimonials") {

				//glbData = formName.name;

				//alert(formName.name);

				//alert(queryString);

				var myurl = "php/update.testimonial.php?" + queryString +"testimonialid=" +recordid;

				//alert(myurl);

				xmlUpdateTestimonialHttp = GetXmlHttpObject();

				xmlUpdateTestimonialHttp.onreadystatechange = stateUpdateTestimonial;

				xmlUpdateTestimonialHttp.open("GET",myurl,true);

				xmlUpdateTestimonialHttp.send(null);

				//document.getElementById("loader").style.visibility = "visible";

				}

				

				if(formName.name=="birthdaymaster") {

				//glbData = formName.name;

				var myurl = "php/add.birthdayprogram.php?" + queryString;

				//alert(myurl);

				xmlAddBirthdayProgramHttp = GetXmlHttpObject();

				xmlAddBirthdayProgramHttp.onreadystatechange = stateAddBirthdayProgram;

				xmlAddBirthdayProgramHttp.open("GET",myurl,true);

				xmlAddBirthdayProgramHttp.send(null);

				//document.getElementById("loader").style.visibility = "visible";

				} 

				

				if(formName.name=="editcategory") {

				//glbData = formName.name;

				//alert(formName.name);

				//alert(queryString);

				var myurl = "php/update.category.php?" + queryString +" category_recordid=" +recordid;

			//alert(myurl);

				xmlUpdateCategoryHttp = GetXmlHttpObject();

				xmlUpdateCategoryHttp.onreadystatechange = stateUpdateCategory;

				xmlUpdateCategoryHttp.open("GET",myurl,true);

				xmlUpdateCategoryHttp.send(null);

				//document.getElementById("loader").style.visibility = "visible";

				}

				

				if(formName.name=="editsubcategory") {

				//glbData = formName.name;

				//alert(formName.name);

				//alert(queryString);

				var myurl = "php/update.subcategory.php?" + queryString +"subcategoryid=" +recordid;

				//alert(myurl);

				xmlUpdateSubCategoryHttp = GetXmlHttpObject();

				xmlUpdateSubCategoryHttp.onreadystatechange = stateUpdateSubCategory;

				xmlUpdateSubCategoryHttp.open("GET",myurl,true);

				xmlUpdateSubCategoryHttp.send(null);

				//document.getElementById("loader").style.visibility = "visible";

				}

				

				if(formName.name=="editheadinglist") {

				var myurl = "php/update.heading.php?" + queryString + "&recordid=" + recordid;

				//alert(myurl);

				xmlUpdateHeadingHttp = GetXmlHttpObject();

				xmlUpdateHeadingHttp.onreadystatechange = stateUpdateHeading;

				xmlUpdateHeadingHttp.open("GET",myurl,true);

				xmlUpdateHeadingHttp.send(null);

				//document.getElementById("loader").style.visibility = "visible";

				}

				

				if(formName.name=="carddetail") {

				var myurl = "php/authorized.carddetail.php?" + queryString +"&customerid=" +recordid;

			//alert(myurl);

				xmlCardDetailHttp = GetXmlHttpObject();

				xmlCardDetailHttp.onreadystatechange = stateCardDetail;

				xmlCardDetailHttp.open("GET",myurl,true);

				xmlCardDetailHttp.send(null);

				//document.getElementById("loader").style.visibility = "visible";

				}

				

				if(formName.name=="birthday") {

				var myurl = "php/birthday.sumission.php?" + queryString;

			//alert(myurl);

				xmlBirthdaySumissionHttp = GetXmlHttpObject();

				xmlBirthdaySumissionHttp.onreadystatechange = stateBirthdaySumission;

				xmlBirthdaySumissionHttp.open("GET",myurl,true);

				xmlBirthdaySumissionHttp.send(null);

				//document.getElementById("loader").style.visibility = "visible";

				}

				

				if(formName.name=="servicemaster") {

				  try {

					

					var buttonValue = document.getElementById("serviceActionType").value;

					if(buttonValue=="add") {

					//var myurl = "php/add.service.php?" + queryString + "&service=" + serviceData;

					var myurl = "php/add.service.php?" + queryString;

					//alert(myurl);

					}

					if(buttonValue=="edit") {

					//var myurl = "php/update.service.php?" + queryString + "&service=" + serviceData;

					var myurl = "php/update.service.php?" + queryString + "&serviceid=" + document.getElementById("serviceid").value;

					//alert(myurl);

					}	

						

						xmlAddServiceHttp = GetXmlHttpObject();

						xmlAddServiceHttp.onreadystatechange = stateAddService;

						xmlAddServiceHttp.open("GET",myurl,true);

						xmlAddServiceHttp.send(null);

				//document.getElementById("loader").style.visibility = "visible";

				  } catch(e) {

					alert(e.discription + "Initial Err");

					}

				} 

				

				if(formName.name=="indexmaster") {

				//glbData = formName.name;

				var myurl = "php/add.indexdata.php?" + queryString;

				//alert(myurl);

				xmlAddIndexDataHttp = GetXmlHttpObject();

				xmlAddIndexDataHttp.onreadystatechange = stateAddIndexData;

				xmlAddIndexDataHttp.open("GET",myurl,true);

				xmlAddIndexDataHttp.send(null);

				}

				

				if(formName.name=="testimonialmaster") {

				//glbData = formName.name;

				var myurl = "php/add.testimonial.php?" + queryString;

				//alert(myurl);

				xmlAddTestimonialHttp = GetXmlHttpObject();

				xmlAddTestimonialHttp.onreadystatechange = stateAddTestimonial;

				xmlAddTestimonialHttp.open("GET",myurl,true);

				xmlAddTestimonialHttp.send(null);

				}

				

				if(formName.name=="testimonial") {

				//glbData = formName.name;

				var myurl = "php/testimonial.user.php?" + queryString;

		//alert(myurl);

				xmlUserTestimonialHttp = GetXmlHttpObject();

				xmlUserTestimonialHttp.onreadystatechange = stateUserTestimonial;

				xmlUserTestimonialHttp.open("GET",myurl,true);

				xmlUserTestimonialHttp.send(null);

				}

				

				if(formName.name=="purchaseproduct") {

                 try {

					 

if (document.getElementById("cartid")) {

//alert("comin");

                    var ProductBoxErr = '';

                    var ProductBoxData = '';

                    var ProductBoxChecks = document.getElementsByName('cartid');

                    var ProductBoxLength = ProductBoxChecks.length;

                 // alert(ProductBoxLength);

                    for(i=0;i<ProductBoxLength;i++) {

                      //alert(ProductBoxChecks[i].checked);

                        if(ProductBoxChecks[i].checked == true) {

                           

                        //ProductBoxData += ProductBoxChecks[i].value+",";

						ProductBoxData += ProductBoxChecks[i].value;

                        }

                    }

             // alert(ProductBoxData);

                } 

				if(ProductBoxData.length==0){

					alert("Please Select Product(s)");

				}

				/*if(ProductBoxData.length>3){

					alert("Only Select 3 Product(s)");

				}

				if(ProductBoxData.length>0 && ProductBoxData.length<4)*/

        if(ProductBoxData.length>0)    {

			var personalizetextvalue = document.getElementById("personalize_text").value;

    	 addtocart(ProductBoxData,1,personalizetextvalue);

		 //alert("asvjha");

		 //window.location = "checkout.php?cart=" + ProductBoxData;

    //alert(url);

       /* xmlProductBoxCheckHttp = GetXmlHttpObject();

        xmlProductBoxCheckHttp.onreadystatechange = stateProductBoxCheck;

        xmlProductBoxCheckHttp.open("GET",url,true);

        //xmlProductBoxCheckHttp.send(null);*/

			return true;

		} else {

			return false;

		}

    } catch(e) {

    alert(e.discription);

    }

                }

				

				if(formName.name=="purchaseownproduct") {

                 try {

					// alert(document.getElementById("product_for"));

					// alert(document.getElementById("menuid"));

if (document.getElementById("boxid") && document.getElementById("dvdid") && document.getElementById("toyid") && document.getElementById("accessoryid")) {

//alert("cominpurchAGAEMASTERPAEG");

//alert(document.getElementById("toyid"));

                    var ProductBoxErr = '';

                    var ProductBoxIdData = '';

					var ProductDvdIdData = '';

					var ProductToyIdData = '';

					var ProductAccesoryIdData ='';

					var ProductBoxAllData = '';

                    var ProductBoxIdChecks = document.getElementsByName('boxid');

					var ProductBoxDvdIdChecks = document.getElementsByName('dvdid');

					var ProductBoxToyIdChecks = document.getElementsByName('toyid');

					var ProductBoxAccesoryIdChecks = document.getElementsByName('accessoryid');

					

                    var ProductBoxIdLength = ProductBoxIdChecks.length;

					var ProductBoxDvdIdLength = ProductBoxDvdIdChecks.length;

					var ProductBoxToyIdLength = ProductBoxToyIdChecks.length;

					var ProductBoxAccesoryIdLength = ProductBoxAccesoryIdChecks.length;

                    //alert(ProductBoxLength);

					

               for(i=0;i<ProductBoxIdLength;i++) {

                        //alert(ProductBoxChecks[i].checked);

                        if(ProductBoxIdChecks[i].checked == true) {

                           

                        ProductBoxIdData += ProductBoxIdChecks[i].value+"_";

						//ProductBoxData += ProductBoxChecks[i].value;

                        }

                }

              //alert(ProductBoxIdData + "boxid");



			  for(j=0;j<ProductBoxDvdIdLength;j++) {

						if(ProductBoxDvdIdChecks[j].checked == true) {

                           

                        ProductDvdIdData += ProductBoxDvdIdChecks[j].value+",";

						//ProductBoxData += ProductBoxChecks[i].value;

                        }

			  }

				//alert(ProductDvdIdData +"dvdid");

			  

			  for(k=0;k<ProductBoxToyIdLength;k++) {		

						if(ProductBoxToyIdChecks[k].checked == true) {

                           

                        ProductToyIdData += ProductBoxToyIdChecks[k].value+",";

						//ProductBoxData += ProductBoxChecks[i].value;

					//alert(ProductToyIdData);

                        }

			  }

				// alert(ProductToyIdData + "toyid");

				 

			  for(l=0;l<ProductBoxAccesoryIdLength;l++) {

						if(ProductBoxAccesoryIdChecks[l].checked == true) {

                           

                        ProductAccesoryIdData += ProductBoxAccesoryIdChecks[l].value+",";

						//ProductBoxData += ProductBoxChecks[i].value;

                        }

			  }

				//alert(ProductAccesoryIdData + "accesoryid");

						

						//if(ProductBoxIdChecks.checked == true && ProductBoxDvdIdChecks.checked == true && ProductBoxToyIdChecks.checked == true && ProductBoxAccesoryIdChecks.checked == true) {

                           ///alert("s");

                        ProductBoxAllData += ProductBoxIdData+ProductDvdIdData+ProductToyIdData+ProductAccesoryIdData;

						//ProductBoxData += ProductBoxChecks[i].value;

                       // }

					//alert(ProductBoxAllData);

                } 

				if(ProductBoxIdData.length==0){

					alert("Please Select a Box");

					return false;

				}

				if(ProductDvdIdData.length==0){

					alert("Please Select a DVD");

					return false;

				}

				if(ProductToyIdData.length==0){

					alert("Please Select a Toy");

					return false;

				}

				if(ProductAccesoryIdData.length==0){

					alert("Please Select a Accessory");

					return false;

				}

				

				if(ProductBoxIdData.length>0 && ProductDvdIdData.length>0 && ProductToyIdData.length>0 && ProductAccesoryIdData.length>0)    {

					

				var myurl = "php/addbox.alldata.php?" + queryString + "&ProductBoxAllData=" + ProductBoxAllData;

			//alert(myurl);

				xmlProductBoxAllDataHttp = GetXmlHttpObject();

				xmlProductBoxAllDataHttp.onreadystatechange = stateProductBoxAllData;

				xmlProductBoxAllDataHttp.open("GET",myurl,true);

				xmlProductBoxAllDataHttp.send(null);

    	 

			return true;

		} else {

			return false;

		}

		

				/*if(ProductBoxData.length>3){

					alert("Only Select 3 Product(s)");

				}

				if(ProductBoxData.length>0 && ProductBoxData.length<4)*/

     /*   if(ProductBoxData.length>0)    {

    	 addtocart(ProductBoxData,1);

		 //window.location = "checkout.php?cart=" + ProductBoxData;

    //alert(url);

        xmlProductBoxCheckHttp = GetXmlHttpObject();

        xmlProductBoxCheckHttp.onreadystatechange = stateProductBoxCheck;

        xmlProductBoxCheckHttp.open("GET",url,true);

        //xmlProductBoxCheckHttp.send(null);

			return true;

		} else {

			return false;

		}*/

    } catch(e) {

    alert(e.discription + "err");

    }

                }

				

	  	 } 

}



function stateProductBoxAllData() {

    try {

        if(xmlProductBoxAllDataHttp.readyState==4 || xmlProductBoxAllDataHttp.readyState=="complete") {

            try{

            var result = xmlProductBoxAllDataHttp.responseText;

          //alert(result); 

		  // alert("Box Added");

		  var personalizetextvalue = document.getElementById("personalize_text").value;

    	// addtocart(ProductBoxData,1,personalizetextvalue);

		  addtocart(result,1,personalizetextvalue);

			//document.ProductBoxmaster.submit();

            } catch(e) {

                alert(e.description + " New Error");   

              }

        }

    }

    catch(e) {

    alert(e.description);

    }

}







var xmlAddCartHttp;

/*function AddCart(action_value,product_id)

{

	xmlAddCarthttp=GetXmlHttpObject();

	var url="cart.php?action="+action_value+"&id="+product_id;

	//alert(url)

	xmlAddCarthttp.onreadystatechange=StateAddCart;

	xmlAddCarthttp.open("get",url,true);

	xmlAddCarthttp.send(null);

}

function StateAddCart()

{

	if(xmlAddCarthttp.readyState==4)

      {

		 //alert(xmlAddCarthttp.responseText);

		 ShowCart();

		 window.location = "checkout.php";

	  }

}

*/



function addtocart(productid,product_qty,personalizetextvalue) {

	try {

	var url = "php/addto.cart.php?productid=" + productid  + "&product_qty=" + product_qty + "&personalize_text=" + personalizetextvalue;

//alert(url);

		xmlAddCartHttp = GetXmlHttpObject();

		xmlAddCartHttp.onreadystatechange = stateAddCart;

		xmlAddCartHttp.open("GET",url,true);

		xmlAddCartHttp.send(null);

	} catch(e) {

	//alert(e.discription);

	}

}



function stateAddCart() {

	try {

		if(xmlAddCartHttp.readyState==4 || xmlAddCartHttp.readyState=="complete") {

			try{

			//alert(xmlAddCartHttp.responseText);

			var result = xmlAddCartHttp.responseText;

				if(result=="added") 

				{

					//	alert("added");

					//window.location = "checkout.html";

					window.location = "https://www.imaginabox.com/home/checkout.html";

					//alert("addeedd");

					////alert(result);

					//loadShopCart();

					//loadCart();

					document.getElementById('error_occur').style.display="none";

				}

				else if(result=="Notadded") 

				{

					////alert(result);

					document.getElementById('error_occur').innerHTML = "Sorry stock not available";

					document.getElementById('error_occur').style.display="inline";

				}

			} catch(e) {

			//alert(e.description);	

			}

		}

	}

	catch(e) {

	//alert(e.description);

	}

}



function loadShopCart() {

	try {

	var url = "php/load.shopping.list.php";

//alert(url);

		xmlLoadShopListHttp = GetXmlHttpObject();

		xmlLoadShopListHttp.onreadystatechange = stateLoadShopList;

		xmlLoadShopListHttp.open("GET",url,true);

		xmlLoadShopListHttp.send(null);

	} catch(e) {

	//alert(e.discription);

	}

}



function stateLoadShopList() {

	try {

		/*if(xmlLoadShopListHttp.readyState<=3)

		{

			document.getElementById("shoppingDetaillist").innerHTML = "<img src=images/shopping-loader.gif>";	

		}

		else*/ 

		if(xmlLoadShopListHttp.readyState==4 || xmlLoadShopListHttp.readyState=="complete") {

			try{

			var result = xmlLoadShopListHttp.responseText;

		//alert(result);

			result = result.split("counter");

			////alert(result[1]);

				document.getElementById("shoppingDetaillist").style.display = "inline";

				document.getElementById("shoppingDetaillist").innerHTML = result[0];

				//document.getElementById("shoppingcount").innerHTML = result[1];

			} catch(e) {

			//alert(e.description);	

			}

		}

	}

	catch(e) {

	//alert(e.description);

	}

}



function loadCart() {

	try {

	var url = "php/load.shop.php";

//alert(url);

		xmlLoadShopHttp = GetXmlHttpObject();

		xmlLoadShopHttp.onreadystatechange = stateLoadShop;

		xmlLoadShopHttp.open("GET",url,true);

		xmlLoadShopHttp.send(null);

	} catch(e) {

	//alert(e.discription);

	}

}



function stateLoadShop() {

	try {

		if(xmlLoadShopHttp.readyState<=3)

		{

			document.getElementById("shoppinglist").innerHTML = "<img src=images/shopping-loader.gif>";	

		}

		else if(xmlLoadShopHttp.readyState==4 || xmlLoadShopHttp.readyState=="complete") {

			try{

			var result = xmlLoadShopHttp.responseText;

		//alert(result);

			result = result.split("counter");

			////alert(result[1]);

				document.getElementById("shoppinglist").innerHTML = result[0];

				document.getElementById("shoppingcount").innerHTML = result[1];

			} catch(e) {

			//alert(e.description);	

			}

		}

	}

	catch(e) {

	//alert(e.description);

	}

}





function validname(pqty) {

	pqty.value = pqty.value.replace(/[^\u00D1\u00F10-9]*/ig,'');

} 



function deletecart(shoppingid) {

		try {

			var deleteproduct;

			deleteproduct = confirm("Do you want delete this Box ?");

			//alert(deleterecord);

		  if(deleteproduct==true){

			var url = "php/delete.cart.php?shoppingid=" + shoppingid;

			////alert(url);

			xmlDeleteCartHttp = GetXmlHttpObject();

			xmlDeleteCartHttp.onreadystatechange = stateDeleteCart;

			xmlDeleteCartHttp.open("GET",url,true);

			xmlDeleteCartHttp.send(null);

		  }

		} catch(e) {

		//alert(e.discription);

		}

}



function stateDeleteCart() {

	try {

		if(xmlDeleteCartHttp.readyState==4 || xmlDeleteCartHttp.readyState=="complete") {

			try{

			var result = xmlDeleteCartHttp.responseText;

			////alert(result);

				if(result=="deleted") {

				//loadShopCart();

				window.location.reload(true);

				//loadCart();

				}

			} catch(e) {

			//alert(e.description);	

			}

		}

	}

	catch(e) {

	//alert(e.description);

	}

}



function ProductInfo(productid) {

    try {

    var url = "php/productinfo.php?productid=" + productid;

   // alert(url);

        xmlProductInfoHttp = GetXmlHttpObject();

        xmlProductInfoHttp.onreadystatechange = stateProductInfo;

        xmlProductInfoHttp.open("GET",url,true);

        xmlProductInfoHttp.send(null);

        document.getElementById("productinfo").innerHTML = "<img src=images/ajax-loader.gif>";

    } catch(e) {

    alert(e.discription + "Error MYn");

    }

}



function stateProductInfo() {

    try {

        if(xmlProductInfoHttp.readyState==4 || xmlProductInfoHttp.readyState=="complete") {

            try {

                document.getElementById("productinfo").innerHTML = "";

            var result = xmlProductInfoHttp.responseText;

          //alert(result);

            document.getElementById("productinfo").style.display = "inline";

            document.getElementById("productinfo").innerHTML = result;

            } catch(e) {

            alert(e.description);   

            }

        }

    }

    catch(e) {

    alert(e.description);

    }

}



/*function ProductInfo1(productid) {

	

    try {

    var url = "product.php?productid="+productid;

    alert(url);

        xmlProductInfoHttp = GetXmlHttpObject();

        xmlProductInfoHttp.onreadystatechange = ProductInfo1;

        xmlProductInfoHttp.open("GET",url,true);

        xmlProductInfoHttp.send(null);

       // document.getElementById("productinfo").innerHTML = "<img src=images/ajax-loader.gif>";

    } catch(e) {

    alert(e.discription + "Error MYn");

    }

}

*/



/*function del()

{

	var d = confirm("Do you want delete this Box?");

	return d;

	document.getElementById('error_occur').style.display="none";

}

*/



//Show Cart



/*var xmlShowCart;

function ShowCart()

{

	xmlShowCart=GetXmlHttpObject();

	var url="cart.php?sw_cart=view";

	//alert(url)

	xmlShowCart.onreadystatechange=StateShowCart;

	xmlShowCart.open("get",url,true);

	//document.getElementById("shopping_cart").innerHTML="<img src=images/loader.gif>";

	xmlShowCart.send(null);

}

function StateShowCart()

{

	if(xmlShowCart.readyState==4)

      {

		  //window.location = "checkout.php";

		  var result =xmlShowCart.responseText;

		  //alert(xmlShowCart.responseText);

		 document.getElementById("shopping_cart").style.display = "inline";

		 document.getElementById("shopping_cart").innerHTML= result;

		 //document.getElementById("shopping_cart").style.display = "inline";

	  }

}

*/





function stateAddCategory() {

	try {

		if(xmlAddCategoryHttp.readyState==4 || xmlAddCategoryHttp.readyState=="complete") {

			try{

				//document.getElementById("").innerHTML = "";

			var result = xmlAddCategoryHttp.responseText;

			//alert(result);

				if(result=="correct") {

				//loadCategory();

					document.getElementById("category_id").value = "";

					window.location = "category.php";

					//document.getElementById("add_category").style.display = "none";

					alert("successfully Added");

				} else if(result=="error") {

						alert("This Category is already exists");

						document.getElementById("category_id").value = "";

				  }

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function stateAddSubCategory() {

	try {

		if(xmlAddSubCategoryHttp.readyState==4 || xmlAddSubCategoryHttp.readyState=="complete") {

			try{

				//document.getElementById("").innerHTML = "";

			var result = xmlAddSubCategoryHttp.responseText;

		//	alert(result);

				if(result=="correct") {

			//	loadCategory();

					document.getElementById("sub_category_id").value = "";

					//document.getElementById("add_category").style.display = "none";

					alert("successfully Added");

				} else if(result=="error") {

						alert("This Category is already exists");

						document.getElementById("sub_category_id").value = "";

				  }

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function stateAddNavigationMenu() {

	try {

		if(xmlAddNavigationMenuHttp.readyState==4 || xmlAddNavigationMenuHttp.readyState=="complete") {

			try{

				//document.getElementById("").innerHTML = "";

			var result = xmlAddNavigationMenuHttp.responseText;

			//alert(result);

				if(result=="correct") {

			//	loadCategory();

					document.getElementById("nav_menu_name").value = "";

					document.getElementById("nav_menu_tag").value = "";

					//document.getElementById("add_category").style.display = "none";

					alert("successfully Added");

				} else if(result=="error") {

						alert("This Category is already exists");

						document.getElementById("nav_menu_name").value = "";

				  }

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}





/*function loadCategory() {

	try {

			var url = "php/list.categories.php";

	//alert(url);

		xmlloadCategoryHttp = GetXmlHttpObject();

		xmlloadCategoryHttp.onreadystatechange = stateloadCategory;

		xmlloadCategoryHttp.open("GET",url,true);

		xmlloadCategoryHttp.send(null);

		//document.getElementById("").innerHTML = "<img src=images/.gif>";

	} catch(e) {

	alert(e.discription);

	}

}



function stateloadCategory() {

	try {

		if(xmlloadCategoryHttp.readyState==4 || xmlloadCategoryHttp.readyState=="complete") {

			try{

				//document.getElementById("").innerHTML = "";

			var result = xmlloadCategoryHttp.responseText;

			//alert(result);

				document.getElementById("categorieslist").innerHTML = result;

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}

*/

function EditCategory(id) {

try {

	var url = "php/edit.categories.php?id=" + id;

	//alert(url);

	if(document.getElementById("add_category").style.display = "inline") {

		document.getElementById("add_category").style.display = "none";

	}

		xmlEditCategoryHttp = GetXmlHttpObject();

		xmlEditCategoryHttp.onreadystatechange = stateEditCategory;

		xmlEditCategoryHttp.open("GET",url,true);

		xmlEditCategoryHttp.send(null);

		//document.getElementById("").innerHTML = "<img src=.gif>";

	} catch(e) {

	alert(e.discription);

	}

}



function stateEditCategory() {

	try {

		if(xmlEditCategoryHttp.readyState==4 || xmlEditCategoryHttp.readyState=="complete") {

			try{

				//document.getElementById("").innerHTML = "";

			var result = xmlEditCategoryHttp.responseText;

			//alert(result);

				document.getElementById("editcategory").innerHTML = result;

				document.getElementById("editcategory").style.display = "inline";

				document.getElementById("add_category").style.display = "none";

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



/*function stateUpdateCategory() {

	try {

		if(xmlUpdateCategoryHttp.readyState==4 || xmlUpdateCategoryHttp.readyState=="complete") {

			try{

				//document.getElementById("").innerHTML = "";

			var result = xmlUpdateCategoryHttp.responseText;

			//alert(result);

			//loadCategory();

			alert("updated successfully");

			document.getElementById("editcategory").style.display = "none";

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}

*/



function stateAddProduct() {

	try {

		if(xmlAddProductHttp.readyState==4 || xmlAddProductHttp.readyState=="complete") {

			try{

				//document.getElementById("").innerHTML = "";

			var result = xmlAddProductHttp.responseText;

			//alert(result);

			if(result==1) {

				alert("product Added");

				window.location ="product_master.php";

			} 

			if(result==2) {

				alert("product Updated");

				window.location.reload(true);

			} 

			//LoadProducts(1);

				//document.getElementById("categorieslist").innerHTML = result;

				//document.getElementById("uploadSingle").style.display = "none";

				//document.getElementById("AddHeadings").style.display = "inline";

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function LoadProducts(page) {

var url = "php/load.products.php?page="+page;

//alert(url);

	try {

		xmlLoadProductsHttp = GetXmlHttpObject();

		xmlLoadProductsHttp.onreadystatechange = stateLoadProducts;

		xmlLoadProductsHttp.open("GET",url,true);

		xmlLoadProductsHttp.send(null);

	}

	catch(e) {

		var txt = "An exception occured in the script.\n\n";

		txt += "Error Name:" + e.name + "\n\n";

		txt += "Error Description:" + e.description+ "\n\n";

		alert(txt);

	}

}



function stateLoadProducts() {

	try {

		if(xmlLoadProductsHttp.readyState==4 || xmlLoadProductsHttp.readyState=="complete") {

			try{

			//alert(xmlLoadProductsHttp.responseText);

			//document.getElementById("mobileslist").style.display = "none";

			document.getElementById("LoadProductsResult").innerHTML = xmlLoadProductsHttp.responseText;

			document.getElementById("LoadProductsResult").style.display = "inline";



			

			} catch(e) {

			alert(e.description + "myerror");	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function LoadMenus(page) {

var url = "php/load.menus.php?page="+page;

//alert(url);

	try {

		xmlLoadMenusHttp = GetXmlHttpObject();

		xmlLoadMenusHttp.onreadystatechange = stateLoadMenus;

		xmlLoadMenusHttp.open("GET",url,true);

		xmlLoadMenusHttp.send(null);

	}

	catch(e) {

		var txt = "An exception occured in the script.\n\n";

		txt += "Error Name:" + e.name + "\n\n";

		txt += "Error Description:" + e.description+ "\n\n";

		alert(txt);

	}

}



function stateLoadMenus() {

	try {

		if(xmlLoadMenusHttp.readyState==4 || xmlLoadMenusHttp.readyState=="complete") {

			try{

			//alert(xmlLoadMenusHttp.responseText);

			//document.getElementById("mobileslist").style.display = "none";

			document.getElementById("LoadMenusResult").innerHTML = xmlLoadMenusHttp.responseText;

			document.getElementById("LoadMenusResult").style.display = "inline";



			

			} catch(e) {

			alert(e.description + "myerror");	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function LoadIndex(page) {

var url = "php/load.index.data.php?page="+page;

//alert(url);

	try {

		xmlLoadIndexHttp = GetXmlHttpObject();

		xmlLoadIndexHttp.onreadystatechange = stateLoadIndex;

		xmlLoadIndexHttp.open("GET",url,true);

		xmlLoadIndexHttp.send(null);

	}

	catch(e) {

		var txt = "An exception occured in the script.\n\n";

		txt += "Error Name:" + e.name + "\n\n";

		txt += "Error Description:" + e.description+ "\n\n";

		alert(txt);

	}

}



function stateLoadIndex() {

	try {

		if(xmlLoadIndexHttp.readyState==4 || xmlLoadIndexHttp.readyState=="complete") {

			try{

			//alert(xmlLoadIndexHttp.responseText);

			//document.getElementById("mobileslist").style.display = "none";

			document.getElementById("LoadIndexResult").innerHTML = xmlLoadIndexHttp.responseText;

			document.getElementById("LoadIndexResult").style.display = "inline";



			

			} catch(e) {

			alert(e.description + "myerror");	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function LoadBirhtdayProgram(page) {

var url = "php/load.birthday.offer.php?page="+page;

//alert(url);

	try {

		xmlLoadBirhtdayProgramHttp = GetXmlHttpObject();

		xmlLoadBirhtdayProgramHttp.onreadystatechange = stateLoadBirthdayProgram;

		xmlLoadBirhtdayProgramHttp.open("GET",url,true);

		xmlLoadBirhtdayProgramHttp.send(null);

	}

	catch(e) {

		var txt = "An exception occured in the script.\n\n";

		txt += "Error Name:" + e.name + "\n\n";

		txt += "Error Description:" + e.description+ "\n\n";

		alert(txt);

	}

}



function stateLoadBirthdayProgram() {

	try {

		if(xmlLoadBirhtdayProgramHttp.readyState==4 || xmlLoadBirhtdayProgramHttp.readyState=="complete") {

			try{

			//alert(xmlLoadBirhtdayProgramHttp.responseText);

			//document.getElementById("mobileslist").style.display = "none";

			document.getElementById("LoadBirthdayProgramResult").innerHTML = xmlLoadBirhtdayProgramHttp.responseText;

			document.getElementById("LoadBirthdayProgramResult").style.display = "inline";



			

			} catch(e) {

			alert(e.description + "myerror");	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function LoadTestimonial(page) {

var url = "php/load.testimonial.php?page="+page;

//alert(url);

	try {

		xmlLoadTestimonialHttp = GetXmlHttpObject();

		xmlLoadTestimonialHttp.onreadystatechange = stateLoadTestimonial;

		xmlLoadTestimonialHttp.open("GET",url,true);

		xmlLoadTestimonialHttp.send(null);

	}

	catch(e) {

		var txt = "An exception occured in the script.\n\n";

		txt += "Error Name:" + e.name + "\n\n";

		txt += "Error Description:" + e.description+ "\n\n";

		alert(txt);

	}

}



function stateLoadTestimonial() {

	try {

		if(xmlLoadTestimonialHttp.readyState==4 || xmlLoadTestimonialHttp.readyState=="complete") {

			try{

			//alert(xmlLoadTestimonialHttp.responseText);

			//document.getElementById("mobileslist").style.display = "none";

			document.getElementById("LoadTestimonialResult").innerHTML = xmlLoadTestimonialHttp.responseText;

			document.getElementById("LoadTestimonialResult").style.display = "inline";



			

			} catch(e) {

			alert(e.description + "myerror");	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function LoadCategory(page) {

var url = "php/load.category.php?page="+page;

//alert(url);

	try {

		xmlLoadCategoryHttp = GetXmlHttpObject();

		xmlLoadCategoryHttp.onreadystatechange = stateLoadCategory;

		xmlLoadCategoryHttp.open("GET",url,true);

		xmlLoadCategoryHttp.send(null);

	}

	catch(e) {

		var txt = "An exception occured in the script.\n\n";

		txt += "Error Name:" + e.name + "\n\n";

		txt += "Error Description:" + e.description+ "\n\n";

		alert(txt);

	}

}



function stateLoadCategory() {

	try {

		if(xmlLoadCategoryHttp.readyState==4 || xmlLoadCategoryHttp.readyState=="complete") {

			try{

			//alert(xmlLoadCategoryHttp.responseText);

			//document.getElementById("mobileslist").style.display = "none";

			document.getElementById("LoadCategoryResult").innerHTML = xmlLoadCategoryHttp.responseText;

			document.getElementById("LoadCategoryResult").style.display = "inline";

			} catch(e) {

			alert(e.description + "myerror");	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}





function LoadSubcategory(page) {

var url = "php/load.subcategory.php?page="+page;

//alert(url);

	try {

		xmlLoadSubCategoryHttp = GetXmlHttpObject();

		xmlLoadSubCategoryHttp.onreadystatechange = stateLoadSubCategory;

		xmlLoadSubCategoryHttp.open("GET",url,true);

		xmlLoadSubCategoryHttp.send(null);

	}

	catch(e) {

		var txt = "An exception occured in the script.\n\n";

		txt += "Error Name:" + e.name + "\n\n";

		txt += "Error Description:" + e.description+ "\n\n";

		alert(txt);

	}

}



function stateLoadSubCategory() {

	try {

		if(xmlLoadSubCategoryHttp.readyState==4 || xmlLoadSubCategoryHttp.readyState=="complete") {

			try{

			//alert(xmlLoadSubCategoryHttp.responseText);

			//document.getElementById("mobileslist").style.display = "none";

			document.getElementById("LoadSubCategoryResult").innerHTML = xmlLoadSubCategoryHttp.responseText;

			document.getElementById("LoadSubCategoryResult").style.display = "inline";



			

			} catch(e) {

			alert(e.description + "myerror");	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}





function EditProducts_old(id){

var url = "php/edit.products.php?prodid=" + id;

//alert(url);

	try {

		xmlEditProducts = GetXmlHttpObject();

		xmlEditProducts.onreadystatechange = stateEditProducts_old;

		xmlEditProducts.open("GET",url,true);

		xmlEditProducts.send(null);

	}

	catch(e) {

		var txt = "An exception occured in the script.\n\n";

		txt += "Error Name:" + e.name + "\n\n";

		txt += "Error Description:" + e.description+ "\n\n";

		alert(txt);

	}

}



function stateEditProducts_old() {

	try {

		if(xmlEditProducts.readyState==4 || xmlEditProducts.readyState=="complete") {

			try{

				///alert(xmlEditProducts.responseText);

				var result = xmlEditProducts.responseText;

				var arrResult = result.split("lax");

				//alert(arrResult[0]);alert(arrResult[1]);alert(arrResult[2]);alert(arrResult[3]);alert(arrResult[4]);

			var prodResult = arrResult[0].split("prod");			//alert(prodResult[0]);alert(prodResult[1]);alert(prodResult[2]);alert(prodResult[3]);alert(prodResult[4]);alert(prodResult[5]);alert(prodResult[6]);



			document.getElementById("category_field").value = prodResult[0];

			document.getElementById("category_id").value = prodResult[1];

			document.getElementById("title").value = prodResult[2];

			document.getElementById("rate").value = prodResult[3];

			document.getElementById("quan").value = prodResult[4];

			document.getElementById("result").innerHTML = "<img src='uploadedimages/thumbimages/" + prodResult[5] + "'>";

			document.getElementById("imagename").value = prodResult[5];

			document.getElementById("product_desc").value = prodResult[6];

			document.getElementById("productid").value = prodResult[7];

			if(prodResult[0]=="Mobiles") {

				//alert("yes");

				document.getElementById("mobiles").style.display = "inline";

			} else {

				//alert("no");

				document.getElementById("accessories").style.display = "none";

			  }

			

				//alert(arrResult[1]);

	//alert(arrResult[11]);

	var HeadingResults = arrResult[1].split("#");

	for(hi=0;hi<arrResult[2];hi++) {

			headData = HeadingResults[hi].split(",");

			//alert(headData[0]);

			var SubDivId = document.getElementById('SubTitleDiv');

			var Subtextbox = document.getElementById('theNewValue');

			var num = (document.getElementById("theNewValue").value -1)+ 2;

			var rowStyle = "";

			//alert(num);

			Subtextbox.value = num;

		   

			if(num>0) {

			   

			} else {

			   

			}

		   

			if(num%2==0) {

				rowStyle = "background-color:d3e3fa;";

			} else {

				rowStyle = "background-color:#E9E9E9;";

			}

			//alert(rowStyle);

			var divIdName = "SubTitle"+num+"Div";

			var newdiv = document.createElement('div');

			newdiv.setAttribute("id",divIdName);

			

			newdiv.innerHTML ="<div id="+num+" style=display:block>"+"<table border='0' cellpadding='2' cellspacing='1' width='100%' style='padding-top:5px;'><tr><td align='center'><strong>Select Heading</strong></td><td align='center'><strong>Field Name</strong></td><td align='center'><strong>Field Value</strong></td></tr><tr style='height:35px;" + rowStyle + "'><td width='20%' align='center'>" + glbHeadingData + "</td><td  width='20%'><input type='text' name='h_heading[]' id='h_heading[]' value='" + headData[1] + "' size=15></td><td  width='20%'><input type='text' name='h_heading[]' id='h_heading[]' value='" + headData[2] + "' size=15></td>"+"<td width='20%'><a href='javascript:void(0);' onClick=removeSubTitle('"+num+"')>Remove</a></td></tr></table></div>";

			SubDivId.appendChild(newdiv);

			if(document.getElementById("h_heading[]").value=="") {

						//alert("comimh");

						//for($i=0;$i<count($arrSeats)-1;$i++) {

						for(a=0;a<headData[0];a++) {

							//alert("hi");

					document.getElementById("h_heading[]").value = headData[a];

						}

					}

					//var boardCombo = document.getElementById("h_heading[]").innerHTML;

					//alert(boardCombo.search(/option/i));

	       }

			

			document.getElementById("initCaption").innerHTML = "";

			document.getElementById("initCaption").innerHTML = "Edit Products";

			document.getElementById("ActionAdd").style.display = "none";

			document.getElementById("ActionEdit").style.display = "inline";			

			document.getElementById("actionType").value = "edit";

			//document.getElementById("galleryResult").innerHTML = xmlEditProducts.responseText;

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function EditProducts(id){

var url = "php/edit.product.php?prodid=" + id;

//alert(url);

	try {

		xmlEditProducts = GetXmlHttpObject();

		xmlEditProducts.onreadystatechange = stateEditProducts;

		xmlEditProducts.open("GET",url,true);

		xmlEditProducts.send(null);

	}

	catch(e) {

		var txt = "An exception occured in the script.\n\n";

		txt += "Error Name:" + e.name + "\n\n";

		txt += "Error Description:" + e.description+ "\n\n";

		alert(txt);

	}

}





function stateEditProducts() {

	try {

		if(xmlEditProducts.readyState==4 || xmlEditProducts.readyState=="complete") {

			try{

				//alert(xmlEditProducts.responseText);

				var result = xmlEditProducts.responseText;

		    document.getElementById("uploadSingle").style.display = "none";

		    document.getElementById("productResult").style.display = "inline";

			document.getElementById("productResult").innerHTML = xmlEditProducts.responseText;

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function stateUpdateProduct() {

	try {

		if(xmlUpdateProductHttp.readyState==4 || xmlUpdateProductHttp.readyState=="complete") {

			try{

				//document.getElementById("").innerHTML = "";

				//alert(xmlUpdateProductHttp.responseText);

			var result = xmlUpdateProductHttp.responseText;

			//alert(result);

			//LoadProducts(1);

			if(result==2) {

			alert("updated successfully");

			window.location="products.php";

			} else if(result==0) {

				alert("not updated");

			}

			//document.getElementById("editheading").style.display = "none";

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}





function stateUpdateMenu() {

	try {

		if(xmlUpdateMenuHttp.readyState==4 || xmlUpdateMenuHttp.readyState=="complete") {

			try{

				//document.getElementById("").innerHTML = "";

				//alert(xmlUpdateMenuHttp.responseText);

			var result = xmlUpdateMenuHttp.responseText;

			//alert(result);

			//LoadProducts(1);

			if(result==2) {

			alert("updated successfully");

			window.location="menus.php";

			} else if(result==0) {

				alert("not updated");

			}

			//document.getElementById("editheading").style.display = "none";

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function stateUpdateIndex() {

	try {

		if(xmlUpdateIndexHttp.readyState==4 || xmlUpdateIndexHttp.readyState=="complete") {

			try{

				//document.getElementById("").innerHTML = "";

				//alert(xmlUpdateIndexHttp.responseText);

			var result = xmlUpdateIndexHttp.responseText;

			//alert(result);

			//LoadProducts(1);

			if(result==2) {

			alert("updated successfully");

			window.location="index.php";

			} else if(result==0) {

				alert("not updated");

			}

			//document.getElementById("editheading").style.display = "none";

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function stateUpdateBirthdayProgram() {

	try {

		if(xmlUpdateBirthdayProgramHttp.readyState==4 || xmlUpdateBirthdayProgramHttp.readyState=="complete") {

			try{

				//document.getElementById("").innerHTML = "";

				//alert(xmlUpdateBirthdayProgramHttp.responseText);

			var result = xmlUpdateBirthdayProgramHttp.responseText;

			//alert(result);

			//LoadProducts(1);

			if(result==2) {

			alert("updated successfully");

			window.location="birthday.php";

			} else if(result==0) {

				alert("not updated");

			}

			//document.getElementById("editheading").style.display = "none";

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function stateUpdateTestimonial() {

	try {

		if(xmlUpdateTestimonialHttp.readyState==4 || xmlUpdateTestimonialHttp.readyState=="complete") {

			try{

				//document.getElementById("").innerHTML = "";

				//alert(xmlUpdateTestimonialHttp.responseText);

			var result = xmlUpdateTestimonialHttp.responseText;

			//alert(result);

			//LoadProducts(1);

			if(result==1) {

			alert("updated successfully");

			window.location="testmonials.php";

			} else if(result==0) {

				alert("not updated");

			}

			//document.getElementById("editheading").style.display = "none";

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function stateUpdateCategory() {

	try {

		if(xmlUpdateCategoryHttp.readyState==4 || xmlUpdateCategoryHttp.readyState=="complete") {

			try{

				//document.getElementById("").innerHTML = "";

				//alert(xmlUpdateCategoryHttp.responseText);

			var result = xmlUpdateCategoryHttp.responseText;

			//alert(result);

			//LoadProducts(1);

			if(result==2) {

			alert("updated successfully");

			window.location="category.php";

			} else if(result==0) {

				alert("not updated");

			}

			//document.getElementById("editheading").style.display = "none";

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}





function stateUpdateSubCategory() {

	try {

		if(xmlUpdateSubCategoryHttp.readyState==4 || xmlUpdateSubCategoryHttp.readyState=="complete") {

			try{

			//alert(xmlUpdateMenuHttp.responseText);

			var result = xmlUpdateSubCategoryHttp.responseText;

			//alert(result);

			if(result==2) {

			alert("updated successfully");

			window.location="subcategory.php";

			} else if(result==0) {

				alert("not updated");

			}

			//document.getElementById("editheading").style.display = "none";

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}







function DeleteProduct(productid) {

	try {

var deleteproduct;

deleteproduct = confirm("are you sure want to delete ?");

//alert(deleterecord);

		if(deleteproduct==true){

			//alert("hai");

			var url = "php/delete.product.php?productid=" + productid;

		//alert(url);

			xmlDeleteProductHttp = GetXmlHttpObject();

			xmlDeleteProductHttp.onreadystatechange = stateDeleteProduct;

			xmlDeleteProductHttp.open("GET",url,true);

			xmlDeleteProductHttp.send(null);

		}

	} catch(e) {

	alert(e.discription);

	}

}



function stateDeleteProduct() {

	try {

		if(xmlDeleteProductHttp.readyState==4 || xmlDeleteProductHttp.readyState=="complete") {

			try{

			var result = xmlDeleteProductHttp.responseText;

			//alert(result);

				if(result=="deleted") {

					//alert(result);

					//LoadProducts(1,'1');

					alert("Deleted");

					window.location.reload(true);

				}

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function ChangeStatusProduct(productid,productstatus) {

	try {

var Statusproduct;

if(productstatus=="active") {

Statusproduct = confirm("It will affect your front end listing ?");

} else {

Statusproduct = confirm("It will list in your front end");	

  }

//alert(Statusproduct);

		if(Statusproduct==true){

			//alert("hai");

			var url = "php/change.status.product.php?productid=" + productid +"&productstatus=" + productstatus;

		//alert(url);

			xmlStatusProductHttp = GetXmlHttpObject();

			xmlStatusProductHttp.onreadystatechange = stateStatusProduct;

			xmlStatusProductHttp.open("GET",url,true);

			xmlStatusProductHttp.send(null);

		}

	} catch(e) {

	alert(e.discription);

	}

}





function stateStatusProduct() {

	try {

		if(xmlStatusProductHttp.readyState==4 || xmlStatusProductHttp.readyState=="complete") {

			try{

			var result = xmlStatusProductHttp.responseText;

			//alert(result);

				if(result==1) {

					//alert(result);

					//LoadProducts(1,'1');			

					window.location.reload(true);

					alert("Status Changed");

				}

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function ChangeStatusindex(homepageid,indexstatus) {

	try {

var Statusindex;

if(indexstatus=="active") {

Statusindex = confirm("It will affect your front end listing ?");

} else {

Statusindex = confirm("It will list in your front end");	

  }

//alert(Statusproduct);

		if(Statusindex==true){

			//alert("hai");

			var url = "php/change.status.index.php?homepageid=" + homepageid +"&indexstatus=" + indexstatus;

		//alert(url);

			xmlStatusIndexHttp = GetXmlHttpObject();

			xmlStatusIndexHttp.onreadystatechange = stateStatusIndex;

			xmlStatusIndexHttp.open("GET",url,true);

			xmlStatusIndexHttp.send(null);

		}

	} catch(e) {

	alert(e.discription);

	}

}



function stateStatusIndex() {

	//alert("comi");

	try {

		if(xmlStatusIndexHttp.readyState==4 || xmlStatusIndexHttp.readyState=="complete") {

			try{

			var result = xmlStatusIndexHttp.responseText;

		//	alert(result);

				if(result==1) {

					//alert(result);

					//LoadProducts(1,'1');			

					//window.location.reload(true);

					window.location = "index.php";

					alert("Status Changed");

				}

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function ChangeStatusMenus(menuid,menustatus) {

	try {

var Menuindex;

if(menustatus=="active") {

Menuindex = confirm("It will affect your front end listing ?");

} else {

Menuindex = confirm("It will list in your front end");	

  }

//alert(Statusproduct);

		if(Menuindex==true){

			//alert("hai");

			var url = "php/change.status.menu.php?menuid=" + menuid +"&menustatus=" + menustatus;

		//alert(url);

			xmlStatusMenusHttp = GetXmlHttpObject();

			xmlStatusMenusHttp.onreadystatechange = stateStatusMenu;

			xmlStatusMenusHttp.open("GET",url,true);

			xmlStatusMenusHttp.send(null);

		}

	} catch(e) {

	alert(e.discription);

	}

}



function stateStatusMenu() {

	//alert("comi");

	try {

		if(xmlStatusMenusHttp.readyState==4 || xmlStatusMenusHttp.readyState=="complete") {

			try{

			var result = xmlStatusMenusHttp.responseText;

			//alert(result);

				if(result==1) {

					//alert(result);

					//LoadProducts(1,'1');			

					//window.location.reload(true);

					window.location = "menus.php";

					alert("Status Changed");

				}

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}





function ChangeStatusBirthday(birthdayid,birthdaystatus) {

	try {

var birthdayConfirm;

if(birthdaystatus=="active") {

birthdayConfirm = confirm("It will affect your front end listing ?");

} else {

birthdayConfirm = confirm("It will list in your front end");	

  }

//alert(Statusproduct);

		if(birthdayConfirm==true){

			//alert("hai");

			var url = "php/change.status.birthday.php?birthdayid=" + birthdayid +"&birthdaystatus=" + birthdaystatus;

		//alert(url);

			xmlStatusBirthdayProgramHttp = GetXmlHttpObject();

			xmlStatusBirthdayProgramHttp.onreadystatechange = stateStatusBirthdayProgram;

			xmlStatusBirthdayProgramHttp.open("GET",url,true);

			xmlStatusBirthdayProgramHttp.send(null);

		}

	} catch(e) {

	alert(e.discription);

	}

}



function stateStatusBirthdayProgram() {

	//alert("comi");

	try {

		if(xmlStatusBirthdayProgramHttp.readyState==4 || xmlStatusBirthdayProgramHttp.readyState=="complete") {

			try{

			var result = xmlStatusBirthdayProgramHttp.responseText;

			//alert(result);

				if(result==1) {

					//alert(result);

					//LoadProducts(1,'1');			

					//window.location.reload(true);

					window.location = "birthday.php";

					alert("Status Changed");

				}

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function ChangeStatusTestimonial(testimonialid,testimonialstatus) {

	try {

var TestimonialConfirm;

if(testimonialstatus=="active") {

TestimonialConfirm = confirm("It will affect your front end listing ?");

} else {

TestimonialConfirm = confirm("It will list in your front end");	

  }

//alert(Statusproduct);

		if(TestimonialConfirm==true){

			//alert("hai");

			var url = "php/change.status.testimonial.php?testimonialid=" + testimonialid +"&testimonialstatus=" + testimonialstatus;

		//alert(url);

			xmlStatusTestimonialHttp = GetXmlHttpObject();

			xmlStatusTestimonialHttp.onreadystatechange = stateStatusTestimonial;

			xmlStatusTestimonialHttp.open("GET",url,true);

			xmlStatusTestimonialHttp.send(null);

		}

	} catch(e) {

	alert(e.discription);

	}

}



function stateStatusTestimonial() {

	//alert("comi");

	try {

		if(xmlStatusTestimonialHttp.readyState==4 || xmlStatusTestimonialHttp.readyState=="complete") {

			try{

			var result = xmlStatusTestimonialHttp.responseText;

			//alert(result);

				if(result==1) {

					//alert(result);

					//LoadProducts(1,'1');			

					//window.location.reload(true);

					window.location = "testmonials.php";

					alert("Status Changed");

				}

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function ChangeStatusCategory(categoryid,categorystatus) {

	try {

var StatusCategory;

if(categorystatus=="active") {

StatusCategory = confirm("It will affect your front end listing ?");

} else {

StatusCategory = confirm("It will list in your front end");	

  }

//alert(StatusCategory);

		if(StatusCategory==true){

			//alert("hai");

			var url = "php/change.status.category.php?categoryid=" + categoryid +"&categorystatus=" + categorystatus;

		//alert(url);

			xmlStatusCategoryHttp = GetXmlHttpObject();

			xmlStatusCategoryHttp.onreadystatechange = stateStatusCategory;

			xmlStatusCategoryHttp.open("GET",url,true);

			xmlStatusCategoryHttp.send(null);

		}

	} catch(e) {

	alert(e.discription);

	}

}



function stateStatusCategory() {

	try {

		if(xmlStatusCategoryHttp.readyState==4 || xmlStatusCategoryHttp.readyState=="complete") {

			try{

			var result = xmlStatusCategoryHttp.responseText;

			//alert(result);

				if(result==1) {

					//alert(result);

					//LoadProducts(1,'1');			

					window.location = "category.php";

					alert("Status Changed");

				}

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}





function ChangeStatusSubCategory(subcategoryid,categorystatus) {

	try {

var StatusSubCategory;

if(categorystatus=="active") {

StatusSubCategory = confirm("It will affect your front end listing ?");

} else {

StatusSubCategory = confirm("It will list in your front end");	

  }

//alert(StatusSubCategory);

		if(StatusSubCategory==true){

			//alert("hai");

			var url = "php/change.status.subcategory.php?subcategoryid=" + subcategoryid +"&categorystatus=" + categorystatus;

		//alert(url);

			xmlStatusSubCategoryHttp = GetXmlHttpObject();

			xmlStatusSubCategoryHttp.onreadystatechange = stateStatusSubCategory;

			xmlStatusSubCategoryHttp.open("GET",url,true);

			xmlStatusSubCategoryHttp.send(null);

		}

	} catch(e) {

	alert(e.discription);

	}

}



function stateStatusSubCategory() {

	try {

		if(xmlStatusSubCategoryHttp.readyState==4 || xmlStatusSubCategoryHttp.readyState=="complete") {

			try{

			var result = xmlStatusSubCategoryHttp.responseText;

			//alert(result);

				if(result==1) {

					//alert(result);

					//LoadProducts(1,'1');			

					window.location = "subcategory.php";

					alert("Status Changed");

				}

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}





function DeleteMenu(menuid) {

	try {

var deleteMenu;

deleteMenu = confirm("are you sure want to delete ?");

//alert(deleteMenu);

		if(deleteMenu==true){

			//alert("hai");

			var url = "php/delete.menu.php?menuid=" +menuid;

		//alert(url);

			xmlDeleteMenuHttp = GetXmlHttpObject();

			xmlDeleteMenuHttp.onreadystatechange = stateDeleteMenu;

			xmlDeleteMenuHttp.open("GET",url,true);

			xmlDeleteMenuHttp.send(null);

		}

	} catch(e) {

	alert(e.discription);

	}

}



function stateDeleteMenu() {

	try {

		if(xmlDeleteMenuHttp.readyState==4 || xmlDeleteMenuHttp.readyState=="complete") {

			try{

			var result = xmlDeleteMenuHttp.responseText;

			//alert(result);

				if(result=="deleted") {

					//alert(result);

					//LoadProducts(1,'1');

					alert("Deleted");

					window.location.reload(true);

				}

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function DeleteindexData(productid) {

	try {

var deleteIndexData;

deleteIndexData = confirm("are you sure want to delete ?");

//alert(deleterecord);

		if(deleteIndexData==true){

			//alert("hai");

			var url = "php/delete.index.data.php?productid=" + productid;

	//	alert(url);

			xmlDeleteIndexHttp = GetXmlHttpObject();

			xmlDeleteIndexHttp.onreadystatechange = stateDeleteindex;

			xmlDeleteIndexHttp.open("GET",url,true);

			xmlDeleteIndexHttp.send(null);

		}

	} catch(e) {

	alert(e.discription);

	}

}



function stateDeleteindex() {

	try {

		if(xmlDeleteIndexHttp.readyState==4 || xmlDeleteIndexHttp.readyState=="complete") {

			try{

			var result = xmlDeleteIndexHttp.responseText;

			//alert(result);

				if(result=="deleted") {

					//alert(result);

					//LoadProducts(1,'1');

					alert("Deleted");

					window.location.reload(true);

				}

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function DeleteBirthdayProgram(birthdayid) {

	try {

var deleteBirthday;

deleteBirthday = confirm("are you sure want to delete ?");

//alert(deleteBirthdayProgram);

		if(deleteBirthday==true){

			//alert("hai");

			var url = "php/delete.birthday.offer.php?birthdayid=" +birthdayid;

		//alert(url);

			xmlDeleteBirthdayProgramHttp = GetXmlHttpObject();

			xmlDeleteBirthdayProgramHttp.onreadystatechange = stateDeleteBirthdayProgram;

			xmlDeleteBirthdayProgramHttp.open("GET",url,true);

			xmlDeleteBirthdayProgramHttp.send(null);

		}

	} catch(e) {

	alert(e.discription);

	}

}



function stateDeleteBirthdayProgram() {

	try {

		if(xmlDeleteBirthdayProgramHttp.readyState==4 || xmlDeleteBirthdayProgramHttp.readyState=="complete") {

			try{

				//alert(xmlDeleteBirthdayProgramHttp.responseText);

			var result = xmlDeleteBirthdayProgramHttp.responseText;

			////alert(result);

				if(result==1) {

					//alert(result);

					//LoadProducts(1,'1');

					alert("Deleted");

					window.location.reload(true);

				}

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function DeleteTestimonial(testimonialid) {

	try {

var deleteTestimonialid;

deleteTestimonialid = confirm("are you sure want to delete ?");

//alert(deleterecord);

		if(deleteTestimonialid==true){

			//alert("hai");

			var url = "php/delete.testimonial.php?testimonialid=" + testimonialid;

		//alert(url);

			xmlDeleteTestimonialHttp = GetXmlHttpObject();

			xmlDeleteTestimonialHttp.onreadystatechange = stateDeleteTestimonial;

			xmlDeleteTestimonialHttp.open("GET",url,true);

			xmlDeleteTestimonialHttp.send(null);

		}

	} catch(e) {

	alert(e.discription);

	}

}



function stateDeleteTestimonial() {

	try {

		if(xmlDeleteTestimonialHttp.readyState==4 || xmlDeleteTestimonialHttp.readyState=="complete") {

			try{

				//alert(xmlDeleteTestimonialHttp.responseText);

			var result = xmlDeleteTestimonialHttp.responseText;

			//alert(result);

				if(result=="deleted") {

					//alert(result);

					//LoadProducts(1,'1');

					alert("Deleted");

					window.location.reload(true);

				}

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function DeleteCategory(category_id) {

	try {

			var deletecategoryrecord;

			deletecategoryrecord = confirm("are you sure want to delete ?");

			//alert(deleterecord);

		if(deletecategoryrecord==true){

			var url = "php/delete.category.php?category_id=" + category_id;

			//alert(url);

			xmlDeleteCategoryHttp = GetXmlHttpObject();

			xmlDeleteCategoryHttp.onreadystatechange = stateDeleteCategory;

			xmlDeleteCategoryHttp.open("GET",url,true);

			xmlDeleteCategoryHttp.send(null);

		}

	} catch(e) {

	alert(e.discription);

	}

}



function stateDeleteCategory() {

	try {

		if(xmlDeleteCategoryHttp.readyState==4 || xmlDeleteCategoryHttp.readyState=="complete") {

			try{

			var result = xmlDeleteCategoryHttp.responseText;

			//alert(result);

				if(result=="deleted") {

					//alert(result);

				///	loadCategory();

					alert("Deleted");

				window.location = "category.php";

				}

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}





function DeleteSubCategory(subcategoryid) {

	try {

var deleteCategory;

deleteCategory = confirm("are you sure want to delete ?");

//alert(deleterecord);

		if(deleteCategory==true){

			//alert("hai");

			var url = "php/delete.subcategory.php?subcategoryid=" + subcategoryid;

		//alert(url);

			xmlDeleteSubCategoryHttp = GetXmlHttpObject();

			xmlDeleteSubCategoryHttp.onreadystatechange = stateDeleteSubCategory;

			xmlDeleteSubCategoryHttp.open("GET",url,true);

			xmlDeleteSubCategoryHttp.send(null);

		}

	} catch(e) {

	alert(e.discription);

	}

}



function stateDeleteSubCategory() {

	try {

		if(xmlDeleteSubCategoryHttp.readyState==4 || xmlDeleteSubCategoryHttp.readyState=="complete") {

			try{

			var result = xmlDeleteSubCategoryHttp.responseText;

			//alert(result);

				if(result=="deleted") {

					//alert(result);

					//LoadProducts(1,'1');

					alert("Deleted");

					window.location = "subcategory.php";

				}

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}





function stateAddBirthdayProgram() {

	try {

		if(xmlAddBirthdayProgramHttp.readyState==4 || xmlAddBirthdayProgramHttp.readyState=="complete") {

			try{

			var result = xmlAddBirthdayProgramHttp.responseText;

			//alert(result);

			if(result==1) {

			//loadHeading();

			/*	document.getElementById("heading_id").value = "";

				document.getElementById("add_heading").style.display = "none";*/

				alert("successfully Added");

				} else if(result=="error") {

					alert("This Heading already exists");

				//	document.getElementById("heading_id").value = "";

				  }

			} catch(e) {

			alert(e.description + "my error");	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function stateCardDetail() {

	try {

		if(xmlCardDetailHttp.readyState==4 || xmlCardDetailHttp.readyState=="complete") {

			try{

				//document.getElementById("").innerHTML = "";				

			var result = xmlCardDetailHttp.responseText;

		///alert(result);

			var cardresult = result.split(",");

			alert(cardresult[3]);

			if(cardresult[3]=="(TESTMODE) This transaction has been approved.") {

				 window.location = "authorized.payment.success.php?userid="+ cardresult[12];

			} else {

				alert(cardresult[3]);

			  }

			//alert(sresult[0]);alert(sresult[1]);alert(sresult[2]);alert(sresult[3]);			

			///window.location = "authorized.payment.success.php";

			//alert("updated successfully");			

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function stateBirthdaySumission() {

	try {

		if(xmlBirthdaySumissionHttp.readyState==4 || xmlBirthdaySumissionHttp.readyState=="complete") {

			try{

				//document.getElementById("").innerHTML = "";				

			var result = xmlBirthdaySumissionHttp.responseText;

	//alert(result);

			if(result==1) {

			document.getElementById("name1").value = "";

			document.getElementById("childid").value = "";

			document.getElementById("child_name").value = "";

			document.getElementById("firstinput").value = "";

				alert("Thank you for Birthday program Sumission");

			} else {

				alert("Try again later");	

			}

			

			//alert(sresult[0]);alert(sresult[1]);alert(sresult[2]);alert(sresult[3]);			

			///window.location = "authorized.payment.success.php";

			//alert("updated successfully");			

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}







function loadHeading() {

	try {

			var url = "php/list.heading.php";

	//alert(url);

		xmlloadHeadingHttp = GetXmlHttpObject();

		xmlloadHeadingHttp.onreadystatechange = stateloadHeading;

		xmlloadHeadingHttp.open("GET",url,true);

		xmlloadHeadingHttp.send(null);

		//document.getElementById("").innerHTML = "<img src=images/.gif>";

	} catch(e) {

	alert(e.discription);

	}

}



function stateloadHeading() {

	try {

		if(xmlloadHeadingHttp.readyState==4 || xmlloadHeadingHttp.readyState=="complete") {

			try{

				//document.getElementById("").innerHTML = "";

			var result = xmlloadHeadingHttp.responseText;

			//alert(result);

				document.getElementById("headingslist").innerHTML = result;

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function EditHeading(id) {

try {

	var url = "php/edit.heading.php?id=" + id;

	//alert(url);

	if(document.getElementById("add_heading").style.display = "inline") {

		document.getElementById("add_heading").style.display = "none";

	}

		xmlEditHeadingHttp = GetXmlHttpObject();

		xmlEditHeadingHttp.onreadystatechange = stateEditHeading;

		xmlEditHeadingHttp.open("GET",url,true);

		xmlEditHeadingHttp.send(null);

		//document.getElementById("").innerHTML = "<img src=.gif>";

	} catch(e) {

	alert(e.discription);

	}

}



function stateEditHeading() {

	try {

		if(xmlEditHeadingHttp.readyState==4 || xmlEditHeadingHttp.readyState=="complete") {

			try{

				//document.getElementById("").innerHTML = "";

			var result = xmlEditHeadingHttp.responseText;

			//alert(result);

				document.getElementById("editheading").innerHTML = result;

				document.getElementById("editheading").style.display = "inline";

				document.getElementById("add_heading").style.display = "none";

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function stateUpdateHeading() {

	try {

		if(xmlUpdateHeadingHttp.readyState==4 || xmlUpdateHeadingHttp.readyState=="complete") {

			try{

				//document.getElementById("").innerHTML = "";

			var result = xmlUpdateHeadingHttp.responseText;

			//alert(result);

			loadHeading();

			alert("updated successfully");

			document.getElementById("editheading").style.display = "none";

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function DeleteHeading(heading_id) {

	try {

			document.getElementById("add_heading").style.display = "none";

			document.getElementById("editheading").style.display = "none";

var deleterecord;

deleterecord = confirm("are you sure want to delete ?");

//alert(deleterecord);

		if(deleterecord==true){

			//alert("hai");

			var url = "php/delete.heading.php?heading_id=" + heading_id;

		//alert(url);

			xmlDeleteHeadingHttp = GetXmlHttpObject();

			xmlDeleteHeadingHttp.onreadystatechange = stateDeleteHeading;

			xmlDeleteHeadingHttp.open("GET",url,true);

			xmlDeleteHeadingHttp.send(null);

		}

	} catch(e) {

	alert(e.discription);

	}

}



function stateDeleteHeading() {

	try {

		if(xmlDeleteHeadingHttp.readyState==4 || xmlDeleteHeadingHttp.readyState=="complete") {

			try{

			var result = xmlDeleteHeadingHttp.responseText;

			//alert(result);

				if(result=="deleted") {

					//alert(result);

					loadHeading();

					alert("Deleted");

				}

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function ProductHeading() {

	try {

			var url = "php/load.heading.php";

	//alert(url);

		xmlProductHeadingHttp = GetXmlHttpObject();

		xmlProductHeadingHttp.onreadystatechange = stateProductHeading;

		xmlProductHeadingHttp.open("GET",url,true);

		xmlProductHeadingHttp.send(null);

		//document.getElementById("").innerHTML = "<img src=images/.gif>";

	} catch(e) {

	alert(e.discription);

	}

}



function stateProductHeading() {

	try {

		if(xmlProductHeadingHttp.readyState==4 || xmlProductHeadingHttp.readyState=="complete") {

			try{

				//document.getElementById("").innerHTML = "";

		 glbHeadingData = xmlProductHeadingHttp.responseText;

			//alert(glbHeadingData);

				//document.getElementById("headingslist").innerHTML = result;

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function stateAddService() {

	try {

		if(xmlAddServiceHttp.readyState==4 || xmlAddServiceHttp.readyState=="complete") {

			try{

				//document.getElementById("").innerHTML = "";

			var result = xmlAddServiceHttp.responseText;

			//alert(result);

			if(result==1) {

				alert("Service Added");

			} 

			if(result==2) {

				alert("Service Updated");

			} 

			LoadService(1);

				//document.getElementById("categorieslist").innerHTML = result;

				//document.getElementById("uploadSingle").style.display = "none";

				//document.getElementById("AddHeadings").style.display = "inline";

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function LoadService(page) {

var url = "php/load.service.php?page=" +page;

//alert(url);

	try {

		xmlLoadServiceHttp = GetXmlHttpObject();

		xmlLoadServiceHttp.onreadystatechange = stateLoadService;

		xmlLoadServiceHttp.open("GET",url,true);

		xmlLoadServiceHttp.send(null);

	}

	catch(e) {

		var txt = "An exception occured in the script.\n\n";

		txt += "Error Name:" + e.name + "\n\n";

		txt += "Error Description:" + e.description+ "\n\n";

		alert(txt);

	}

}



function stateLoadService() {

	try {

		if(xmlLoadServiceHttp.readyState==4 || xmlLoadServiceHttp.readyState=="complete") {

			try{

			//alert(xmlLoadServiceHttp.responseText);

			document.getElementById("LoadServiceResult").innerHTML = xmlLoadServiceHttp.responseText;

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function EditService(id) {

try {

	var url = "php/edit.service.php?serviceid=" + id;

	//alert(url);

	/*if(document.getElementById("add_category").style.display = "inline") {

		document.getElementById("add_category").style.display = "none";

	}*/

		xmlEditServiceHttp = GetXmlHttpObject();

		xmlEditServiceHttp.onreadystatechange = stateEditService;

		xmlEditServiceHttp.open("GET",url,true);

		xmlEditServiceHttp.send(null);

		//document.getElementById("").innerHTML = "<img src=.gif>";

	} catch(e) {

	alert(e.discription);

	}

}



function stateEditService() {

	try {

		if(xmlEditServiceHttp.readyState==4 || xmlEditServiceHttp.readyState=="complete") {

			try{

				//document.getElementById("").innerHTML = "";

			var result = xmlEditServiceHttp.responseText;

			var arrResult = result.split("serv");

			

			//alert(arrResult[0]);alert(arrResult[1]);alert(arrResult[2]);alert(arrResult[3]);

				/*document.getElementById("editcategory").innerHTML = result;

				document.getElementById("editcategory").style.display = "inline";

				document.getElementById("add_category").style.display = "none";*/

				document.getElementById("title").value = arrResult[0];

			//document.getElementById("title").value = arrResult[1];

			document.getElementById("result").innerHTML = "<img src='upload/" + arrResult[1] + "'>";

			document.getElementById("imagename").value = arrResult[1];

			document.getElementById("serv_desc").value = arrResult[2];

			document.getElementById("serviceid").value = arrResult[3];

			

			document.getElementById("initCaption").innerHTML = "";

			document.getElementById("initCaption").innerHTML = "Edit Service Details";

			document.getElementById("ServiceActionAdd").style.display = "none";

			document.getElementById("ServiceActionEdit").style.display = "inline";			

			document.getElementById("serviceActionType").value = "edit";

			

			} catch(e) {

				alert(e.description);	

			  }

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function DeleteService(service_id) {

	try {

	var deleterecord;

deleterecord = confirm("are you sure want to delete ?");

//alert(deleterecord);

		if(deleterecord==true){

			//alert("hai");

			var url = "php/delete.service.php?service_id=" + service_id;

		//alert(url);

			xmlDeleteServiceHttp = GetXmlHttpObject();

			xmlDeleteServiceHttp.onreadystatechange = stateDeleteService;

			xmlDeleteServiceHttp.open("GET",url,true);

			xmlDeleteServiceHttp.send(null);

		}

	} catch(e) {

	alert(e.discription);

	}

}



function stateDeleteService() {

	try {

		if(xmlDeleteServiceHttp.readyState==4 || xmlDeleteServiceHttp.readyState=="complete") {

			try{

			var result = xmlDeleteServiceHttp.responseText;

			//alert(result);

				if(result=="deleted") {

					//alert(result);

					LoadService(1);

					alert("Deleted");

				}

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function stateAddIndexData() {

	try {

		if(xmlAddIndexDataHttp.readyState==4 || xmlAddIndexDataHttp.readyState=="complete") {

			try{

			var result = xmlAddIndexDataHttp.responseText;

			//alert(result);

			if(result==1) {

			//loadHeading();

				//document.getElementById("heading_id").value = "";

				//document.getElementById("add_heading").style.display = "none";

				alert("successfully Added");

				} else if(result==2) {

					alert("This already exists");

					//document.getElementById("heading_id").value = "";

				  }

			} catch(e) {

			alert(e.description + "my error");	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function stateAddTestimonial() {

	try {

		if(xmlAddTestimonialHttp.readyState==4 || xmlAddTestimonialHttp.readyState=="complete") {

			try{

			var result = xmlAddTestimonialHttp.responseText;

			//alert(result);

			if(result==1) {

			//loadHeading();

				//document.getElementById("heading_id").value = "";

				//document.getElementById("add_heading").style.display = "none";

				alert("successfully Added");

				} else if(result==2) {

					alert("This already exists");

					//document.getElementById("heading_id").value = "";

				  }

			} catch(e) {

			alert(e.description + "my error");	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function stateUserTestimonial() {

	try {

		if(xmlUserTestimonialHttp.readyState==4 || xmlUserTestimonialHttp.readyState=="complete") {

			try{

			var result = xmlUserTestimonialHttp.responseText;

		//alert(result);

			if(result==1) {

			//loadHeading();

				//document.getElementById("heading_id").value = "";

				//document.getElementById("add_heading").style.display = "none";

				alert("Your Testimonial has Added,Waiting for admin Verification!");

				} else if(result==2) {

					alert("This already exists");

					//document.getElementById("heading_id").value = "";

				  }

			} catch(e) {

			alert(e.description + "my error");	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



var allDataIds = ["bycreditcard" ,"bypaypal"];





function PayingType(PaymentdivName) {

	////alert("ki");////

	//alert(PaymentdivName);

	if(PaymentdivName=="bycreditcard") {

		document.getElementById("bycreditcard").style.display = "inline";

		for(i=0;i<allDataIds.length;i++) {

				if(allDataIds[i]!="bycreditcard") {

					document.getElementById(allDataIds[i]).style.display = "none";

				}

		}

    }

	

	

	if(PaymentdivName=="bypaypal") {

		document.getElementById("bypaypal").style.display = "inline";

		for(i=0;i<allDataIds.length;i++) {

				if(allDataIds[i]!="bypaypal") {

					document.getElementById(allDataIds[i]).style.display = "none";

				}

		}

    }

		

}





function LoadVideos(page) {

var url = "php/load.videos.php?page="+page;

//alert(url);

	try {

		xmlLoadVideosHttp = GetXmlHttpObject();

		xmlLoadVideosHttp.onreadystatechange = stateLoadVideos;

		xmlLoadVideosHttp.open("GET",url,true);

		xmlLoadVideosHttp.send(null);

	}

	catch(e) {

		var txt = "An exception occured in the script.\n\n";

		txt += "Error Name:" + e.name + "\n\n";

		txt += "Error Description:" + e.description+ "\n\n";

		alert(txt);

	}

}



function stateLoadVideos() {

	try {

		if(xmlLoadVideosHttp.readyState==4 || xmlLoadVideosHttp.readyState=="complete") {

			try{

			//alert(xmlLoadVideosHttp.responseText);

			//document.getElementById("mobileslist").style.display = "none";

			document.getElementById("LoadVideosResult").innerHTML = xmlLoadVideosHttp.responseText;

			document.getElementById("LoadVideosResult").style.display = "inline";



			

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function DeleteVideo(productid) {

	try {

var deleteproduct;

deleteproduct = confirm("are you sure want to delete ?");

//alert(deleterecord);

		if(deleteproduct==true){

			//alert("hai");

			var url = "php/delete.video.php?productid=" + productid;

		//alert(url);

			xmlDeleteVideoHttp = GetXmlHttpObject();

			xmlDeleteVideoHttp.onreadystatechange = stateDeleteVideo;

			xmlDeleteVideoHttp.open("GET",url,true);

			xmlDeleteVideoHttp.send(null);

		}

	} catch(e) {

	alert(e.discription);

	}

}



function stateDeleteVideo() {

	try {

		if(xmlDeleteVideoHttp.readyState==4 || xmlDeleteVideoHttp.readyState=="complete") {

			try{

			var result = xmlDeleteVideoHttp.responseText;

			//alert(result);

				if(result=="deleted") {

					//alert(result);

					LoadVideos(1);

					alert("Deleted");

					window.location.reload(true);

				}

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function UsersList(id) {

try {

	var url = "php/users.list.php?id=" + id;

	//alert(url);

	

		xmlUsersListHttp = GetXmlHttpObject();

		xmlUsersListHttp.onreadystatechange = stateUsersList;

		xmlUsersListHttp.open("GET",url,true);

		xmlUsersListHttp.send(null);

		//document.getElementById("").innerHTML = "<img src=.gif>";

	} catch(e) {

	alert(e.discription);

	}

}



function stateUsersList() {

	try {

		if(xmlUsersListHttp.readyState==4 || xmlUsersListHttp.readyState=="complete") {

			try{

				//document.getElementById("").innerHTML = "";

			var result = xmlUsersListHttp.responseText;

			//alert(result);

				document.getElementById("UserDetails").innerHTML = result;

				document.getElementById("UserDetails").style.display = "inline";

				//document.getElementById("add_category").style.display = "none";

			} catch(e) {

			alert(e.description);	

			}

		}

	}

	catch(e) {

	alert(e.description);

	}

}



function addService() {

   //	if(document.getElementById("").value!="" && document.getElementById("").value!="addnew") {

			var SubDivId = document.getElementById('ServiceDiv');

			var Subtextbox = document.getElementById('theServiceValue');

			var num = (document.getElementById("theServiceValue").value -1)+ 2;

			var rowStyle = "";

			//alert(num);

			Subtextbox.value = num;

		   

			if(num>0) {

			   

			} else {

			   

			}

		   

			if(num%2==0) {

				rowStyle = "background-color:d3e3fa;";

			} else {

				rowStyle = "background-color:#E9E9E9;";

			}

			//alert(rowStyle);

			var divIdName = "Service"+num+"Div";

			var newdiv = document.createElement('div');

			newdiv.setAttribute("id",divIdName);

			newdiv.innerHTML ="<div id="+num+" style=display:block>"+"<table border='0' cellpadding='5' cellspacing='2' width='100%' style='padding-top:5px;'><tr style='height:35px;" + rowStyle + "'><td width='20%' align='center'><table cellpadding='5' cellspacing='2' width='100%'><tr><td width='20%'>Title</td><td width='20%'><input type='text' name='service[]' id='service[]' size='25'></td></tr><tr><td width='20%'>Image</td><td  width='20%'><input type='file' name='service[]' id='service[]' size='25' onchange='return read(this.form)'></td></tr><tr><td width='20%'>Description</td><td  width='20%'><textarea name='service[]' id='service[]' rows='5' cols='25'></textarea></td><td width='20%'><a href='javascript:void(0);' onClick=removeService('"+num+"')>Remove</a></td></tr>"+"</tr></table></td></tr></table></div>";

			SubDivId.appendChild(newdiv);

			//document.getElementById('remove').style.display='block';

	//} else {

		//alert("Please Select Source Before Add Boarding Point");

//	}



}



function removeService(divNum) {

    //alert(divNum);

    var divremove = document.getElementById('Service'+divNum+'Div');

    var olddiv = document.getElementById(divNum);

    divremove.removeChild(olddiv);

}



function read(form1) {

//alert('hi');

var i;

var err=0;

	var total=document.form1.elements.length;

	for(i=0;i<total;i++)

	{

		ele=form1.elements[i];

		

		switch(ele.name)

		{

			case 'imagefile':

				//alert('num');

				if(ele.value=="")

				{

					err=1;

				}

				else

				{

				//alert('rrrr');

				}

			break;

			case 'theServiceValue':

			//alert(ele);

			break;

			default:

			 	

					

		}

	}

	/*if(err==1)

	{

		

		return false;

	}

	else

	{

	alert('checked');

	document.getElementById("mysubmit").disabled=false;

	//document.getElementById("mysubmit").style.display="block";	

	return true;

	

	}*/

}



//function showQuickAdd(value) {

//	//glbQuickAddType = type;

//	alert(value);

//	//if(type=="heading") {

//		if(value=="addnew") {

//			document.getElementById("addQuickHeading").style.display = "inline";

//			/*document.getElementById("addQuickDest").style.display = "none";

//			document.getElementById("addQuickBoard").style.display = "none";

//			document.getElementById("addQuickMid").style.display = "none";

//			document.getElementById("new_source_id").value="";*/

//			//alert(document.getElementById("addQuickSource").style.display);

//		} else {

//			document.getElementById("addQuickHeading").style.display = "none";

//		}

//	//}

//}



function GetXmlHttpObject() {

var xmlHttp = null;

	try {

	// Firefox , opera , safari

	xmlHttp = new XMLHttpRequest();

	}

	catch(e) {

	//Internet explorer

	var aVersions = ["MSXML2.XMLHttp","Msxml2.XMLHTTP","Microsoft.XMLHttp","MSXML2.XMLHttp.5.0","MSXML2.XMLHttp.4.0",

	"MSXML2.XMLHttp.3.0"];

		try{

			for(i=0 ; i < aVersions.length ; i++) {

				try{

				xmlHttp = new ActiveXObject(aVersions[i]);

				return xmlHttp;

				}

				catch(oError) {

				// Do Nothing

				}



			}

		}

		catch(e) {

		// Do Nothing

		}

	}

	if(xmlHttp==null) {

	alert("Your browser doesnot support AJAX");

	return;

	}

	return xmlHttp;

}