

var photos=new Array()
var photoslink=new Array()
var which=0
var photoslenght = 40

//define images. You can have as many as you want:
photos[0]="images/smartlocal.jpg"
photos[1]="images/vistreet.jpg"
photos[2]="images/bodyperfect.jpg"
photos[3]="images/cherbus.jpg"
photos[4]="images/a2voip.jpg"
photos[5]="images/designinmind.jpg"
photos[6]="images/businessfinder.jpg"
photos[7]="images/cuinuk.jpg"
photos[8]="images/infofed.jpg"
photos[9]="images/searchaco.jpg"
photos[10]="images/shoppinglinx.jpg"
photos[11]="images/pups.jpg"
photos[12]="images/the-shop_L.jpg"
photos[13]="images/essef.jpg"
photos[14]="images/ablenet.jpg"
photos[15]="images/hebdan_L.jpg"
photos[16]="images/happydaysdirect_L.jpg"
photos[17]="images/shuffty_L.jpg"

//Set corresponding URLs for above images. Define ONLY if variable linkornot equals "1"
photoslink[0]="http://www.smartlocal.co.uk"
photoslink[1]="http://www.vistreet.com"
photoslink[2]="http://www.bodyperfectbeauty.co.uk"
photoslink[3]="http://cherubs.shoppinglinx.co.uk"
photoslink[4]="http://www.a2voip.com"
photoslink[5]="http://www.designinmind.co.uk"
photoslink[6]="http://www.businessfinder.co.uk"
photoslink[7]="http://www.cuinuk.co.uk"
photoslink[8]="http://www.infofed.co.uk"
photoslink[9]="http://www.searchaco.co.uk"
photoslink[10]="http://www.shoppinglinx.co.uk"
photoslink[11]="http://pawsforpups.shoppinglinx.co.uk"
photoslink[12]="http://www.theshop-northberland.co.uk"
photoslink[13]="http://www.essefceilings.com"
photoslink[14]="http://www.ablenet.co.uk"
photoslink[15]="http://www.hebdenbridgeequestriancentre.co.uk"
photoslink[16]="http://www.happydaysdirect.co.uk"
photoslink[17]="http://www.shuffty.com"


//do NOT edit pass this line

var preloadedimages=new Array()
for (i=0;i<photoslenght;i++){
preloadedimages[i]=new Image()
preloadedimages[i].src=photos[i]
}


function applyeffect(){
if (document.all && photoslider.filters){
photoslider.filters.revealTrans.Transition=Math.floor(Math.random()*23)
photoslider.filters.revealTrans.stop()
photoslider.filters.revealTrans.apply()
}
}



function playeffect(){
if (document.all && photoslider.filters)
photoslider.filters.revealTrans.play()
}

function Zero(){
if (which<photoslenght-1){
which++
applyeffect()
document.getElementById('imglink').href = photoslink[0]
document.images.photoslider.src=photos[0]
playeffect()
}
}

function One(){
if (which<photoslenght-1){
which++
applyeffect()
document.images.photoslider.src=photos[1]
document.getElementById('imglink').href = photoslink[1]
playeffect()
}
}


function Two(){
if (which<photoslenght-1){
which++
applyeffect()
document.images.photoslider.src=photos[2]
document.getElementById('imglink').href = photoslink[2]
playeffect()

}
}

function Three(){
if (which<photoslenght-1){
which++
applyeffect()
document.images.photoslider.src=photos[3]
document.getElementById('imglink').href = photoslink[3]
playeffect()

}
}

function four(){
if (which<photoslenght-1){
which++
applyeffect()
document.images.photoslider.src=photos[4]
document.getElementById('imglink').href = photoslink[4]
playeffect()

}
}

function five(){
if (which<photoslenght-1){
which++
applyeffect()
document.images.photoslider.src=photos[5]
document.getElementById('imglink').href = photoslink[5]
playeffect()

}
}

function six(){
if (which<photoslenght-1){
which++
applyeffect()
document.images.photoslider.src=photos[6]
document.getElementById('imglink').href = photoslink[6]
playeffect()

}
}

function seven(){
if (which<photoslenght-1){
which++
applyeffect()
document.images.photoslider.src=photos[7]
document.getElementById('imglink').href = photoslink[7]
playeffect()

}
}

