// Globals 
var toBlankcells=['A02_CELL','C02_CELL','C03_CELL','C04_CELL','N02_CELL','N03_CELL','N01_CELL','D02_CELL'];
/* Dom ready */
window.addEvent('domready',function(){
	//Go to Home page 
	$('51EAST_LOGO').addEvent('click',function () {
		var homeEffect = $('OUTER_DIV').effect('opacity',{duration:1500,onComplete:function () { location.href=siteURL+'main.php' }});
		homeEffect.start(0);
	});
});
  // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ empty function 
	function emptyScrollpages (currentCell){
		var currentCell
		toBlankcells.each(function (theElement) {
		if (theElement != currentCell){
			 $(theElement).empty();
		}
	});
}
  
  
// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  
function sendcontactForm() {
	  if ( contactformVal() !=false){
		var url=siteURL+'fixed-pages/ajax-form.php';
		var formAjax = new Ajax(url, {
			method: 'get',
			data:'recipient='+$('recipient').value+'&name='+$('name').value+'&last-name='+$('last-name').value+'&email='+$('email').value+'&message='+$('message').value+'&country='+$('country').value,
			update: $('log'),
			onComplete: function() {
				$('myform').innerHTML="";
				$('ContactFormSumitterTd').innerHTML="";
			}
		 });
		formAjax.request();
	  }
}
// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  
function  sendnewsletterForm(){
	var parr=$$('.chbox').getValue();
	parr.each(function(parr){
	})
	
	var name=$('nl_firstname').getValue();
	var last_name=$('nl_lastname').getValue();
	var email=$('nl_email').getValue();
	var country=$('nl_country').getValue();
	var gender=$('nl_gender').getValue();
	var yob=$('nl_yob').getValue();
	var url=siteURL+'fixed-pages/newsletter.php';
	var emailval=echeck('nl_email');
	if (name=='' && emailval==true){
		alert('Complete the information please!');
		return false;
	}
	if (name!=null && emailval==true){			
	var newsformAjax = new Ajax(url, {
		method: 'get',
		update: $('newslog'),
		data:'name='+name+'&last_name='+last_name+'&country='+country+'&intrist='+parr+'&email='+email+'&gender='+gender+'&yob='+yob,
		onComplete: function() {
		//$('box_content').innerHTML="";
		//$('toptable').innerHTML="";
	}});	
	newsformAjax.request();
	}
}


function selAllCheckBoxes() { 
		
	if ($('all').getValue()=='all'){

	$ES('input','box_content').each(function(el){ el.checked = true; });
	}else{
	
	$ES('input','box_content').each(function(el){ el.checked = false; });
	}


} 
 // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  
 
function makelotScrollbars(content,scrollbar,handle,horizontal,ignoreMouse){
var steps = $(content).getSize().scrollSize.y;
	fsteps=eval(steps);
				var slider = new Slider(scrollbar, handle, {	
					steps: fsteps,
					mode: (horizontal?'horizontal':'vertical'),
					onChange: function(step){
						// Scrolls the content element in x or y direction.
						var x = (horizontal?step:0);
						var y = (horizontal?0:step);
						content.scrollTo(x,y);
					}
				}).set(0);
				if( !(ignoreMouse) ){
					// Scroll the content element when the mousewheel is used within the 
					// content or the scrollbar element.
					$$(content, scrollbar).addEvent('mousewheel', function(e){
						e = new Event(e).stop();
						var step = slider.step - e.wheel * 30;	
						slider.set(step);					
					});
				}
				// Stops the handle dragging process when the mouse leaves the document body.
				$(document.body).addEvent('mouseleave',function(){slider.drag.stop()});
			}
