/* <![CDATA[ */
$.fn.encHTML = function() {
  return this.each(function(){
    var me   = jQuery(this);
    var html = me.html();
    me.html(html.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;'));
  });
};
$.fn.decHTML = function() {
  return this.each(function(){
    var me   = jQuery(this);
    var html = me.html();
    me.html(html.replace(/&amp;/g,'&').replace(/&lt;/g,'<').replace(/&gt;/g,'>'));
  });
};
 
$.fn.isEncHTML = function(str) {
  if(str.search(/&amp;/g) != -1 || str.search(/&lt;/g) != -1 || str.search(/&gt;/g) != -1)
    return true;
  else
    return false;
};
$.fn.decHTMLifEnc = function(){
  return this.each(function(){
    var me   = jQuery(this);
    var html = me.html();
    if(jQuery.fn.isEncHTML(html))
      me.html(html.replace(/&amp;/g,'&').replace(/&lt;/g,'<').replace(/&gt;/g,'>'));
  });
}
function validatehresort(form,pid)
{
	/*if(document.getElementById('resort_select'+pid).checked)
	{
		document.getElementById('hpid'+pid).value=document.getElementById('resort_select'+pid).value;
	}	*/
	
}

function validatebresort(form,pid)
{
	/*if(document.getElementById('resort_select'+pid).checked)
	{
		document.getElementById('bpid'+pid).value=document.getElementById('resort_select'+pid).value;
	}	*/
	
}
function ValidateForm123(form){
	alert(form.gender.length);
	for (i=0;i<form.gender.length;i++){
		if (form.gender[i].checked==true){
			alert(form.gender[i].value);
		}
	}
}
function updatestatus(msgstatus)
{
	document.getElementById('resortaction').value=msgstatus;
}

function updatepid(pid,rvalue)
{	
	/*document.getElementById('bpid'+pid).value=rvalue;
	document.getElementById('hpid'+pid).value=rvalue;*/
}
function pricesum(membershipid)
{	
	if(membershipid=='0')
	{
		document.getElementById('totalprice').value=document.getElementById('price').value;		
	}
	else
	{
		var price=document.getElementById('membership'+membershipid).value;
		document.getElementById('totalprice').value=price;		
	}
	document.getElementById('pricelvl').innerHTML='$'+document.getElementById('totalprice').value;
}
function htmlEncode(source, display, tabs)
{
	function special(source)
	{
		var result = '';
		for (var i = 0; i < source.length; i++)
		{
			var c = source.charAt(i);
			if (c < ' ' || c > '~')
			{
				c = '&#' + c.charCodeAt() + ';';
			}
			result += c;
		}
		return result;
	}
	
	function format(source)
	{
		// Use only integer part of tabs, and default to 4
		tabs = (tabs >= 0) ? Math.floor(tabs) : 4;
		
		// split along line breaks
		var lines = source.split(/\r\n|\r|\n/);
		
		// expand tabs
		for (var i = 0; i < lines.length; i++)
		{
			var line = lines[i];
			var newLine = '';
			for (var p = 0; p < line.length; p++)
			{
				var c = line.charAt(p);
				if (c === '\t')
				{
					var spaces = tabs - (newLine.length % tabs);
					for (var s = 0; s < spaces; s++)
					{
						newLine += ' ';
					}
				}
				else
				{
					newLine += c;
				}
			}
			// If a line starts or ends with a space, it evaporates in html
			// unless it's an nbsp.
			newLine = newLine.replace(/(^ )|( $)/g, '&nbsp;');
			lines[i] = newLine;
		}
		
		// re-join lines
		var result = lines.join('<br />');
		
		// break up contiguous blocks of spaces with non-breaking spaces
		result = result.replace(/  /g, ' &nbsp;');
		
		// tada!
		return result;
	}

	var result = source;
	
	// ampersands (&)
	result = result.replace(/\&/g,'&amp;');

	// less-thans (<)
	result = result.replace(/\</g,'&lt;');

	// greater-thans (>)
	result = result.replace(/\>/g,'&gt;');
	
	if (display)
	{
		// format for display
		result = format(result);
	}
	else
	{
		// Replace quotes if it isn't for display,
		// since it's probably going in an html attribute.
		result = result.replace(new RegExp('"','g'), '&quot;');
	}

	// special characters
	result = special(result);
	
	// tada!
	return result;
}
function pagination_test(pagenum)
{
	document.getElementById('pagenum').value=pagenum;
		$.ajax({
			type: "POST",
			url: "http://www.vestedtravelclub.com/resortsearchresult_test.php",
			data: "pagenum="+ pagenum +"&resortdest="+document.getElementById('resortdest').value+"&cs_date="+document.getElementById('cs_date').value+"&cs_year="+document.getElementById('cs_year').value,
			beforeSend:function(){
				$("#dialog-modals").dialog("destroy");
				$("#dialog-modals").attr('title','Results are Loading...');
				$("#loaders").show();
				$("#nodatas").hide();
				$("#dialog-modals").dialog({
						height: 140,position:'bottom',
						modal: true
				});	
			},
			success: function(msgssss){
				$("#dialog-modals").dialog("destroy");$("#loaders").hide();$("#dialog-modals").hide();
				msgssss=$.trim(msgssss);
				$("#rightcontents").html(msgssss);
				$("#rightcontents").encHTML();
				$("#rightcontents").decHTMLifEnc();
			}
		});
}
function pagination_test1(pagenum)
{
	document.getElementById('pagenum1').value=pagenum;
		$.ajax({
			type: "POST",
			url: "http://www.vestedtravelclub.com/resortsearchresult_test.php",
			data: "pagenum="+ pagenum +"&resortdest="+document.getElementById('resortdest').value+"&cs_date="+document.getElementById('cs_date').value+"&cs_year="+document.getElementById('cs_year').value,
			beforeSend:function(){
				$("#dialog-modals").dialog("destroy");
				$("#dialog-modals").attr('title','Results are Loading...');
				$("#loaders").show();
				$("#nodatas").hide();
				$("#dialog-modals").dialog({
						height: 140,position:'bottom',
						modal: true
				});	
			},
			success: function(msgssss){
				$("#dialog-modals").dialog("destroy");$("#loaders").hide();$("#dialog-modals").hide();
				msgssss=$.trim(msgssss);
				$("#rightcontents").html(msgssss);
				$("#rightcontents").encHTML();
				$("#rightcontents").decHTMLifEnc();
			}
		});
}

function pagination(pagenum)
{
	document.getElementById('pagenum').value=pagenum;
		$.ajax({
			type: "POST",
			url: "http://www.vestedtravelclub.com/resortsearchresult.php",
			data: "pagenum="+ pagenum +"&resortdest="+document.getElementById('resortdest').value+"&cs_date="+document.getElementById('cs_date').value+"&cs_year="+document.getElementById('cs_year').value,
			beforeSend:function(){
				$("#dialog-modals").dialog("destroy");
				$("#dialog-modals").attr('title','Results are Loading...');
				$("#loaders").show();
				$("#nodatas").hide();
				$("#dialog-modals").dialog({
						height: 140,position:'bottom',
						modal: true
				});	
			},
			success: function(msgssss){
				$("#dialog-modals").dialog("destroy");$("#loaders").hide();$("#dialog-modals").hide();
				msgssss=$.trim(msgssss);
				$("#rightcontents").html(msgssss);
				$("#rightcontents").encHTML();
				$("#rightcontents").decHTMLifEnc();
			}
		});
}

function pagination1(pagenum)
{
	document.getElementById('pagenum1').value=pagenum;
		$.ajax({
			type: "POST",
			url: "http://www.vestedtravelclub.com/resortsearchresult.php",
			data: "pagenum="+ pagenum +"&resortdest="+document.getElementById('resortdest').value+"&cs_date="+document.getElementById('cs_date').value+"&cs_year="+document.getElementById('cs_year').value,
			beforeSend:function(){
				$("#dialog-modals").dialog("destroy");
				$("#dialog-modals").attr('title','Results are Loading...');
				$("#loaders").show();
				$("#nodatas").hide();
				$("#dialog-modals").dialog({
						height: 140,position:'bottom',
						modal: true
				});	
			},
			success: function(msgss){
				$("#dialog-modals").dialog("destroy");$("#loaders").hide();$("#dialog-modals").hide();
				msgss=$.trim(msgss);
				$("#rightcontents").html(msgss);
				$("#rightcontents").encHTML();
				$("#rightcontents").decHTMLifEnc();
			}
		});
}
function validateresortsearch(rid)
{
	$("#dialog-modalss").dialog("destroy");
		$("#dialog-modalss").attr('title','Sorry...');
		$("#nodatass").show();
		$("#dialog-modalss").dialog({
				height: 140,position:'bottom',
				modal: true
		});	
	return false;
}
function validateresortsearch_old123()
{		 
var gmonth=document.getElementById('cs_date').value;
var gyear=document.getElementById('cs_year').value;
var cmonth=document.getElementById('cmonth').value;
var cyear=document.getElementById('cyear').value;
var validatedate=false;
if(gyear==cyear)
{
	if(gmonth < cmonth)
	{
		validatedate=true;
	}
	
}
if(validatedate==true)
{
	$("#dialog-modalss").dialog("destroy");
		$("#dialog-modalss").attr('title','No Availbility...');
		$("#nodatass").show();
		$("#dialog-modalss").dialog({
				height: 140,position:'bottom',
				modal: true
		});	
}
else{
	$.ajax({
   		type: "POST",
		url: "http://www.vestedtravelclub.com/validateresortsearch.php",
	    data: "resortdest="+document.getElementById('resortdest').value+"&cs_date="+gmonth+"&cs_year="+gyear,
		beforeSend:function(){
			$("#dialog-modals").dialog("destroy");
			$("#dialog-modals").attr('title','Results are Loading...');
			$("#loaders").show();
			$("#nodatas").hide();
			$("#dialog-modals").dialog({
					height: 140,position:'bottom',
					modal: true
			});	
		},
	    success: function(msg){			
	     	if(msg.indexOf("Norecord")!='-1')
			{
				$("#dialog-modals").dialog("destroy");
				$("#loaders").hide();
				$("#nodatas").show();
				$("#dialog-modals").attr('title','AVAILABILITY INFOMATION');		
				$("#dialog-modals").dialog({
					height: 140,position:'bottom',
					modal: true
				});	
			}else{
				
					$.ajax({
					type: "POST",
					url: "http://www.vestedtravelclub.com/resortsearchresult_test.php",
					data: "total="+msg+"&resortdest="+document.getElementById('resortdest').value+"&cs_date="+document.getElementById('cs_date').value+"&cs_year="+document.getElementById('cs_year').value,
					
					success: function(msgs){
						$("#dialog-modals").dialog("destroy");$("#loaders").hide();$("#dialog-modals").hide();
						msgs=$.trim(msgs);
						$("#rightcontents").html(msgs);
						$("#rightcontents").encHTML();
						$("#rightcontents").decHTMLifEnc();
					}
					});
			}
	   }
 	});
}
}
function sleep(milliseconds) {
setTimeout(function(){
var start = new Date().getTime();
while ((new Date().getTime() - start) < milliseconds){
// Do nothing
}
},0);
}
function updateattr(frmatt,resortatt,resortid)
{
document.getElementById('frmatt'+resortid).value=frmatt;
document.getElementById('resortatt'+resortid).value=resortatt;
}
function mintancemsg()
{
	$("#dialog-modalss").dialog("destroy");
	$("#dialog-modalss").attr('title','Search under maintance...');
	$("#nodatass").show();
	$("#dialog-modalss").dialog({
			height: 140,position:'bottom',
			modal: true
	});	
}
function validatesuiteholdbook(resortid)
{	
	var forms=document.getElementById('frmresort'+resortid);
	var radele=document.getElementsByName('rad_resort');
	
	for(var i = 0; i < radele.length; i++)
	{
		var obj = document.getElementsByName('rad_resort').item(i);
		if (obj.checked==true){					
			document.getElementById('resortatt'+resortid).value=obj.value;			
		}
	}
	
	
	if(document.getElementById('loginstatus').value=='yes')
	{		
		if(document.getElementById('resortaction').value=='book')
		{
			forms.action='http://www.vestedtravelclub.com/club/resort_reservNEW.php';
		}
		if(document.getElementById('resortaction').value=='hold')
		{
			forms.action='http://www.vestedtravelclub.com/club/resort_holdNEW.php';
			forms.submit();
			return true;
		}
		forms.submit();
		return true;
	}
	else{
		var resortatt=document.getElementById('resortatt'+resortid).value;
		var frmatt=document.getElementById('frmatt'+resortid).value;
		var action=document.getElementById('resortaction').value;
		var rid=document.getElementById('resortid'+resortid).value;
		
		setCookie('resortatt',resortatt,1);
		setCookie('resortid',rid,1);			
		setCookie('frmatt',frmatt,1);
		setCookie('action',action,1);
		
		
		$("#giftdialog").dialog("destroy");		
		$("#giftloader").hide();
		$("#nogiftcode").hide();$("#wcode").show();
		$("#giftdialog").attr('title','Gift Code');		
		$("#giftdialog").dialog({
			height: 140,position:'bottom',
			modal: true
		});
		/*forms.action='http://www.vestedtravels.com/vts_join.php';
		forms.submit();
		return true;*/
	}
	return false;
}
function validategiftcode()
{
	var forms=document.getElementById('wcode');
	var resortatt=getCookie('resortatt');
	var resortid=getCookie('resortid');
	var frmatt=getCookie('frmatt');
	var action=getCookie('action');
	var resortdest=getCookie('resortdest');
	var giftcode=document.getElementById('rcode').value;	
	if(document.getElementById('search_action'))
	{
		document.getElementById('raction').value=document.getElementById('search_action').value;
	}else{
		document.getElementById('raction').value='';
	}
	document.getElementById('rid').value=resortid;
	document.getElementById('rdest').value=resortdest;
	document.getElementById('ratt').value=resortatt;
	document.getElementById('fatt').value=frmatt;	
	
	document.getElementById('resortaction').value=action;

	if(action=='hold')
	{
		forms.action='http://www.vestedtravelclub.com/resort_holdNEW.php';
	}
	if(action=='book')
	{
		forms.action='http://www.vestedtravelclub.com/resort_reservNEW.php';
	}
$.ajax({
		type: "POST",
		url: "http://www.vestedtravelclub.com/validategiftcode.php",
		data: "promo="+giftcode,
		beforeSend:function(){
			$("#giftdialog").dialog("destroy");
				$("#giftloader").show();
				$("#nogiftcode").hide();$("#wcode").hide();
				$("#giftdialog").attr('title','Gift Code...');		
				$("#giftdialog").dialog({
					height: 140,position:'bottom',
					modal: true
				});
		},
		success: function(msg){			
				if(parseInt(msg)==99999)
				{							
					$("#giftdialog").dialog("destroy");
						$("#giftloader").hide();
						$("#nogiftcode").show();
						$("#giftdialog").attr('title','Gift Code:Not Found');		
						$("#giftdialog").dialog({
							height: 140,position:'bottom',
							modal: true
					});
				}
				else
				{
					var mainarraylist=msg.split("**");
					if(mainarraylist.length>1)
					{									
						document.getElementById("afflevel").value=mainarraylist[0];
						document.getElementById("usertype").value=mainarraylist[1];
						forms.submit();return true;
					}
					else
					{
						$("#giftdialog").dialog("destroy");
							$("#giftloader").hide();
							$("#nogiftcode").show();
							$("#giftdialog").attr('title','Gift Code:Not Found');		
							$("#giftdialog").dialog({
								height: 140,position:'bottom',
								modal: true
							});
					}
				}
	   }
});

	
	return false;
}
/*currently used js funtion to live site*/
function validateholdbook(resortid)
{	
	var forms=document.getElementById('frmresort'+resortid);
	var radele=document.getElementsByName('rad_resort'+resortid);

	for(var i = 0; i < radele.length; i++)
	{
		var obj = document.getElementsByName('rad_resort'+resortid).item(i);
		if (obj.checked==true){		
			document.getElementById('resortatt'+resortid).value=obj.value;			
		}
	}

	if(document.getElementById('loginstatus').value=='yes')
	{
		if(document.getElementById('resortaction').value=='hold')
		{
			forms.action='http://www.vestedtravelclub.com/club/resort_holdNEW.php';
		}
		if(document.getElementById('resortaction').value=='book')
		{
			forms.action='http://www.vestedtravelclub.com/club/resort_reservNEW.php';
		}
		//sleep(5000);
			$.ajax({
				type: "POST",
				url: "http://www.vestedtravelclub.com/validatehold.php",
				data: "validate=yes",
				beforeSend:function(){
					$("#hold-dialog-modals").dialog("destroy");
						$("#holdloaders").show();
						$("#holddata").hide();
						$("#hold-dialog-modals").attr('title','Request is on process..');		
						$("#hold-dialog-modals").dialog({
							height: 140,position:'bottom',
							modal: true
						});
				},
				success: function(msg){			
					if(msg.indexOf("Already")!='-1')
					{
						$("#hold-dialog-modals").dialog("destroy");
						$("#holdloaders").hide();
						$("#holddata").show();
						$("#hold-dialog-modals").attr('title','ALREAY PLACED UNIT ON HOLD');		
						$("#hold-dialog-modals").dialog({
							height: 140,position:'bottom',
							modal: true
						});	
					}else{
						forms.submit();
						return true;
					}
			   }
		});

	}
	else{
			var resortatt=document.getElementById('resortatt'+resortid).value;
			var frmatt=document.getElementById('frmatt'+resortid).value;
			var action=document.getElementById('resortaction').value;
			var rid=document.getElementById('resortid'+resortid).value;
			setCookie('resortatt',resortatt,1);
			setCookie('resortid',rid,1);			
			setCookie('frmatt',frmatt,1);
			setCookie('action',action,1);

			$("#giftdialog").dialog("destroy");		
			$("#giftloader").hide();
			$("#nogiftcode").hide();$("#wcode").show();
			$("#giftdialog").attr('title','Gift Code');		
			$("#giftdialog").dialog({
				height: 140,position:'bottom',
				modal: true
			});
		/*forms.action='http://www.vestedtravels.com/vts_join.php';
		forms.submit();
		return true;*/
	}
	return false;
}
function getCookie(c_name)
{
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=");
  if (c_start!=-1)
    {
    c_start=c_start + c_name.length+1;
    c_end=document.cookie.indexOf(";",c_start);
    if (c_end==-1) c_end=document.cookie.length;
    return unescape(document.cookie.substring(c_start,c_end));
    }
  }
return "";
}

