/* $(document).ready(function(){
   $("#categorycombo").change(function(){
//	   alert("hi");
     $("#getsubcategory").load("getsubcategory");
   });
 }); */
function toggletheview(par)
{
	if(par.value=="yes"){
		document.getElementById('filtereventsmenuvalue').value="yes";
		document.getElementById('filtereventsmenu').value="";
		var asdf=document.getElementById('filtereventsmenuform');
		asdf.submit();
	}else{
		document.getElementById('filtereventsmenuvalue').value="no";
		document.getElementById('filtereventsmenu').value="yes";
		var asdf=document.getElementById('filtereventsmenuform');
		asdf.submit();
	}
}
function getsubcategories(par)
{
	var paramValue;
	paramValue=par.value;
	$("#buildsubcategory").empty();
    $("#buildsubcategory").prepend("<img src='/images/loader.gif' alt='Loading..'/>");
	
		$.post("buildsubcategory",{
		compid: paramValue},  
		function(xml){
			 	
				$("#buildsubcategory").empty();
				$("#buildsubcategory").prepend(xml);

		 });
	
}


function blockusernew()
{
	var paramValue;
	paramValue=document.getElementById('addedCity').value
	
	if(paramValue==""){
	alert('Enter User Mail id');
	return false;
	}
	$("#blockunblockuser").empty();
    $("#blockunblockuser").prepend("<img src='/images/loader.gif' alt='Loading..'/>");
	
		$.post("BlockUsersAjax",{
		compid: paramValue},  
		function(xml){
			 	
				$("#blockunblockuser").empty();
				$("#blockunblockuser").prepend(xml);

		 });
	
}


function updateuser(par,dowhat)
{
	

	$("#updetetheblockedunblockeduserspan").empty();
    $("#updetetheblockedunblockeduserspan").prepend("<img src='/images/loader.gif' alt='Loading..'/>");
	
		$.post("BlockunblocknowUsersAjax",{
		compid: par, 
		dow:dowhat	},  
		function(xml){
			 	
				$("#updetetheblockedunblockeduserspan").empty();
				$("#updetetheblockedunblockeduserspan").prepend(xml);

		 });
	
}




function testajax(par)
{

	$("#roshan").empty();
    $("#roshan").prepend("<img src='/images/loader.gif' alt='Loading..'/>");
	
		$.post("roshan",{
		},  
		function(xml){
			 	
				$("#roshan").empty();
				$("#roshan").prepend(xml);

		 });
	
}



function getdomainandcomapnyname(par){
	var paramValueDate;
	paramValueDate=par.value;
	$("#builddomainandcompanyname").empty();
	    $("#builddomainandcompanyname").prepend("<img src='/images/loader.gif' alt='Loading..'/>");
		
			$.post("builddomainandcompanyname",{
			compid: paramValueDate},  
			function(xml){
				 	
					$("#builddomainandcompanyname").empty();
					$("#builddomainandcompanyname").prepend(xml);
	
			 });

}

function archivethis(par){
	
	
	$("#get"+par).empty();
	    $("#get"+par).prepend("<img src='/images/loader.gif' alt='Loading..'/>");
		
			$.post("buildArchive",{
			compid: par},  
			function(xml){
				 	
					$("#get"+par).empty();
					$("#get"+par).prepend(xml);
	
			 });

}

function deletecommunityusers(){
	$("#deletecommunityusers").empty();
	   // $("#deletecommunityusers").prepend("<img src='/images/loader.gif' alt='Loading..'/>");
		
			$.post("deletecommunityusers",{
			},  
			function(xml){
				 	
					$("#deletecommunityusers").empty();
					$("#deletecommunityusers").prepend(xml);
	
			 });

}



function getsubcategoryforadminmodfication(par){
	
	$("#buildsubcategory").empty();
	    $("#buildsubcategory").prepend("<img src='/images/loader.gif' alt='Loading..'/>");
		
			$.post("getsubcategoryforadminmodfication",{
			compid: par.value},  
			function(xml){
				 	
					$("#buildsubcategory").empty();
					$("#buildsubcategory").prepend(xml);
	
			 });

}

