//function used for showing case study divs
function toggle_img(divid1)
{
	if(divid1 == 'img1')
	{
		 document.getElementById('cs1').style.display='block';
		 document.getElementById('cs2').style.display='none';
		 document.getElementById('cs3').style.display='none';
	}
	else if(divid1 == 'img2')
	{	
		document.getElementById('cs1').style.display='none';
		document.getElementById('cs2').style.display='block';
		document.getElementById('cs3').style.display='none';	
	}
	else if(divid1 == 'img3')
	{	
		document.getElementById('cs1').style.display='none';
		document.getElementById('cs2').style.display='none';
		document.getElementById('cs3').style.display='block';	
	}
	return true;	
}

//function for getting filtered category
function reload_news_page(cat)
{
	//alert(cat);
	/*if(cat == 'featured')
	{
		
		document.getElementById('cat_all').style.display='none';
		document.getElementById('cat_featured').style.display='block';
		//window.location = 'http://projectsjunction.com/maccabi/news/';
		
	}
	else if(cat == 'allposts')
	{
		
		document.getElementById('cat_featured').style.display='none';
		document.getElementById('cat_all').style.display='block';
		//window.location = 'http://projectsjunction.com/maccabi/news/';
	}*/
	
	xmlHttp=check_ajax_support();
	if (xmlHttp==null)
	{
		alert ("Your browser does not support AJAX!");
		return;
	}
	
	var url="http://projectsjunction.com/maccabi/wp-content/themes/maccabi-theme/ajax/filter_post.php";
	url=url+"?cat="+cat;
	url=url+"&sid="+Math.random();
	xmlHttp.open("GET",url,true);
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.setRequestHeader("Content-length",url.length);
    xmlHttp.setRequestHeader("Connection", "close");
    xmlHttp.send(url);
	xmlHttp.onreadystatechange=function()
	{
		if(xmlHttp.readyState==4)
		{
			if(xmlHttp.responseText != '')
			{
				//alert(xmlHttp.responseText);
				
			}
		}
	}
window.location = 'http://projectsjunction.com/maccabi/news/';
}

function reload_page(cat)
{
	if(cat == 'featured')
	{
		window.location = 'http://projectsjunction.com/maccabi/featured_cat/';
		
	}
	else if(cat == 'allposts')
	{
		window.location = 'http://projectsjunction.com/maccabi/news/';
	}
}