			$(document).ready(function(){
				
				//slides the element with class "menu_body" when paragraph with class "menu_head" is clicked
				$("#firstpane p.menu_head").click(function(){
				    $(this).css({backgroundImage:"url(../css/down.png)"}).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow");
				    $(this).siblings().css({backgroundImage:"url(../css/left.png)"});
				});
				
				$("a[name=click]").click(function(){ 
					if(this.id == 'editPost'){
						$("#fill").load("post.php?act=edit");
					}else if(this.id == "upload"){
						window.location = 'upload.php';
					}else if(this.id == "uploadphoto"){
						window.location = 'uploadphoto.php';
					}else{
						$("#fill").load(this.id+".php");
					}
				});
				
				$(this).bind("contextmenu", function(e) {
	                $.prompt("Copyright shaifulazizi.com");
					//e.preventDefault();
					return false;
	            });
				
				$("#page #prev").click(function(){ 
					$("#wrapper").animate({
			            marginLeft: "-=260px"
			        }, 1000);
				});
				
				$("#page #next").click(function(){
					$("#wrapper").animate({
			            marginLeft: "+=260px"
			        }, 1000);
				});
				
				$(".item").click(function(){
					if(this.id == "admin"){
						window.location = 'admin/';
					}else if(this.id == "admin-home"){
						window.location = '../';
					}else if(this.id == "admin-gallery"){
						window.location = '../pages/gallery.php';
					}else if(this.id == "gallery"){
						window.location = 'pages/gallery.php';
					}else{
						window.location = '../index.php';
					}
				});
				
				$("a.links").click( function(){
					var margin = $("#wrapper").css("margin-left").replace("px",""); //to capture current wrapper left margin
					var move = 0, indicator = 0; //var to hold how px to move
					move = parseInt(this.id)*700;
					indicator = parseInt(this.id)*30;
					move = "-"+String(move)+"px";
					indicator = "+"+String(indicator)+"px";
					$("#wrapper").animate({
						marginLeft: move	
					}, 1000);	
					$(".pointer").animate({
						marginTop: indicator	
					}, 300);
				});
				
				$("#slider li").hover(
					function(){
						$(this).stop().animate({marginLeft: "-5px"},{queue:false,duration:100});
					},
					function(){
						$(this).stop().animate({marginLeft: "0px"},{queue:false,duration:100});
					}
				).click(function(){
						$(this).addClass('selected');
					}
				);
				
				$(".frame").hover(
					function(){
						$(".caption",this).stop().animate({bottom:'0px'},{queue:false,duration:160});
					},
					function(){
						$(".caption",this).stop().animate({bottom:'-100px'},{queue:false,duration:160});
					}
				);
				
				$('#portfolio').innerfade({
					speed: 3000,
					timeout: 4000,
					type: 'sequence',
					containerheight: '220px'
				});
				
				$("li").click(function(){
					if(this.id == "kwick7"){
						window.location = "/admin/";
					}else if(this.id == "kwick1"){
						window.location = "../index.php";
					}else if(this.id == "kwick2"){
						window.location = "pages/contact.php";
					}else if(this.id == "kwick3"){
						window.location = "pages/about.php";
					}else if(this.id == "kwick4"){
						window.location = "pages/gallery.php";
					}else if(this.id == "kwick5"){
						window.location = "pages/quotation.php";
					}else if(this.id == "kwick6"){
						window.location = "pages/team.php";
					}else if(this.id == "kwick8"){
						window.location = "pages/link.php";
					}
				});
			
			});
			
			function loadmain(){
				var param = gup( 'id' );
					if(param){
						$("#fill").load('post.php?id='+param);
					}else{
						$("#fill").load('main.php');
					}
			}
			
			function loadpost(){
				var param = gup( 'id' );
					if(param){
						$("#fill").load('board.php?id='+param);
					}else{
						$("#fill").load('index.php');
					}
			}
			
			function editpost(){
				$.prompt('Example 3',{ opacity: 0.2 });
			}
			
			function gup( name ){
			  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
			  var regexS = "[\\?&]"+name+"=([^&#]*)";
			  var regex = new RegExp( regexS );
			  var results = regex.exec( window.location.href );
			  if( results == null )
			    return "";
			  else
			    return results[1];
			}