 


document.write("<!--Please do not copy and use this javascript directly. -->");
document.write("<!--This script loses functionality unless called from external src file. -->");
document.write("<!--(c) 2006 eLocalLink, Inc. -->"); 

//Detect browser
var tourbook_browserName;
var tourbook_browserVersion;
var tourbook_ieworkaround=false;
preload_image0 = new Image(25,25); preload_image0.src='http://www.elocallink.tv/clients3/nc/kernersville/welcome.jpg';preload_image1 = new Image(25,25); preload_image1.src='http://www.elocallink.tv/clients3/nc/kernersville/quality.jpg';preload_image2 = new Image(25,25); preload_image2.src='http://www.elocallink.tv/clients3/nc/kernersville/real.jpg';preload_image3 = new Image(25,25); preload_image3.src='http://www.elocallink.tv/clients3/nc/kernersville/edu.jpg';preload_image4 = new Image(25,25); preload_image4.src='http://www.elocallink.tv/clients3/nc/kernersville/park.jpg';preload_image5 = new Image(25,25); preload_image5.src='http://www.elocallink.tv/clients3/nc/kernersville/business.jpg';preload_mimage = new Image(25,25); preload_mimage.src='http://www.elocallink.tv/clients3/nc/kernersville/main.jpg';function ellwriteImageToDiv(imageName, width, height, xPos, yPos, divName, linkNameVar){
	
	if(browserName=="Explorer"){
		if(	Number(browserVersion<7)){
			if(linkNameVar!="")
				document.getElementById(divName).innerHTML+='<a href="'+linkNameVar+'"><img src="http://www.elocallink.tv/sandbox2/testing/spacer.png" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+imageName+'\', sizingMethod=\'scale\'); border-width:0px; position:absolute; left:'+xPos+'px; top:'+yPos+'px; width:'+width+'px; margin:0px; height:'+height+'px;" ></a>';
			else
				document.getElementById(divName).innerHTML+='<img src="http://www.elocallink.tv/sandbox2/testing/spacer.png" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+imageName+'\', sizingMethod=\'scale\'); border-width:0px; position:absolute; left:'+xPos+'px; top:'+yPos+'px; width:'+width+'px; margin:0px; height:'+height+'px;" >';
			return;
		}
	}
	
	if(linkNameVar!="")
		document.getElementById(divName).innerHTML+="<a href='"+linkNameVar+"'><img src='"+imageName+"' style='border-width:0px; margin:0px; width:"+width+"px; height:"+height+"px;position:absolute; left:"+xPos+"px; top:"+yPos+"px;'></a>";
	else
		document.getElementById(divName).innerHTML+="<img src='"+imageName+"' style='border-width:0px; margin:0px; position:absolute; width:"+width+"px; height:"+height+"px;left:"+xPos+"px; top:"+yPos+"px;'>";
}

function elloverwriteImageToDiv(imageName, width, height, xPos, yPos, divName, linkNameVar){
	
	if(browserName=="Explorer"){
		if(	Number(browserVersion<7)){
			if(linkNameVar!="")
				document.getElementById(divName).innerHTML='<a href="'+linkNameVar+'"><img src="http://www.elocallink.tv/sandbox2/testing/spacer.png" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+imageName+'\', sizingMethod=\'scale\'); border-width:0px; margin:0px; position:absolute; left:'+xPos+'px; top:'+yPos+'px; width:'+width+'px; height:'+height+'px;" ></a>';
			else
				document.getElementById(divName).innerHTML='<img src="http://www.elocallink.tv/sandbox2/testing/spacer.png" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+imageName+'\', sizingMethod=\'scale\'); border-width:0px; margin:0px; position:absolute; left:'+xPos+'px; top:'+yPos+'px; width:'+width+'px; height:'+height+'px;" >';
			return;
		}
	}
	
	if(linkNameVar!="")
		document.getElementById(divName).innerHTML="<a href='"+linkNameVar+"'><img src='"+imageName+"' style='border-width:0px; margin:0px; width:"+width+"px; height:"+height+"px;position:absolute; left:"+xPos+"px; top:"+yPos+"px;'></a>";
	else
		document.getElementById(divName).innerHTML="<img src='"+imageName+"' style='border-width:0px; position:absolute; margin:0px; width:"+width+"px; height:"+height+"px;left:"+xPos+"px; top:"+yPos+"px;'>";
}

