jQuery(document).ready(function() {
	if(jQuery('div').hasClass('tx-srfeuserregister-pi1')){
		//var d=new Date();var uv = {};uv['eID'] = 'addcenter';uv['u'] = d.getTime();var u = cJSONURL(uv);
		//jQuery.getJSON(u,function(data){if(data['error'] != 0){alert(data['error']);}else{if(data['error']==0){jQuery('#tx-srfeuserregister-pi1-fe_users_form > fieldset > dl').prepend(data['return']);} else {alert(data['error']);}}});
	}

	// create accordion
	var accordionConf;accordionConf = {collapsible: true,active: false}; 
	if(jQuery('div').hasClass('choosenMember')){jQuery('.choosenMember').accordion(accordionConf);}
	if(jQuery('div').hasClass('choosenCenter')){jQuery('.choosenCenter').accordion(accordionConf);}

	
	if($('div') && $('div').hasClass('dayview')){

		var rows = $('div.dayview > table > tbody > tr > td:first > table > tbody > tr:last > td > table > tbody > tr');
		
		var rowHaveEvent = false;
		$(rows).each(function(i,row){ 
			
			if($(row).children('td').hasClass('t3cms-nocolspan')){
				rowHaveEvent = true;
			}
			
			
			if( $(row).children('td').size() >= 3 && $(row).children('td').hasClass('eventbg2') ){
				
				if( ( $(row).children('td').hasClass('dayborder')  ) ){
					$(row).children('td.dayborder').html('');
				}
				if( ( $(row).children('td').hasClass('dayborder2')  ) ){
					$(row).children('td.dayborder2').html('');
				}
			//	if( $(row).children('td').size() == 3 && ( $(row).children('td:last').hasClass('eventbg2')  ) ){
			//	$(row).children('td.eventbg2').css({'border-top':'1px dashed #CCCCCC'});
			//	$(row).children('eventfont').css({width:'202px',overflow:'hidden',height:'40px'});
			//	}
				
			} else if(!$(row).children('td').hasClass('t3cms-nocolspan')) { 
				
				if(rowHaveEvent == false) {
					
					if( $(row).children('td').size() == 2 && ( $(row).children('td').hasClass('dayborder') || $(row).children('td').hasClass('dayborder2'))){
						$(row).children('td:last').attr('colspan',0);
					} else if( $(row).children('td').size() == 3 && $(row).children('td:first').hasClass('timeborder') && ( $(row).children('td').hasClass('dayborder') || $(row).children('td').hasClass('dayborder2') ) ){
						$(row).children('td:last').attr('colspan',0);
					} 
				} else {
					rowHaveEvent = false;
				} 
			}
			
			if(i >= 47){
				if( ( $(row).children('td').hasClass('dayborder')  ) ){
					$(row).children('td.dayborder').html('');
				}
				if( ( $(row).children('td').hasClass('dayborder2')  ) ){
					$(row).children('td.dayborder2').html('');
				}
			}
		});
	}
	/**/
	
	
	function cJSONURL(uv) {var us = '';if(typeof uv != "undefined"){var i = 1;for(k in uv){us=us+(i==1?"?":"&")+k+"="+uv[k];i++;}}us = "http://" + top.location.host + top.location.pathname  + encodeURI(us);return us;} 
});

