/*val adams totallyTimeshares common functions*/
function WriteHeader()
{
   document.write('<div id="header">');
   document.write('<h1>TotallyTimeshares</h1>');
   document.write('<div style=\"position:relative; top:94px; left:500px; width:149px; height:156px; margin-bottom:20px;\">');
   document.write('<img  title=\"Val Adams\" alt=\"val adams\" src=\"images/valPortraitSmall.gif\" />'); 
   document.write('</div>');
   document.write('</div>');
}
//
//==============================================================================
//
function SnugglesMessage(msg)
{
	alert("a problem was detected: " + msg);
}
//
//==============================================================================
//
/**
* DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
*/
//
//==============================================================================
//
function CheckEmailString(preamble, str) {

		var at="@";
		var dot=".";
		var lat=str.indexOf(at);
		var lstr=str.length;
		/*var ldot=str.indexOf(dot);*/
		if (str.indexOf(at)==-1){
		   SnugglesMessage(preamble + "Invalid email address, no @ character: " + str);
		   return false;
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   SnugglesMessage(preamble + "Invalid email address, '@' character in an invalid location: " + str);
		   return false;
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    SnugglesMessage(preamble + "Invalid email address, missing or invalid location for the '.' character: " + str);
		    return false;
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    SnugglesMessage(preamble + "Invalid email address, more than 1 '@' character found : " + str);
		    return false;
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    SnugglesMessage(preamble + "Invalid email address, '.' character is adjacent to the '@' character: " + str);
		    return false;
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    SnugglesMessage(preamble + "Invalid email address, '.' not found after the '@' character: " + str);
		    return false;
		 }
		
		 if (str.indexOf(" ")!=-1){
		    SnugglesMessage(preamble + "Invalid email address, no spaces are permitted: " + str);
		    return false;
		 }

		 return true;					
	}
//
//==============================================================================
//
