

$(document).ready(function() {      
	
	var active;
  var byName = null;


  if ($.getUrlVar('tx_felogin_pi1[forgot]') || $.getUrlVar('tx_felogin_pi1[login]') || $.getUrlVar('tx_felogin_pi1[logout]') || $.getUrlVar('tx_felogin_pi1[change]'))
	     var byName = 4;
  else var byName = $.getUrlVar('id');
   

	if (byName !== null) {
		//active = $('a#metamenu_'+byName)[0].tagName.toLowerCase();
		//active = $('a#metamenu_'+byName).parent().parent().parent().children()[0].tagName.toLowerCase();
		active = $('#metamenu_'+byName).parent().parent().parent().children()[0];
		$('#metamenu_'+byName).addClass('active');
	} else {
	    active = false;
	}   

  $("#move_content").delay(3000).animate(
			{"left": "+=1024px"}, 
			2500,
			function() {
				location.replace("http://no1-officeavenue.com/index.php?id=13");
	});      
         
  $("#image_content").click(function () { 
    	$("#mc_1").delay(0).animate(
    			{"left": "+=1024px"}, 
    			2500,
    			function() {
    				location.replace("http://no1-officeavenue.com/index.php?id=13");
    	});
    });
    



	
	$('#menu').accordion({
		header: 'h3',
		active: active,
		alwaysOpen: false,
		animated: 'easeslide',
		autoheight: false
	});           

         
	$("div#kommentar_accordion").accordion({
		header: 'div.tx-guestbook-header', 
		active: false, 
		alwaysOpen: false, 
		animated: false, 
		autoheight: false								   
	});						   
	$('#wrap_content').masonry();
	
	

	
});  

$.extend({
  getUrlVars: function(){
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for(var i = 0; i < hashes.length; i++)
    {
      hash = hashes[i].split('=');
      vars.push(hash[0]);
      vars[hash[0]] = hash[1];
    }
    return vars;
  },
  getUrlVar: function(name){
    return $.getUrlVars()[name];
  }
});