function modifthecrosslink(){
	var asdf=document.getElementById('crosslinks');
	asdf.submit();

}

function chekcthesubcategoryifisempty(){

if(document.getElementById('subcategory').value==""){

alert("Please select Sub Category");
return false;
}
else{
return true;
}

}

function chekcthesubcategoryifisempty2(){

if(document.getElementById('subcategory').value==""){

alert("Please select Sub Category");
return false;
}
else{
	parvalue=document.getElementById('subcategory').value;
	$("#buildCrosslink").empty();
	    $("#buildCrosslink").prepend("<img src='/images/loader.gif' alt='Loading..'/>");
		
			$.post("buildCrosslink",{
			compid: parvalue},  
			function(xml){
				 	
					$("#buildCrosslink").empty();
					$("#buildCrosslink").prepend(xml);
	
			 });
}

}

function Sendmail(){
var asdf=document.getElementById('sendmailform');
document.getElementById('Sendmail').value="sendmails"
asdf.action="findFlagUser";
asdf.submit();
}


function fadeObj(object){
	obj=document.getElementById(object); 
	obj.style.opacity = ".75"; 
	obj.style.MozOpacity = ".75"; 
	obj.style.KhtmlOpacity = ".75"; 
	obj.style.filter = "alpha(opacity=75)";
	}


function wopen(url, name, w, h)
{

  w += 32;
  h += 96;
  wleft = (screen.width - w) / 2;
  wtop = (screen.height - h) / 2;
  
  if (wleft < 0) {
    w = screen.width;
    wleft = 0;
  }
  if (wtop < 0) {
    h = screen.height;
    wtop = 0;
  }
  var win = window.open(url,
    name,
    'width=' + w + ', height=' + h + ', ' +
    'left=' + wleft + ', top=' + wtop + ', ' +
    'location=no, menubar=no, ' +
    'status=no, toolbar=no, scrollbars=yes, resizable=yes');
    win.resizeTo(w, h);
  win.moveTo(wleft, wtop);
  win.focus();

}

function postcatinthiscat(prm)
{

	var asdf = document.getElementById('senditems');

	asdf.action = "http://wikree.com/postads/Postfromfind";
	asdf.submit();
}
function postcatinthiscatrent(prm)
{

	var asdf = document.getElementById('senditems');

	asdf.action = "http://wikree.com/postads/Postfromrent";
	asdf.submit();
}

function sendtoreplytothispost(prm)
{

	var asdf = document.getElementById('replytoform');

	asdf.action = "http://wikree.com/search/replytopost";
	asdf.submit();
}

/*function updatecompany(prm)
{
//	$("#displaycity").empty();
  // $("#displaycity").prepend(prm.id);
if(document.getElementById('chagecompany'))
	 {

		 $("#citylistBB").hide('slow');
	 }
//   document.location.href = document.location.href+"sdfasd";
	var asdf = document.getElementById('senditems');
	//asdf.companyid.value = prm.id;
//	alert(prm.id);
	asdf.action = "http://wikree.com/user/signout?signinmsg=newcompany";
	asdf.submit();
} */

