// JavaScript Document
var sliderOpen = false;
var textFaded = false;
var sliderPosition = -210;
var opacityLevel = 1;

var leftColumnText = 'left column';
var rightColumnText = 'right column';

function readMore(company){
	var icon ='';
	var iconHeight = '';
	var iconWidth = '';
	var phoneNumber = '';
	var url = '';
	var details = '';
	
	switch(company){
		case 'camwest':
			icon = 'dwaCamwestGroupLogo.png';
			iconHeight = 85;
			iconWidth = 200;
			phoneNumber = '(520) 297-2171';
			url = 'www.camwestgroup.com';
			details = '<p>Camwest Group, Inc. is a full service development construction company with diverse experience in commerical and residential projects. We specialize in construction with an emphasis on Dental and Medical offices. Every member of our staff has technical and practical experience in the construction industry</p> <p>Our on staff Real Estate Broker can assist you with selecting the best location for your practice (i.e. tenant space or acquiring land). We also provide full service for design, complete building construction or interior build-out as well as renovations on existing office space.</p>'
		break;
		case 'crosswalk':
			icon= 'dwaCrosswalkLogo.png';
			iconHeight = 74;
			iconWidth = 195;
			phoneNumber = '(520) 399-6598'
			url = 'www.crosswalktechnologies.com';
			details = '<p>Crosswalk Technologies is a business management, technology services and outsourcing company. Our three divisions: Information Technology Services, Infrastructure Services and Business Services, provide our customers a wealth of diversified information and resources not usually found in the small to medium business market. We assist our customers with everything from provisioning new computer network systems and digital information management to workflow efficency processes and business financial services.</p> <p>Let Crosswalk Technologies keep your practice and staff current with the latest &quot;hi-tech&quot; updates.</p>';
		break;
		case 'fandn':
			icon = 'dwaFAndNLogo.png';
			iconHeight = 85;
			iconWidth = 151;
			phoneNumber = '(520) 290-8119';
			url = 'www.fandnenterprises.com';
			details='<p>We offer many exciting solutions for your communications needs. Whether it is residential or commercial, no problem. From one cable outlet to an 800 watt booming stereo system, burglar protection, or just to talk on the phone, we have the solutions!</p> <p>We ensure that your cabling infrastructure is designed and installed in such a manner that it will handle your most rigorous data transfer needs. It will be setup for today, and tomorrows needs! Your telephone system will be easy to use, rugged, reliable, not complicated . . .efficient! Sound and security round out the total LV inspection package that will make your practice stand out above the others!</p>';
		break;
		case 'instyprints':
			icon = 'dwaInstyPrintsLogo.png';
			iconHeight = 70;
			iconWidth = 199;
			phoneNumber = '(520) 888-0000';
			url = 'www.instyonoracle.com';
			details = '<p>Insty-Prints is your paper printing solution. Whether it is a product presentation, invoices, or forms, Insty-Prints will help you every step of the way. Our professional staff and experienced crew will give your projects a professional, clean, and polished look. We offer a vast array of services from start to finish. It is our focus to make you look good and put your marketing dollars to best work for you.</p>';
		break;
		case 'irapture':
			icon = 'dwaIRaptureLogo.png';
			iconHeight = 81;
			iconWidth = 145;
			phoneNumber = '(520) 881-8488';
			url = 'www.irapture.com';
			details = "<h3>Website Solutions</h3><p><ul><li>Hassle Free</li><li>Cost Effective</li><li>Professional</li></ul></p><p>iRapture.com is a full-service website company with over ten years of experience.  Talk to us if you would like to make your current website more effective.  Don't have a website?  We can get your website designed and operational quickly, cost-effectively, and hassle-free.</p>";
		break;
		case 'starbuck':
			icon ='dwaStarbuckLogo.png';
			iconHeight = 59;
			iconWidth = 224;
			phoneNumber = '(520) 690-1248';
			url = 'www.starbucktextile.com';
			details ='<p>Starbuck Design is a full service promotion and marketing company that also manufactures on site. Since we are designing and producing on site you are working with the artist directly to best capture your image.</p> <p>Our award-winning graphic design department will work directly with you to develop a brand and a look that will represent you and your practice for years to come. We also design wearables for you and your staff to make a professional and unified impression on your patients.</p>';
		break;
	}
	
	leftColumnText = '<p><img src="http://www.dentalworksalliance.com/images/' + icon + '" width="' + iconWidth + '" height="' + iconHeight + '" alt="company logo" /></p>' + '<p class="phoneNumber">' + phoneNumber + '</p>' + '<p class="siteAddress"><a href="http://' + url + '" target="_blank">' + url + '</a></p>'
	
	rightColumnText = details;
	
	if(sliderPosition < -10){
		document.getElementById('leftColumn').innerHTML = leftColumnText;
		document.getElementById('rightColumn').innerHTML = rightColumnText;
		slidePanelOpen();
	}else{
		fadeOut();
	}
}

function fadeOut(){
	if (opacityLevel > 0){
		opacityLevel -= .1;
	}else{
		document.getElementById('leftColumn').innerHTML = leftColumnText;
		document.getElementById('rightColumn').innerHTML = rightColumnText;
		fadeIn();
		return;
	}
	document.getElementById('leftColumn').style.opacity = opacityLevel;
	document.getElementById('rightColumn').style.opacity = opacityLevel;
	var filterText = 'alpha(opacity = ' + (100 * opacityLevel) + ')'
	//document.getElementById('leftColumn').style.filter = filterText;
	//document.getElementById('rightColumn').style.filter = filterText;
	
	setTimeout("fadeOut()", 25); 
}

function fadeIn(){
	if (opacityLevel < 1){
		opacityLevel += .1;
	}else{
		return;
	}
	document.getElementById('leftColumn').style.opacity = opacityLevel;
	document.getElementById('rightColumn').style.opacity = opacityLevel;
	var filterText = 'alpha(opacity = ' + (100 * opacityLevel) + ')'
	//document.getElementById('leftColumn').style.filter = filterText;
	//document.getElementById('rightColumn').style.filter = filterText;
	
	setTimeout("fadeIn()", 25);
}

function slidePanelOpen(){
	if(sliderPosition < -10){
		sliderPosition += 10;
	}else{
		return;
	}
	document.getElementById('contentSlider').style.top = sliderPosition + 'px';
	setTimeout("slidePanelOpen()", 25); 
}

function slidePanelClosed(){
	if(sliderPosition > -210){
		sliderPosition -= 10;
	}else{
		return;
	}
	document.getElementById('contentSlider').style.top = sliderPosition + 'px';
	setTimeout("slidePanelClosed()", 25); 
}