// LEFT NAVIGATION ////////////////////////////////////////////////////////////////////////////////////////////

function leftnav(){
var myimages=new Array()

myimages[1]="../buttons/identprob1.gif"
myimages[2]="../buttons/identap1.gif"
myimages[3]="../buttons/pdf1.gif"
myimages[4]="../buttons/faq1.gif"
myimages[5]="../buttons/stainless_1.gif"
myimages[6]="../buttons/fragranite_1.gif"
myimages[7]="../buttons/ceramic_1.gif"
myimages[8]="../buttons/astron_1.gif"
myimages[9]="../buttons/fradura_1.gif"
myimages[10]="../buttons/taps_1.gif"
myimages[11]="../buttons/bins_1.gif"
myimages[12]="../buttons/soap_1.gif"


// links
var imagelinks=new Array()
imagelinks[1]="../home/idprob.html"
imagelinks[2]="../home/identify_tap.html"
imagelinks[3]="../home/pdf.html"
imagelinks[4]="../home/faq.html"
imagelinks[5]="../home/stainless_sinks.shtml"
imagelinks[6]="../home/fragranite_sinks.shtml"
imagelinks[7]="../home/ceramic_sinks.shtml"
imagelinks[8]="../home/astron_sinks.shtml"
imagelinks[9]="../home/fradura_sinks.shtml"
imagelinks[10]="../home/taps.shtml"
imagelinks[11]="../home/bins.shtml"
imagelinks[12]="../home/soap.shtml"


// alternate text
var alttext=new Array()
alttext[1]="Identify the problem with your tap"
alttext[2]="Identify the type of tap you have"
alttext[3]="Down-Load a PDF instruction leaflet of your tap"
alttext[4]="Some Frequently Asked Questions"
alttext[5]="Stainless Steel Sinks"
alttext[6]="Fragranite Sinks"
alttext[7]="Ceramic Sinks"
alttext[7]="Astron Sinks"
alttext[7]="Fradura Sinks"
alttext[10]="Taps"
alttext[11]="Waste Management / Bins"
alttext[12]="Soap / Lotion Dispenser"



// Image Name
var myname=new Array()
myname[1]="img1"
myname[2]="img2"
myname[3]="img3"
myname[4]="img4"
myname[5]="img5"
myname[6]="img6"
myname[7]="img7"
myname[8]="img8"
myname[9]="img9"
myname[10]="img10"
myname[11]="img20"
myname[12]="img21"


//onmouse down
var myid1=new Array()
myid1[1]="javascript:buttonPress('img1')"
myid1[2]="javascript:buttonPress('img2')"
myid1[3]="javascript:buttonPress('img3')"
myid1[4]="javascript:buttonPress('img4')"
myid1[5]="javascript:buttonPress('img5')"
myid1[6]="javascript:buttonPress('img6')"
myid1[7]="javascript:buttonPress('img7')"
myid1[8]="javascript:buttonPress('img8')"
myid1[9]="javascript:buttonPress('img9')"
myid1[10]="javascript:buttonPress('img10')"
myid1[11]="javascript:buttonPress('img20')"
myid1[12]="javascript:buttonPress('img21')"


//onmouse over
var myid2=new Array()
myid2[1]="javascript:buttonOver('img1')"
myid2[2]="javascript:buttonOver('img2')"
myid2[3]="javascript:buttonOver('img3')"
myid2[4]="javascript:buttonOver('img4')"
myid2[5]="javascript:buttonOver('img5')"
myid2[6]="javascript:buttonOver('img6')"
myid2[7]="javascript:buttonOver('img7')"
myid2[8]="javascript:buttonOver('img8')"
myid2[9]="javascript:buttonOver('img9')"
myid2[10]="javascript:buttonOver('img10')"
myid2[11]="javascript:buttonOver('img20')"
myid2[12]="javascript:buttonOver('img21')"


//onmouse out
var myid3=new Array()
myid3[1]="javascript:buttonOff('img1')"
myid3[2]="javascript:buttonOff('img2')"
myid3[3]="javascript:buttonOff('img3')"
myid3[4]="javascript:buttonOff('img4')"
myid3[5]="javascript:buttonOff('img5')"
myid3[6]="javascript:buttonOff('img6')"
myid3[7]="javascript:buttonOff('img7')"
myid3[8]="javascript:buttonOff('img8')"
myid3[9]="javascript:buttonOff('img9')"
myid3[10]="javascript:buttonOff('img10')"
myid3[11]="javascript:buttonOff('img20')"
myid3[12]="javascript:buttonOff('img21')"


///////////////////////////////


document.write('<div align="center"><img src="../buttons/services_head.gif" border="0"></div><div align="right">')

for ( var i=1; i<=4; i++ )

document.write('<div align="right"><a href="'+imagelinks[i]+'"><img name="'+myname[i]+'" src="'+myimages[i]+'" border="0" alt="'+alttext[i]+'" onmousedown="'+myid1[i]+'" onmouseout="'+myid3[i]+'" onmouseover="'+myid2[i]+'" vspace="1"></a>')
document.write('</div>')

document.write('<div align="center"><br><img src="../buttons/select_product.gif" border="0"></div><div align="right">')

for ( var i=5; i<=12; i++ )
document.write('<div align="right"><a href="'+imagelinks[i]+'"><img name="'+myname[i]+'" src="'+myimages[i]+'" border="0" alt="'+alttext[i]+'" onmousedown="'+myid1[i]+'" onmouseout="'+myid3[i]+'" onmouseover="'+myid2[i]+'" vspace="1"></a>')

document.write('</div>')

}  

