//an image formatter
function showImage (imgSrc) {
	/*var image = dojo.create('img', {
		className	:	'imgView',
		id			:	imgSrc,
		value		:	0,
		src			:	'images/'+imgSrc[0]
	});*/
	var imageDiv = dojo.create('div', {
		className	:	'imgDiv',
		imgStore	:	imgSrc,
		value		:	0
	});
	imageDiv.style.background = 'url("images/'+imgSrc[0]+'") no-repeat center center';
	
	var goLeft = dojo.create('img', {
		src			:	'images/leftArrow.png',
		className	:	'imgLeftArrow',
		onclick		: 	function () {
			theImage = this.parentNode;
			theImage.value = Math.max(theImage.value-1,0);
			theImage.style.background = 'url("images/'+theImage.attributes.imgStore.value.split(",")[theImage.value]+'") no-repeat center center';
			theImage.style.backgroundRepeat = 'none';			
		}
	});
	
	var goRight = dojo.create('img', {
		src			:	'images/rightArrow.png',
		className	: 	'imgRightArrow',
		onclick		:	function () {
			theImage = this.parentNode;
			theImage.value = Math.min(theImage.value+1,theImage.attributes.imgStore.value.split(",").length-1);
			theImage.style.background = 'url("images/'+theImage.attributes.imgStore.value.split(",")[theImage.value]+'") no-repeat center center';
		}
	});
	//put(imageDiv, image);
	put(imageDiv, goLeft);
	put(imageDiv, goRight);
	return imageDiv;
}


if (window.location.pathname=="/index_files/petinform.php")
{
	var myService;
	var feedUrl = "https://www.google.com/calendar/feeds/jim@network2market.com/private/full";
	google.load("gdata", "1");
}
function echeck(obj,str) {
		var at="@";
		var dot=".";
		var lat=str.indexOf(at);
		var lstr=str.length;
		var ldot=str.lastIndexOf(dot);
		var rv = true;			

		if(lat<1||ldot-lat<4||ldot<5||lstr-ldot!=4)
		{
			rv = false;
		}

        if (str.indexOf(" ")!=-1)
		{ 		     
			rv = false;
		}

        if (rv==false)
        {
			obj.style.backgroundColor="rgb(255,100,100)";			
		}
		
 		return rv;					
}

function gup( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "d";
  else
    return results[1];
}
function testDataCheck2 ()
{
	var x=document.getElementById("myFormer");
	for (var i=0;i<x.length;i++)
	{
		if (x.elements[i].value=="")
		{
			var x1=document.getElementsByTagName("input");
			
			for (var i1=0;i1<x1.length;i1++)
			{
				x1[i1].style.backgroundColor="rgb(255,150,150)";				
			}
			var x2=document.getElementsByTagName("textarea");
			for (var i1=0;i1<x2.length;i1++)
			{
				x2[i1].style.backgroundColor="rgb(255,150,150)";				
			}
			alert("Please fill in all fields");
			return false;
		}
	}
	return true;
}
function TestDataCheck()
{
var x=document.getElementById("myForm");
FirstName= x.FirstName.value;
LastName = x.LastName.value;
email = x.email.value;

var returnval;

if ( (FirstName != '') && (LastName != '') && (email != '')) {    
    returnval = true;   
}
else
   {
   alert("Please Enter information in all required fields");      
   document.getElementById('fstNm').style.color="red";
   document.getElementById('lstNm').style.color="red";   
   document.getElementById('emailo').style.color="red";
   return false;
   }
return returnval;
}
function testDataCheckr (formObject)
{
	if (formObject.clientName.value == "" || formObject.datesRequested.value == "" || formObject.serviceType.value == "" ||	formObject.requestDetails.value == "")
	{
		alert("Please Enter information in all required fields");
		formObject.clientName.style.color="red";
		formObject.datesRequested.style.color="red";
		formObject.serviceType.style.color="red";
		formObject.requestDetails.style.color="red";
	}
}
function checkstatus ()
{
	if (gup("status")=="pass")
	{
		document.getElementById('thanks').innerHTML="<span style='font-weight:600;color:green'>Thanks for your submission, a qualified No Mess Pets customer service representative will be in touch shortly</span>";
	}
	else if (gup("status")=="fail")
	{
		document.getElementById('thanks').innerHTML="<span style='font-weight:600;color:red'>I'm sorry there seems to be a problem with your e-mail address<br />Please try again.<br /></span>";
	}
	else if (gup("status")=="invalidClientNum")
	{
		document.getElementById('thanks').innerHTML="<span style='font-weight:600;color:red'>I'm sorry there seems to be a problem with your client number<br />Please call No Mess Pets or use the form below to let us know!.<br /></span>";
	}
	else if (gup("status")=="noClientNum")
	{
		document.getElementById('thanks').innerHTML="<span style='font-weight:600;color:orange'>Thank you, your request has been logged.<br /> However, we're sorry, but there seems to be a problem with your client number. Please call No Mess Pets or use the form below to let us know!.<br /></span>";
	}
	else if (gup("status")=="success")
	{
		document.getElementById('thanks').innerHTML="<span style='font-weight:600;color:green'>Thank you, your request has been logged.<br /> You should receive a confirmation of your service request shortly.<br /></span>";
	}
	else 
	{
		return;
	}
}
		
function showAd ()
{
}