function updatecity2(prm)
{
//	  alert((($(prm).children()).children()).html()+':ciy2');
	//alert(prm.id.substr(1,prm.id.length - 1));
	/*
	if(prm.id.substr(1,prm.id.length - 1) == "1")
	    $("#citynamespan").html("Mumbai");  
	else if(prm.id.substr(1,prm.id.length - 1) == "2")
		$("#citynamespan").html("Pune");  
	else if(prm.id.substr(1,prm.id.length - 1) == "3")
		$("#citynamespan").html("Bangalore");  
	else if(prm.id.substr(1,prm.id.length - 1) == "4")
		$("#citynamespan").html("Delhi");  
	else if(prm.id.substr(1,prm.id.length - 1) == "5")
		$("#citynamespan").html("Kolkata");
	else if(prm.id.substr(1,prm.id.length - 1) == "6")
		$("#citynamespan").html("Chennai");
	else if(prm.id.substr(1,prm.id.length - 1) == "7")
		$("#citynamespan").html("Ahmedabad");
	else if(prm.id.substr(1,prm.id.length - 1) == "8")
		$("#citynamespan").html("Baroda");
	else if(prm.id.substr(1,prm.id.length - 1) == "9")
		$("#citynamespan").html("Chandigarh");
	else if(prm.id.substr(1,prm.id.length - 1) == "10")
		$("#citynamespan").html("Coimbatore");
	else if(prm.id.substr(1,prm.id.length - 1) == "11")
		$("#citynamespan").html("Goa");
	else if(prm.id.substr(1,prm.id.length - 1) == "12")
		$("#citynamespan").html("Hyderabad");
	else if(prm.id.substr(1,prm.id.length - 1) == "13")
		$("#citynamespan").html("Indore");
	else if(prm.id.substr(1,prm.id.length - 1) == "14")
		$("#citynamespan").html("Jaipur");
	else if(prm.id.substr(1,prm.id.length - 1) == "15")
		$("#citynamespan").html("Surat");
	else if(prm.id.substr(1,prm.id.length - 1) == "16")
		$("#citynamespan").html("Others");
	else if(prm.id.substr(1,prm.id.length - 1) == "allcitieslist")
		$("#citynamespan").html("All Locations"); */
	
	//$(prm).children()
	
	$("#citynamespan").html((($(prm).children()).children()).html());

   $("#citylistCC").hide();
    $("#ddFrame").hide();

	var asdf = document.getElementById('senditems');
	//var bbbb = document.getElementById('sendevents');
	asdf.cityid.value = prm.id.substr(1,prm.id.length - 1);

if (document.location.href.indexOf("search/findpost")!=-1 || document.location.href.indexOf("myEvents/allevents")!=-1  || document.location.href.indexOf("myEvents/rpgEvents")!=-1  )
	{
		asdf.frompaginatione.value='yes';
		asdf.commingfromcity.value = 'yes';
		asdf.action = document.location.href;
		asdf.submit();
	}
	else if(document.location.href.indexOf("post/home")!=-1 || document.location.href.indexOf("http://wikree.com")!=-1 || document.location.href.indexOf("post/home/#")!=-1){
		asdf.action = document.location.href;
		asdf.submit();
	}
	else
	{

		 $.post("setcityid",{
		 cityid: prm.id.substr(1,prm.id.length - 1) },  
		 function(xml) {
	//			 alert(xml);
	
				 }
	
		   );
	}
}

