var locat = "";

var mainpages = ['home', 'events', 'megashows', 'megaShows', 'sponsors', 'contacts', 'guests', 'workshops', 'exhibitions', 'profilepane','teams','acco', 'results','forum'];

var genesis=['C-Monopoly', 'Woodstock', 'Forex', 'Math_Challenge', 'Excalibur', 'Relic_Hunter', 'Mindsport', 'Cryptex', 'Bitcraft'];
var quizzard= ['Bizquiz', 'Techquiz'];
var conceptualize=['Open_Soft', 'ASME_SDE', 'B_Plan', 'Eureka', 'Speak_Out_For_Engineering', 'EcoVision',];
var theories=['EmbeTronix', 'Kryotech', 'Overnite', 'Anadigix'];
var robotix=['Inferno', 'Vertigo', 'Stalker', 'Nuke Clear', 'Echelon'];
var abinitio=['Terra_Drifters', 'Laws_of_Motion', 'Stabilitix', 'Nightshift','aquaranger','mechatron'];
var strategia=['Zero_Hour', 'The_Senate', 'El_Dorado', 'Marca_De_Fabrica', 'Exemplar','theverdict','synergy', 'Capital_Edge'];
var tech=['TechQuila', 'Sn(a)ppit', 'X_Games', 'GeoTech'];
var idp=['GeoTech'];

var events = new Array();
events = events.concat(genesis, quizzard, conceptualize, theories, robotix, abinitio, strategia, tech, idp);

