var wfg_spd_current
wfg_spd_current = 'spd_thumb0';

function wfg_spd_image_chg(spd_thumb, image_directory, image_name, picture_text ) { 
//	alert('got here' + image_directory + '/' + image_name);
//	document.images.sp_image.src = 'wfg-image-watermark-hidden.php?wfgimage=' + image_directory + '/' + image_name;
	document.images.sp_image.src = 'wfg-image-watermark-hidden.php?wfgimage=' + image_directory + '/' + image_name;
	document.getElementById( 'wfg-picture-text' ).innerHTML = picture_text;
	
	current_thumb = document.getElementById( wfg_spd_current );
	current_thumb.className='spd-thumbs';
	
	wfg_spd_current = spd_thumb;
	identity = document.getElementById( spd_thumb );
	identity.className='spd-thumbs-selected';
	
}

function wfg_spd_image_chg_2008(spd_thumb, image_directory, image_name, picture_text ) { 
//	alert('got here' + image_directory + '/' + image_name);
//	document.images.sp_image.src = 'wfg-image-watermark-hidden.php?wfgimage=' + image_directory + '/' + image_name;
	document.images.sp_image.src = 'images/watermarkimages/' + image_name;
	document.getElementById( 'wfg-picture-text' ).innerHTML = picture_text;
	
	current_thumb = document.getElementById( wfg_spd_current );
	current_thumb.className='spd-thumbs';
	
	wfg_spd_current = spd_thumb;
	identity = document.getElementById( spd_thumb );
	identity.className='spd-thumbs-selected';
	
}

function checkEnter(e, currform) { //e is event object passed from function invocation
var characterCode // literal character code will be stored in this variable

if(e && e.which) { //if which property of event object is supported (NN4)
e = e
characterCode = e.which //character code is contained in NN4's which property
}
else {
e = event
characterCode = e.keyCode //character code is contained in IE's keyCode property
}

if(characterCode == 13) { //if generated character code is equal to ascii 13 (if enter key)
currform.submit() //submit the form
return false 
}
else {
return true 
}

}

/*
function wfg_spd_image_chg(spd_thumb, image_directory, image_name) { 
	alert('got here');
	document.images.sp_image.src = 'Imagesnew/' + image_directory + '/' + image_name;
	if (	wfg_spd_current_thumb <> "" ) {
		current = document.getElementById( wfg_spd_current_thumb );
		current.className = 'spd-thumbs';
	} 
	selected = document.getElementById( spd_thumb );
	selected.className = 'spd-thumbs-selected';
	wfg_spd_current_thumb = identity.Name; 
}
*/