function updatecity(prm)
{
//	$("#displaycity").empty();
  // $("#displaycity").prepend(prm.id);
//  alert((($(prm).children()).children()).html()+':ciy1');
/*
	if(prm.id.substr(1,prm.id.length - 1) == "1")
	    $("#citynamespan").html("Mumbai");  
	else if(prm.id.substr(1,prm.id.length - 1) == "2")
		$("#citynamespan").html("Pune");  
	else if(prm.id.substr(1,prm.id.length - 1) == "3")
		$("#citynamespan").html("Bangalore");  
	else if(prm.id.substr(1,prm.id.length - 1) == "4")
		$("#citynamespan").html("Delhi");  
	else if(prm.id.substr(1,prm.id.length - 1) == "5")
		$("#citynamespan").html("Kolkata");
	else if(prm.id.substr(1,prm.id.length - 1) == "6")
		$("#citynamespan").html("Chennai");
	else if(prm.id.substr(1,prm.id.length - 1) == "7")
		$("#citynamespan").html("Ahmedabad");
	else if(prm.id.substr(1,prm.id.length - 1) == "8")
		$("#citynamespan").html("Baroda");
	else if(prm.id.substr(1,prm.id.length - 1) == "9")
		$("#citynamespan").html("Chandigarh");
	else if(prm.id.substr(1,prm.id.length - 1) == "10")
		$("#citynamespan").html("Coimbatore");
	else if(prm.id.substr(1,prm.id.length - 1) == "11")
		$("#citynamespan").html("Goa");
	else if(prm.id.substr(1,prm.id.length - 1) == "12")
		$("#citynamespan").html("Hyderabad");
	else if(prm.id.substr(1,prm.id.length - 1) == "13")
		$("#citynamespan").html("Indore");
	else if(prm.id.substr(1,prm.id.length - 1) == "14")
		$("#citynamespan").html("Jaipur");
	else if(prm.id.substr(1,prm.id.length - 1) == "15")
		$("#citynamespan").html("Surat");
	else if(prm.id.substr(1,prm.id.length - 1) == "16")
		$("#citynamespan").html("Others");
	else if(prm.id.substr(1,prm.id.length - 1) == "allcitieslist")
		$("#citynamespan").html("All Locations"); */

	$("#citynamespan").html((($(prm).children()).children()).html());

//alert(prm.id.substr(1,prm.id.length - 1))
   $("#citylistCC").hide();
    $("#ddFrame").hide();
//   document.location.href = document.location.href+"sdfasd";
	var asdf = document.getElementById('senditems');
	
	asdf.cityid.value = prm.id.substr(1,prm.id.length - 1);
//	alert(prm.id);
if (document.location.href.indexOf("search/findpost")!=-1 || document.location.href.indexOf("myEvents/allevents")!=-1  || document.location.href.indexOf("myEvents/rpgEvents")!=-1  )
	{
		asdf.commingfromcity.value = 'yes';
		asdf.action = document.location.href;
		theurl = getTheString(asdf);
		var kids = (($(prm).children()).children());
		//alert(kids[0]);
		//$(kids[0]).attr({ href: theurl});
		document.location.href =theurl;
		asdf.submit();
	}
	else if(document.location.href.indexOf("post/home")!=-1 || document.location.href.indexOf("http://wikree.com")!=-1 || document.location.href.indexOf("post/home/#")!=-1){
		asdf.action = document.location.href;
		asdf.submit();
	}
	else
	{
		 $.post("setcityid",{
		 cityid: prm.id.substr(1,prm.id.length - 1) },  
		 function(xml) {
	//			 alert(xml);
	
				 }
	
		   );
	}
}

 $(document).ready(function(){
	 // any where click should hide the dropdown
		
	 $(document).click(function(e){
//		 if($("#citylistCC:visible"))
//			  alert(e.target.id);
		 if(e.target.id != 'citylistCC' && e.target.id != 'changecity')
		 {
			$("#citylistCC").hide();
			$("#ddFrame").hide();
		 }

//		   if(e.target.id != 'hidecala'  && e.target.id != 'hidecalb'  && e.target.id != 'hidecalc'  && e.target.id != 'hidecald')
//		 {
//			closeCalendar();
//		 }

	 });




	 function validateDate(fromdate3,fromdate2,fromdate1,todate3,todate2,todate1)
	 {
		var difference = 0;
	 	fromDate = new Date(fromdate3,fromdate2-1,fromdate1);
 		toDate = new Date(todate3,todate2-1,todate1);	
	 	difference = toDate - fromDate;
	 	
	 	if(difference<=0)
	 	{
	 		alert("To date should be greater than from date");	
	 		return false;
	 	}
	 	
	 	return true;
	 }

	    // ******Code for Posts report***********
	    $("#goandfindposts").click(function(){
		var asdf = document.getElementById('frmRegistration');
		var start =asdf.startdate.value;
		if(start=="")
		{
			alert("Please enter from date");
			return false;
		}
		var start_array=start.split("-");
		var startday = start_array[0];
	  	var startmonth=start_array[1];
 		var startyear=start_array[2];
		
 		var end =asdf.enddate12.value;
 		if(end=="")
		{
			alert("Please enter to date");
			return false;
		}
 		var end_array=end.split("-");
		var endday = end_array[0];
	  	var endmonth=end_array[1];
 		var endyear=end_array[2];
 	
 		if(!validateDate(startyear,startmonth,startday,endyear,endmonth,endday))
 		{
 			return false;
 		}
 		var categoryadmin = asdf.AdminCategory.value;
 		var subcatadmin=asdf.SubCategory.value;
 		//alert(subcatadmin);
 		var paramValueDate=startyear+"-"+startmonth+"-"+startday+","+endyear+"-"+endmonth+"-"+endday+","+categoryadmin+","+asdf.SubCategory.value;
		$("#getpostsfordate").empty();
	    $("#getpostsfordate").prepend("<img src='/images/loader.gif' alt='Loading..'/>");
		
			$.post("getrequestedpost",{
			 compid: paramValueDate},  
			function(xml){
				 	
					$("#getpostsfordate").empty();
					$("#getpostsfordate").prepend(xml);
	
			 });
			   
		$("#getApppostsfordate").empty();
		$("#getApppostsfordate").prepend("<img src='/images/loader.gif' alt='Loading..'/>");
			
			$.post("getrequestedApppost",{
					 compid: paramValueDate},  
					function(xml) {
						 	
		    				$("#getApppostsfordate").empty();
        					$("#getApppostsfordate").prepend(xml);
							
					   			  });
					
		$("#getRejpostsfordate").empty();
		$("#getRejpostsfordate").prepend("<img src='/images/loader.gif' alt='Loading..'/>");
		
			$.post("getrequestedRejpost",{
						 compid: paramValueDate},  
						function(xml) {
							 	
								$("#getRejpostsfordate").empty();
 							    $("#getRejpostsfordate").prepend(xml);
								
						   			});
						
		$("#getAllposts").empty();
		$("#getAllposts").prepend("<img src='/images/loader.gif' alt='Loading..'/>");
		
			$.post("getrequestedAllpost",{
						 compid: paramValueDate},  
						function(xml) {
									 	
								$("#getAllposts").empty();
								$("#getAllposts").prepend(xml);
								   });
								
		$("#getAllpostsPending").empty();
		$("#getAllpostsPending").prepend("<img src='/images/loader.gif' alt='Loading..'/>");
			$.post("getrequestedPendingpost",{
						 compid: paramValueDate},  
						function(xml) {
								$("#getAllpostsPending").empty();
  					            $("#getAllpostsPending").prepend(xml);
						     		   });
			
			
			$("#getAllpostsCorp").empty();
			$("#getAllpostsCorp").prepend("<img src='/images/loader.gif' alt='Loading..'/>");
				$.post("getrequestedCorppots",{
							 compid: paramValueDate},  
							function(xml) {
								 	$("#getAllpostsCorp").empty();
	  					            $("#getAllpostsCorp").prepend(xml);
							     		   });
			$("#getAllpostsWikree").empty();
			$("#getAllpostsWikree").prepend("<img src='/images/loader.gif' alt='Loading..'/>");
				$.post("getrequestedWikreePosts",{
							 compid: paramValueDate},  
							function(xml) {
								 	$("#getAllpostsWikree").empty();
		  				            $("#getAllpostsWikree").prepend(xml);
								     		   });
		  			
		}); 
	  
	 
	  
	  
	    // ******Code for Events report***********
	  
	    $("#goandfindevents").click(function(){
		var asdf = document.getElementById('frmRegistration');
		var start =asdf.startdate.value;
		var start_array=start.split("-");
		var startday = start_array[0];
	  	var startmonth=start_array[1];
 		var startyear=start_array[2];
 		if(start=="")
		{
			alert("Please enter from date");
			return false;
		}
 		var end =asdf.enddate12.value;
 		if(end=="")
		{
			alert("Please enter to date");
			return false;
		}
		var end_array=end.split("-");
		var endday = end_array[0];
	  	var endmonth=end_array[1];
 		var endyear=end_array[2];
 		
 		if(!validateDate(startyear,startmonth,startday,endyear,endmonth,endday))
 		{
 			return false;
 		}
 		var paramValueDate=startyear+"-"+startmonth+"-"+startday+" 00:00:00"+","+endyear+"-"+endmonth+"-"+endday+" 00:00:00";
 		
		
		$("#geteventsfordate").empty();
		$("#geteventsfordate").prepend("<img src='/images/loader.gif' alt='Loading..'/>");
		
			$.post("getrequestedEvent",{
			 compid: paramValueDate},  
			function(xml) {
				 	
					$("#geteventsfordate").empty();
					$("#geteventsfordate").prepend(xml);
			   });
			
		$("#getAppeventsfordate").empty();
		$("#getAppeventsfordate").prepend("<img src='/images/loader.gif' alt='Loading..'/>");
			
			$.post("getrequestedAppEvent",{
			 compid: paramValueDate},  
			function(xml) {
			
				    $("#getAppeventsfordate").empty();
					$("#getAppeventsfordate").prepend(xml);
			   }); 
	
		$("#getRejeventsfordate").empty();
		$("#getRejeventsfordate").prepend("<img src='/images/loader.gif' alt='Loading..'/>");
			
			$.post("getrequestedRejEvent",{
			 compid: paramValueDate},  
			function(xml) {
						$("#getRejeventsfordate").empty();
						$("#getRejeventsfordate").prepend(xml);
				   });
			
		$("#getAllevents").empty();
		$("#getAllevents").prepend("<img src='/images/loader.gif' alt='Loading..'/>");
		
			$.post("getrequestedAllEvent",{
			 compid: paramValueDate},  
			function(xml) {
						$("#getAllevents").empty();
						$("#getAllevents").prepend(xml);
				   });
			
		$("#getPendingevents").empty();
		$("#getPendingevents").prepend("<img src='/images/loader.gif' alt='Loading..'/>");
		
			$.post("getrequestedPendingEvent",{
			 compid: paramValueDate},  
			function(xml) {
						$("#getPendingevents").empty();
						$("#getPendingevents").prepend(xml);
				   });
			$("#getAlleventsCorp").empty();
			$("#getAlleventsCorp").prepend("<img src='/images/loader.gif' alt='Loading..'/>");
			
				$.post("getrequestedCorpEvent",{
				 compid: paramValueDate},  
				function(xml) {
							$("#getAlleventsCorp").empty();
							$("#getAlleventsCorp").prepend(xml);
					   });
				
				$("#getAlleventsWikree").empty();
				$("#getAlleventsWikree").prepend("<img src='/images/loader.gif' alt='Loading..'/>");
				
					$.post("getrequestedWikreeEvent",{
					 compid: paramValueDate},  
					function(xml) {
								$("#getAlleventsWikree").empty();
								$("#getAlleventsWikree").prepend(xml);
						   });
			
		}); 
	 
	  


// *****code for group company

	  $("#groupcombo1").change(function(){
		  var asdf = document.getElementById('senditems');
		  var cmbvalue = $(this).val();
		asdf.companygroupname.value = cmbvalue;
	
		if(cmbvalue != 'none' && cmbvalue != 'mycompany' && cmbvalue != 'all')
		  {
//			alert("here1");
		$("#companiescombospan").empty();
		 $("#companiescombospan").prepend("<span style='color:red;font:15px bold;'>Loading Subgroup..</span>");
		//$("#companiescombospan").prepend("khkl");
			 //show loding
			$.post("getgroupcomp",{
			 compid: cmbvalue},  
			function(xml) {

					$("#companiescombospan").empty();
//					 $("#companiescombospan").prepend(xml);
					 $(xml).appendTo($("#companiescombospan"));
					$("#companycombo").change(function(){
						asdf.companyname.value = $(this).val();
					document.getElementById('groupcompanybut').focus();
					});

			   });
			   return false;	 
		  }
		  else
		  {
		//	alert("here2");
			  document.getElementById('companycombo').selectedIndex = 0;
			document.getElementById('companycombo').disabled = true;
			asdf.companyname.value = "";
		  }
			
		}); 


		// ***** end of code for group company


//$("#ddFrame").hide();
	$("#changecity").click(function(e){
//		alert("here");
	//	alert(e.target.id);
		 $("#citylistCC").toggle();
		 $("#ddFrame").toggle();
	});

	
	// Ajax code for feching subcategories 
	 $("#admincategorycombo").change(function(){
	
	 $("#getsubcategoryadmin").empty();
	 $("#getloadingadmin").prepend("Loading Sub Categories ....");
		 //show loding
		    $.post("getsubcategoryadmin",{
		 catid: $("#admincategorycombo").val()},  
		function(xml) {
			 $("#getloadingadmin").empty();
				$("#getsubcategoryadmin").empty();
				 $("#getsubcategoryadmin").prepend(xml);
					
		   });
	 	   return false;	 
	}); 






 /*	 $("#currentcityid").click(function(){
		 alert("hre");
		 //Change Location and hide list
//			$("#displaycity").empty();
//			 $("#displaycity").prepend($(this).html());
//			$("#citylistA").hide('slow');

	 }); */

	// Ajax code for feching subcategories 
	 $("#categorycombo").change(function(){
	
	

	 $("#getloading").prepend("Loading SubCategories ....");
		 //show loding
		    $.post("getsubcategory",{
		 catid: $("#categorycombo").val()},  
		function(xml) {
	//			 alert("hi");
		 //hide loading


	$("#getloading").empty();
				$("#getsubcategory").empty();
				 $("#getsubcategory").prepend(xml);
					if(document.getElementById('categorycombo').value==7){
					 $("#rentmsgsell").empty();
					 $("#rentmsgsell").prepend("I would like to <font class='redbold'>offer</font> a job.");
					 $("#rentmsgbuy").empty();
					 $("#rentmsgbuy").prepend("I am <font class='redbold'>looking </font> for a job.");
					}
					else if(document.getElementById('categorycombo').value==14000){
					 $("#rentmsgsell").empty();
					 $("#rentmsgsell").prepend("I would like to <font class='redbold'>offer</font> matmor roshan.");
					 $("#rentmsgbuy").empty();
					 $("#rentmsgbuy").prepend("I am <font class='redbold'>looking </font> matmor roshan.");
					}
					else if(document.getElementById('categorycombo').value==15000){
					 $("#rentmsgsell").empty();
					 $("#rentmsgsell").prepend("I would like to <font class='redbold'>offer</font> donate roshan.");
					 $("#rentmsgbuy").empty();
					 $("#rentmsgbuy").prepend("I am <font class='redbold'>looking </font> donate roshan.");
					}
					else
					{		
						if(document.getElementById('rentajaxcheck').checked==true)
				 {
				 $("#rentmsgsell").empty();
				 $("#rentmsgsell").prepend("I would like to <font class='redbold'>offer</font> an item or service on rent.");
				 $("#rentmsgbuy").empty();
				 $("#rentmsgbuy").prepend("I would like to <font class='redbold'>get</font>  an item or service on rent.");
		
				 }else
				 {
				 $("#rentmsgsell").empty();
				 $("#rentmsgsell").prepend("I would like to <font class='redbold'>sell</font> an item or service");
				 $("#rentmsgbuy").empty();
				 $("#rentmsgbuy").prepend("I would like to <font class='redbold'>buy</font>  an item or service.");
		
				 }
				 }

	
		   });
	 	   return false;	 
	}); 


	// Ajax code for feching subcategories 
	 




});