// TOP BUTTONS///////////////////////////////////////////////////////////////////////////////////////////////////

function imglink(){
var myimages=new Array()

//specify images below. You can have as many as you wish
myimages[1]="../pics/go_back.gif"
myimages[2]="../pics/view_cart.gif"
myimages[3]="../pics/print_page.gif"
myimages[4]="../pics/email.gif"
myimages[5]="../pics/favorites.gif"


//specify corresponding links below
var imagelinks=new Array()
imagelinks[1]="javascript:history.go(-1)"
imagelinks[2]="JavaScript: newWindow = openWin('https://shop.south-services.com/new/andycart.cgi?command=view', 'Southshop', 'width=750,height=500,toolbar=0,location=center,directories=0,status=1,menuBar=0,scrollBars=1,resizable=1'); newWindow.focus()"
//imagelinks[2]="JavaScript: newWindow = openWin('http://10.0.0.2/South Services/shop/shop/andycart.cgi?command=view', 'Southshop', 'width=750,height=500,toolbar=0,location=center,directories=0,status=1,menuBar=0,scrollBars=1,resizable=1'); newWindow.focus()"
imagelinks[3]="javascript:print();javascript:mouse_click()"
imagelinks[4]="mailto:sales@south-services.com"//?SUBJECT=Hello&BODY=HELLO"
imagelinks[5]="javascript:makeLink()"


//specify corresponding alternate text
var alttext=new Array()
alttext[1]="Go back to previous page"
alttext[2]="View and buy items you have placed in the shopping cart"
alttext[3]="Print Page"
alttext[4]="Send us an e-mail"
alttext[5]="Add our site to your favorites list"

for ( var i=1; i<=5; i++ ) 
document.write('<a href="'+imagelinks[i]+'"><img src="'+myimages[i]+'" border="0" alt="'+alttext[i]+'"></a>')
}

// TOP NAV (TEXT LINKS) /////////////////////////////////////////////////////////////////////////////////////////