var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
		browserName=this.browser;
		browserVersion=this.version;
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();
if(tourbook_browserName=="Explorer" && tourbook_browserVersion<7){
	tourbook_ieworkaround=true;
}

document.write('<div id=\'tourbookdivdebug\' style=\'display:none\'></div><div id=\'tourbookdiv\' style=\'position:relative; width:450px; height:176px; border-width:0px; border-color:#000000; border-style:solid\'></div>');
ellwriteImageToDiv("http://www.elocallink.tv/ellsrc/horiz_leftside.png", 16, 168, 0,0, "tourbookdiv", "");
ellwriteImageToDiv("http://www.elocallink.tv/ellsrc/horiz_middle.png", 417, 168, 16,0, "tourbookdiv", "");
ellwriteImageToDiv("http://www.elocallink.tv/ellsrc/horiz_rightside.png", 16, 168, 16+417,0, "tourbookdiv", "");

document.getElementById("tourbookdiv").innerHTML+="<div id=\"tourbook_col1\" style=\"font-family:Arial; font-size:11px; color:#333333; font-weight:bold; width:150px; left:4px;height:108px; position:absolute; top:44px\"></div>";
	document.getElementById("tourbookdiv").innerHTML+="<div style=\"height:108px; left:154px; width:1px; position:absolute; background-color:#b9b9b9; top:44px;\"></div>";
	document.getElementById("tourbookdiv").innerHTML+="<div id=\"tourbook_col2\" style=\"font-family:Arial; font-size:11px;color:#333333; font-weight:bold;width:150px; left:155px; position:absolute; height:108px;top:44px\"></div>";
	document.getElementById("tourbookdiv").innerHTML+="<div style=\"height:108px; left:305px; width:1px; position:absolute; background-color:#b9b9b9; top:44px;\"></div><div id=\"photodiv\" style=\"left:306px;width:138px; position:absolute; background-color:#b9b9b9; top:44px;\"></div>";document.getElementById('tourbook_col1').innerHTML+='<div id=\'1-0\' onclick=\'javascript:ellOpenWindow(\"http://www.elocallink.tv/clients3/nc/kernersville/tourplay.php?movie=kvnc_wel_iwd&spon=welcome\", 874, 692)\' onmouseover=\'javascript:elltour_over(1, 0, \"http://www.elocallink.tv/clients3/nc/kernersville/welcome.jpg\")\' onmouseout=\'javascript:elltour_out()\' style=\'margin-top:0px;margin-bottom:0px;cursor:pointer; position:relative; height:27px\'><img src=\'http://www.elocallink.tv/ellsrc/spacer.gif\' style=\'position:absolute;border-width:0px; width:100%;left:0px; height:100%\'><div id=\'1-0inner\' style=\'position:relative; font-family:Arial; font-size:11px;margin-left:3px;line-height:11px;text-align:center; width:144px; height:auto; color:#333333\'>Welcome<br/></div></div>';document.getElementById('tourbook_col1').innerHTML+='<div id=\'1-1\' onclick=\'javascript:ellOpenWindow(\"http://www.elocallink.tv/clients3/nc/kernersville/tourplay.php?movie=kvnc_qual_rev2_iwd&spon=qualityo\", 874, 692)\' onmouseover=\'javascript:elltour_over(1, 1, \"http://www.elocallink.tv/clients3/nc/kernersville/quality.jpg\")\' onmouseout=\'javascript:elltour_out()\' style=\'margin-top:0px;margin-bottom:0px;cursor:pointer; position:relative; height:27px\'><img src=\'http://www.elocallink.tv/ellsrc/spacer.gif\' style=\'position:absolute; border-width:0px;left:0px; width:100%; height:100%\'><div style=\'position:relative; width:150px; height:1px; overflow:hidden; background-color:#AAAAAA; margin-top:0px\'></div><div style=\'position:relative; width:150px; height:1px; overflow:hidden; background-color:#FFFFFF;margin-top:0px\'></div><div id=\'1-1inner\' style=\'text-align:center; font-family:Arial; font-size:11px;position:relative; margin-left:3px; padding:0px;line-height:11px; width:144px; color:#333333\'>Quality of Life<br/></div></div>';document.getElementById('tourbook_col1').innerHTML+='<div id=\'1-2\' onclick=\'javascript:ellOpenWindow(\"http://www.elocallink.tv/clients3/nc/kernersville/tourplay.php?movie=kvnc_real_iwd&spon=realesta\", 874, 692)\' onmouseover=\'javascript:elltour_over(1, 2, \"http://www.elocallink.tv/clients3/nc/kernersville/real.jpg\")\' onmouseout=\'javascript:elltour_out()\' style=\'margin-top:0px;margin-bottom:0px;cursor:pointer; position:relative; height:27px\'><img src=\'http://www.elocallink.tv/ellsrc/spacer.gif\' style=\'position:absolute; border-width:0px;left:0px; width:100%; height:100%\'><div style=\'position:relative; width:150px; height:1px; overflow:hidden; background-color:#AAAAAA; margin-top:0px\'></div><div style=\'position:relative; width:150px; height:1px; overflow:hidden; background-color:#FFFFFF;margin-top:0px\'></div><div id=\'1-2inner\' style=\'text-align:center; font-family:Arial; font-size:11px;position:relative; margin-left:3px; padding:0px;line-height:11px; width:144px; color:#333333\'>Real Estate and Relocation<br/></div></div>';document.getElementById('tourbook_col1').innerHTML+='<div id=\'1-3\' onclick=\'javascript:ellOpenWindow(\"http://www.elocallink.tv/clients3/nc/kernersville/tourplay.php?movie=kvnc_edu_rev_iwd&spon=educatio\", 874, 692)\' onmouseover=\'javascript:elltour_over(1, 3, \"http://www.elocallink.tv/clients3/nc/kernersville/edu.jpg\")\' onmouseout=\'javascript:elltour_out()\' style=\'margin-top:0px;margin-bottom:0px;cursor:pointer; position:relative; height:27px\'><img src=\'http://www.elocallink.tv/ellsrc/spacer.gif\' style=\'position:absolute; border-width:0px;left:0px; width:100%; height:100%\'><div style=\'position:relative; width:150px; height:1px; overflow:hidden; background-color:#AAAAAA; margin-top:0px\'></div><div style=\'position:relative; width:150px; height:1px; overflow:hidden; background-color:#FFFFFF;margin-top:0px\'></div><div id=\'1-3inner\' style=\'text-align:center; font-family:Arial; font-size:11px;position:relative; margin-left:3px; padding:0px;line-height:11px; width:144px; color:#333333\'>Education<br/></div></div>';