function getrentcat(prm)
{
	if(prm.checked == true)
	{

document.getElementById('xyz').disabled="true";
document.getElementById('xyz').selectedIndex =0;

 $("#rentmsgsell").empty();
 $("#rentmsgsell").prepend("I would like to <font class='redbold'>offer</font> an item or service on rent.");
 $("#rentmsgbuy").empty();
 $("#rentmsgbuy").prepend("I would like to <font class='redbold'>get</font>  an item or service on rent.");
		

		$.post("getcategoryrent",{
		 catid: $("#categorycombo").val()},  
		function(xml) {
	

				//document.getElementById('xyz').disabled="true";

				//document.getElementById('rentvaluecheckid').value="1";
					$("#getloading").empty();
				$("#getcategoryrent").empty();
				 
				 $(xml).appendTo($("#getcategoryrent"));
			//this is for sub cat rent
				 
										 $("#categorycomborent").change(function(){  

																								 
																 $("#getloading").prepend("Loading SubCategories ....");
																	 //show loding
																		$.post("getsubcategoryrent",{
																	 catidrent: $("#categorycomborent").val()},  
																	function(xml) {
																//			 alert("hi");
																	 //hide loading


																			$("#getloading").empty();
																			$("#getsubcategory").empty();
																			 $("#getsubcategory").prepend(xml);

																
																	   });

											});
			//this is for sub cat rent
	
		   });

	}
	else
	{
		
			$.post("getcategoragain",{},  
		function(xml) {
	

					
 $("#rentmsgsell").empty();
 $("#rentmsgsell").prepend("I would like to <font class='redbold'>sell</font> an item or service.");
 $("#rentmsgbuy").empty();
 $("#rentmsgbuy").prepend(" I would like to<font class='redbold'> buy</font> an item or service.");

		document.getElementById('xyz').disabled="true";
		document.getElementById('xyz').selectedIndex =0;

				$("#getcategoryrent").empty();
								 
				$("#getcategoryrent").prepend(xml);




													  $("#categorycombo").change(function(){
						
																	
																	 $("#getloading").prepend("Loading SubCategories ....");
																		 //show loding
																			$.post("getsubcategory",{
																		 catid: $("#categorycombo").val()},  
																		function(xml) {
																	//			 alert("hi");
																		 //hide loading


																	$("#getloading").empty();
																				$("#getsubcategory").empty();
																				 $("#getsubcategory").prepend(xml);
																						
																						if(document.getElementById('categorycombo').value==7){
					 $("#rentmsgsell").empty();
					 $("#rentmsgsell").prepend("I would like to <font class='redbold'>offer</font> a job.");
					 $("#rentmsgbuy").empty();
					 $("#rentmsgbuy").prepend("I am <font class='redbold'>looking </font> for a job.");
					}

					else if(document.getElementById('categorycombo').value==14000){
					 $("#rentmsgsell").empty();
					 $("#rentmsgsell").prepend("I would like to <font class='redbold'>offer</font> matmor roshan.");
					 $("#rentmsgbuy").empty();
					 $("#rentmsgbuy").prepend("I am <font class='redbold'>looking </font> matmor roshan.");
					}
					else if(document.getElementById('categorycombo').value==15000){
					 $("#rentmsgsell").empty();
					 $("#rentmsgsell").prepend("I would like to <font class='redbold'>offer</font> donate roshan.");
					 $("#rentmsgbuy").empty();
					 $("#rentmsgbuy").prepend("I am <font class='redbold'>looking </font> donate roshan.");
					}
					else
					{		
						if(document.getElementById('rentajaxcheck').checked==true)
				 {
				 $("#rentmsgsell").empty();
				 $("#rentmsgsell").prepend("I would like to <font class='redbold'>offer</font> an item or service on rent.");
				 $("#rentmsgbuy").empty();
				 $("#rentmsgbuy").prepend("I would like to <font class='redbold'>get</font>  an item or service on rent.");
		
				 }else
				 {
				 $("#rentmsgsell").empty();
				 $("#rentmsgsell").prepend("I would like to <font class='redbold'>sell</font> an item or service");
				 $("#rentmsgbuy").empty();
				 $("#rentmsgbuy").prepend("I would like to <font class='redbold'>buy</font>  an item or service.");
		
				 }
				 }
																	
																		   });
																		   return false;	 
																	}); 

				
				 	});
	}


}


function testcheck(){
	if(document.getElementById("valuechecker").value=="1")
	{
		$("#rentmsgsell").empty();
 $("#rentmsgsell").prepend("I would like to <font class='redbold'>offer</font> an item or service on rent.");
 $("#rentmsgbuy").empty();
 $("#rentmsgbuy").prepend("I would like to <font class='redbold'>get</font>  an item or service on rent.");
	}


}