function textlink(){
var mytext=new Array()

//specify text below. You can have as many as you wish
mytext[1]="Home"
mytext[2]="Services"
mytext[3]="About Us"
mytext[4]="Contact Us"
mytext[5]="Terms & Conditions"
mytext[6]="INTRANET"


//specify corresponding links below
var textlinks=new Array()
textlinks[1]="../home/home.html"
textlinks[2]="../home/services.html"
textlinks[3]="../home/about.html"
textlinks[4]="../home/contact.html"
textlinks[5]="../home/terms_and_conditions.html"
textlinks[6]="http://10.0.0.2/"

document.write('&nbsp;')
for ( var i=1; i<=6; i++ ) 
document.write('<span class="topnav">|</span><a href="'+textlinks[i]+'" class="topnav">&nbsp;'+mytext[i]+'&nbsp;&nbsp;&nbsp;</a>')
}

// ADDRESS //////////////////////////////////////////////////////////////////////////////////////////////////////

function address(){
document.write('<span class="address"><br><b>SOUTH SERVICES</b>',
'<br>PO BOX 123, PULBOROUGH, RH20 2FD<br>',
'sales@south-services.com<br>&nbsp;</span>')
}

// TELEPHONE NUMBER /////////////////////////////////////////////////////////////////////////////////////////////

function telephone(){
document.write('<br><div align="left"><b class="tel">&nbsp;&nbsp;(T) +44 (0)844 800 3346<br>',
'&nbsp;&nbsp;<span class="closenumber">(Lo-call number 5p per min)</span><br>',
'&nbsp;&nbsp;(F) +44 (0)1903 744566<br>',
'&nbsp;&nbsp;<small>Normal office hours<br>',
'&nbsp;&nbsp;&nbsp;09.00 - 17.00 Mon - Fri</small></b><div><br>') 

document.write('<form name="search" action="../search/search.cgi" method="get"><h6>&nbsp;&nbsp;SEARCH&nbsp;OUR&nbsp;SITE<br>&nbsp;&nbsp;<input type="text" name="search" size="11" value=""><input type="submit" name="submit" value="GO"></h6></form>')

}

// RIGHT AD /////////////////////////////////////////////////////////////////////////////////////////////////////

