/* constants */
var REPORT_COOKIE_NAME = 'report';

var AJAX_GEO_URL = '/ajax/geo_selects.html';
var AJAX_CAPTCHA_URL = '/ajax/captcha.html';

var AuthImage = new Class.create();
AuthImage.prototype = {
	initialize: function(auth_img_div, auth_img_link){
		this.auth_img_div = $(auth_img_div);
		this.auth_img_link = $(auth_img_link);
		this.auth_img_link.onclick = this.get.bindAsEventListener(this);
		this.get();
	},
	get: function(e){
		new Ajax.Updater(
			this.auth_img_div,
			AJAX_CAPTCHA_URL
			);
	}
};

document.observe("dom:loaded", function() {
	new Ajax.PeriodicalUpdater('online_users', '/ajax/rating/online.html', {
		 method: 'get', 
		 frequency: 30, 
		 decay: 1,
		 skipUpdateOnStart: 1 
	});
	
	Cufon.replace("#content .s-header");
	Cufon.replace(".online-users .s-header");
	Cufon.now();
	
	$$('.context-menu-link').each( setUserContextMenuHandler );
	$$('.event-context-link').each( setEventContextMenuHandler );
	$$('.paco-rabanne-link').each( setPacoRabanneHandler );
	$$('.belaya-dacha-link').each( setBelayaDachaHandler );
} );

ZeroClipboard.setMoviePath( '/flash/ZeroClipboard.swf' );

Prototip.Styles = {
  'default': {
    border: 0,
    borderColor: '#c7c7c7',
    className: 'context-menu',
    closeButton: false,
    hideAfter: false,
    hideOn: false,
    hook: false,
    images: '/',
    radius: 0,
    showOn: 'mousemove',
    stem: {
      //position: 'topLeft',       // Example: optional default stem position, this will also enable the stem
      height: 12,
      width: 15
    }
  },
  'pacorabanne': {
    border: 0,
	borderColor: '#f0be69',
	className: 'paco-rabanne-context',
	closeButton: false,
    hideAfter: false,
    hideOn: false,
	images: '/',
    radius: 0,
    showOn: 'mousemove',
	stem: {
      position: 'bottomMiddle',
      height: 12,
      width: 22
    }
  },
  'belayadacha': {
    border: 0,
	borderColor: '#f0be69',
	className: 'belaya-dacha-context',
	closeButton: false,
    hideAfter: false,
    hideOn: false,
	images: '/',
    radius: 0,
    showOn: 'mousemove',
	stem: {
      position: 'bottomMiddle',
      height: 12,
      width: 22
    }
  }
}
