$(document).ready(function() {
	var imgFlag = "";	
	var flag = true;
     
	// Expand Panel
	$("#open").click(function(){
		$("div#panel").slideDown("slow");	
		imgFlag = "show";
	});	
	
	// Collapse Panel
	$("#close").click(function(){
		$("div#panel").slideUp("slow");	
		imgFlag = "hide";
	});		
	
	var query_str = "";	
	if(document.getElementById("hdnTitle"))
	{
		if(document.getElementById("hdnTitle").value!="")	
			query_str = "&t="+document.getElementById("hdnTitle").value+"&s="+document.getElementById("hdnSubTitle").value;			
	}
	
	// Switch buttons from "Log In | Register" to "Close Panel" on click
	$("#toggle a").click(function () {
		$("#toggle a").toggle();

		if(imgFlag=="show")
		{
			if(flag==true && document.getElementById("ifrChart").style.display=="none")
			{			
            var rand_no = Math.random();		
				document.getElementById("ifrChart").style.display = "inline";
				document.getElementById("ifrChart").src = WWWROOT+"/post/showChart2.php?rand"+rand_no+query_str;
				flag = false;	
			}
			
			document.getElementById("imgShow").style.display = "none";
			document.getElementById("imgHide").style.display = "";

			writeJavaCookie("COOK_SLIDE","no");	
		}
		else
		{
			document.getElementById("imgShow").style.display = "";
			document.getElementById("imgHide").style.display = "none";
			
			writeJavaCookie("COOK_SLIDE","yes");	
		}
	});		
		
});

/*
	$(document).ready(function() {
		var flag = true;	
		// Expand Panel
		$("#open").click(function(){
			$("div#panel").slideDown("slow");			

			if(flag==true)
			{
				document.getElementById("ifrChart").style.display = "inline";
				document.getElementById("ifrChart").src = "post/showChart2.php";
				flag = false;	
			}

			document.getElementById("imgShow").style.display = "none";
			document.getElementById("imgHide").style.display = "";			
	});	
	
	// Collapse Panel
	$("#close").click(function(){
		$("div#panel").slideUp("slow");			
		alert(inline);
			document.getElementById("imgShow").style.display = "inline";
			document.getElementById("imgHide").style.display = "none";			
//		document.getElementById("ifrChart").src = "post/default.html";							   		
	});		
	
	// Switch buttons from "Log In | Register" to "Close Panel" on click
	$("#toggle a").click(function () {
		$("#toggle a").toggle();
	});		
		
});
	*/