function rightad(){

// Get today's current date.
var now = new Date();

// Array list of days.
var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');

// Array list of months.
var months = new Array('01','02','03','04','05','06','07','08','09','10','11','12');

//Array('January','February','March','April','May','June','July','August','September','October','November','December');

// Calculate the number of the current day in the week.
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();

// Calculate four digit year.
function fourdigits(number)	{
	return (number < 1000) ? number + 1900 : number;
								}

// Join it all together
today =  days[now.getDay()] + " " +
               date + "/" +
                months[now.getMonth()] + "/" +
                (fourdigits(now.getYear())) ;

// Print out the data.
document.write("<div align='center'><span class='date'>Today\'s date is " +today+ ".</span></div><br>");

//////////////////////////////////////////////////

/*Example message arrays for the two demo scrollers*/

var pausecontent=new Array()
pausecontent[0]='<p class="close"><a href="JavaScript:newWindow = openWin(\'../franke/tap_extras/monosales.shtml\', \'Tapextras\', \'width=750,height=500,toolbar=0,location=center,directories=0,status=1,menuBar=0,scrollBars=1,resizable=1\'); newWindow.focus()">Professional Monobloc</a><br><span class="close1">Compression tap available in white & Brown</span></p>'
pausecontent[1]='<p class="close"><a href="JavaScript: newWindow = openWin(\'../franke/tap_extras/qtsales.shtml\', \'Tapextras\', \'width=750,height=500,toolbar=0,location=center,directories=0,status=1,menuBar=0,scrollBars=1,resizable=1\'); newWindow.focus()">Professional 1/4 Turn</a><br><span class="close1">Quarter Turn tap available in white & Brown</span></p>'
pausecontent[2]='<p class="close"><a href="JavaScript: newWindow = openWin(\'../franke/tap_extras/luganosales.shtml\', \'Tapextras\', \'width=750,height=500,toolbar=0,location=center,directories=0,status=1,menuBar=0,scrollBars=1,resizable=1\'); newWindow.focus()">Lugano</a><br><span class="close1">Quarter Turn tap available in Champagne/Beige & Brown<span></p>'
pausecontent[3]='<p class="close"><a href="JavaScript: newWindow = openWin(\'../franke/tap_extras/genevasales.shtml\', \'Tapextras\', \'width=750,height=500,toolbar=0,location=center,directories=0,status=1,menuBar=0,scrollBars=1,resizable=1\'); newWindow.focus()">Geneva</a><br><span class="close1">Quarter Turn tap available in Silk Steel & White</span></p>'
pausecontent[4]='<p class="close"><a href="JavaScript: newWindow = openWin(\'../franke/tap_extras/arosasales.shtml\', \'Tapextras\', \'width=750,height=500,toolbar=0,location=center,directories=0,status=1,menuBar=0,scrollBars=1,resizable=1\'); newWindow.focus()">Arosa</a><br><span class="close1">Single Lever tap available in Chrome</span></p>'


/***********************************************
* Pausing up-down scroller- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

function pausescroller(content, divId, divClass, delay){
this.content=content //message array content
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
this.hiddendivpointer=1 //index of message array for hidden div
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
var scrollerinstance=this
if (window.addEventListener) //run onload in DOM2 browsers
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent) //run onload in IE5.5+
window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
setTimeout(function(){scrollerinstance.initialize()}, 500)
}

// -------------------------------------------------------------------
// initialize()- Initialize scroller method.
// -Get div objects, set initial positions, start up down animation
// -------------------------------------------------------------------

pausescroller.prototype.initialize=function(){
this.tickerdiv=document.getElementById(this.tickerid)
this.visiblediv=document.getElementById(this.tickerid+"1")
this.hiddendiv=document.getElementById(this.tickerid+"2")
this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.getinline(this.visiblediv, this.hiddendiv)
this.hiddendiv.style.visibility="visible"
var scrollerinstance=this
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent) //Clean up loose references in IE
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}


// -------------------------------------------------------------------
// animateup()- Move the two inner divs of the scroller up and in sync
// -------------------------------------------------------------------

pausescroller.prototype.animateup=function(){
var scrollerinstance=this
if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
setTimeout(function(){scrollerinstance.animateup()}, 50)
}
else{
this.getinline(this.hiddendiv, this.visiblediv)
this.swapdivs()
setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
}
}

// -------------------------------------------------------------------
// swapdivs()- Swap between which is the visible and which is the hidden div
// -------------------------------------------------------------------

pausescroller.prototype.swapdivs=function(){
var tempcontainer=this.visiblediv
this.visiblediv=this.hiddendiv
this.hiddendiv=tempcontainer
}

pausescroller.prototype.getinline=function(div1, div2){
div1.style.top=this.visibledivtop+"px"
div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
}

// -------------------------------------------------------------------
// setmessage()- Populate the hidden div with the next message before it's visible
// -------------------------------------------------------------------

pausescroller.prototype.setmessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
setTimeout(function(){scrollerinstance.setmessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=this.content.length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
this.animateup()
}
}

pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle) //if DOM2
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}

//document.write('<table width="140"><tr><td><p align="center" class="navhit"><b>Limited Offers</b>');
//new pausescroller(pausecontent, "pscroller1", "someclass", 3000)
//document.write('</p></td></tr></table>');
////////////////////////////////////////////////
} 

// LEFT TEXT ////////////////////////////////////////////////////////////////////////////////////////////////////

function lefttext(){
document.write('')
//<div align="left"><table border="0" cellpadding="5" cellspacing="0" width="150"><tr><td align="center"><table border="0" cellpadding="5" cellspacing="0" width="130" style="border:1px solid red"><tr><td align="center" class="red">All prices shown are discounted from shop prices!<br>( <small>inc. free delivery for orders £500 and over</small> )</td></tr></table></td></tr></table></div>
}

// FORM TAG /////////////////////////////////////////////////////////////////////////////////////////////////////

function form(){
//document.write('<form action="http://10.0.0.2/South Services/shop/shop/andycart.cgi" method="post" target="Southshop">')
document.write('<form action="https://shop.south-services.com/new/andycart.cgi" method="post" target="Southshop">')
}

function form2(){
//document.write('<form action="http://10.0.0.2/South Services/shop/shop/andycart.cgi" method="post">')
document.write('<form action="https://shop.south-services.com/new/andycart.cgi" method="post">')
}


// SEARCH //////////////////////////////////////////////////////////////////////////////////////////////

function search(){
document.write('<div align="center" valign="center"><img src="../pics/Franke-logo4.gif"></div>')
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////
function mouse_click() {
window.alert("Before you print this page, please set your printer to landscape")
//history.go(-1)
}

// Susgested item /////////////////////////////////////////////////////////////////////////////////////////

 function susitem(){
 document.write("")

/*  var cc = new Array(3)

cc[0] = '<table border="0" cellpadding="3" cellspacing="0" width="140"><tr><td height="4"></td></tr><tr height="20"><td height="20"><iframe src="../ise/intrest_45.shtml" width="140" scrolling="no" height="170" frameBorder="0" style="border:1px solid #006400" name="iframe"></iframe></td></tr></table>'

cc[1] = '<table border="0" cellpadding="3" cellspacing="0" width="140"><tr><td height="4"></td></tr><tr height="20"><td height="20"><iframe src="../ise/intrest_55.shtml" width="140" scrolling="no" height="170" frameBorder="0" style="border:1px solid #006400" name="iframe"></iframe></td></tr></table>'

cc[2] = '<table border="0" cellpadding="3" cellspacing="0" width="140"><tr><td height="4"></td></tr><tr height="20"><td height="20"><iframe src="../ise/intrest_65.shtml" width="140" scrolling="no" height="170" frameBorder="0" style="border:1px solid #006400" name="iframe"></iframe></td></tr></table>'
        
 var now = new Date()
 var sec = now.getSeconds()


document.write(cc[sec % 3]) */
} 