function showPet ()
{
	var petLink=new Array(); 
	petLink[0]="http://photos-a.ak.fbcdn.net/hphotos-ak-snc3/hs418.snc3/25188_331720303039_117442203039_3578042_1854929_s.jpg"; 
	petLink[1]="http://photos-g.ak.fbcdn.net/hphotos-ak-snc3/hs418.snc3/25188_331720343039_117442203039_3578043_43957_s.jpg"; 
	petLink[2]="http://photos-g.ak.fbcdn.net/hphotos-ak-ash1/hs458.ash1/25188_336266898039_117442203039_3590421_1401016_s.jpg"; 
	petLink[3]="http://photos-e.ak.fbcdn.net/hphotos-ak-ash1/hs458.ash1/25188_336266908039_117442203039_3590422_5594452_s.jpg"; 
	petLink[4]="http://photos-c.ak.fbcdn.net/hphotos-ak-snc3/hs438.snc3/25188_336266923039_117442203039_3590423_2466497_s.jpg"; 
	petLink[5]="http://photos-b.ak.fbcdn.net/hphotos-ak-snc3/hs418.snc3/25188_336266933039_117442203039_3590424_3594929_s.jpg"; 
	petLink[6]="http://photos-h.ak.fbcdn.net/hphotos-ak-ash1/hs458.ash1/25188_336266953039_117442203039_3590425_2751122_s.jpg"; 
	petLink[7]="http://photos-g.ak.fbcdn.net/hphotos-ak-snc3/hs418.snc3/25188_336277343039_117442203039_3590435_3774384_s.jpg"; 
	petLink[8]="http://photos-e.ak.fbcdn.net/hphotos-ak-snc3/hs418.snc3/25188_336277353039_117442203039_3590436_5504404_s.jpg"; 
	petLink[9]="http://photos-e.ak.fbcdn.net/hphotos-ak-snc3/hs452.snc3/25886_338385838039_117442203039_3595688_4735599_s.jpg"; 
	petLink[10]="http://photos-f.ak.fbcdn.net/hphotos-ak-snc3/hs452.snc3/25886_338385833039_117442203039_3595687_473628_s.jpg"; 
	petLink[11]="http://photos-d.ak.fbcdn.net/hphotos-ak-ash1/hs472.ash1/25886_338385828039_117442203039_3595686_2900931_s.jpg"; 
	petLink[12]="http://photos-b.ak.fbcdn.net/hphotos-ak-snc3/hs472.snc3/25886_338385823039_117442203039_3595685_3733700_s.jpg"; 
	petLink[13]="http://photos-d.ak.fbcdn.net/hphotos-ak-snc3/hs452.snc3/25886_340694573039_117442203039_3601161_293928_s.jpg"; 
	petLink[14]="http://photos-b.ak.fbcdn.net/hphotos-ak-snc3/hs452.snc3/25886_340694578039_117442203039_3601162_4709923_s.jpg"; 
	petLink[15]="http://photos-h.ak.fbcdn.net/hphotos-ak-ash1/hs472.ash1/25886_340694588039_117442203039_3601163_7348974_s.jpg"; 
	petLink[16]="http://photos-e.ak.fbcdn.net/hphotos-ak-snc3/hs452.snc3/25886_340694593039_117442203039_3601164_5360808_s.jpg"; 
	petLink[17]="http://photos-c.ak.fbcdn.net/hphotos-ak-snc3/hs452.snc3/25886_340694598039_117442203039_3601165_7262190_s.jpg"; 
	petLink[18]="http://photos-b.ak.fbcdn.net/hphotos-ak-snc3/hs472.snc3/25886_341716143039_117442203039_3603476_5293425_s.jpg"; 
	petLink[19]="http://photos-d.ak.fbcdn.net/hphotos-ak-snc3/hs408.snc3/24688_346784488039_117442203039_3620906_1179561_s.jpg"; 
	petLink[20]="http://photos-f.ak.fbcdn.net/hphotos-ak-snc3/hs408.snc3/24688_346784513039_117442203039_3620907_71148_s.jpg"; 
	petLink[21]="http://photos-e.ak.fbcdn.net/hphotos-ak-ash1/hs448.ash1/24688_346784548039_117442203039_3620908_4061160_s.jpg"; 
	petLink[22]="http://photos-c.ak.fbcdn.net/hphotos-ak-snc3/hs428.snc3/24688_346784563039_117442203039_3620909_4507253_s.jpg"; 
	petLink[23]="http://photos-h.ak.fbcdn.net/hphotos-ak-ash1/hs448.ash1/24688_346784583039_117442203039_3620910_7264865_s.jpg"; 
	petLink[24]="http://photos-e.ak.fbcdn.net/hphotos-ak-snc3/hs428.snc3/24688_349511648039_117442203039_3628711_3565972_s.jpg"; 
	petLink[25]="http://photos-g.ak.fbcdn.net/hphotos-ak-snc3/hs428.snc3/24688_349511683039_117442203039_3628712_7303939_s.jpg"; 
	petLink[26]="http://photos-a.ak.fbcdn.net/hphotos-ak-snc3/hs428.snc3/24688_349511703039_117442203039_3628713_4481346_s.jpg"; 
	petLink[27]="http://photos-d.ak.fbcdn.net/hphotos-ak-snc3/hs428.snc3/24688_349511713039_117442203039_3628714_2938236_s.jpg"; 
	petLink[28]="http://photos-f.ak.fbcdn.net/hphotos-ak-snc3/hs424.snc3/24492_354938323039_117442203039_3638491_6426868_s.jpg"; 
	petLink[29]="http://photos-h.ak.fbcdn.net/hphotos-ak-snc3/hs424.snc3/24492_354938343039_117442203039_3638492_7815190_s.jpg";
	petLink[30]="http://photos-b.ak.fbcdn.net/hphotos-ak-snc3/hs424.snc3/24492_354938358039_117442203039_3638493_4695405_s.jpg"; 
	petLink[31]="http://photos-c.ak.fbcdn.net/hphotos-ak-snc3/hs424.snc3/24492_354944748039_117442203039_3638494_4725021_s.jpg"; 
	petLink[32]="http://photos-e.ak.fbcdn.net/hphotos-ak-snc3/hs424.snc3/24492_354944763039_117442203039_3638495_2577891_s.jpg"; 
	petLink[33]="http://photos-g.ak.fbcdn.net/hphotos-ak-snc3/hs404.snc3/24492_354944778039_117442203039_3638496_6854379_s.jpg"; 
	petLink[34]="http://photos-a.ak.fbcdn.net/hphotos-ak-ash1/hs444.ash1/24492_354944793039_117442203039_3638497_3317715_s.jpg"; 
	petLink[35]="http://photos-g.ak.fbcdn.net/hphotos-ak-snc3/hs460.snc3/26311_364573823039_117442203039_3667544_891105_s.jpg"; 
	petLink[36]="http://photos-a.ak.fbcdn.net/hphotos-ak-snc3/hs480.snc3/26311_364573838039_117442203039_3667545_1962526_s.jpg"; 
	petLink[37]="http://photos-c.ak.fbcdn.net/hphotos-ak-snc3/hs460.snc3/26311_364573848039_117442203039_3667546_910717_s.jpg"; 
	petLink[38]="http://photos-e.ak.fbcdn.net/hphotos-ak-snc3/hs480.snc3/26311_364573858039_117442203039_3667547_2503082_s.jpg"; 
	petLink[39]="http://photos-b.ak.fbcdn.net/hphotos-ak-ash1/hs492.ash1/26875_372286653039_117442203039_3687773_976887_s.jpg"; 
	petLink[40]="http://photos-f.ak.fbcdn.net/hphotos-ak-snc3/hs480.snc3/26311_364573878039_117442203039_3667548_4507028_s.jpg"; 
	petLink[41]="http://photos-h.ak.fbcdn.net/hphotos-ak-snc3/hs460.snc3/26311_364580223039_117442203039_3667568_4292779_s.jpg"; 
	petLink[42]="http://photos-b.ak.fbcdn.net/hphotos-ak-snc3/hs480.snc3/26311_364580243039_117442203039_3667569_4084862_s.jpg"; 
	petLink[43]="http://photos-e.ak.fbcdn.net/hphotos-ak-snc3/hs460.snc3/26311_364580278039_117442203039_3667570_2425657_s.jpg";
	petLink[44]="http://photos-c.ak.fbcdn.net/hphotos-ak-snc3/hs460.snc3/26311_364580298039_117442203039_3667571_7359190_s.jpg"; 
	petLink[45]="http://photos-a.ak.fbcdn.net/hphotos-ak-ash1/hs480.ash1/26311_364580303039_117442203039_3667572_6156742_s.jpg"; 
	petLink[46]="http://photos-a.ak.fbcdn.net/hphotos-ak-snc3/hs460.snc3/26311_364585273039_117442203039_3667587_503689_s.jpg"; 
	petLink[47]="http://photos-b.ak.fbcdn.net/hphotos-ak-ash1/hs480.ash1/26311_364585293039_117442203039_3667588_2214905_s.jpg"; 
	petLink[48]="http://photos-h.ak.fbcdn.net/hphotos-ak-ash1/hs480.ash1/26311_364585303039_117442203039_3667589_3204465_s.jpg"; 
	petLink[49]="http://photos-c.ak.fbcdn.net/hphotos-ak-snc3/hs460.snc3/26311_364585313039_117442203039_3667590_2903629_s.jpg"; 
	petLink[50]="http://photos-e.ak.fbcdn.net/hphotos-ak-snc3/hs480.snc3/26311_364585338039_117442203039_3667591_7275969_s.jpg"; 
	petLink[51]="http://photos-g.ak.fbcdn.net/hphotos-ak-ash1/hs492.ash1/26875_372285863039_117442203039_3687762_8051256_s.jpg"; 
	petLink[52]="http://photos-a.ak.fbcdn.net/hphotos-ak-ash1/hs492.ash1/26875_372285878039_117442203039_3687763_2692702_s.jpg"; 
	petLink[53]="http://photos-f.ak.fbcdn.net/hphotos-ak-snc3/hs512.snc3/26875_372285893039_117442203039_3687765_59093_s.jpg"; 
	petLink[54]="http://photos-h.ak.fbcdn.net/hphotos-ak-snc3/hs492.snc3/26875_372285898039_117442203039_3687766_7941164_s.jpg"; 
	petLink[55]="http://photos-g.ak.fbcdn.net/hphotos-ak-ash1/hs492.ash1/26875_372286608039_117442203039_3687769_1648241_s.jpg"; 
	petLink[56]="http://photos-d.ak.fbcdn.net/hphotos-ak-snc3/hs492.snc3/26875_372286618039_117442203039_3687770_3065449_s.jpg"; 
	petLink[57]="http://photos-f.ak.fbcdn.net/hphotos-ak-ash1/hs492.ash1/26875_372286628039_117442203039_3687771_2797317_s.jpg"; 
	petLink[58]="http://photos-h.ak.fbcdn.net/hphotos-ak-snc3/hs512.snc3/26875_372286638039_117442203039_3687772_7221091_s.jpg"; 
	petLink[59]="http://photos-b.ak.fbcdn.net/hphotos-ak-ash1/hs492.ash1/26875_372286653039_117442203039_3687773_976887_s.jpg"; 
	petLink[60]="http://photos-e.ak.fbcdn.net/hphotos-ak-ash1/hs458.ash1/25188_331720223039_117442203039_3578040_3925467_s.jpg"; 
	petLink[61]="http://photos-c.ak.fbcdn.net/hphotos-ak-snc3/hs438.snc3/25188_331720263039_117442203039_3578041_246975_s.jpg"; 
	petLink[62]="http://photos-b.ak.fbcdn.net/hphotos-ak-snc3/hs153.snc3/18070_237968078039_117442203039_3248943_5962279_s.jpg";
	petLink[63]="http://photos-b.ak.fbcdn.net/hphotos-ak-snc3/hs153.snc3/18070_238004178039_117442203039_3249040_2444046_s.jpg";
	petLink[64]="http://photos-b.ak.fbcdn.net/hphotos-ak-snc3/hs153.snc3/18070_237880853039_117442203039_3248555_5308821_s.jpg";
	petLink[65]="http://photos-g.ak.fbcdn.net/hphotos-ak-snc3/hs133.snc3/18070_237843473039_117442203039_3248441_6111328_s.jpg";
	petLink[66]="http://photos-e.ak.fbcdn.net/hphotos-ak-snc3/hs133.snc3/18070_237843493039_117442203039_3248442_3908923_s.jpg";
	petLink[67]="http://photos-h.ak.fbcdn.net/hphotos-ak-snc3/hs153.snc3/18070_237843538039_117442203039_3248445_6460588_s.jpg";
	petLink[68]="http://photos-f.ak.fbcdn.net/hphotos-ak-snc3/hs153.snc3/18070_237880883039_117442203039_3248557_1561189_s.jpg";
	petLink[69]="http://photos-h.ak.fbcdn.net/hphotos-ak-snc3/hs153.snc3/18070_237849918039_117442203039_3248451_3490528_s.jpg";
	petLink[70]="http://photos-f.ak.fbcdn.net/hphotos-ak-snc3/hs153.snc3/18070_237849928039_117442203039_3248452_1853453_s.jpg";
	petLink[71]="http://photos-d.ak.fbcdn.net/hphotos-ak-snc3/hs153.snc3/18070_237849938039_117442203039_3248453_1155819_s.jpg";
	petLink[72]="http://photos-b.ak.fbcdn.net/hphotos-ak-snc3/hs153.snc3/18070_237863908039_117442203039_3248499_2022527_s.jpg";
	petLink[73]="http://photos-g.ak.fbcdn.net/hphotos-ak-snc3/hs133.snc3/18070_237849953039_117442203039_3248455_3295742_s.jpg";
	petLink[74]="http://photos-h.ak.fbcdn.net/hphotos-ak-snc3/hs153.snc3/18070_237857683039_117442203039_3248472_3411233_s.jpg";
	petLink[75]="http://photos-c.ak.fbcdn.net/hphotos-ak-snc3/hs133.snc3/18070_237857698039_117442203039_3248474_2290943_s.jpg";
	petLink[76]="http://photos-g.ak.fbcdn.net/hphotos-ak-snc3/hs133.snc3/18070_237890243039_117442203039_3248621_8071829_s.jpg";
	petLink[77]="http://photos-g.ak.fbcdn.net/hphotos-ak-snc3/hs133.snc3/18070_237857713039_117442203039_3248476_6132635_s.jpg";
	petLink[78]="http://photos-e.ak.fbcdn.net/hphotos-ak-snc3/hs133.snc3/18070_237890248039_117442203039_3248622_8167047_s.jpg";
	petLink[79]="http://photos-h.ak.fbcdn.net/hphotos-ak-snc3/hs153.snc3/18070_237880843039_117442203039_3248554_6649921_s.jpg";
	petLink[80]="http://photos-e.ak.fbcdn.net/hphotos-ak-snc3/hs133.snc3/18070_238059488039_117442203039_3249425_2129533_s.jpg";
	petLink[81]="http://photos-c.ak.fbcdn.net/hphotos-ak-snc3/hs133.snc3/18070_237880903039_117442203039_3248559_4874500_s.jpg";
	petLink[82]="http://photos-d.ak.fbcdn.net/hphotos-ak-snc3/hs153.snc3/18070_237898403039_117442203039_3248665_1793390_s.jpg";
	petLink[83]="http://photos-d.ak.fbcdn.net/hphotos-ak-snc3/hs153.snc3/18070_237863923039_117442203039_3248500_5568557_s.jpg";
	petLink[84]="http://photos-b.ak.fbcdn.net/hphotos-ak-snc3/hs153.snc3/18070_237898408039_117442203039_3248666_4608947_s.jpg";
	petLink[85]="http://photos-b.ak.fbcdn.net/hphotos-ak-snc3/hs153.snc3/18070_237863968039_117442203039_3248503_570692_s.jpg";
	petLink[86]="http://photos-h.ak.fbcdn.net/hphotos-ak-snc3/hs153.snc3/18070_237863953039_117442203039_3248502_7995346_s.jpg";
	petLink[87]="http://photos-e.ak.fbcdn.net/hphotos-ak-snc3/hs133.snc3/18070_237857708039_117442203039_3248475_6766351_s.jpg";
	petLink[88]="http://photos-g.ak.fbcdn.net/hphotos-ak-snc3/hs133.snc3/18070_237898448039_117442203039_3248668_2276165_s.jpg";
	petLink[89]="http://photos-b.ak.fbcdn.net/hphotos-ak-snc3/hs124.snc3/17170_284764208039_117442203039_3418835_6725025_s.jpg";
	petLink[90]="http://photos-d.ak.fbcdn.net/hphotos-ak-snc3/hs144.snc3/17170_284764238039_117442203039_3418836_3460663_s.jpg";
	petLink[91]="http://photos-f.ak.fbcdn.net/hphotos-ak-snc3/hs144.snc3/17170_284764248039_117442203039_3418837_3191670_s.jpg";
	petLink[92]="http://photos-e.ak.fbcdn.net/hphotos-ak-ash1/hs244.ash1/17170_286545433039_117442203039_3423926_6841031_s.jpg";
	petLink[93]="http://photos-d.ak.fbcdn.net/hphotos-ak-snc3/hs124.snc3/17170_286545388039_117442203039_3423923_4493357_s.jpg";
	petLink[94]="http://photos-b.ak.fbcdn.net/hphotos-ak-snc3/hs124.snc3/17170_286545358039_117442203039_3423920_4655984_s.jpg";
	petLink[95]="http://photos-d.ak.fbcdn.net/hphotos-ak-snc3/hs144.snc3/17170_286555478039_117442203039_3423949_5591732_s.jpg";
	petLink[96]="http://photos-g.ak.fbcdn.net/hphotos-ak-snc3/hs124.snc3/17170_286545418039_117442203039_3423925_7187163_s.jpg";
	petLink[97]="http://photos-f.ak.fbcdn.net/hphotos-ak-ash1/hs244.ash1/17170_286545383039_117442203039_3423922_6651626_s.jpg";
	petLink[98]="http://photos-g.ak.fbcdn.net/hphotos-ak-snc3/hs124.snc3/17170_286555498039_117442203039_3423950_2470478_s.jpg";
	petLink[99]="http://photos-a.ak.fbcdn.net/hphotos-ak-snc3/hs144.snc3/17170_288833553039_117442203039_3432576_5223273_s.jpg";
	petLink[101]="http://photos-g.ak.fbcdn.net/hphotos-ak-snc3/hs124.snc3/17170_288833573039_117442203039_3432577_5688887_s.jpg";
	petLink[102]="http://photos-h.ak.fbcdn.net/hphotos-ak-snc3/hs144.snc3/17170_288833578039_117442203039_3432578_2502033_s.jpg";
	petLink[103]="http://photos-b.ak.fbcdn.net/hphotos-ak-snc3/hs124.snc3/17170_288833598039_117442203039_3432579_2619056_s.jpg";
	petLink[104]="http://photos-c.ak.fbcdn.net/hphotos-ak-snc3/hs124.snc3/17170_288833608039_117442203039_3432580_7027183_s.jpg";
	petLink[105]="http://photos-a.ak.fbcdn.net/hphotos-ak-snc3/hs124.snc3/17170_288836328039_117442203039_3432588_5637759_s.jpg";
	petLink[106]="http://photos-d.ak.fbcdn.net/hphotos-ak-snc3/hs124.snc3/17170_288836343039_117442203039_3432590_6313525_s.jpg";
	petLink[107]="http://photos-f.ak.fbcdn.net/hphotos-ak-snc3/hs124.snc3/17170_288836353039_117442203039_3432591_3409521_s.jpg";
	petLink[108]="http://photos-h.ak.fbcdn.net/hphotos-ak-ash1/hs244.ash1/17170_288836373039_117442203039_3432592_5021898_s.jpg";
	petLink[109]="http://photos-a.ak.fbcdn.net/hphotos-ak-ash1/hs256.ash1/18370_299948433039_117442203039_3465257_4319576_s.jpg";
	petLink[110]="http://photos-b.ak.fbcdn.net/hphotos-ak-snc3/hs156.snc3/18370_299948448039_117442203039_3465258_2876539_s.jpg";
	petLink[111]="http://photos-h.ak.fbcdn.net/hphotos-ak-snc3/hs156.snc3/18370_299948453039_117442203039_3465259_332163_s.jpg";
	petLink[112]="http://photos-a.ak.fbcdn.net/hphotos-ak-snc3/hs156.snc3/18370_299948478039_117442203039_3465260_5658298_s.jpg";
	petLink[113]="http://photos-g.ak.fbcdn.net/hphotos-ak-snc3/hs136.snc3/18370_299948493039_117442203039_3465261_3027883_s.jpg";
	petLink[114]="http://photos-f.ak.fbcdn.net/hphotos-ak-snc3/hs136.snc3/18370_299952373039_117442203039_3465266_4895274_s.jpg";
	petLink[115]="http://photos-g.ak.fbcdn.net/hphotos-ak-ash1/hs256.ash1/18370_301475068039_117442203039_3470423_3931162_s.jpg";
	petLink[116]="http://photos-f.ak.fbcdn.net/hphotos-ak-snc3/hs156.snc3/18370_301475083039_117442203039_3470424_6905841_s.jpg";
	petLink[117]="http://photos-c.ak.fbcdn.net/hphotos-ak-snc3/hs156.snc3/18370_301588688039_117442203039_3471031_3679820_s.jpg";
	petLink[118]="http://photos-a.ak.fbcdn.net/hphotos-ak-ash1/hs256.ash1/18370_301588708039_117442203039_3471032_3430337_s.jpg";
	petLink[119]="http://photos-g.ak.fbcdn.net/hphotos-ak-snc3/hs156.snc3/18370_301588723039_117442203039_3471033_2697612_s.jpg";
	petLink[120]="http://photos-f.ak.fbcdn.net/hphotos-ak-snc3/hs136.snc3/18370_301588743039_117442203039_3471034_5910458_s.jpg";

	document.getElementById('petPic').src=petLink[Math.floor(Math.random()*120)];	
	t=setTimeout("showPet()",6000);
}
function logMeIn() {
  scope = "https://www.google.com/calendar/feeds/";
  var token = google.accounts.user.login(scope);
}

