/* Images for offers in the left menu*/


/***********************************************
* Simple Controls Gallery- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/

var mygallery=new simpleGallery({
	wrapperid: "simplegallery1", //ID of main gallery container,
	dimensions: [158, 136], //width/height of gallery in pixels. Should reflect dimensions of the images exactly
	imagearray: [
		["images/image_gallery/free_smear_test.jpg", "cervical_smear_test.php", "", ""],
		["images/image_gallery/travel_vaccine.jpg", "travel_vaccinations.php", "", ""],
		["images/image_gallery/hearing_aid.jpg", "hearing_aid_clinic.php", "", ""]
	],
	autoplay: [true, 5000, 40], //[auto_play_boolean, delay_btw_slide_millisec, cycles_before_stopping_int]
	persist: false, //remember last viewed slide and recall within same session?
	fadeduration: 500, //transition duration (milliseconds)
	oninit:function(){ //event that fires when gallery has initialized/ ready to run
		//Keyword "this": references current gallery instance (ie: try this.navigate("play/pause"))
	},
	onslide:function(curslide, i){ //event that fires after each slide is shown
		//Keyword "this": references current gallery instance
		//curslide: returns DOM reference to current slide's DIV (ie: try alert(curslide.innerHTML)
		//i: integer reflecting current image within collection being shown (0=1st image, 1=2nd etc)
	}
})



/* Validate Callback form */

function emptyvalidation(entered, alertbox)
{
with (entered)
{
if (value==null || value=="")
{if (alertbox!="") {alert(alertbox);} return false;}
else {return true;}
}
}

function dateValidation(entered, alertbox)
{
	var dtstr = entered.value
		
	if(dtstr.length != 10)
	{
		alert(alertbox);
		return false;
	}
	

	var day = Number(dtstr.substring(0,2));
	
	if(day <= 31 && day >=0)
	{
	}
	else
	{
		alert(alertbox);
		return false;
	}
	
	var month = Number(dtstr.substring(3,5));
		
	if(month <= 12 && month >=1)
	{
	}
	else
	{
		alert(alertbox);
		return false;
	}
	
	var year = Number(dtstr.substring(6,10));
	
	if(year >= 1900 )
	{
	}
	else
	{
		alert(alertbox);
		return false;
	}
	
	
	
	return true;
}


function callbackvalidation(thisform)
{
with (thisform)
{
if (emptyvalidation(name,"Please enter your Name.")==false) {name.focus(); return false;};
if (emptyvalidation(dob,"Please enter your Date of Birth.")==false) {dob.focus(); return false;};
if (emptyvalidation(phone,"Please enter your Phone Number.")==false) {phone.focus(); return false;};
if (emptyvalidation(reason,"Please the reason for callback.")==false) {reason.focus(); return false;};
if (emptyvalidation(location,"Please select location or select 'Not Applicable' if location does not apply.")==false) {location.focus(); return false;};
if (dateValidation(dob	,"Date must be in the format dd-mm-yyyy")==false) {theDate.focus(); return false;};
}
}