
/*
snugglynoodles general javascript library
*/
//
//==============================================================================
//
function WriteSnugglynoodlesWDHeader()
{
   document.write('<div><span style=\"font-size: 24pt\"><span style=\"color:#ffffff\">snugglynoodles web design</span></span> </div><div class=\"logo_64\" style=\"position:relative; top:-40px; left:680px;\"></div></div>');
}
//
//==============================================================================
//
function WriteSnugglynoodlesWDFooter()
{
   document.write('<div>');
   document.write('<a href=\"index.html\"><img src=\"snugglyIconSet/menu/tulliana/home_24.png\" alt=\"snugglynoodles home\" title=\"snugglynoodles web design home page\" border=\"0\" /></a>'); 
   document.write('       ');  
   document.write('<a href=\"contact.html\"><img src=\"snugglyIconSet/menu/blogPerfume/email-24.png\" alt=\"contact snugglynoodles\" title=\"contact snugglynoodles\" border=\"0\" /></a>');   
   document.write('       ');  
   document.write('<a href=\"products.html\"><img src=\"snugglyIconSet/menu/blogPerfume/themes-24.png\" alt=\"products page\" title=\"our products\" border=\"0\" /></a>');   
   document.write('       ');  
   document.write('<a href=\"help.html\"><img src=\"snugglyIconSet/menu/tulliana/info_24.png\" alt=\"help link\" title=\"help page\" border=\"0\" /></a>');   
   document.write('       ');  
   document.write('<a href=\"gunk.html\"><img src=\"snugglyIconSet/menu/blogPerfume/article-24.png\" alt=\"gunk\" title=\"terms and conditions\" border=\"0\" /></a>');   
   document.write('       ');  
   document.write('<a href=\"credits.html\"><img src=\"snugglyIconSet/menu/tulliana/edu_science_24.png\" alt=\"credits page\" title=\"credits including icons\" border=\"0\" /></a>');   
   document.write('</div>'); 
   document.write('copyright &copy; 2008 <a href="http://www.snugglynoodles.com">snugglynoodles web design</a> with the original template designed by <a href=\"http://templates.arcsin.se\">Arcsin</a> and licensed under the <a href=\"http://creativecommons.org/licenses/by/2.5/deed.en\">Creative Commons Attribution 2.5 License</a>');
}
//
//==============================================================================
//
function SnugglesMessage(msg)
{
	alert("snuggles says: " + 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;					
	}
//
//==============================================================================
//