function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toUTCString());
}
function validatemembersearch()
{		 
var gmonth=document.getElementById('cs_date').value;
var gyear=document.getElementById('cs_year').value;
var cmonth=document.getElementById('cmonth').value;
var cyear=document.getElementById('cyear').value;
var resortdest=document.getElementById('resortdest').value;
var validatedate=false;
if(gyear==cyear)
{
	if(gmonth < cmonth)
	{
		validatedate=true;
	}
	
}
if(validatedate==true)
{
	$("#dialog-modalss").dialog("destroy");
		$("#dialog-modalss").attr('title','No Availbility...');
		$("#nodatass").show();
		$("#dialog-modalss").dialog({
				height: 140,position:'bottom',
				modal: true
		});	
}
else{
	$.ajax({
   		type: "POST",
		url: "http://www.vestedtravelclub.com/validateresortsearch_test.php",
	    data: "resortdest="+resortdest+"&cs_date="+gmonth+"&cs_year="+gyear,
		beforeSend:function(){
			$("#dialog-modals").dialog("destroy");
			$("#dialog-modals").attr('title','Results are Loading...');
			$("#loaders").show();
			$("#nodatas").hide();
			$("#dialog-modals").dialog({
					height: 140,position:'bottom',
					modal: true
			});	
		},
	    success: function(msg){			
	     	if(msg.indexOf("Norecord")!='-1')
			{
				$("#dialog-modals").dialog("destroy");
				$("#loaders").hide();
				$("#nodatas").show();
				$("#dialog-modals").attr('title','AVAILABILITY INFOMATION');		
				$("#dialog-modals").dialog({
					height: 140,position:'bottom',
					modal: true
				});	
			}else{
				
					$.ajax({
					type: "POST",
					url: "http://www.vestedtravelclub.com/resortsearchresult.php",
					data: "total="+msg+"&resortdest="+resortdest+"&cs_date="+gmonth+"&cs_year="+gyear,
					
					success: function(msgs){
						$("#dialog-modals").dialog("destroy");$("#loaders").hide();$("#dialog-modals").hide();
						msgs=$.trim(msgs);
						$("#rightcontents").html(msgs);
						$("#rightcontents").encHTML();
						$("#rightcontents").decHTMLifEnc();
					}
					});
			}
	   }
 	});
}
}
function validateresortsearch_old()
{		 
var gmonth=document.getElementById('cs_date').value;
var gyear=document.getElementById('cs_year').value;
var cmonth=document.getElementById('cmonth').value;
var cyear=document.getElementById('cyear').value;
var resortdest=document.getElementById('resortdest').value;
document.getElementById('mm').value=gmonth;
document.getElementById('yy').value=gyear;
var validatedate=false;
setCookie('resortdest',resortdest,1);
setCookie('gmonth',gmonth,1);
setCookie('gyear',gyear,1);
setCookie('cmonth',cmonth,1);
setCookie('cyear',cyear,1);
if(gyear==cyear)
{
	if(gmonth < cmonth)
	{
		validatedate=true;
	}
	
}
if(validatedate==true)
{
	$("#dialog-modalss").dialog("destroy");
		$("#dialog-modalss").attr('title','No Availbility...');
		$("#nodatass").show();
		$("#dialog-modalss").dialog({
				height: 140,position:'bottom',
				modal: true
		});	
}
else{
	$.ajax({
   		type: "POST",
		url: "http://www.vestedtravelclub.com/validateresortsearch_test.php",
	    data: "resortdest="+resortdest+"&cs_date="+gmonth+"&cs_year="+gyear,
		beforeSend:function(){
			$("#dialog-modals").dialog("destroy");
			$("#dialog-modals").attr('title','Results are Loading...');
			$("#loaders").show();
			$("#nodatas").hide();
			$("#dialog-modals").dialog({
					height: 140,position:'bottom',
					modal: true
			});	
		},
	    success: function(msg){			
	     	if(msg.indexOf("Norecord")!='-1')
			{
				$("#dialog-modals").dialog("destroy");
				$("#loaders").hide();
				$("#nodatas").show();
				$("#dialog-modals").attr('title','AVAILABILITY INFOMATION');		
				$("#dialog-modals").dialog({
					height: 140,position:'bottom',
					modal: true
				});	
			}else{
				
					$.ajax({
					type: "POST",
					url: "http://www.vestedtravelclub.com/resortsearchresult.php",
					data: "total="+msg+"&resortdest="+resortdest+"&cs_date="+gmonth+"&cs_year="+gyear,
					
					success: function(msgs){
						$("#dialog-modals").dialog("destroy");$("#loaders").hide();$("#dialog-modals").hide();
						msgs=$.trim(msgs);
						$("#rightcontents").html(msgs);
						$("#rightcontents").encHTML();
						$("#rightcontents").decHTMLifEnc();
					}
					});
			}
	   }
 	});
}
}
function validateresortsearch_back()
{
var gmonth=document.getElementById('searchmon').value;
var gyear=document.getElementById('searchyear').value;
var resortdest=document.getElementById('searchdest').value;
var cmonth=document.getElementById('searchcmon').value;
var cyear=document.getElementById('searchcyear').value;

if(gmonth=="" || gyear=="" || cmonth=="" || cyear=="" || resortdest=="")
{
	alert("You have no such search history at moment.");
	return false;
}
var validatedate=false;
if(gyear==cyear)
{
	if(gmonth < cmonth)
	{
		validatedate=true;
	}
	
}
if(validatedate==true)
{
	$("#dialog-modalss").dialog("destroy");
		$("#dialog-modalss").attr('title','No Availbility...');
		$("#nodatass").show();
		$("#dialog-modalss").dialog({
				height: 140,position:'bottom',
				modal: true
		});	
}
else{
	$.ajax({
   		type: "POST",
		url: "http://www.vestedtravelclub.com/validateresortsearch_test.php",
	    data: "resortdest="+resortdest+"&cs_date="+gmonth+"&cs_year="+gyear,
		beforeSend:function(){
			$("#dialog-modals").dialog("destroy");
			$("#dialog-modals").attr('title','Results are Loading...');
			$("#loaders").show();
			$("#nodatas").hide();
			$("#dialog-modals").dialog({
					height: 140,position:'bottom',
					modal: true
			});	
		},
	    success: function(msg){			
	     	if(msg.indexOf("Norecord")!='-1')
			{
				$("#dialog-modals").dialog("destroy");
				$("#loaders").hide();
				$("#nodatas").show();
				$("#dialog-modals").attr('title','AVAILABILITY INFOMATION');		
				$("#dialog-modals").dialog({
					height: 140,position:'bottom',
					modal: true
				});	
			}else{
				
					$.ajax({
					type: "POST",
					url: "http://www.vestedtravelclub.com/resortsearchresult.php",
					data: "total="+msg+"&resortdest="+resortdest+"&cs_date="+gmonth+"&cs_year="+gyear,
					
					success: function(msgs){
						/*document.getElementById('mm').value=gmonth;
						document.getElementById('yy').value=gyear;*/
						$("#dialog-modals").dialog("destroy");$("#loaders").hide();$("#dialog-modals").hide();
						msgs=$.trim(msgs);
						$("#rightcontents").html(msgs);
						$("#rightcontents").encHTML();
						$("#rightcontents").decHTMLifEnc();
					}
					});
			}
	   }
 	});
}
}
function suitsearch(resortid,resortdest)
{		 
var csmon=document.getElementById('csmon').value;
var csyear=document.getElementById('csyear').value;
//var resortdest=getCookie('resortdest');

	$.ajax({
   		type: "POST",
		url: "http://www.vestedtravelclub.com/validatesuitesearch.php",
	    data: "resortid="+resortid+"&cs_date="+csmon+"&cs_year="+csyear+"&resortdest="+resortdest,
		beforeSend:function(){
			$("#dialog-modals").dialog("destroy");
			$("#dialog-modals").attr('title','Results are Loading...');
			$("#loaders").show();
			$("#nodatas").hide();
			$("#dialog-modals").dialog({
					height: 140,position:'bottom',
					modal: true
			});	
		},
	    success: function(msg){			
	     	if(msg.indexOf("Norecord")!='-1')
			{
				$("#dialog-modals").dialog("destroy");
				$("#loaders").hide();
				$("#nodatas").show();
				$("#dialog-modals").attr('title','AVAILABILITY INFOMATION');		
				$("#dialog-modals").dialog({
					height: 140,position:'bottom',
					modal: true
				});	
			}else{
				
					$.ajax({
					type: "POST",
					url: "http://www.vestedtravelclub.com/suitesearch.php",
					data: "total="+msg+"&resortid="+resortid+"&resortdest="+resortdest+"&cs_date="+csmon+"&cs_year="+csyear,
					
					success: function(msgs){
						$("#dialog-modals").dialog("destroy");$("#loaders").hide();$("#dialog-modals").hide();
						msgs=$.trim(msgs);
						$("#suiteresult").html(msgs);
						$("#suiteresult").encHTML();
						$("#suiteresult").decHTMLifEnc();
					}
					});
			}
	   }
 	});

}
/* ]]> */

