		
		var root_link = "http://www.shecco.com";
		
		var currDiv = "";
		var currAnchor = "";
		var currImage = "";
		var currFunction = "";
		var secondaryFunction = "";
		var linkTimeout = "";
		
		var loaded = 0;
		
		var processRunning = 0;
		var priorityDiv = "";
		
		var imageNumDisp = 1;
		
		var imageLoader = new Array();
		imageLoader[0] = 1;
		imageLoader[1] = 10;
		imageLoader[2] = 6;
		imageLoader[3] = 5;
		imageLoader[4] = 7;
		imageLoader[5] = 4;
		imageLoader[6] = 2;
		imageLoader[7] = 9;
		imageLoader[8] = 8;
		imageLoader[9] = 3;
		
		// Detect if the browser is IE or not.
		// If it is not IE, we assume that the browser is NS.
		var IE = document.all?true:false
		
		// If NS -- that is, !IE -- then set up for mouse capture
		if (!IE) document.captureEvents(Event.MOUSEMOVE)
		
		// Main function to retrieve mouse x-y pos.s
		
		var tempX = 0;
		var tempY = 0;
		
		// Set-up to use getMouseXY function onMouseMove
		document.onmousemove = getMouseXY;
		
		// Temporary variables to hold mouse x-y pos.s
		var tempMouseX = 0
		var tempMouseY = 0
		
		// Main function to retrieve mouse x-y pos.s
		
		function getMouseXY(e) {
		  if (IE) { // grab the x-y pos.s if browser is IE
			tempMouseX = event.clientX + document.body.scrollLeft
			tempMouseY = event.clientY + document.body.scrollTop
		  } else {  // grab the x-y pos.s if browser is NS
			tempMouseX = e.pageX
			tempMouseY = e.pageY
		  }  
		  // catch possible negative values in NS4
		  if (tempMouseX < 0){tempMouseX = 0}
		  if (tempMouseY < 0){tempMouseY = 0}  
		  // show the position values in the form named Show
		  // in the text fields named MouseX and MouseY
		  
		  if (currFunction != '') {
			
			eval(currFunction);
			
		  }
		  
		  return true
		}
		
		function check_email(email) {
			
			ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
			
			for(i=0; i < email.length ;i++){
				if(ok.indexOf(email.charAt(i))<0){ 
					return (false);
				}	
			}
			
			re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
			re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
			if (!email.match(re) && email.match(re_two)) {
				return (-1);		
			} 
			
		
		}
		
		
		function check_phone(phone) {
			
			ok = "1234567890";
			while (phone.indexOf(' ') > 0) {
				phone = phone.replace(' ', '');
			}
			
	
			for(i=0; i < phone.length ;i++){
				if(ok.indexOf(phone.charAt(i))<0){ 
					return (false);
				}	
			}
			return (true);
		}
		
		function getScrollOffset() {
		
			setWindowProps();
		
			tempX = 0;
			tempY = 0;
			
			if (IE) { // grab the x-y pos.s if browser is IE
				tempX = document.body.scrollLeft;
				tempY = document.body.scrollTop;
			} else {
				tempX = window.pageXOffset;
				tempY = window.pageYOffset;
			}
			
			// catch possible negative values in NS4
			if (tempX < 0){tempX = 0}
			if (tempY < 0){tempY = 0}
			
			//alert(tempX + " " + tempY); 
		
		}

		function setWindowProps() {
			
			if (parseInt(navigator.appVersion)>3) {
				if (navigator.appName=="Netscape") {
					winW = window.innerWidth;
					winH = window.innerHeight;
				}
				if (navigator.appName.indexOf("Microsoft")!=-1) {
					winW = (document.body.offsetWidth-21);
					winH = (document.body.offsetHeight-4);
				}
			}
			
		}
		
		function init(resize) {
			
			loaded = 1;
			setWindowProps();
			//alert(winW + " " + winH);
			
			if (document.getElementById('formBox')) {
			
			formBoxLeft	= Math.round((winW-formBoxWidth)/2)+tempX;
			formBoxTop	= Math.round((winH-formBoxHeight)/2)+tempY;
			
				document.getElementById('formBox').style.left = formBoxLeft + "px";
				document.getElementById('formBox').style.top = formBoxTop + "px";
				document.getElementById('formBoxContent').style.left = (formBoxLeft+5) + "px";
				document.getElementById('formBoxContent').style.top = (formBoxTop+5) + "px";
				
			}
			
			if (resize == 0) {
				//alert(document.getElementById('currTab'));
				if (document.getElementById('currTab')) {
					tabOn = document.getElementById('currTab').value;
					//alert(tabOn);
				}
			
				setVisit();
				
				//alert(document.getElementById('TopBanner'));
				
				if (document.getElementById('TopBanner')) {
					setBanner(document.getElementById('SectionId').value);
				}
			}
		
		}
		
		function setVisit() {
		
			//currIp = document.getElementById('CurrIp').value;
			//currSession = document.getElementById('CurrSession').value;
		
			currHref = document.location.href;
			
			questionLocation = currHref.indexOf('?');
			
			variables = '';
			currPage = currHref;
			
			if (questionLocation != -1) {
				variables = currHref.split('?');
				currPage = variables[0];
				variables = variables[1].split('&');
			}
			
			//alert("functions.php?PageView=1&currPage="+currPage+"&variables="+variables+"&currIp="+currIp+"&currSession="+currSession);
			
			currDiv = 'hoverContent';
			sendAjax("functions.php?PageView=1&currPage="+currPage+"&variables="+variables,processAjax);
			
		}
		
		function setBanner(SectionId) {
			
			processRunning = 1;
			priorityDiv = 'TopBanner';
			//alert(priorityDiv);
			currDiv = 'TopBanner';
			sendAjax("functions.php?GetBanner=1&SectionId="+SectionId,processAjax);
			
		}
		
		function IsNumeric(sText) {
		
			var ValidChars = "0123456789.,";
			var IsNumber=true;
			var Char;
		 
			for (i = 0; i < sText.length && IsNumber == true; i++) { 
				Char = sText.charAt(i); 
				if (ValidChars.indexOf(Char) == -1) {
					IsNumber = false;
				}
			}
			
			return IsNumber;
		   
		}

		function nothing() {}
		
		function sendAjax(urlContent,returnFunc) {
		
			/*
			thisWidth = document.getElementById(currDiv).style.width.substring(0,((document.getElementById(currDiv).style.width.length*1)-2))*1;
			thisHeight = document.getElementById(currDiv).style.height.substring(0,((document.getElementById(currDiv).style.height.length*1)-2))*1;
			topPadding = Math.round(thisHeight/2);
			leftPadding = Math.round(thisWidth/2);
			
			document.getElementById(currDiv).innerHTML = '<div align="center" style="padding: '+topPadding+'px 0px 0px '+leftPadding+'px"><img src="'+root_link+'/images/main/ajax_loader.gif"></br></div>';
			*/
			if (loaded == 1) {
				
			createRequest();			
			
			request.open("GET", root_link + "/includes/scripts/" + urlContent, true);
			request.onreadystatechange = eval(returnFunc);
			request.send(null);
			
			}
			/*
			window.clearTimeout(ajaxTimeout);
			ajaxTimeout = window.setTimeout("request.send(null)",500);
			*/
			
		}
		
		function processAjax() {
		
			if(request.readyState == 4) {
				
				if(request.status == 200) {
				
					//alert(trim(request.responseText));
							
					if (priorityDiv != '') {
						if (currDiv != priorityDiv)	{
							currDiv = priorityDiv;
						}
					}
					
					//alert(currDiv + ' ' + priorityDiv);
			
					if((document.getElementById(currDiv)) && (trim(request.responseText) != '')) {
						//alert(document.getElementById('hoverMain').innerHTML);
						document.getElementById(currDiv).innerHTML = trim(request.responseText);
						document.getElementById(currDiv).style.visibility = "visible";
						//setOpacity(currDiv,9.7);
						/*
						clearTimeout(opacityTimeoutVar);
						displayOpacity(currDiv,1);
						*/
						//document.getElementById(currDiv).style.visibility = "visible";
						
						if (secondaryFunction != '') {
							eval(secondaryFunction);
							secondaryFunction = '';
						}
						
						if (currAnchor != '') {
							document.location.href = currAnchor;
							currAnchor = '';
						}
						
						if (priorityDiv != '') {
							if (currDiv == priorityDiv)	{
								priorityDiv = "";
							}
						}
						/*
						if (waitFunction != '') {
							eval(waitFunction);	
						}
						*/
						
					}
					
				}
				
			}
			
			processRunning = 0;
		
		}
		
		function pageScroll() {
			getScrollOffset();
			if ((tempY+winH) < 570) {
				window.scrollBy(0,10); // horizontal and vertical scroll increments
				scrolldelay = setTimeout("pageScroll()",20); // scrolls every 100 milliseconds
			}
		}
		
		function trim(stringToTrim) {
			return stringToTrim.replace(/^\s+|\s+$/g,"");
		}
		
		function check_errors(formName) {
			
			var submitOk = 1;
			var errorContent = '<div style="font-weight: bold; padding-bottom: 5px;">The following fields have not been entered:</div>';
			
			if (formName == 'InquiryForm') {
			
				var FullName = document.InquiryForm.FullName.value;
				var Email = document.InquiryForm.Email.value;
				var Organisation = document.InquiryForm.Organisation.value;
				var Subject = document.InquiryForm.Subject.value;
				var Content = document.InquiryForm.Content.value;
				var emptyField = document.InquiryForm.emptyField.value;
				   
				var SecurityWord = document.InquiryForm.SecurityWord.value;
				var SecurityWordVerify = document.InquiryForm.SecurityWordVerify.value;
				
				if (FullName == '') {
					submitOk = 0;
					errorContent += 'Please enter your full name.<br>';
				}
				
				if (Email == '') {
					submitOk = 0;
					errorContent += 'Please enter your email address.<br>';
				} else if (!check_email(Email)) {
					submitOk = 0;
					errorContent += 'Please enter a valid email address<br>';
				}
				
				if (Organisation == '') {
					submitOk = 0;
					errorContent += 'Please enter your organisation or company.<br>';
				}
				
				if (emptyField != '') {
					submitOk = 0;
					errorContent += 'Please dont spam us.<br>';
				}
				
				if (Subject == '') {
					submitOk = 0;
					errorContent += 'Please enter the subject of your enquiry.<br>';
				}
				
				if (Content == '') {
					submitOk = 0;
					errorContent += 'Please enter the text of your enquiry.<br>';
				} else if ((Content.toLowerCase().indexOf('href') != -1) || (Content.toLowerCase().indexOf('<a') != -1) || (Content.toLowerCase().indexOf('http') != -1) || (Content.toLowerCase().indexOf('www') != -1)) {
					submitOk = 0;
					errorContent += 'Please do not include links in your text<br>';
				}
				
				 if (SecurityWord != SecurityWordVerify) {
					submitOk = 0;
					errorContent += 'Your security word is not correct!<br>';
				}
				
				
			
			}
			
			if (formName == 'SubscriptionForm') {
			
				var FullName = document.SubscriptionForm.FullName.value;
				var Email = document.SubscriptionForm.Email.value;
				var Organisation = document.SubscriptionForm.Organisation.value;
				
				if (FullName == '') {
					submitOk = 0;
					errorContent += 'Please enter your full name.<br>';
				}
				
				if (Email == '') {
					submitOk = 0;
					errorContent += 'Please enter your email address.<br>';
				} else if (!check_email(Email)) {
					submitOk = 0;
					errorContent += 'Please enter a valid email address<br>';
				}
				
				if (Organisation == '') {
					submitOk = 0;
					errorContent += 'Please enter your organisation or company.<br>';
				}
				
			
			}
			
			
			if (formName == 'UploadApplication') {
			
				var Name 		= document.UploadApplication.Name.value;
				var Email 		= document.UploadApplication.Email.value;
				var Phone 		= document.UploadApplication.Phone.value;
				var Q1 			= document.UploadApplication.Q1.value;
				var Q2 			= document.UploadApplication.Q2.value;
				var URL 		= document.UploadApplication.URL.value;
				
				var Woerter = '';
				errorContent = '<div style="font-weight: bold; padding-bottom: 5px;">Please check your entries:</div>';
				if (Name == '') {
					submitOk = 0;
					errorContent += 'Please enter your Name.<br>';
					document.UploadApplication.Name.style.borderColor = '#00a33d';
					document.getElementById('FormError').style.visibility = 'visible';
				}
				
				if (Email == '') {
					submitOk = 0;
					errorContent += 'Please enter your email address.<br>';
					document.UploadApplication.Email.style.borderColor = '#00a33d';
					document.getElementById('FormError').style.visibility = 'visible';
				}  else if (!check_email(Email)) {
					submitOk = 0;
					errorContent += 'Please enter a valid email address<br>';
				}
				if (Phone == '') {
					submitOk = 0;
					errorContent += 'Please enter your phone number.<br>';
					document.UploadApplication.Phone.style.borderColor = '#00a33d';
					document.getElementById('FormError').style.visibility = 'visible';
				}  else if (!check_phone(Phone)) {
					submitOk = 0;
					errorContent += 'Phone number: Please only use numbers.<br>';
				}
				
							
							
				if (Q1 == '') {
					submitOk = 0;
					errorContent += 'Please answer the first question.<br>';
					document.UploadApplication.Q1.style.borderColor = '#00a33d';
					document.getElementById('FormError').style.visibility = 'visible';
				} else {
					
					Woerter = Q1.split(" ");
					if (Woerter.length > 100 ) {
					submitOk = 0;
					errorContent += 'You have entered more then 100 words for answering the first question.<br>';
					document.UploadApplication.Q1.style.borderColor = '#00a33d';
					document.getElementById('FormError').style.visibility = 'visible';
					}
				} 
				
				if (Q2 == '') {
					submitOk = 0;
					errorContent += 'Please answer the second question.<br>';
					document.UploadApplication.Q2.style.borderColor = '#00a33d';
					document.getElementById('FormError').style.visibility = 'visible';
				}  else {
					
					Woerter = Q2.split(" ");
					
					if (Woerter.length > 250 ) {
					submitOk = 0;
					errorContent += 'You have entered more then 250 words for answering the first question.<br>';
					document.UploadApplication.Q2.style.borderColor = '#00a33d';
					document.getElementById('FormError').style.visibility = 'visible';
					}
				} 
			}
			
						
			if (submitOk == 1) {
				return true;	
			} else {
				
				document.location.href = '#formErrors';
				document.getElementById('formErrorsDiv').style.padding = "20px 0px 20px 0px";
				document.getElementById('formErrorsDiv').innerHTML = errorContent;
				return false;
			}
			
		}
		
		function test() {
			currDiv = 'test';
			sendAjax("functions.php?test=1",processAjax);
		}
		
		function displayLinks(num) {
			
			if ((processRunning == 0) && (loaded == 1)) {
			
				clearTimeout(linkTimeout);
				thisDiv = 'subs'+num;
				
				if ((thisDiv != currDiv) && (currDiv.indexOf('subs') != -1)) {
					hideLinksComplete();
				}
				
				currDiv = 'subs'+num;
				document.getElementById(currDiv).style.visibility = 'visible';
			
			}
			
		}
		
		function hideLinks() {
			
			if (processRunning == 0) {
			
				linkTimeout = window.setTimeout("hideLinksComplete()",500);
				
			}
			
		}
		
		function hideLinksComplete() {
			
			if (processRunning == 0) {
		
				if (currDiv != '') {
					document.getElementById(currDiv).style.visibility = 'hidden';
					currDiv = '';
				}
				
			}
			
		}
		
		function loadHomeImage() {
			
			if (currImage == '') {
				currImage = document.getElementById('ImageName').value;
			}
			
			loadHomeImageBg(1);
		
		}
		
		function loadHomeImageBg(num) {
			
			if (num > 1) {
			//changeOpac(100,'mainImage'+imageLoader[num-2]);
			}
			
			var imageNum = imageLoader[num-1];
			if (imageLoader[num-1] < 10) {
				imageNum = '0'+imageLoader[num-1];
			}
			
			//alert(num);
			
			//var bgImage = root_link+'/images/banners/'+currImage+'_'+imageNum+'.jpg';
		
			//document.getElementById('mainImage'+imageLoader[num-1]).style.backgroundImage = 'url('+bgImage+')';
			//document.getElementById('mainImage'+imageLoader[num-1]).innerHTML = '<img src="'+bgImage+'" width="200" height="175" hspace="0" vspace="0" border="0"><br>'; 
			
			var imageOther = 2;
			if (imageNumDisp == 2) {
				imageOther = 1;	
			}
			
			var id = 'mainImage'+imageNumDisp+imageLoader[num-1];
			var idOther = 'mainImage'+imageOther+imageLoader[num-1];
			
			document.getElementById(idOther).style.zIndex = 0;
			document.getElementById(id).style.zIndex = 1;
			//alert(document.getElementById(idOther).style.zIndex + ' ' + document.getElementById(id).style.zIndex + ' ' + idOther);
			//changeOpac(0, id);
			//alert(id);
			opacity(id, 100, 0, 200);
			if (num <= 9) {
			window.setTimeout("loadHomeImageBg("+(num+1)+")",100);
			} else {
				if (document.getElementById('ImageNameNext').value != '') {
					window.setTimeout("loadHomeImageReplace()",10000);
				}
			}
		}
		
		function loadHomeImageDetails() {
		
			CurrImage = document.getElementById('ImageId').value*1;
			currDiv = 'mainImageDetails';
			sendAjax("functions.php?getHomeImage=1&ImageId="+CurrImage,processAjax);
			loadHomeImageBg(1);
		
		}
		
		function loadHomeImageReplace() {
			
			if (imageNumDisp == 1) {
				imageNumOther = 2;
			} else {
				imageNumOther = 1;
			}
			
			var imageNum = '0';
			
			var currImage = document.getElementById('ImageNameNext').value;
			//alert(currImage);
						
			for (i = 1; i <= 10; i++) {
				imageNum = '0'+i;
				if (i == 10) {
				imageNum = '10';	
				}
				document.getElementById('mainImage'+imageNumOther+i).style.zIndex = 1;
				document.getElementById('mainImage'+imageNumDisp+i).style.zIndex = 0;
				changeOpac(100, 'mainImage'+imageNumDisp+i)
				//var bgImage = root_link+'/images/banners/'+currImage+'_'+imageNum+'.jpg';
				var bgImage = '../../images/banners/'+currImage+'_'+imageNum+'.jpg';
				//alert('mainImage'+imageNumDisp+i);
				document.getElementById('mainImage'+imageNumDisp+i).style.backgroundImage = 'url('+bgImage+')';
			}
			
			imageNumDisp = imageNumOther;
			
			window.setTimeout("loadHomeImageDetails()",2000);	
			
		}
		
		function opacity(id, opacStart, opacEnd, millisec) {
		    //speed for each frame
		    var speed = Math.round(millisec / 100);
		    var timer = 0;
		
		    //determine the direction for the blending, if start and end are the same nothing happens
		    if(opacStart > opacEnd) {
		        for(i = opacStart; i >= opacEnd; i--) {
		            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
		            timer++;
		        }
		    } else if(opacStart < opacEnd) {
		        for(i = opacStart; i <= opacEnd; i++)
		            {
		            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
		            timer++;
		        }
		    }
		}
		
		//change the opacity for different browsers
		function changeOpac(opacity, id) {
		    var object = document.getElementById(id).style;
		    object.opacity = (opacity / 100);
		    object.MozOpacity = (opacity / 100);
		    object.KhtmlOpacity = (opacity / 100);
		    object.filter = "alpha(opacity=" + opacity + ")";
			//alert(opacity);
		} 
		
		/*
		*/
		
		function saveUserClick(Id,Report) {
		
			//alert(Email);
			if (Id != 0) { 
			sendAjax("functions.php?setEmailView=1&Id="+Id+"&ReportId="+Report,nothing);
			//alert("functions.php?setEmailView=1&Email="+Email+"&ReportId="+Report);
			}
		
		}