jQuery(function( $ ){

$('#footer').hide();

$('#navigation').css("min-width", screen.width);
if (window.location.hash) {
 $('#navigation').show();
  $('#footer').show();
 $('#update1').show();
 //var divtoscroll= $("div"+window.location.hash);
 //$.scrollTo(divtoscroll);
} 
/*if(window.location=="http://www.ktj.in/index1.php#profilepane")
{
$("#navigation").hide();
}*/
else {
$('#update1').hide();
$('#navigation').hide();
    $var = $('.pane:eq(8)');
    $.scrollTo( $var, {speed:500} );
    $('#spiral').hide();
}

if(screen.width<='1280'){$('#navigation ul li').css('padding-left','10px').css('padding-right','10px');}

$('#sp_2').hide().css('left', "0px").css('bottom', "0px").css('width', screen.availWidth);
$('#gu_side').hide().css('right', "0px").css('top', .25*screen.availHeight);
$('#ev_side').hide().css('right', "0px").css('top', .25*screen.availHeight);
$('#ev_bot').hide().css('right', "80px").css('bottom', "0px");
$('#gu_bot').hide().css('left', "0px").css('bottom', "0px");
$('#mg_side').hide().css('right', "0px").css('top', .25*screen.availHeight);
$('#mg_bot').hide().css('left', "0px").css('bottom', "0px").css('width', .75*screen.availWidth).css('height', .25*screen.availHeight);
$('#ws_bot').hide().css('right', "0px").css('bottom', "0px");
$('#ws_side').hide().css('top', .25*screen.availHeight);
$('#ex_side').hide().css('right', "0px").css('top', .25*screen.availHeight);
$('#ex_bot').hide().css('right', "0px");
$('#sp_side').hide().css('top', .25*screen.availHeight);
$('#cn_side').hide().css('top', .25*screen.availHeight);
$('#home_bot').hide().css('right', "0px").css('bottom', "0px").css('width', .75*screen.availWidth);

// setting the width of the enter div

/*$('#imageenter').css('width', screen.availWidth);
//$('#imageenter').css('height', screen.availHeight);
var positionenterwebsite=.29*$("img#imageenter").attr("height");
$('#enter').css('left', .419 * screen.availWidth).css('top', positionenterwebsite);
var req_length = .3*screen.availWidth;
$('body').css('min-height', '600px');*/

var height=screen.height-140+"px";

$var = $('.pane:eq(0)');
$var.css('left',3*screen.availWidth+'px');
//$var.css('top',2*screen.availHeight+'px');
$var.css('width',screen.availWidth);
$var.css('height',height);
$var.css('overflow', "auto");
$var.css('overflow-x', "hidden");
$var = $('.pane:eq(1)');
$var.css('left',4*screen.availWidth+'px');
$var.css('top','0px');
$var.css('width',screen.availWidth);
$var.css('height' , height);
$var.css('overflow', "auto");
$var = $('.pane:eq(2)');
$var.css('left',5*screen.availWidth+'px');
$var.css('top','0px');
$var.css('width',screen.availWidth);
$var.css('height' , height);
$var.css('overflow', "auto");
$var = $('.pane:eq(3)');
$var.css('left',6*screen.availWidth+'px');
//$var.css('top',3*screen.availHeight+'px');
$var.css('width',screen.availWidth);
$var.css('height' , height);
$var.css('overflow', "auto");
$var = $('.pane:eq(4)');
$var.css('left',7*screen.availWidth+'px');
//$var.css('top',2*screen.availHeight+'px');
$var.css('width',screen.availWidth);
$var.css('height' , height);
$var.css('overflow', "auto");
$var = $('.pane:eq(5)');
$var.css('left',8*screen.availWidth+'px');
//$var.css('top',1*screen.availHeight+'px');
$var.css('width',screen.availWidth);
$var.css('height' , height);
$var.css('overflow', "auto");
$var = $('.pane:eq(6)');
$var.css('left',9*screen.availWidth+'px');
//$var.css('top',2*screen.availHeight+'px');
$var.css('width',screen.availWidth);
$var.css('height', height);
$var.css('overflow', "auto");
$var = $('.pane:eq(7)');
$var.css('left',10*screen.availWidth+'px');
//$var.css('top',1*screen.availHeight+'px');
$var.css('width',screen.availWidth);
$var.css('height' , height);
$var.css('overflow', "auto");
$var = $('.pane:eq(8)');
$var.css('left','0px');
$var.css('top','0px');
$var.css('width',screen.availWidth);
$var.css('height' , screen.availHeight);
$var = $('.pane:eq(9)');
$var.css('left','0px');
//$var.css('top',2*screen.availHeight+'px');
$var.css('width',screen.Width);
$var.css('height',screen.height+"px");
$var = $('.pane:eq(10)');
$var.css('left',2*screen.availWidth);
$var.css('top',0*screen.availHeight+'px');
$var.css('width',screen.availWidth);
$var.css('height',height);
$var.css('overflow', 'auto');

 var profilepanediv=$('#profilepane');
				profilepanediv.css('left',1*screen.availWidth);
				profilepanediv.css('top','0px');
				$("img#myktj_side").hide();
				
				profilepanediv.css('width',screen.availWidth);
				profilepanediv.css('height' , height);
				profilepanediv.css('overflow-y', "auto");
				profilepanediv.css('overflow-x', "hidden");				 



    $.easing.elasout = function(x, t, b, c, d) {
        var s=1.70158;var p=0;var a=c;
        if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
        if (a < Math.abs(c)) { a=c; var s=p/4; }
        else var s = p/(2*Math.PI) * Math.asin (c/a);
        return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
    };  
/****extra for teams & myktj when not logged in*****/    
$var = $('.pane:eq(11)');
$var.css('left',12*screen.availWidth);
$var.css('top',0*screen.availHeight+'px');
$var.css('width',screen.availWidth);
$var.css('height',height);

$var = $('.pane:eq(12)');
$var.css('left',13*screen.availWidth);
$var.css('top',0*screen.availHeight+'px');
$var.css('width',screen.availWidth);
$var.css('height',height);    

/***************************************************/
	 

    $('document').ready(function(){
     var tabcounter=0;
        $('#myktj_side').hide();
    //for removing flash of unstyled content
    $("body").removeClass("fouchidden");
    document.onkeydown = function(evt) {
    evt = evt || window.event;
    var keyCode = evt.keyCode;
    if (keyCode == 37 || keyCode == 39) {
        return false;
    }
    if(keyCode==9) 
     {
     	tabcounter++;
     	if(tabcounter>7) { return false; }
     }
}
//script for stopping zooming in
$("*").keydown(function(event) {
    if(event.ctrlKey) 
      {
         $(this).keydown(function(event) {
if(event.keyCode==187 || event.keyCode==189 || event.keyCode==107 || event.keyCode==109)
            {
event.preventDefault();
return false;
        }
 });
      }
  });
//zooming in ends here.
//script for login backend ajax request
        $("form#login_form input:submit").click(function(event){
    event.preventDefault();
        $("div#login_feedback").hide();
        var username=$("input[name='username']").val();
        var userpass=$("input[name='userpass']").val();
        if(username=="") {
            $("div#login_feedback").html("Enter username").fadeIn("slow");
            return false;
            }
		if(userpass=="") {
            $("div#login_feedback").html("Enter password!").fadeIn("slow");
          
            return false;
            }
        else {
        var datastring="username="+username+"&userpass="+userpass;
                $.ajax({
                type: 'POST',
                url: 'login_ktj.php',
                data: datastring,
                success: function(data) {
                    $("div#login_feedback").html(data).fadeIn("slow");
                     $('div#spons_slide.spons_logout').removeClass('spons_logout');
	              $('div#spons_slide').addClass('spons_login'); 
                                
                       if(data=="Welcome, "+username+".! :)")
                        {
                                $("div.sliding_header").slideUp("fast");
                                $("li#nav9").html('Hello '+username+'&nbsp; &nbsp;').css({'color':'#6b2400', 'padding': '4px'});
                                $("li#nav10").html("");
                                $("li#nav11").html('<a style="margin-left: 15px; color: #4cc2e6;" href="logout.php?logout=1" class="logout" id="logout">Logout</a>');
                                
				    setTimeout('$("li#nav10").html("<a style=\'margin-left: 15px;\' href=\'#profilepane\' class=\'profile\' id=\'profile\'>My Ktj</a>");', 5000);
				    $.ajax({
                                  type: 'POST',
				      url: 'myktj/main.php',
				      success: function(data) {
					$("div#profilepane").html(data);

                                				
					/* var profilepanediv=$('div#profilepane');
					profilepanediv.css('left',11*screen.availWidth);
				profilepanediv.css('top','0px');
				$("img#myktj_side").hide();
				
				profilepanediv.css('width',screen.availWidth);
				profilepanediv.css('height' , height);
				profilepanediv.css('overflow', "auto"); 
					*/

					}
					});
                        }
                }
        
            });
        }
        
    });

//ajax script ends here.
//script for registration
if($("div#solelyforreg").html()!="") {
	//$("div#register_header").slideDown(100);
	$("form#registration_form input[name='username']").focus();
	}


    //script for sponsors
    var flag_spons=0;
    $("a#sponsors").click(function(event) {
        event.preventDefault();
        window.location.hash="#sponsors";
        var idoflink="spons2012";
    var datastring="spons_year="+idoflink;
    if(flag_spons!=-1) {
         $.ajax({
    type: "POST",
    url: "../newspons/sponsor_ajax_respond.php",
    data: datastring,
    success: function(data) {
        flag_spons=-1;
    $("div#receivingrequest").fadeOut("fast", function() {
    $("div#content_spons").html(data);
        $("div#content_spons").fadeIn("fast");
         });
    }
    });
       }
     });
$("a.spons_year").click(function(event) {
        event.preventDefault();
        flag_spons=0;
	$('li.current_spons').removeClass('current_spons');
	$(this).parent().addClass('current_spons');
    var idoflink=$(this).attr("id");
    var datastring="spons_year="+idoflink;
    $.ajax({
    type: "POST",
    url: "../newspons/sponsor_ajax_respond.php",
    data: datastring,
    success: function(data) {
        $("div#receivingrequest").fadeOut("fast", function() {
    $("div#content_spons").html(data);
        $("div#content_spons").fadeIn("fast");
                 });
    }
    });
});
$("div#receivingrequest").ajaxStart(function() {
    $("div#content_spons").fadeOut("fast",function() {
        $("div#receivingrequest").fadeIn("fast");
        });
   });

    //sponsors ends here
    $("a#userlogin").click(function(event){
    event.preventDefault();
    $("form#login_form").submit();
    });
    $("a#login_slider1").click(function(event) {
    event.preventDefault();
    $("div#login_header").slideToggle("fast");
    $("div#register_header").slideUp(100);
    });
    $("a#login_slider2").click(function(event) {
    event.preventDefault();
    $("div#register_header").slideToggle("fast");
    $("div#login_header").slideUp(100);
    });
    $("div.pane").click(function() {
        $("div.sliding_header").slideUp("fast", function() {
        $("div.pane").css("margin-top", 0);         
        });
        });

	var newscrollflag=0;
	$(window).resize(function(){ 
	var scrollpos=$("body").scrollLeft();
	var windowwidth=$(window).width();
	
	if(windowwidth<1000)
	{
		var newscrollpos=scrollpos+100;
		if( newscrollflag==0)
		{
		$("body").scrollLeft(newscrollpos);
		newscrollflag=-1;
		}
		$("img#gu_side, img#ev_side, img#cn_side, img#ws_side, img#mg_side, img#ex_side").fadeOut("fast");
	}
	if(windowwidth>1020)
	{
		newscrollpos=scrollpos-100;
		if(newscrollflag==-1)
		{
		$("body").scrollLeft(newscrollpos);
		newscrollflag=0;
		}
		//$("img#gu_side, img#ev_side, img#cn_side, img#ws_side, img#mg_side").show("fast");
	}

	});
	
//Do not even attempt to edit or understand the following few lines. 
//They animate the update ticker, if you have to edit the animation, better write the code again.
//i can assure you, writing it again will take much less time.	
	$('div#update1').click(function() {
		$(this).animate({
		height: '300px',
		width: '200px',
		
		
		}, 500, function() { $(this).append("<p id='closeupdate1'><a href=''>x</a></p>");
					$('p#closeupdate1').click(function() {
					event.preventDefault();
					event.stopPropagation();
					$('div#update1').animate({
						height: '40px',
						width: '100px'
						
						}, 500, function() {$("p#closeupdate1").remove(); });
					
					});
		}
		
		);
	});
	
//update ticker ends here.	





	var windowspace123=$(window).width();
    $(window).resize(function() {
	 windowspace123=$(window).width(); });
    $('#home').click(function(){
      $('.pane').show();
       $('#footer').fadeIn();
       $var = $('.pane:eq(0)');
        $.scrollTo( $var, {speed:500} );
        document.title = "Kshitij 2012, Annual Techno-management Festival of IIT Kharagpur";
        $('#mg_side').hide();
        $('#mg_bot').hide();
        $('#spiral').show();
        $('#sp_2').hide();
        $('#sp_side').hide();
        $('#ev_side').hide();
        $('#ev_bot').hide();
        $('#gu_bot').hide();
        $('#gu_side').hide();
        $('#ex_side').hide();
        $('#ex_bot').hide();
               $('#ws_bot').hide();
        $('#ws_side').hide();
        $('#cn_side').hide();
        $('#home_bot').fadeIn();
        $('#myktj_side').hide();
        $('#navigation').show();
        $('#spiral').show();
        $('.active').removeClass('active');
        $("#justlike").slideUp();
        document.getElementById("nav1").className="active";
        
        
        //return false;
    });

    $('#enter').click(function(){
       $('.pane:eq(0)').show();
       $('#spiral').show();
       $var = $('.pane:eq(0)');
        $.scrollTo( $var, {speed:1000} );
        $('#navigation').fadeIn(1500);
        $('#sp_2').hide();
        $('#gu_side').hide();
        $('#gu_bot').hide();
        $('#ws_bot').hide();
        $('#ws_side').hide();
        $('#mg_side').hide();
        $('#mg_bot').hide();
              $('#ex_side').hide();
        $('#ev_side').hide();
        $('#ev_bot').hide();
        $('#ex_bot').hide();
        $('#sp_side').hide();
        $('#cn_side').hide();
        $('#home_bot').hide();
        $('#myktj_side').hide();
        $('#navigation').show();
        $("#update1").show();
        document.getElementById("nav1").className="active";
        document.title = "Kshitij 2012, Annual Techno-management Festival of IIT Kharagpur";
        //return false;
    });
    
    $('#sponsors').click(function(){
    $('#navigation').show();
    $('#spiral').hide();
       $('.pane').show();
       $var = $('.pane:eq(6)');
        $.scrollTo( $var, {speed:500} );
        $('#ev_side').hide();
        $('#ev_bot').hide();
        $('#ws_bot').hide();
        $('#ws_side').hide();
	if(windowspace123<1000) {$('img#sp_side').fadeOut(); }
	else {
        $('#sp_side').fadeIn(); }
        $('#mg_side').hide();
        $('#mg_bot').hide();
        $('#spiral').hide();
        $('#sp_2').hide();
        $('#gu_side').hide();
        $('#gu_bot').hide();
        $('#ex_side').hide();
        $('#ex_bot').hide();
        $('#cn_side').hide();
        $('#home_bot').hide();
        $('#myktj_side').hide();
        //$('.pane:not(:eq(6))').hide();
        $('#navigation').show();
        $('.active').removeClass('active');
               $("#justlike").slideUp();
        document.getElementById("nav2").className="active";
        document.title = "Sponsors || Kshitij 2012";
        //return false;
    });
    
    $('#contacts').click(function(){
    $('#navigation').show();
        $('#spiral').hide();
      $('.pane').show();
       $var = $('.pane:eq(7)');
        $.scrollTo( $var, {speed:500} );
        $('#ev_side').hide();
        $('#ev_bot').hide();
        $('#ws_bot').hide();
        $('#ws_side').hide();
        $('#sp_side').hide();
        $('#mg_side').hide();
        $('#mg_bot').hide();
        $('#spiral').hide();
        $('#sp_2').hide();
        $('#gu_side').hide();
        $('#gu_bot').hide();
        $('#ex_side').hide();
        $('#ex_bot').hide();
        $('#myktj_side').hide();
		if(windowspace123<1000) {$('img#sp_side').fadeOut(); }
	else {
        $('#cn_side').fadeIn(); }
        $('#home_bot').hide();
        //$('.pane:not(:eq(7))').hide();
        $('#navigation').show();
        $('.active').removeClass('active');
               $("#justlike").slideUp();
        document.getElementById("nav3").className="active";
        document.title = "Contacts || Kshitij 2012";
        //return false;
    });

    $('#events').click(function(){
    $('#navigation').show();
        $('#spiral').hide();
    $('.pane').show();
       $var = $('.pane:eq(2)');
        $.scrollTo( $var, {speed:500} );
	if(windowspace123<1000) {$('img#sp_side').fadeOut(); }
	else {
        $('#ev_side').fadeIn(); }

        //$('#ev_side').fadeIn();
        $('#ev_bot').fadeIn();
        $('#ws_bot').hide();
        $('#ws_side').hide();
        $('#sp_side').hide();
        $('#mg_side').hide();
        $('#mg_bot').hide();
        $('#spiral').hide();
        $('#sp_2').hide();
        $('#gu_side').hide();
        $('#gu_bot').hide();
        $('#ex_side').hide();
        $('#ex_bot').hide();
        $('#cn_side').hide();
        $('#home_bot').hide();
        $('#myktj_side').hide();
        $('.active').removeClass('active');
               $("#justlike").slideUp();
        document.getElementById("nav4").className="active";
        document.title = "Events || Kshitij 2012";
        $('#navigation').show();
        //return false;
$('#events-slider').liteAccordion({
                    onActivate : function() {
                        
                    },
                    slideCallback : function() {    
                        this.find('figcaption').fadeIn();
                    },
                    theme : 'dark',
                    rounded : true,
                    containerWidth : 773,
                    containerHeight : 200,
                    enumerateSlides : false
            }).find('figcaption:first').show();
    });

    $('#guests').click(function(){
    $('#navigation').show();
        $('#spiral').hide();
      $('.pane').show();
       $var = $('.pane:eq(1)');
        $.scrollTo( $var, {speed:500} );
        $('#ev_side').hide();
        $('#ev_bot').hide();
        $('#ws_bot').hide();
        $('#ws_side').hide();
        $('#sp_side').hide();
        $('#mg_side').hide();
        $('#mg_bot').hide();
        $('#spiral').hide();
        $('#sp_2').show();
	if(windowspace123<1000) {$('img#sp_side').fadeOut(); }
	else {
        $('#gu_side').fadeIn(); }

        $('#gu_bot').fadeIn();
        $('#ex_side').hide();
        $('#ex_bot').hide();
        $('#cn_side').hide();
        $('#home_bot').hide();
        $('#myktj_side').hide();
        $('.active').removeClass('active');
        document.getElementById("nav5").className="active";
        document.title = "Guests || Kshitij 2012";
        $('#navigation').show();
        //return false;
    });

    $('#megashows').click(function(){
    $('#navigation').show();
        $('#spiral').hide();
      $('.pane').show();
       $var = $('.pane:eq(3)');
        $.scrollTo( $var, {speed:500} );
        $('#ev_side').hide();
        $('#ev_bot').hide();
        $('#ws_bot').hide();
        $('#ws_side').hide();
        $('#sp_side').hide();
	if(windowspace123<1000) {$('img#sp_side').fadeOut(); }
	else {
        $('#mg_side').fadeIn(); }

        //$('#mg_side').show();
        $('#mg_bot').fadeIn();
        $('#spiral').hide();
        $('#sp_2').hide();
        $('#gu_side').hide();
        $('#gu_bot').hide();
        $('#ex_side').hide();
        $('#ex_bot').hide();
        $('#cn_side').hide();
        $('#home_bot').hide();
        $('#myktj_side').hide();
        $('.active').removeClass('active');
        document.getElementById("nav6").className="active";
        $('#navigation').show();
        document.title = "Megashows || Kshitij 2012";
        //return false;
    });

    $('#exhibitions').click(function(){
    $('#navigation').show();
        $('#spiral').hide();
    $('.pane').show();
       $var = $('.pane:eq(5)');
        $.scrollTo( $var, {speed:500} );
        $('#ev_side').hide();
        $('#ev_bot').hide();
        $('#ws_bot').hide();
        $('#ws_side').hide();
        $('#sp_side').hide();
        $('#mg_side').hide();
        $('#mg_bot').hide();
        $('#spiral').hide();
        $('#sp_2').hide();
        $('#gu_side').hide();
        $('#gu_bot').hide();
	if(windowspace123<1000) {$('img#sp_side').fadeOut(); }
	else {
        $('#ex_side').fadeIn(); }

        //$('#ex_side').show();
        $('#ex_bot').fadeIn();
        $('#cn_side').hide();
        $('#home_bot').hide();
        $('#myktj_side').hide();
        $('.active').removeClass('active');
        document.getElementById("nav7").className="active";
        $('#navigation').show();
        document.title = "Exhibitions || Kshitij 2012";
        //return false;
    });

	


    $('#workshops').click(function(){
    $('#navigation').show();
        $('#spiral').hide();
    $('.pane').show();
       $var = $('.pane:eq(4)');
        $.scrollTo( $var, {speed:500} );
        $('#ev_side').hide();
        $('#ev_bot').hide();
        $('#ws_bot').fadeIn();
       if(windowspace123<1000) {$('img#sp_side').fadeOut(); }
	else {
        $('#ws_side').fadeIn(); }
 

        $('#sp_side').hide();
        $('#mg_side').hide();
        $('#mg_bot').hide();
        $('#spiral').hide();
        $('#sp_2').hide();
        $('#gu_side').hide();
        $('#gu_bot').hide();
        $('#ex_side').hide();
        $('#ex_bot').hide();
        $('#cn_side').hide();
        $('#home_bot').hide();
        $('#myktj_side').hide();
        $('.active').removeClass('active');
        document.getElementById("nav8").className="active";
        document.title = "Workshops || Kshitij 2012";
        $('#navigation').show();
        //return false;
    });
	
	
    $('#profile').click(function(){
    $('#navigation').show();
        $('#spiral').hide();
    //$('.pane').show();
       $var = $('.pane:eq(10)');
        $.scrollTo( $var, {speed:500} );
        $('#ev_side').hide();
        $('#ev_bot').hide();
        $('#ws_bot').fadeIn();
       if(windowspace123<1000) {$('img#sp_side').fadeOut(); }
	else {
        $('#ws_side').fadeIn(); }
 	
	$('#ws_side').hide();
	$('#ws_bot').hide();
        $('#sp_side').hide();
        $('#mg_side').hide();
        $('#mg_bot').hide();
        $('#spiral').hide();
        $('#sp_2').hide();
        $('#gu_side').hide();
        $('#gu_bot').hide();
        $('#ex_side').hide();
        $('#ex_bot').hide();
        $('#cn_side').hide();
        $('#home_bot').hide();
        $('#myktj_side').show();
        $('.active').removeClass('active');
        $("li#nav10").addClass('active');
        document.title = "Myktj || Kshitij 2012";
        $('#navigation').show();
        //return false;
    });
    
    $('#sidemenu').click(function(){
    $('#justlike').slideUp();
    });
    
    	});

});


function loadEvent(name, flag) {
    locat = name;
    $('#evt-details').html('<div style="width:100%;height:100%;margin:10% 50%;"><img src="images/loading.gif" /></div>');
    $.ajax({
        url: "../events/" + name + ".html",
        type: "GET",
        data: "load=yeah",
        success: function(a) {
            $('#evt-details').html(a);
            $("#container").tabs({ fxSlide: true, fxFade: true, fxSpeed: "normal" });
        }
    });
}

function checkUrl() {
    var temp= "";
    temp=window.location.href;
    var i=temp.indexOf('#')+1;
    if (i==0) 
        temp="";    
    else 
        temp = temp.substr(i);

    if (locat != temp) {
        if (mainpages.indexOf(temp) != -1) {
            locat = temp;
            $('#'+temp).trigger('click');
        }
        else if (events.indexOf(temp) != -1) {
            locat = temp;
            $('#events').trigger('click');
            loadEvent(temp, 1);
        }
    }

   setTimeout("checkUrl()", 200);
}

function showHint(str)
{
if (str.length==0)return;
var url = "search.php?q="+escape(str);
$("#txtHint").load(url);
$("#txtHint").slideDown();
}

//////////////


