		function toggleBox(layerID, iState)
		{
			var docwidth=0;
			var docheight=0;
			if (window.innerWidth || window.innerHeight)
			{
				docwidth = window.innerWidth; 
				docheight = window.innerHeight; 
			} 
			else if (document.body.clientWidth || document.body.clientHeight)
			{ 
				docwidth = document.body.clientWidth; 
				docheight = document.body.clientHeight; 
			} 
			var obj =document.getElementById(layerID);
			var IpopTop=(docheight - obj.offsetHeight)/2;
			var IpopLeft=(docwidth - obj.offsetWidth)/2;
			var nLeft=IpopLeft + document.body.scrollLeft;
			var nTop=IpopTop + document.body.scrollTop;
			obj.style.left=nLeft;
			obj.style.top=nTop;
			obj.style.visibility = document.layers ? (iState ? "show" : "hide") :(iState ? "visible" : "hidden");
		}

		function confirmDelete(url)
		{
			var ok=confirm('Are you sure, Do you want to delete this data?');
			if(ok===true)
			{
				this.location.href=url;
			}
		}

		function createXMLHttpRequest()
		{
			var xmlHttp;
			if (window.XMLHttpRequest) // Mozilla, Safari,...
			{ 
				xmlHttp = new XMLHttpRequest();
			}
			else if (window.ActiveXObject) // IE
			{ 
				try 
				{
					xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
				}
				catch(e) 
				{
					try 
					{
						xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
					} 
					catch (e) 
					{
					}
				}
			}
			
			if (!xmlHttp) 
			{
				alert('Cannot create XMLHTTP instance');
				return false;
			}
			else
			{
				return xmlHttp;
			}
		} 
		
		function getAjax(url,display)
		{		
			var xmlHttp=createXMLHttpRequest();
			xmlHttp.onreadystatechange=function()
			{
				viewAjax(xmlHttp,display);
			}
			xmlHttp.open("post",url,true);
			xmlHttp.send(null);	
		}
 
		function viewAjax(xml,display)
		{	
			if(xml.readyState==4)
			{	
				if(xml.status==200)
				{			
					document.getElementById(display).innerHTML=xml.responseText;	
				}
			}
		}

		function getVdo(divId,video,image)
		{
			var s1 = new SWFObject("player.swf",divId,"320","240","9");
			s1.addParam("wmode","transparent");
			s1.addParam("allowscriptaccess","always");
			s1.addParam("allowfullscreen","true");
			s1.addVariable("file",video);
			s1.addVariable("image",image);
			s1.addVariable("backcolor","0x333333");
			s1.addVariable("frontcolor","0xaaaaaa");
			s1.addVariable("lightcolor","0xeeeeee");
			s1.addVariable("showstop","true");
			s1.addVariable("volume","80");
			s1.write(divId);
		}


		function deleteEvent(gid,lid,id,display,showStatus)
		{
			var ok=confirm('Are you sure, Do you want to delete this data?');
			if(ok===true)
			{
				var xmlHttp=createXMLHttpRequest();
				xmlHttp.onreadystatechange=function()
				{
					refreshEventList(xmlHttp,gid,lid,showStatus,display);
				}
				xmlHttp.open("post","deleteEvent.php?id="+id,true);
				xmlHttp.send(null);	
			}
		}

		function refreshEventList(xml,gid,lid,showStatus,display)
		{	
			if(xml.readyState==4)
			{	
				if(xml.status==200)
				{			
					getAjax('eventList.php?gid='+gid+'&lid='+lid+'&showStatus='+showStatus,display);
				}
			}
		}


		function setEventVisible(gid,lid,id,display,showStatus,visibility)
		{

			var xmlHttp=createXMLHttpRequest();
			xmlHttp.onreadystatechange=function()
			{
				refreshEventList(xmlHttp,gid,lid,showStatus,display);
			}
			xmlHttp.open("post","updateVisibility.php?id="+id+'&status='+visibility,true);
			xmlHttp.send(null);	
		}

		function showLoading(div)
		{
			var resp='<table border="0" cellpadding="0" cellspacing="0" background="themes/default/images/loading_bg.png">';
			resp+='<tr><td width="51" height="51" align="center" valign="middle"><img src="themes/default/images/spinner.gif"></td></tr></table>';
			document.getElementById(div).innerHTML=resp;
		}



		function deleteBanner(gid,id,display)
		{
			var ok=confirm('Are you sure, Do you want to delete this data?');
			if(ok===true)
			{
				var xmlHttp=createXMLHttpRequest();
				xmlHttp.onreadystatechange=function()
				{
					refreshBannerList(xmlHttp,gid,display);
				}
				xmlHttp.open("post","deleteBanner.php?gid="+gid+"&id="+id,true);
				xmlHttp.send(null);	
			}
		}

		function refreshBannerList(xml,gid,display)
		{	
			if(xml.readyState==4)
			{	
				if(xml.status==200)
				{			
					getAjax('bannerList.php?gid='+gid,display);
				}
			}
		}


		function deleteLogo(gid,id,display)
		{
			var ok=confirm('Are you sure, Do you want to delete this data?');
			if(ok===true)
			{
				var xmlHttp=createXMLHttpRequest();
				xmlHttp.onreadystatechange=function()
				{
					refreshLogoList(xmlHttp,gid,display);
				}
				xmlHttp.open("post","deleteLogo.php?gid="+gid+"&id="+id,true);
				xmlHttp.send(null);	
			}
		}

		function refreshLogoList(xml,gid,display)
		{	
			if(xml.readyState==4)
			{	
				if(xml.status==200)
				{			
					getAjax('logoList.php?gid='+gid,display);
				}
			}
		}


		function deleteBoard(bid,display)
		{
			var ok=confirm('Are you sure, Do you want to delete this board?');
			if(ok===true)
			{
				var xmlHttp=createXMLHttpRequest();
				xmlHttp.onreadystatechange=function()
				{
					refreshWebboardList(xmlHttp,display);
				}
				xmlHttp.open("post","deleteBoard.php?bid="+bid,true);
				xmlHttp.send(null);	
			}
		}

		function refreshWebboardList(xml,display)
		{	
			if(xml.readyState==4)
			{	
				if(xml.status==200)
				{			
					getAjax('webboardList.php',display);
				}
			}
		}


		function deleteTopic(bid,qid,display)
		{
			var ok=confirm('Are you sure, Do you want to delete this topic?');
			if(ok===true)
			{
				var xmlHttp=createXMLHttpRequest();
				xmlHttp.onreadystatechange=function()
				{
					refreshTopicList(xmlHttp,bid,display);
				}
				xmlHttp.open("post","deleteTopic.php?bid="+bid+"&qid="+qid,true);
				xmlHttp.send(null);	
			}
		}

		function refreshTopicList(xml,bid,display)
		{	
			if(xml.readyState==4)
			{	
				if(xml.status==200)
				{			
					getAjax('boardList.php?bid='+bid,display);
				}
			}
		}


		function deleteAlbum(aid,display)
		{
			var ok=confirm('Are you sure, Do you want to delete this album?');
			if(ok===true)
			{
				var xmlHttp=createXMLHttpRequest();
				xmlHttp.onreadystatechange=function()
				{
					refreshAlbumList(xmlHttp,display);
				}
				xmlHttp.open("post","deleteAlbum.php?aid="+aid,true);
				xmlHttp.send(null);	
			}
		}

		function refreshAlbumList(xml,display)
		{	
			if(xml.readyState==4)
			{	
				if(xml.status==200)
				{			
					getAjax('albumList.php',display);
				}
			}
		}

		function deletePhoto(aid,id,pg,display)
		{
			var ok=confirm('Are you sure, Do you want to delete this photo?');
			if(ok===true)
			{
				var xmlHttp=createXMLHttpRequest();
				xmlHttp.onreadystatechange=function()
				{
					refreshPhotoList(xmlHttp,aid,pg,display);
				}
				xmlHttp.open("post","deletePhoto.php?id="+id+"&aid="+aid,true);
				xmlHttp.send(null);	
			}
		}
		function refreshPhotoList(xml,aid,pg,display)
		{	
			if(xml.readyState==4)
			{	
				if(xml.status==200)
				{			
					getAjax('photoList.php?aid='+aid+'&pg='+pg,display);
				}
			}
		}
		function deletePhotoEvent(eid,id,pg,display)
		{
			var ok=confirm('Are you sure, Do you want to delete this photo?');
			if(ok===true)
			{
				var xmlHttp=createXMLHttpRequest();
				xmlHttp.onreadystatechange=function()
				{
					refreshPhotoList(xmlHttp,eid,pg,display);
				}
				xmlHttp.open("post","deletePhotoEvent.php?id="+id+"&eid="+eid,true);
				xmlHttp.send(null);	
			}
		}

		function refreshPhotoEventList(xml,eid,pg,display)
		{	
			if(xml.readyState==4)
			{	
				if(xml.status==200)
				{			
					getAjax('photoEventList.php?eid='+eid+'&pg='+pg,display);
				}
			}
		}
		function setRankEvent(gid,lid,id,rank,display)
		{
			var xmlHttp=createXMLHttpRequest();
			xmlHttp.onreadystatechange=function()
			{
				refreshEventList(xmlHttp,gid,lid,1,display);
			}			
			xmlHttp.open("post","updateEventRank.php?gid="+gid+"&lid="+lid+"&id="+id+"&rank="+rank,true);
			xmlHttp.send(null);	
		}


		function setRating(id,rate,display)
		{
			var xmlHttp=createXMLHttpRequest();
			xmlHttp.onreadystatechange=function()
			{
				refreshRating(xmlHttp,id,display);
			}			
			xmlHttp.open("post","addRating.php?id="+id+"&rate="+rate,true);
			xmlHttp.send(null);	
		}

		function refreshRating(xml,id,display)
		{	
			if(xml.readyState==4)
			{	
				if(xml.status==200)
				{			
					getAjax('rateList.php?id='+id,display);
				}
			}
		}

		function popup(url,w,h)
		{
			var docwidth=0;
			var docheight=0;
			if (screen.width|| screen.height)
			{
				docwidth = screen.width; 
				docheight = screen.height; 	
			}
			else if (window.innerWidth || window.innerHeight)
			{
				docwidth = window.innerWidth; 
				docheight = window.innerHeight; 
			} 
			else if (document.body.clientWidth || document.body.clientHeight)
			{ 
				docwidth = document.body.clientWidth; 
				docheight = document.body.clientHeight; 
			} 
			var IpopTop=(docheight - h)/2;
			var IpopLeft=(docwidth - w)/2;
			var left=IpopLeft + document.body.scrollLeft;
			var top=IpopTop + document.body.scrollTop;
			var rand_no = Math.random();
			window.open(url,"chic"+rand_no,"toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width="+w+",height="+h+",left="+left+",top="+top);
		}
 
 
		function popup2(url,w,h,target)
		{
			var docwidth=0;
			var docheight=0;
			if (screen.width|| screen.height)
			{
				docwidth = screen.width; 
				docheight = screen.height; 	
			}
			else if (window.innerWidth || window.innerHeight)
			{
				docwidth = window.innerWidth; 
				docheight = window.innerHeight; 
			} 
			else if (document.body.clientWidth || document.body.clientHeight)
			{ 
				docwidth = document.body.clientWidth; 
				docheight = document.body.clientHeight; 
			} 
			var IpopTop=(docheight - h)/2;
			var IpopLeft=(docwidth - w)/2;
			var left=IpopLeft + document.body.scrollLeft;
			
			var top=IpopTop;
			var rand_no = Math.random();
			window.open(url,target,"toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width="+w+",height="+h+",left="+left+",top="+top);
		}

		function refreshOpenerAndClose(time)
		{
			window.opener.location.reload();
			window.setTimeout('self.close()',time);
		}

		function confirmDelete(url)
		{
			var ok=confirm('Do you want to delete?');
			if(ok===true)
			{
				this.location.href=url;
			}
		}


