var service_switch = false;
var service_page = 1;
var Rc = { 
	init: function(){
	/////////		
		
		new SmoothScroll({ duration: 1000 });
		
		this.navOp = function open_navBtns(elem){
			$(elem).effect('margin-top', {
				duration: 700
			}).start(65, 0);
		
		}
		
		this.fadeContent = function fade_content(){
			$('content').effect('opacity', {
				duration: 1200
			}).start(0,1);
		
		}
		
		var tO = 500;
		
		
		setTimeout ( "Rc.navOp('nServ')", tO );
		setTimeout ( "Rc.navOp('nPort')", tO+100 );
		setTimeout ( "Rc.navOp('nFaq')", tO+200 );
		setTimeout ( "Rc.navOp('nCont')", tO+300 );
		/*setTimeout ( "Rc.fadeContent()", tO+1000 );*/
		
		
		$$('div.navs').addEvent('mouseover', function() {
			this.effect('margin-top', {
				duration: 100
			}).start(0, 3);
		});
		$$('div.navs').addEvent('mouseout', function() {
			this.effect('margin-top', {
				duration: 100
			}).start(3, 0);
		});
		
		if(window.ie6 == true){
			 if (document.all && document.styleSheets && document.styleSheets[0] && document.styleSheets[0].addRule) {
				document.styleSheets[0].addRule('*', 'behavior: url(com.rcifre/js/iepngfix.htc)');
			 }
		}
		
	/*	this.cp_logout = function cpanel_logout() {
			
		new Ajax('com.rcifre/php/logout.php', {
			method: 'get',
			onComplete: function(){
				window.location.href = 'http://www.rcifre.com/login.php';
			}
		}).send();
				}
			*/
		this.cp_fade = function cp_backfade(elem){
			new Fx.Style(elem, 'background-color', {duration:1200, wait: true}).start('#d5a5ad', '#eeeeee');
		}
		
		
		this.Tips= new Tips($$('.tips'), {
			initialize:function(){
				this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 500, wait: false}).set(0);
			},
			onShow: function(toolTip) {
				this.fx.start(1);
			},
			onHide: function(toolTip) {
				this.fx.start(0);
			},
			fixed: true
		});
		this.clearVal = function clearVal(){
			$('form_name').value = '';
			$('form_company').value = '';
			$('form_phone').value = '';
			$('form_email').value = '';
			$('form_state').value = '';
			$('form_mess').value = '';
		}
		
		
		this.openPM = function open_printMedia(){
				if(service_switch == false){
				if(service_page == 1){
						service_switch = true;
						$('srv_contentWS').effect('opacity', {
							duration: 400, 
							onComplete: function(){
								$('srv_contentWS').setStyle('height', 0);
								if(window.ie6 == true){
									$('srv_contentWS').setStyle('display', 'none');
								}
								$('servContainer').effect('height', {
									onComplete: function(){
										$('srv_contentPM').effect('opacity', {
											duration: 300,
											onComplete: function(){
												service_switch = false;
												service_page = 2;
											}
										}).start(0, 1);
									}
								 }).start(480,400);
							}
						}).start(1,0);
					}
				}
			}
			
			
			this.openWS = function open_webServices(){
				if(service_switch == false){
					if(service_page == 2){
						service_switch = true;
						$('srv_contentPM').effect('opacity', {
							duration: 400, 
							onComplete: function(){
								$('srv_contentWS').setStyle('height', 445);
								if(window.ie6 == true){
									$('srv_contentWS').setStyle('display', 'inherit');
								}
								$('servContainer').effect('height', {
									onComplete: function(){
										$('srv_contentWS').effect('opacity', {
											duration: 300,
												onComplete: function(){
													service_switch = false;	
													service_page = 1;
												}
										}).start(0, 1);
									}
								 }).start(400,480);
							}
						}).start(1,0);
					}
				}
			}
			
			
			this.accordion = new Accordion('h3.atStart', 'div.atStart', {
				opacity: false,
				wait: true,
				duration: 1200
			}, $('accordion'));
			
			this.loadFlyers= function portfolio_flyers(img) {
				return Lightbox.open([['com.rcifre/images/client_flyer_rfFfBIG.jpg', 'Revolution Fitness: Fall Fisticuffs 2007'], ['com.rcifre/images/client_flyer_rfGirlBIG.jpg', 'Revolution Fitness: Boxing Girl']], img);
			}
			
			this.loadBc= function portfolio_flyers(img) {
				return Lightbox.open([['com.rcifre/images/client_bc_pdsBIG.jpg', 'Primary Design Services'], ['com.rcifre/images/client_bc_wfmBIG.jpg', 'Web Film Media']], img);
			}
		
		
		
			this.mlist = function mailing_list_info(si,sn,se,sj){
				$('subId').setHTML(si);
				$('subName').setHTML(sn);
				$('subEmail').setHTML(se);
				$('subJoined').setHTML(sj);
			}


/////////
	}
}


window.addEvent('domready', Rc.init.bind(Rc));