var clock_time;

function js_clock_en(x,y,current ){

	clock_time = new Date(current);
//	clock_time.setTime(clock_time.getTime()+0*60*1000);
	clock_time.setSeconds(clock_time.getSeconds()+1);

	setTimeout("js_clock_en('" + x + "', '" + y + "',  "+clock_time.getTime()+")", 1000);

	var clock_hours = clock_time.getHours();
	var clock_minutes = clock_time.getMinutes();
	var clock_seconds = clock_time.getSeconds();
	var clock_years =  clock_time.getFullYear();
	var clock_months =  clock_time.getMonth() + 1;
	var clock_days =  clock_time.getDate();
	var clock_week = clock_time.getDay();


	var clock_prefix = "AM";
	if (clock_hours >= 12 ){
		 clock_prefix = "PM";
	}

	if (clock_hours>12){	
		clock_hours = clock_hours -12
	}

/*
	if (clock_hours < 10){
		clock_hours = "0" + clock_hours;
	}*/

	if (clock_minutes < 10){
			clock_minutes = "0" + clock_minutes;
	}

	if (clock_months < 10){
		clock_months = "0" + clock_months;
	}
	if (clock_days < 10){
			clock_days = "0" + clock_days;
	}
		
	if ($(x))
	{
//		$(x).update('<span title="' + clock_years + '-' + clock_months  +   '-'  + clock_days + ' '+ clock_hours + ":" + clock_minutes + " " + clock_prefix + '  " >' + clock_hours + ":" + clock_minutes + " " + clock_prefix + '</span>'); 
		$(x).update(  clock_hours + ":" + clock_minutes + " " + clock_prefix  ); 
		$(y).update( clock_years + '-' + clock_months  +   '-'  + clock_days + ' '+ clock_hours + ":" + clock_minutes + ":" +  clock_seconds + " " + clock_prefix); 
	}
}



function clickBanner(url,refreshElement)
{ 

  new Ajax.Updater(	refreshElement,	url,{ asynchronous:true, evalScripts:true,
											onComplete: function(request, json) {
	
											},
											onException:function(request, json){
												
												
												
											},
											onFailure:function(request, json){
																							
												
											},												
										  onLoading:function(request, json){																					
											}}
  );												 
 return false;
}






function changeBanner(url,refreshElement , BannerAreaID )
{ 

   S = '';
  $$('#' + BannerAreaID + ' input[title]').each(function(e){
        
     S += '_' + e.value;
  
  });
  
  url += '&bid=' + S;


  new Ajax.Updater(	refreshElement,	url,{ asynchronous:true, evalScripts:true,
											onComplete: function(request, json) {
	
											},
											onException:function(request, json){
												
												
												
											},
											onFailure:function(request, json){
																							
												
											},												
										  onLoading:function(request, json){																					
											}}
  );												 
 return false;
}



