var browserType;

if (document.layers) {browserType = "nn4"}
if (document.all) {browserType = "ie"}
if (window.navigator.userAgent.toLowerCase().match("gecko")) {
 browserType= "gecko"
}

function hide() {
	if (browserType == "gecko" )
		 document.poppedLayer =
				 eval('document.getElementById("cat-section")');
	else if (browserType == "ie")
		 document.poppedLayer =
				eval('document.getElementById("cat-section")');
	else
		 document.poppedLayer =
				eval('document.layers["cat-section"]');
	document.poppedLayer.style.display = "none";

}

function show() {
	if (browserType == "gecko" )
		 document.poppedLayer =
				 eval('document.getElementById("cat-section")');
	else if (browserType == "ie")
		 document.poppedLayer =
				eval('document.getElementById("cat-section")');
	else
		 document.poppedLayer =
				 eval('document.layers["cat-section"]');
	document.poppedLayer.style.display = "block";
}


function getContent(DivID, url, params)
{
	var newurl = encodeURIComponent(url);
	if (window.XMLHttpRequest)
	{// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
		xmlhttp.open("GET",newurl,false);
		if (typeof params == "undefined")
			xmlhttp.send(null);
		else
			xmlhttp.send(params);
	}
	else
	{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		xmlhttp.open("GET",newurl,false);
		if (typeof params == "undefined")
			xmlhttp.send();
		else
			xmlhttp.send(params);
	}
	document.getElementById(DivID).innerHTML=xmlhttp.responseText;
}


function postContent(DivID, url, params, callback)
{
	var newurl = encodeURIComponent(url);
	if (window.XMLHttpRequest)
	{// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
		xmlhttp.open("POST",newurl,false);
		xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
		if (typeof params == "undefined")
			xmlhttp.send(null);
		else
			xmlhttp.send(params);
	}
	else
	{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		xmlhttp.open("POST",newurl,false);
		xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
		if (typeof params == "undefined")
			xmlhttp.send();
		else
			xmlhttp.send(params);
	}
	document.getElementById(DivID).innerHTML=xmlhttp.responseText;
	eval(callback);
}

function dp1() {
	showDatepicker("fromdate","-0","+7");
	showDatepicker("todate","+1","+30");
}


function showDatepicker(id, minDays, maxDays )
{
	$(function() {
		$("#"+id).datepicker({
			showOn: 'button',
			buttonImage: 'images/calendar.png',
			buttonImageOnly: true,
			dateFormat: 'yy-mm-dd'
		});
	});
	
	
	
	
	
}
