/* slideBuild.js
2010 HamillBros

Builds the HTML for s3Slider script.
*/


/* Descriptions for each slide and image

to use individual descriptions for each image
build the array below 1 to amount of images with corresponding description
then change the content of the description <span> to slideDesc[slideSlPa][cImg]
*/

slideDesc = new Array()

slideDesc[1] = new Array()
slideDesc[1][0] = "31330" // Text orientation. one number per image in slide. 0 = top, 1 = right, 2 = bottom, 3 = left
slideDesc[1][1] = "<strong>Child Portrait Photographer of the year 2011</strong><br/><a href=\"contactus.php\"> > Contact us now</a>"


slideDesc[2] = new Array()
slideDesc[2][0] = "31313"
slideDesc[2][1] = "<strong>Winner Classical Wedding Image of the Year 2009, 2010 and 2011</strong><br/><a href=\"contactus.php\"> > Contact us now</a>"


slideDesc[3] = new Array()
slideDesc[3][0] = "32110"
slideDesc[3][1] = "<strong>Get two photographers for the price of one at your wedding.</strong><br/><a href=\"contactus.php\"> > Contact us now</a>"


slideDesc[4] = new Array()
slideDesc[4][0] = "23120"
slideDesc[4][1] = "<strong>&euro;1000 Weddings!!</strong><br/><a href=\"contactus.php\"> > Contact us now</a>"


slideDesc[5] = new Array()
slideDesc[5][0] = "13330"
slideDesc[5][1] = "<strong>Special Offers on Weddings</strong><br/><a href=\"contactus.php\"> > Contact us now</a>"


slideDesc[6] = new Array()
slideDesc[6][0] = "10321"
slideDesc[6][1] = "<strong>&euro;1000 Weddings!!</strong><br/><a href=\"contactus.php\"> > Contact us now</a>"


slideDesc[7] = new Array()
slideDesc[7][0] = "11231"
slideDesc[7][1] = "<strong>Get two photographers for the price of one at your wedding.</strong><br/><a href=\"contactus.php\"> > Contact us now</a>"



// Build Variables

slideName = "slider" // Name of this slide (must correlate to styles)

slideImPa = "images/general/MainShow/" // Slide/Image path
slideImNa = "" // Name of the images, to be followed by a number
slideImTy = ".jpg" // image type - extension

slideImWi = 920 // width of images
slideImHi = 360 // height of images

slideNumb = slideDesc.length - 1 // Amount of slides available, may be set to constant
slideSlPa = Math.floor(Math.random()*slideNumb)+1 // Which directory (slide) to use. may set to constant.
slideImNu = 5 // slideDesc[slideSlPa].length - 1 // How many images per slide, may set to constant


// Do not change these variables.

slideTxOr = new Array("top","right","bottom","left") // determines orientation of text
slideUsRa = "0" // used random number populated here later
cImg = 0 // current image to be written. 0 does not exist

// start the slide's HTML - Build the images
document.write ("<div id=\"" + slideName + "\"><div id=\"" + slideName + "Content\">")

	for ( i = 1 ; i <= slideImNu ; i++ ) {

		while (slideUsRa.indexOf(cImg) != -1) { // while random number has not been added to slideUsRa
			cImg = Math.floor(Math.random()*slideImNu)+1 // generate random number as cur no
		}
		slideUsRa += cImg // when random number is found that has not been used, ass to slideUsRa

		// write an image
		document.write ("<div class=\"" + slideName + "Image\">"
		+ "<img src=\"" + slideImPa + "/slide" + slideSlPa + "/" + cImg + slideImNa + slideImTy + "\" width=" + slideImWi + " height=" + slideImHi + " />"
		+ "<span class=\"" + slideTxOr[parseInt(slideDesc[slideSlPa][0].charAt(cImg-1))] + "\">" + slideDesc[slideSlPa][1] + "</span></div>") }

// end the slide's HTML
document.write ("<div class=\"clear " + slideName + "Image\"></div></div></div>")