// Tap Drop Down /////////////////////////////////////////////////////////////////////////////////////////


if (document.getElementById){
document.write('<style type="text/css">\n')
document.write('.submenu{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("masterdiv").getElementsByTagName("span");
		if(el.style.display != "block"){
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="submenu")
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}



if (document.getElementById){ //DynamicDrive.com change
document.write('<style type="text/css">\n')
document.write('.submenu2{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu2(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
		if(el.style.display != "block"){ //DynamicDrive.com change
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="submenu2") //DynamicDrive.com change
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "block";
		}
	}
}


////// Resize iframe //////////////////////////////////////////////////////////////////////////////

/// Iframe code ////////////////////////////////////////////////////

/***********************************************
* IFrame SSI script II- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/

//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["iframeprod", "iframeprodmon", "iframeprodtues", "iframeprodwed", "iframeprodthurs", "iframeprodfri", "lefttext", "iframedirect"]

//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"

function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}

function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight; 
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent)
currentfr.attachEvent("onload", readjustIframe)
}
}

function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}

function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}

if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller


///////////////////////////////////////

document.write('<style type="text/css" media="print">body {background-color:#ffffff;}.noprint {display:none;}</style>')


function remote(){
win2=window.open("../xmas/index.shtml","","width=600,height=485")
win2.creator=self
}

////////////////////////////////////////

function ajaxinclude(url) {
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
} 
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.open('GET', url, false) //get page synchronously 
page_request.send(null)
writecontent(page_request)
}

function writecontent(page_request){
if (window.location.href.indexOf("http")==-1 || page_request.status==200)
document.write(page_request.responseText)
}