ellwriteImageToDiv("http://www.elocallink.tv/clients3/nc/kernersville/main.jpg", 138, 108, 0,0, "photodiv", "");
document.getElementById("tourbookdiv").innerHTML+="<img src=\"http://www.elocallink.tv/clients3/nc/kernersville/horz2_header.jpg\" style=\"position:absolute; left:12px; top:7px\">";


document.getElementById('tourbook_col2').innerHTML+='<div id=\'2-4\' onclick=\'javascript:ellOpenWindow(\"http://www.elocallink.tv/clients3/nc/kernersville/tourplay.php?movie=kvnc_park_rev_iwd&spon=parksrec\", 874, 692)\' onmouseover=\'javascript:elltour_over(2, 4, \"http://www.elocallink.tv/clients3/nc/kernersville/park.jpg\")\' onmouseout=\'javascript:elltour_out()\' style=\'margin-top:0px;margin-bottom:0px;cursor:pointer; position:relative; height:27px\'><img src=\'http://www.elocallink.tv/ellsrc/spacer.gif\' style=\'position:absolute; width:100%;left:0px; height:100%\'><div id=\'2-4inner\' style=\'position:relative; margin-left:3px;line-height:11px;font-family:Arial; font-size:11px;text-align:center; width:144px\'>Parks and Recreation<br/></div></div>';document.getElementById('tourbook_col2').innerHTML+='<div id=\'2-5\' onclick=\'javascript:ellOpenWindow(\"http://www.elocallink.tv/clients3/nc/kernersville/tourplay.php?movie=kvnc_bus_rev_iwd&spon=business\", 874, 692)\' onmouseover=\'javascript:elltour_over(2, 5, \"http://www.elocallink.tv/clients3/nc/kernersville/business.jpg\")\' onmouseout=\'javascript:elltour_out()\' style=\'margin-top:0px;margin-bottom:0px;cursor:pointer; position:relative; height:27px\'><img src=\'http://www.elocallink.tv/ellsrc/spacer.gif\' style=\'position:absolute; left:0px;width:100%; height:100%\'><div style=\'position:relative; width:150px; height:1px; overflow:hidden; background-color:#AAAAAA; margin-top:0px\'></div><div style=\'position:relative; width:150px; height:1px; overflow:hidden; background-color:#FFFFFF;margin-top:0px\'></div><div id=\'2-5inner\' style=\'text-align:center; position:relative; margin-left:3px;font-family:Arial; font-size:11px; padding:0px;line-height:11px; width:144px\'>Business and Industry<br/></div></div>';if(document.getElementById("tourbook_col2")) document.getElementById("tourbook_col2").innerHTML+="<div style=\"margin-top:0px;margin-bottom:0px; position:relative; height:27px\"><div style=\"position:relative; width:150px; height:1px; overflow:hidden; background-color:#AAAAAA; margin-top:0px\"></div><div style=\"position:relative; width:150px; height:1px; overflow:hidden; background-color:#FFFFFF;margin-top:0px\"></div><div  style=\"text-align:center;position:relative; margin-left:3px; padding:0px;line-height:11px; width:144px\"><br/></div></div>";
if(document.getElementById("tourbook_col3")) document.getElementById("tourbook_col3").innerHTML+="<div  style=\"margin-top:0px;margin-bottom:0px; position:relative; height:27px\"><div style=\"position:relative; width:150px; height:1px; overflow:hidden; background-color:#AAAAAA; margin-top:0px\"></div><div style=\"position:relative; width:150px; height:1px; overflow:hidden; background-color:#FFFFFF;margin-top:0px\"></div><div style=\"text-align:center;position:relative; margin-left:3px; padding:0px;line-height:11px; width:144px\"><br/></div></div>";
if(document.getElementById("col4")) document.getElementById("col4").innerHTML+="<div  style=\"margin-top:0px;margin-bottom:0px; position:relative; height:27px\"><div style=\"position:relative; width:150px; height:1px; overflow:hidden; background-color:#AAAAAA; margin-top:0px\"></div><div style=\"position:relative; width:150px; height:1px; overflow:hidden; background-color:#FFFFFF;margin-top:0px\"></div><div style=\"text-align:center;position:relative; margin-left:3px; padding:0px;line-height:11px; width:144px\"><br/></div></div>";
function elltour_over(row, col, textval){
	elloverwriteImageToDiv(textval, 138, 108, 0,0, "photodiv", "");
	cc=0;
	i=1;
	while(i<5){
		if (document.getElementById(i+"-"+cc)) document.getElementById(i+"-"+cc).style.backgroundColor="";
		cc++;
		if(cc%4==0){
			i++;
		}
	}
	document.getElementById(row+"-"+col).style.backgroundColor="#c5e5ff";
}

