function paCreateRollOvers(){

	if(document.getElementById){

		var paImages = document.getElementsByTagName('IMG');

		var paButtons = document.getElementsByTagName('INPUT');

	}else if(document.all && navigator.userAgent.indexOf('Mac')==-1){

		var paImages = document.all['mouseovers'].all.tags('IMG');

		var paButtons = document.all['mouseovers'].all.tags('INPUT');

	}else return;

	paPreloads = new Object();



	for (var i = 0; i < paImages.length; i++){

		var paImageOffSrc = paImages[i].src + "";

		if(paImageOffSrc.indexOf("_off.") != -1){

			var paImageOnSrc = paImageOffSrc.replace(/_off\./g, "_on.");

			paPreloads['paImageOff_' + i] = new Image();

			paPreloads['paImageOff_' + i].src = paImageOffSrc;

			paPreloads['paImageOn_' + i] = new Image();

			paPreloads['paImageOn_' + i].src = paImageOnSrc;

			/*paPreloads['paImageOn_' + i].onerror = function(){this.src='/images/blank.gif';}*/

			paImages[i].onmouseover = function(){this.src = this.src.replace(/_off\./g, "_on.");}

			paImages[i].onmouseout = function(){this.src = this.src.replace(/_on\./g, "_off.");}

		}

	} 



	for (var i = 0; i < paButtons.length; i++){

		if(paButtons[i].src){

		var paImageOffSrc = paButtons[i].src + "";

		if(paImageOffSrc.indexOf("_off.") != -1){

			var paImageOnSrc = paImageOffSrc.replace(/_off\./g, "_on.");

			paPreloads['paImageOff_' + i] = new Image();

			paPreloads['paImageOff_' + i].src = paImageOffSrc;

			paPreloads['paImageOn_' + i] = new Image();

			paPreloads['paImageOn_' + i].src = paImageOnSrc;

			/*paPreloads['paImageOn_' + i].onerror = function(){this.src='/images/blank.gif';}*/

			paButtons[i].onmouseover = function(){this.src = this.src.replace(/_off\./g, "_on.");}

			paButtons[i].onmouseout = function(){this.src = this.src.replace(/_on\./g, "_off.");}

		}

		}

	} 

}



window.onload = paCreateRollOvers;



function MM_openBrWindow(theURL,winName,features) { //v2.0

  window.open(theURL,winName,features);

}



function hide(id){ 

if (document.getElementById){ 

obj = document.getElementById(id); 

obj.style.display = "none"; 

} 

} 



function show(id){ 

if (document.getElementById){ 

obj = document.getElementById(id); 

obj.style.display = ""; 

} 

}



function showhide(id){ 

if (document.getElementById){

obj = document.getElementById(id); 

if (obj.style.display == "none"){ 

obj.style.display = ""; 

} else { 

obj.style.display = "none"; 

} 

} 

} 



myUrl = location.href;

mySub1 = ".php";

mySub2 = "-all.php";



function leftFromSubStringToBeginningOfFullString(fullString, subString) {

if (fullString.lastIndexOf(subString) == -1) {

return "";

} else {

return fullString.substring(0, fullString.lastIndexOf(subString));

}

}



function viewall() {

myText = leftFromSubStringToBeginningOfFullString(myUrl, mySub1);

document.write('<A HREF="');

document.write(myText); 

document.write('-all.php">');

document.write('View All');

document.write('</A>');

}



function normalview() {

myText = leftFromSubStringToBeginningOfFullString(myUrl, mySub2);

document.write('<A HREF="');

document.write(myText); 

document.write('.php">');

document.write('View Larger Photos');

document.write('</A>');

}



function MM_jumpMenu(targ,selObj,restore){ //v3.0

 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");

   if (restore) selObj.selectedIndex=0;

   }



function textCounter(field,cntfield,maxlimit) {

if (field.value.length > maxlimit) // if too long...trim it!

field.value = field.value.substring(0, maxlimit);

// otherwise, update 'characters left' counter

else

cntfield.value = maxlimit - field.value.length;

}




