// javascript document

function writeEA(nam,dom,tla) {
document.write("<a href='mailto:"+nam+"@"+dom+"."+tla+"'>"+nam+"@"+dom+"."+tla+"</a>");
}

function switchVal(e,o) {
// e is the element  - o is the orginal value
if (document.getElementById(e.name).value==o) document.getElementById(e.name).value="";
}
function checkVal(e,o) {
// e is the element  - o is the orginal value
if (document.getElementById(e.name).value=="") document.getElementById(e.name).value=o;
}


var onvel;
function showFPImage(n){
if (!onvel) onvel=document.getElementById("fp1");
	var el=document.getElementById("fp_photo");
	el.style.backgroundImage="url("+(fp_images_dir+fp_images[n-1])+")";
	var nv="fp"+n;
	onvel.className="";
	var nvel=document.getElementById(nv);
	
	nvel.className="on";
	onvel=nvel;
	
}

function writePnav(){
retval='';
for (r=0;r<fp_images.length;r++){
	if (r==0) cl=' class="on" '; else cl='';
	retval+='<a href="javascript:void(0);" onmousedown="showFPImage('+(r+1)+')" id="fp'+(r+1)+'" '+cl+'>'+(r+1)+'</a>';
}
document.write (retval);
}

function writePhotoTag(){
//alert(fp_images_dir+fp_images[0]);
if (fp_images.length==0) {
fp_images_dir="";
fp_images[0]="/img/projects/no_img.jpg";

}
	var retval='<div class="pphoto" id="fp_photo" style="background-image:url('+(fp_images_dir+fp_images[0])+')"></div>';
	
	if (fp_images.length>0) {
	for (r=0;r<fp_images.length;r++){
	retval+='<div class="hiddenphoto" style="background-image:url('+(fp_images_dir+fp_images[r])+')"></div>';
	
	}}
	document.write(retval);
}

function writeProjectGallerySubnav(){
var retval='';
	var l=location.toString();
	var pa=l.split("/");
	var mypage=pa[pa.length-1];
	for(r=0;r<projectsSubNav.length;r++){
		var cur_arr=projectsSubNav[r].split("|");
		var cl='';
		if (cur_arr[1]==mypage) cl=' class="on" ';
		retval+="<a href='"+cur_arr[1]+"' title='"+cur_arr[0]+"' "+cl+">"+cur_arr[0]+"</a>";
	}
	document.write(retval);
}

function writeIconThing(){
var version=7;
var swf_id="samcon";
var movieTag="../media/4icons.swf";
var movieHeight="55";
var movieWidth="276";
var FlashVars="";
var allow_fscommand=true;
var alternateContent='';
return writeTag(returnFlashTag(version,swf_id,movieTag,movieHeight,movieWidth,FlashVars,allow_fscommand,alternateContent));
}

// projectsSubNav  PROJECT NAME|FILE
var projectsSubNav=[
"Manzano Mesa Elementary|manzano.html",
"Sugarite Canyon Reclamation Project|sugarite.html",
"Village of Cimarron|cimarron.html",
"New Mexico State University, Creative Media Institute|unm.html",
"Office Building Retrofit|do30.html",
"Apartment Renovation|do18.html",
"Headworks at Sewage Treatment Facility|hstf.html"
]

// testimonials [short|long|author]
var testimonials=[
"We enjoyed the team spirit of a very productive working relationship with Samcon.| SAMCON is a great partner to have on the construction team. They recently completed a very technical project at New Mexico State University with us. The project included a state-of-the-art video production facility, a computer animation studio, and a THX theater. The work required precision craftsmanship from every trade. The construction executives of SAMCON provided the necessary leadership to achieve the quality required by NMSU, and SAMCON delivered the project on time for the fall semester. The completed project is a valuable asset to the Las Cruces community. The architects and technical staff of Gregory T. Hicks and Associates enjoyed the congenial team spirit of this very productive work relationship with SAMCON.|Gregory T. Hicks and Assoc., Architects",

"Samcon is a top notch company.| D.R.B. Electric, Inc. has had an excellent working relationship with Samcon, Inc. on numerous projects for the past several years. We are an electrical contractor doing projects throughout New Mexico. Samcon is a professionally run business with very competent employees at every level that we have dealt with. Samcon has always worked with our project team to solve problems using their experience and expertise to move forward. They value the team concept and contribute fairly to working through the day to day situations that are common to the construction business. All of us at D.R.B. Electric value the assistance and long term relationship we have had with Samcon. This all has been possible because they are a top notch company.| D. Randy Baker,D.R.B. Electric, Inc.",

"We have always counted on Samcon's professionalism.|From 2002 to present day, Solar Electric Company and I have had the pleasure of working as an electrical subcontractor for Samcon Inc.  Together we have completed many new construction and remodeling projects at White Sands Missile Range.  We have participated in numerous projects with Samcon in and around the Las Cruces City area.  We have always counted on Samcon's professional instruction, firm planning, astute scheduling, and prompt payments.  We hope to continue our working relationship with Samcon for many years.  It has been a real pleasure working with the Samcon Inc. organization.|Hector Apodaca, Project Manager Solar Electric"

];

function shortTestimonial(){
	var n=Math.floor(Math.random()*testimonials.length);
	var te=testimonials[n].split("|");
	var t=te[0];
	var a=te[2];
	var retval='<div class="quote"><img src="img/lquote.gif" align="absmiddle" alt="" />'+t+'<img src="img/rquote.gif" align="absmiddle" alt="" /></div><div class="author"><img src="img/quote_handle.gif" align="top" alt="" />'+a+' <a href="/about/testimonials.html">More &gt;</a></div>';
	document.write(retval);
}

function writeTestimonials(){
	var retval="";
	for (r=0;r<testimonials.length;r++){
		var te=testimonials[r].split("|");
		var t=te[1];
		var a=te[2];
		while (t.substring(0,1)==" ") t=t.substring(1);
		while (a.substring(0,1)==" ") a=a.substring(1);
		retval+='<div class="f_quoteholder"><div class="f_quote">&#8220;'+t+'&#8221;</div><div class="f_author">'+a+'</div></div>';
	}
	document.write(retval);
}