function elltour_out(){
	elloverwriteImageToDiv("http://www.elocallink.tv/clients3/nc/kernersville/main.jpg", 138, 108, 0,0, "photodiv", "");
	cc=0;
	i=1;
	while(i<5){
		if (document.getElementById(i+"-"+cc)) document.getElementById(i+"-"+cc).style.backgroundColor="";
		cc++;
		if(cc%4==0){
			i++;
		}
	}
}

function setTourbookTextPosition(){
	if(document.getElementById("1-0")) document.getElementById("1-0inner").style.top=((document.getElementById("1-0").offsetHeight-document.getElementById("1-0inner").offsetHeight)/2)+"px";
    if(document.getElementById("1-1")) document.getElementById("1-1inner").style.top=((document.getElementById("1-1").offsetHeight-2-document.getElementById("1-1inner").offsetHeight)/2)+"px";
    if(document.getElementById("1-2")) document.getElementById("1-2inner").style.top=((document.getElementById("1-2").offsetHeight-2-document.getElementById("1-2inner").offsetHeight)/2)+"px";
    if(document.getElementById("1-3")) document.getElementById("1-3inner").style.top=((document.getElementById("1-3").offsetHeight-2-document.getElementById("1-3inner").offsetHeight)/2)+"px";

	if(document.getElementById("2-4")) document.getElementById("2-4inner").style.top=Math.floor(((document.getElementById("2-4").offsetHeight-document.getElementById("2-4inner").offsetHeight)/2))+"px";
    if(document.getElementById("2-5")) document.getElementById("2-5inner").style.top=Math.floor(((document.getElementById("2-5").offsetHeight-2-document.getElementById("2-5inner").offsetHeight)/2))+"px";
    if(document.getElementById("2-6")) document.getElementById("2-6inner").style.top=Math.floor(((document.getElementById("2-6").offsetHeight-2-document.getElementById("2-6inner").offsetHeight)/2))+"px";
    if(document.getElementById("2-7")) document.getElementById("2-7inner").style.top=Math.floor(((document.getElementById("2-7").offsetHeight-2-document.getElementById("2-7inner").offsetHeight)/2))+"px";

	if(document.getElementById("3-8")) document.getElementById("3-8inner").style.top=((document.getElementById("3-8").offsetHeight-document.getElementById("3-8inner").offsetHeight)/2)+"px";
    if(document.getElementById("3-9")) document.getElementById("3-9inner").style.top=((document.getElementById("3-9").offsetHeight-3-document.getElementById("3-9inner").offsetHeight)/2)+"px";
    if(document.getElementById("3-10")) document.getElementById("3-10inner").style.top=((document.getElementById("3-10").offsetHeight-3-document.getElementById("3-10inner").offsetHeight)/2)+"px";
    if(document.getElementById("3-11")) document.getElementById("3-11inner").style.top=((document.getElementById("3-11").offsetHeight-3-document.getElementById("3-11inner").offsetHeight)/2)+"px";
    
    if(document.getElementById("4-12")) document.getElementById("4-12inner").style.top=((document.getElementById("4-12").offsetHeight-document.getElementById("4-12inner").offsetHeight)/2)+"px";
    if(document.getElementById("4-13")) document.getElementById("4-13inner").style.top=((document.getElementById("4-13").offsetHeight-3-document.getElementById("4-13inner").offsetHeight)/2)+"px";
    if(document.getElementById("4-14")) document.getElementById("4-14inner").style.top=((document.getElementById("4-14").offsetHeight-3-document.getElementById("4-14inner").offsetHeight)/2)+"px";
    if(document.getElementById("4-15")) document.getElementById("4-15inner").style.top=((document.getElementById("4-15").offsetHeight-3-document.getElementById("4-15inner").offsetHeight)/2)+"px";

}

var TourbookPreScriptLoad = window.onload;
window.onload = function() {
	if (typeof (TourbookPreScriptLoad) == 'function') {
		TourbookPreScriptLoad();
	}
	setTourbookTextPosition();
};

function ellOpenWindow(url, w, h) {var windowprops = "width=" + w + ",height=" + h+", scrollbars=yes";popup = window.open(url,"remote",windowprops);}
