function WinOpen(url,width,heigth)
{
	window.open(url,'','width='+width+',height='+heigth+',left=200,top=50,scrollbars=yes,resizable=yes,toolbar=no,status=no,directories=no,location=no');
}

//############## SEND DATA USING AJAX(GET METHOD) - START ##############//

function validate(url,divname,methods,param)
{
	//alert(url + divname + methods + param)
	var xmlHttp ;
	try
    {
         // Firefox, Opera 8.0+, Safari
		 xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
	  // Internet Explorer
		try
		{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try
			{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				alert("Your browser does not support AJAX!");
				return false;
			}
		}
	}

     xmlHttp.onreadystatechange=function()
	{
	  if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
	  {
			var pElement=document.getElementById(divname);
			pElement.innerHTML=xmlHttp.responseText;
	  }
	}
	xmlHttp.open(methods,url,true);
	if(methods == 'POST' || methods == 'Post' )
	{
		xmlHttp.push('Content-type',
        'application/x-www-form-urlencoded');
		xmlHttp.push('Connection', 'close');
	}
	xmlHttp.send(param);
}

//############## SEND DATA USING AJAX(GET METHOD) - END ##############//

function Pagination(pageid,currentpage,flag,divname)
{
	if(flag=="bloglist")
	{
		if(!divname)
			var divname = 'recordlist';

		var url="common_ajax.html?pageid=" + pageid + "&currentpage="	+ currentpage + "&flag="+ flag ;
		//alert(url);
		return validate(url,divname,'GET',null);
	}
	else	
	{
	
		var color = document.getElementById("hide_color").value;
		var breeding = document.getElementById("hide_breeding").value;
		var sex = document.getElementById("hide_sex").value;
		var breed = document.getElementById("hide_breed").value;
		var age = document.getElementById("hide_age").value;
		var price = document.getElementById("hide_price").value;

		if(flag=="showcasedlist")
		{
			document.getElementById("hide_filter1").value = "";
			document.getElementById("hide_show").value = "";	
		}
		else
		{
			document.getElementById("hide_filter2").value = "";
			document.getElementById("hide_show").value = "GETFALPACA";	
		}		
		if(!divname)
			var divname = 'recordlist';
		var url="common_ajax.html?pageid=" + pageid + "&currentpage="	+ currentpage + "&flag="+ flag +"&color=" + color + "&breeding=" + breeding + "&sex=" + sex + "&breed=" + breed + "&age=" + age + "&price=" + price;
		//alert(url);
		return validate(url,divname,'GET',null);
	}
	

}

function ValidateSearch()
{
	return document.search.submit();

}

function FiltersProcess(filter,show)
{
	if(show=="GETSALPACA")
	{
		document.getElementById("hide_filter1").value = filter;
	}
	else
	{
		document.getElementById("hide_filter2").value = filter;
	}	
	document.getElementById("hide_show").value = show;	

	return document.frmmain.submit();
}

function ShowComments(postid)
{
	window.location = "_comments_"+postid+".html";
}
function ReadMore(postid)
{
	window.location = "_comments_"+postid+".html";
}
