function resetForm(formName) {
	fName = (formName == null) ? 0 : formName;
	if (document.forms[fName] == null) {
		alert('Error while trying to reset the FORM.\n\nPlease contact website administrator.\nThank you!');
	}
	else if(confirm('Are you sure that you want to RESET form?')) document.forms[fName].reset();
}

function changeSearchFormBg(val) {
	objBg = document.getElementById('searchFormBg');
	if (val) objBg.style.backgroundImage = 'url(_include/gui/header/_bg_menu_on.gif)';
	else objBg.style.backgroundImage = '';
}


function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}

function changeOpenerLocation(theURL) {
	if(window.opener != null) {
		window.opener.location = theURL;
		window.opener.focus();
	}
	else {
		MM_openBrWindow(theURL,'blank','');
	}
}

var regProject = new Array();
var portfolio = new Array();
projURL = "http://www.phpagency.biz/clients2/satilla/popup_other.php?id=";

portfolio[24] = ['', '24.jpg']; regProject.push(24);
portfolio[35] = ['', '35.jpg']; regProject.push(35);
portfolio[36] = ['', '36.jpg']; regProject.push(36);
portfolio[37] = ['', '37.jpg']; regProject.push(37);



var openedAnchor = 1;

function projectImg(imgID) {
	projID = projectID();
	document.getElementById('imgProj').src = './images/other/' + projID + '/' + portfolio[projID][imgID];
	document.getElementById('anchor'+openedAnchor).className = '';
	document.getElementById('anchor'+imgID).className = 'opened';
	openedAnchor = imgID;
}

function projectUrl() {
	projID = projectID();
    //if( portfolio[projID][0] != '' ) document.write('<a onclick="MM_openBrWindow(\'http://' + portfolio[projID][0] + ',\'popup\',\'scrollbars=yes,width=800,height=600\');" href="javascript:;">Launch Site</a>');  javascript:window.open
	//if( portfolio[projID][0] != '' ) document.write('<a href="http://' + portfolio[projID][0] + '" target="_blank" >Launch Site</a>');
     if( portfolio[projID][0] != '' ) document.write('<a href="javascript:;" onClick="MM_openBrWindow(\'http://' + portfolio[projID][0] + '\' ,\'Project\',\'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,width=1024,height=768\')">Launch Site</a>');
    // if( portfolio[projID][0] != '' ) document.write('<a href="http://' + portfolio[projID][0] + '" target="examplepopup2" OnClick="openpopup(this.href,\'examplepopup2\'); return false;" >Launch Site</a>');
}

function projectPages() {
	projID = projectID();
	document.getElementById('imgProj').src = './images/other/' + projID + '/' + portfolio[projID][1];
	for(i=1; i < portfolio[projID].length; i++) {
		document.write('<a id="anchor' + i + '" href="javascript:projectImg(' + i + ')">' + i + '</a>');
	}
	document.getElementById('anchor1').className = 'opened';
}

function projectNextPrevious() {
	for(i=0; i < regProject.length; i++) {
		if(regProject[i] == projectID()) {
			if(i==0) {
				previousItem = regProject[regProject.length-1];
				nextItem = regProject[i+1];
				break;
			}
			else if(i==regProject.length-1) {
				previousItem = regProject[i-1];
				nextItem = regProject[0];
				break;
			}
			else {
				previousItem = regProject[i-1];
				nextItem = regProject[i+1];
				break;
			}
		}
	}
	document.write('<a href="' + projURL + previousItem + '" class="prev">Previous Photo</a>&nbsp; | &nbsp;<a href="' + projURL + nextItem + '" class="next">Next Photo</a>');
}

function projectID() {
	//hash = document.location.hash;
	//return hash.substring(1, hash.length);
	href = document.location.href;
	return href.substring(href.indexOf('?id=')+4,href.length);
}

function openProject(id) {
	newWin = window.open(projURL + id ,'project','scrollbars=yes,status=yes,width=680,height=660');
	newWin.focus();
}



function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
    if (restore) selObj.selectedIndex=0;
    }