function eight(){
if (which<photoslenght-1){
which++
applyeffect()
document.images.photoslider.src=photos[8]
document.getElementById('imglink').href = photoslink[8]
playeffect()

}
}
function nine(){
if (which<photoslenght-1){
which++
applyeffect()
document.images.photoslider.src=photos[9]
document.getElementById('imglink').href = photoslink[9]
playeffect()

}
}

function ten(){
if (which<photoslenght-1){
which++
applyeffect()
document.images.photoslider.src=photos[10]
document.getElementById('imglink').href = photoslink[10]
playeffect()

}
}
function eleven(){
if (which<photoslenght-1){
which++
applyeffect()
document.images.photoslider.src=photos[11]
document.getElementById('imglink').href = photoslink[11]
playeffect()

}
}
function twelve(){
if (which<photoslenght-1){
which++
applyeffect()
document.images.photoslider.src=photos[12]
document.getElementById('imglink').href = photoslink[12]
playeffect()

}
}
function thirteen(){
if (which<photoslenght-1){
which++
applyeffect()
document.images.photoslider.src=photos[13]
document.getElementById('imglink').href = photoslink[13]
playeffect()

}
}
function fourteen(){
if (which<photoslenght-1){
which++
applyeffect()
document.images.photoslider.src=photos[14]
document.getElementById('imglink').href = photoslink[14]
playeffect()

}
}
function fifteen(){
if (which<photoslenght-1){
which++
applyeffect()
document.images.photoslider.src=photos[15]
document.getElementById('imglink').href = photoslink[15]
playeffect()

}
}
function sixteen(){
if (which<photoslenght-1){
which++
applyeffect()
document.images.photoslider.src=photos[16]
document.getElementById('imglink').href = photoslink[16]
playeffect()

}
}
function seventeen(){
if (which<photoslenght-1){
which++
applyeffect()
document.images.photoslider.src=photos[17]
document.getElementById('imglink').href = photoslink[17]
playeffect()

}
}

//var re_mail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z])+$/;
//function fcnSendEmail() {
//	if ( document.form1.name.value == "" ) 
//	{ 
//		alert("Please fill in your name")
//	}
//	else if (document.form1.message.value == "" )
//	{ 
//		alert("Please fill in the message box")
//	}
//	else if (document.form1.email.value == "")
//	{
//		alert("Please fill in your email")
//	}
//	else if (document.form1.txtCaptcha.value == "")
//	{
//		alert("Please fill in the security code")
//	}
//	else
//	{
//	document.getElementById('form1').submit();	
//	}	
//}

//
// If the string matches the regular expression it is all letters
//
function isAlphabet(fString)
{
	var alphaExp = /^([a-zA-Z]+)$/;
	
	if(fString.match(alphaExp))
	{
		return true;
	}
	else
	{
		return false;
	}
}

//
// Check the email string entered
//
function echeck(str)
{
    var at      = "@";
    var dot     = ".";
	var lat     = str.indexOf(at)
	var lstr    = str.length
	var ldot    = str.indexOf(dot)
		
    if (str.indexOf(at) == -1)
    {
        alert("Invalid Email Address")
        return false
    }

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr)
	{
	   alert("Invalid Email Address")
	   return false
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr)
	{
        alert("Invalid Email Address")
	    return false
	}

	 if (str.indexOf(at,(lat+1))!=-1)
	 {
        alert("Invalid Email Address")
	    return false
	 }

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot)
	 {
        alert("Invalid Email Address")
	    return false
	 }

	 if (str.indexOf(dot,(lat+2))==-1)
	 {
        alert("Invalid Email Address")
	    return false
	 }
		
	 if (str.indexOf(" ")!=-1)
	 {
        alert("Invalid Email Address")
	    return false
	 }

	 return true					
}

// Declaring required variables
var digits = "0123456789";

// non-digit characters which are allowed in phone numbers
var phoneNumberDelimiters = "()- ";

// characters which are allowed in international phone numbers
// (a leading + is OK)
var validWorldPhoneChars = phoneNumberDelimiters + "+";

// Minimum no of digits in an international phone no.
var minDigitsInIPhoneNumber = 10;

function isInteger(s)
{   var i;

    for (i = 0; i < s.length; i++)
    {   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag)
{   var i;
    var returnString = "";

    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkInternationalPhone(strPhone)
{
    s = stripCharsInBag(strPhone,validWorldPhoneChars);
    return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}


