function resize_page(){
	mypage = document.getElementById("page");
	if(document.body.clientWidth){
		mywidth = document.body.clientWidth;
				
		if (mywidth<1182){				
			
			if(mywidth>1024){
					mypage.style.padding = "20px "+(117-(1182-mywidth)/2)+"px 40px;";
				}else{
					mypage.style.padding = "20px 17px 40px;";
				}
			
		}else{
			mypage.style.padding = "";
		}
	}	
}

window.onload = resize_page
window.onresize = resize_page
function clear_search_form()
{
	var subcats = window.document.esearch.subcats; 
	var optionCounter; 
	for (optionCounter = 0; optionCounter < subcats.length; optionCounter++) 
	{ 
		subcats.options[optionCounter].selected = 0; 
	}
	window.document.esearch.sector.value = 0;
	window.document.esearch.keyword.value = '';

	return true;    
}

function clear_search_form2()
{
    var subcats = window.document.esearch.subcats; 
    var optionCounter; 
	for (optionCounter = 0; optionCounter < subcats.length; optionCounter++) 
    { 
        subcats.options[optionCounter].selected = 0; 
    }
	window.document.esearch.topic[0].selected = 1;
	window.document.esearch.calendar.value = '';
	window.document.esearch.keyword.value = '';    

	return true;    
}

    jQuery().ready(function(){                  
     $('#post_thread').hide();
     $('#toggle_post_thread').click(function()
     {
        $('#post_thread').toggle();
     });
     
     $('#post_topic').hide();
     $('#toggle_post_topic').click(function()
     {
        $('#post_topic').toggle();
     });  
     
     $('#new_post').hide();
     $('#toggle_post').click(function()
     {
     $('#new_post').toggle();
     });
        
 });  