function setupMyService() {
  myService = new google.gdata.calendar.CalendarService('seven');
  logMeIn();
}

function getMyFeed() {
  setupMyService(); 
  myService.getEventsFeed(feedUrl,handleMyFeed,handleError);
}
function handleMyFeed(myResultsFeedRoot) {
  alert("This feed's title is: " + myResultsFeedRoot.feed.getTitle().getText());
}

function handleError(e) {
  alert("There was an error!");
  alert(e.cause ? e.cause.statusText : e.message);
}
function addEventToCalendar()
{
/*
 * Create a single event
 */ 

// Create the calendar service object
var calendarService = new google.gdata.calendar.CalendarService('GoogleInc-jsguide-1.0');

// The default "private/full" feed is used to insert event to the 
// primary calendar of the authenticated user
var feedUri = 'https://www.google.com/calendar/feeds/jim@network2market.com/private/full';

// Create an instance of CalendarEventEntry representing the new event
var entry = new google.gdata.calendar.CalendarEventEntry();
//2010-08-19T10:00:00.000-08:00
// Set the title of the event
entry.setTitle(google.gdata.Text.create('entryTitle'));

// Create a When object that will be attached to the event
var when = new google.gdata.When();
var d3 = new Date();
var misin = (d3.getYear()+1900)+"-0"+(d3.getMonth()+1)+"-"+d3.getDate()+"T0"+d3.getHours()+":00:00.000-04:00";
alert(misin);
// Set the start and end time of the When object
var startTime = google.gdata.DateTime.fromIso8601('2010-08-18T06:00:00.000-04:00');
var endTime = google.gdata.DateTime.fromIso8601(misin);
when.setStartTime(startTime);
when.setEndTime(endTime);

// Add the When object to the event 
entry.addTime(when);

// The callback method that will be called after a successful insertion from insertEntry()
var callback = function(result) {
 alert('event created!');
}

// Error handler will be invoked if there is an error from insertEntry()
var handleError = function(error) {
  alert(error);
}

// Submit the request using the calendar service object
calendarService.insertEntry(feedUri, entry, callback, 
    handleError, google.gdata.calendar.CalendarEventEntry);
}
function handleInfo(data) {
    var response = eval(data.currentTarget.responseText);
  
    alert('Target: ' + response.Target + "\n" + 
          'Scope: ' + response.Scope + "\n" +
          'Secure: ' + response.Secure);
}

