require_login = function require_login(){	
	new Effect.Appear('mustbeshadow', { duration: 0.2, from: 0.0, to: 0.5 });
	$('mustbelog').show();
	$('inputmail2').focus();	
}

update_form_sha = function update_form(form, target, params, url){	
	params 	= typeof(params) != 'undefined' ? params : '';
	url 	= typeof(url) != 'undefined' ? url : $(form).action;
	
	var JX = new Ajax.Updater(
		target, 
		url,
		{method: $(form).method,
		 parameters: ($(form).serialize()+params),
		 evalScripts: true,
     onCreate: function(t){
       var a = new Element('img',{'src':'images/loading.gif','width':'160'}).setStyle({position:'absolute', top:'50%', left:($(target).getWidth()/2-80)+'px'});
       var div = new Element('div').setStyle({
			   position: 'absolute',
			   top:'0px',
			   left:'0px',
			   width:'100%',
			   height:'100%',
			   display:'none',
			   backgroundColor:'#000'

	      }).update(a);
      $(target).insert(div);
	  new Effect.Appear(div, { duration: 0.2, from: 0.0, to: 0.5 });
     }
   });
	return false;
}

update_link_sha = function update_link_sha(url, target, params){ 
 
	params = typeof(params) != 'undefined' ? params : '';
	
	var JX = new Ajax.Updater(
	target, 
	url, {method: 'get', 
    parameters: params+'&nocache='+Math.random()*900,
    evalScripts: true,
     onCreate: function(t){
       var a = new Element('img',{'src':'images/loading.gif','width':'160'}).setStyle({position:'absolute', top:'50%', left:($(target).getWidth()/2-80)+'px'});
       var div = new Element('div').setStyle({
			   position: 'absolute',
			   top:'0px',
			   left:'0px',
			   width:'100%',
			   height:'100%',
			   display:'none',
			   backgroundColor:'#000'

	      }).update(a);
      $(target).insert(div);
	  new Effect.Appear(div, { duration: 0.2, from: 0.0, to: 0.5 });
     }
   });
}




update_form = function update_form(form, target, params, url){	
	params 	= typeof(params) != 'undefined' ? params : '';
	url 	= typeof(url) != 'undefined' ? url : $(form).action;
	
	var JX = new Ajax.Updater(
		target, 
		url,
		{method: $(form).method,
		 parameters: ($(form).serialize()+params),
		 evalScripts: true,
     onCreate: function(t){
       var a = new Element('img',{'src':'images/loading.gif','width':'160'}).setStyle({});
       var div = new Element('div').setStyle({
           position: 'absolute',
		   top:'50%',
		   left:($(target).getWidth()/2-80)+'px'
      }).update(a);
      $(target).update(div);
     }
   });
	return false;
}

function update_link(url, target, params){ 
 
 params = typeof(params) != 'undefined' ? params : '';
	
 var JX = new Ajax.Updater(
  target, 
  url, {method: 'get', 
     parameters: params+'&nocache='+Math.random()*900,
     evalScripts: true,
	 onComplete:  function(t){
		 			// myAjaxPeriodicalUpdater.start();
				  },
     onCreate: function(t){
       var a = new Element('img',{'src':'images/loading.gif'}).setStyle({position:'relative',top:'50%'});
       var div = new Element('div').setStyle({
           width: $(target).getWidth(),
           height: $(target).getHeight(),
           position: 'absolute',
           verticalAlign: 'middle',
           textAlign: 'center'
      }).update(a);
      $(target).update(div);
     }
   });
}

function update_link_simple(url, target, params){	
	var JX = new Ajax.Updater(
		target, 
		url, {method: 'get',	
			  parameters: params,
			  evalScripts: true
	});
}

function request(url, params){	
	var myAjax = new Ajax.Request(
		url, {method: 'get',	
			  parameters: params
	});
}

function getPageSize(){
	 var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = window.innerWidth + window.scrollMaxX;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	
	if (self.innerHeight) {	// all except Explorer
		if(document.documentElement.clientWidth){
			windowWidth = document.documentElement.clientWidth; 
		} else {
			windowWidth = self.innerWidth;
		}
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}
	
	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = xScroll;		
	} else {
		pageWidth = windowWidth;
	}

	return [pageWidth,pageHeight,windowWidth,windowHeight];
}
//--------------------------------------------------------------------

