function loadPic(ur1) {
	var gpic = 'getpic.php?fname='+ur1;
	//alert('getpic.php?fname='+ur1);
	var rez1 = LoadRSDoc(gpic);
	var dest = document.getElementById('picdiv');
	dest.innerHTML = rez1;
	
}

function LoadRSDoc(url) {

    if (window.XMLHttpRequest)
        req = new XMLHttpRequest();
	else if (window.ActiveXObject) 
		req = new ActiveXObject("Microsoft.XMLHTTP");
       
	if (req) {
		req.open("GET", url, false);
		req.send(null);
	}
	
	if (req.status == 200)
		return req.responseText;
	else
		return req.status;
}

// Image replacement
// written by Chris Heilmann (http://www.onlinetools.org)
// ===========================================================
replaceImages = new Array (
	'Latest news from PcShaman|images/section_titles/company_news.gif',
	'PcShaman Clients login|images/section_titles/clients_login.gif',
	'PcShaman testimonials|images/section_titles/testimonials.gif',
	'Latest PcShaman project|images/section_titles/latest_project_home.gif',
	'PcShaman Newsletter|images/section_titles/email_newsletter.gif',
	'Feel free to contact us at (949) 702 - 0908 for a free consultations!|images/phone_number.gif'
	);

function firdom(){
	if(document.getElementsByTagName && document.createElement){
		for (l=1;l<=6;l++){
			h1s=document.getElementsByTagName('h'+l);
			scanandreplace(h1s,'h'+l);
		}
	}
}
function scanandreplace(h1s,tag){
	for(i=0;i<h1s.length;i++){
		for(f=0;f<replaceImages.length;f++){
			chunks=replaceImages[f].split('|');
			thish1=document.getElementsByTagName(tag)[i];
			if(thish1.firstChild.nodeValue==chunks[0]){
				newImg=document.createElement('img');			
				newImg.setAttribute('alt',chunks[0])
				newImg.setAttribute('src',chunks[1])
				// or newImg.src=chunks[1];
				thish1.replaceChild(newImg,thish1.firstChild)
			}
		}
	}
}
window.onload=firdom;
// ===========================================================

// Newsletter check eMail function
var numLists = 1;
function doCheckCount(ccObj) {
	if(ccObj.checked)
		numLists = numLists + 1;
		else
		numLists = numLists - 1;
		}

function CheckSS() {
	theFrm = document.frmSS;
	hasDot = theFrm.Email.value.indexOf(".");
	hasAt = theFrm.Email.value.indexOf("@");
	
	if(hasDot + hasAt < 0) {
		alert("Please enter a valid email address.");
		theFrm.Email.focus();
		theFrm.Email.select();
		return false;
		}
	if(numLists == 0) {
		alert("Please choose a mailing list to subscribe to.");
		return false;
		}
	return true;
	}
// ===========================================================

function winpop (url,w,h,scroll,resize,center) {
	if (center) {
		var winPos = ',top='+((screen.height - h) / 2)+',left='+((screen.width - w) / 2);
	}
	var scrollArg = (scroll == false) ? '' : ',scrollbars=1';
	var resizeArg = (resize == false) ? '' : ',resizable=1';
	flyout = window.open (url,"newin"+scroll+resize+center,"width=" + w + ",height=" + h + scrollArg + resizeArg + winPos);
	flyout.resizeTo(w,h);
	flyout.focus();
}