function doGetInfo() {
  scope = "https://www.google.com/calendar/feeds/";
  if (google.accounts.user.checkLogin(scope)) {
    google.accounts.user.getInfo(handleInfo);
  }
}
function loadPHPDoc(dname)
{
	if (window.XMLHttpRequest)
	{
		xhttp=new XMLHttpRequest()
	}
	else 
	{
		xhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xhttp.open("GET",dname,false);
	xhttp.send("");
	return xhttp.responseText;
}
function getBlog (getDay)
{
	document.getElementById("rssOutput").innerHTML = loadPHPDoc("js/getBlog.php?searchVal="+getDay);
}

function getCalendar (monthOffset)
{
	document.getElementById("calendarDiv").innerHTML = loadPHPDoc("js/nmpBlogCalendar.php?monthOffset="+monthOffset);
	document.getElementById("nolanCalendar").style.zIndex = '200';
}

function getEvent (indexNumber,event,clickedObj)
{
	x = document.getElementById("calendarEvent");
	//alert("events are: "+x.scrollHeight+" : "+event.screenY);
	
	//x.style.top=Number(x.parentNode.parentNode.parentNode.scrollTop)+Math.max(150,Number(event.screenY))-400+'px';
	//x.style.left=(Number(x.scrollTop)+Number(event.screenX))+'px';
	//x.style.zIndex="200";
	
	x.innerHTML = loadPHPDoc("js/getEvent.php?indexNumber="+indexNumber);
	clickedObj.overflow='visible';
	x.zIndex='201';
	clickedObj.appendChild(x);
}

function getRequestedOperation (keyValue) {
	switch (keyValue)
	{
		
		case 'pendingInvoice' :
			document.getElementById('InfoGoesHere').innerHTML=loadPHPDoc("js/getnmp.php?operation="+keyValue);
			break;
		case 'subInvoice' :
			document.getElementById('InfoGoesHere').innerHTML=loadPHPDoc("js/getnmp.php?operation="+keyValue);
			break;
		case 'paidInvoice' :
			document.getElementById('InfoGoesHere').innerHTML=loadPHPDoc("js/getnmp.php?operation="+keyValue);
			break;
		case 'scheduledInvoice' :
			document.getElementById('InfoGoesHere').innerHTML=loadPHPDoc("js/getnmp.php?operation="+keyValue);		
			break;
		default:
			document.getElementById('InfoGoesHere').innerHTML=loadPHPDoc("js/getnmp.php?operation="+keyValue);		
			break;
			
	}
}

function addlines(petsVar) {	
	if (petsVar < 5)
	{
	document.getElementById("petinformationData").innerHTML = document.getElementById("petinformationData").innerHTML+'<br /><br /><ul><li>Pet#'+petsVar+' Name: <input type="text" name="pets'+petsVar+'" size="25" maxlength="50" ></input></li><li>Pet Feeding Instructions: <br /><textarea name="feedingCare'+petsVar+'" rows="4" cols="38"></textarea></li><li><b>Special Alerts</b></li><li>FLIGHT RISK/Describe: <input type="text" size="25" name="flightRisk'+petsVar+'" maxlength="50"></input></li><li>Out On Leash Only?</li><li><select name="leashDispo'+petsVar+'"><option value="yes">yes</option><option value="iFence">no, invisible fence</option><option value="nrmlFence">no, fenced yard</option></select></li><li>Other:<br /> <textarea name="otherSpecialAlerts'+petsVar+'" rows="4" cols="38"></textarea></li></ul>';
	}
	else
	{
		document.getElementById("petinformationData").innerHTML = document.getElementById("petinformationData").innerHTML+"I'm sorry but the current database limit is five pet records, plese combine pet information by type and/or double up on previous entries.  Further, <a href='index_files/nmpcontact.php target='_blank'>contact</a> NMP to let them know to add more space to the database.  Thank you.  --Jim Nolan NMP"
	
}
}

function testDataCheck3 (frmObj)
{

	//reset old stuff
	frmObj.cardNumber.style.backgroundColor = "rgb(255,255,255)";
	frmObj.cvmValue.style.backgroundColor = "rgb(255,255,255)";
	frmObj.zip.style.backgroundColor = "rgb(255,255,255)";
	frmObj.cardExpYear.style.backgroundColor = "rgb(255,255,255)";
	frmObj.cardExpMonth.style.backgroundColor = "rgb(255,255,255)";
	//email
	checkVar = true;
	checkVar = echeck(frmObj.email, frmObj.email.value);

	//zipcode
	if (frmObj.zip.value.search(/^[0-9]{5}/)< 0)
	{
		checkVar = false;
		frmObj.zip.style.backgroundColor = "rgb(255,100,100)";
	}
	//expiration
	if (frmObj.cardExpYear.value =='blank' || frmObj.cardExpMonth.value =='blank')
	{
		checkVar = false;		
		frmObj.cardExpYear.style.backgroundColor = "rgb(255,100,100)";
		frmObj.cardExpMonth.style.backgroundColor = "rgb(255,100,100)";
	}
	var d=new Date();
	d.getFullYear()%100;
	if (frmObj.cardExpYear.value == d.getFullYear()%100 && frmObj.cardExpMonth.value < (d.getMonth()+1))
	{
		checkVar = false;		
		frmObj.cardExpYear.style.backgroundColor = "rgb(255,100,100)";
		frmObj.cardExpMonth.style.backgroundColor = "rgb(255,100,100)";
	}
	//credicard number and cvm
	if (frmObj.cardNumber.value.search(/^[0-9]{16}/)<0 || frmObj.cvmValue.value.search(/^[0-9]{3}/)<0)
	{	
		checkVar = false;
		frmObj.cardNumber.style.backgroundColor = "rgb(255,100,100)";
		frmObj.cvmValue.style.backgroundColor = "rgb(255,100,100)";
	}
	alert (checkVar);
	return checkVar;
}
function generateInvoice(frmObj)		
{	
	var loopCounter = 0;
	holiday = 0;
	addlDisc = 0.0;
	var priceArray = new Array;
	priceArray[0] = 12; //potty break
	priceArray[1] = 15; //30 min dw
	priceArray[2] = 24; //60 min dw
	priceArray[3] = 16; //pet sit
	priceArray[4] = 30; //2x pet sit	
	priceArray[5] = 45; //3x pet sit
	priceArray[6] = 60; //overnite
	priceArray[7] = 1; //pettaxi (won't be used)
	priceArray[8] = 1;  //mileage
	priceArray[9] = 5; //holiday fee
	priceArray[10] = 5; //addl pets
	priceArray[11] = 5; //addl dog
	priceArray[12] = 1;  //single pet disc
	priceArray[13] = 0.0; //not used yet
	
	holidayVar='01Jan17Jan21Feb30May04Jul05Sep11Oct11Nov24Nov24Dec25Dec';  //changes by year....
	subtotal = 0;
	loopCounterMileage = 0;
	mileageMultiplier = 0;
	
	//get mileage fees
	while (loopCounterMileage < 7)
	{
		//alert(mileageMultiplier);
		mileageMultiplier= Number(frmObj[loopCounterMileage].value)+Number(mileageMultiplier);
		loopCounterMileage++;
	}
	if (frmObj[7].value > 0)
	{
		mileageMultiplier++;
	}

	frmObj[8].value=frmObj[8].value*mileageMultiplier;
	frmObj[8].readOnly=true;
	
	
	//get additional dogs:
	if (frmObj.addlDog.checked == true)
	{
		frmObj.addlDog.value= Number(frmObj[0].value)+Number(frmObj[1].value)+Number(frmObj[2].value);
	}
	else
	{
		frmObj.addlDog.value = 0;
	}
	
	//get additional pets:
	if (frmObj.addlPets.value > 0)
	{
		frmObj.addlPets.readOnly=true;
		frmObj.addlPets.style.backgroundColor='#11ff11';
		frmObj.addlPets.value = frmObj.addlPets.value*(Number(frmObj[3].value)+Number(frmObj[4].value)+Number(frmObj[5].value)+Number(frmObj[6].value));
	}
	
	//clear old invoice
	document.getElementById("itemMain").innerHTML='<li id="item1"></li><li id="item2"></li><li id="item3"></li><li id="item4"></li><li id="item5"></li><li id="item6"></li><li id="item7"></li><li id="item8"></li><li id="item9"></li><li id="item10"></li><li id="item11"></li><li id="item12"></li><li id="item13"></li><li id="item14"></li>';
	//get the single pet disc
	if (frmObj.singPetDisc.checked == true)
	{
		frmObj.singPetDisc.value = 0.1;
	}
    else
	{
		frmObj.singPetDisc.value = 0.0;
	}
	discounts = (1.00-frmObj.singPetDisc.value)*(1.00-addlDisc);
	
	// get the holiday counts	
	//start by looking past the end of the list
	loopCounter = 13;
	while (loopCounter < frmObj.length)
	{
		if (holidayVar.indexOf(frmObj[loopCounter].value.substr(0,5),0) >= 0 && frmObj[loopCounter].value != '')
		{
			holiday++;				
		}
		loopCounter++;
	}
	frmObj.holiday.value = holiday;	
	frmObj.holiday.style.backgroundColor = '#11ff11';
	loopCounter = 0;
	//loop through front of list to multiply service requests with current prices from above...
	while (loopCounter < 12)
	{
		//alert ('item'+(loopCounter+1));
		//check to see if there is a value
		if (frmObj[loopCounter].value != 0)
		{			
			document.getElementById('item'+(loopCounter+1)).innerHTML = frmObj[loopCounter].name + " :" + frmObj[loopCounter].value + " Price: " +frmObj[loopCounter].value*priceArray[loopCounter];
			subtotal+=frmObj[loopCounter].value*priceArray[loopCounter];
		}
		
		loopCounter++;
	}
	//get single pet discounts from the three services where they are applicable
	subwithdiscounts = Number((priceArray[5]*frmObj[5].value+priceArray[3]*frmObj[3].value+priceArray[4]*frmObj[4].value)*frmObj.singPetDisc.value);
	document.getElementById('item13').innerHTML = "Discounts :"+subwithdiscounts;
	document.getElementById('item14').innerHTML = "Subtotal :"+subtotal+" With Discounts: "+Number(subtotal-subwithdiscounts)+" <br />Tax: "+Number(subtotal-subwithdiscounts)*0.06+"<br />Total: "+Number(subtotal-subwithdiscounts)*1.06;
	document.getElementById('seven').innerHTML = '<input type = "submit" value = "submit"></input><input type = "reset" value = "reset" onclick="document.getElementById(\'bluepie\').readOnly=false;document.getElementById(\'loopie\').readOnly=false"></input><input type="hidden" name = "disc" value = "'+subwithdiscounts+'"></input><input type="hidden" name="subtotal" value="'+Number(subtotal-subwithdiscounts)+'"></input>';
}	
	
		
	//subtotal = (frmObj.sixtyWalk.value*smDWPrice)+(frmObj.oneSit.value*sPsPrice)+(frmObj.twoSit.value*tPsPrice)+(frmObj.threeSit.value*tPsPrice)+(frmObj.overNightSit.value*oNightsit)+(frmObj.pottyBreaks.value*pbPrice)+(frmObj.thirtyWalk.value*tmDWPrice)+(frmObj.holiday.value*holiday)+(frmObj.addlPets.value*addlPet)+(frmObj.addlDog.value*addlDog)+(frmObj.petTaxi.value*1)+(frmObj.addlMile.value*addlMile);	

	//create holiday fee: pb, 30w, 60w, ps, 2xdps, 3xtps, onsit,  still missing pettaxi: pettaxi
	//alert(Number(frmObj.sixtyWalk.value)+Number(frmObj.oneSit.value)+Number(frmObj.twoSit.value*2)+Number(frmObj.threeSit.value*3)+Number(frmObj.overNightSit.value)+Number(frmObj.pottyBreaks.value)+Number(frmObj.thirtyWalk.value));
	//frmObj.holiday.value = Number(frmObj.sixtyWalk.value)+Number(frmObj.oneSit.value)+Number(frmObj.twoSit.value*2)+Number(frmObj.threeSit.value*3)+Number(frmObj.overNightSit.value)+Number(frmObj.pottyBreaks.value)+Number(frmObj.thirtyWalk.value);
		//put in code to search the addl dates for holiday fees and intelligently add two and 3 pet sit fees...
	/* something like:

	*/
	//subwithdiscounts = ((frmObj.pottyBreaks.value*pbPrice)+(frmObj.thirtyWalk.value*tmDWPrice)+(frmObj.sixtyWalk.value*smDWPrice)+(frmObj.oneSit.value*sPsPrice)+(frmObj.twoSit.value*tPsPrice)+(frmObj.threeSit.value*tPsPrice)+(frmObj.overNightSit.value*oNightsit)+(frmObj.holiday.value*holiday)+(frmObj.addlPets.value*addlPet)+(frmObj.addlDog.value*addlDog)+(frmObj.petTaxi.value*1)+(frmObj.addlMile.value*addlMile))*discounts;
	/*document.getElementById('item1').innerHTML = "Potty Breaks: "+frmObj[0].value+" Price: "+frmObj.pottyBreaks.value*pbPrice;
	document.getElementById('item2').innerHTML = "30 Min Dog Walks: "+frmObj[0].value+" Price: "+frmObj.thirtyWalk.value*tmDWPrice;
	document.getElementById('item3').innerHTML = "60 Min Dog Walks: "+frmObj[2].value+" Price: "+frmObj.sixtyWalk.value*smDWPrice;
	document.getElementById('item4').innerHTML = "Pet Sits: "+frmObj.oneSit.value+" Price: "+frmObj.oneSit.value*sPsPrice;
	document.getElementById('item5').innerHTML = "2x Day Pet Sits: "+frmObj.twoSit.value+" Price: "+frmObj.twoSit.value*tPsPrice;
	document.getElementById('item6').innerHTML = "3x Day Pet Sits: "+frmObj.threeSit.value+" Price: "+frmObj.threeSit.value*tPsPrice;
	document.getElementById('item7').innerHTML = "Overnights: "+frmObj.overNightSit.value+" Price: "+frmObj.overNightSit.value*oNightsit;
	document.getElementById('item8').innerHTML = "Taxi Price: "+frmObj.petTaxi.value;
	document.getElementById('item9').innerHTML = "Mileage: "+frmObj.addlMile.value+" Price: "+frmObj.addlMile.value*addlMile;
	document.getElementById('item10').innerHTML = "Holiday Fees: "+frmObj.holiday.value+" Price: "+frmObj.holiday.value*holiday;
	document.getElementById('item11').innerHTML = "Addl Pets: "+frmObj.addlPets.value+" Price: "+frmObj.addlPets.value*addlPet;
	document.getElementById('item12').innerHTML = "Addl Dogs: "+frmObj.addlDog.value+" Price: "+frmObj.addlDog.value*addlDog;
	document.getElementById('item13').innerHTML = "singlePetDisc "+frmObj.singPetDisc.value+" Price: "+discounts;*/

function addDates(inputObj,updateName)
{
	loopCounter = 0;
	document.getElementById(updateName).innerHTML='';
	while (loopCounter < inputObj)
	{
		//document.getElementById(updateName).innerHTML+
		document.getElementById(updateName).innerHTML=document.getElementById(updateName).innerHTML+updateName+" "+Number(loopCounter+1)+": <input name='"+updateName+loopCounter+"' size='7' maxlength='7' value='DDMMMYY' onfocus='this.value=\"\"'></input><br />";
	loopCounter++;	
	}
		
}
	


