var x = 0;
var y=0;
var picturesbt= new Array("","","");

function setpicturesbt(a)
{
	
	
	for(x=0;x<100;x++)
	picturesbt[x]=" ";
	
	picturesbt=a;
	
}

function viewport()
{
	var viewportwidth;
 var viewportheight;
 
 
 if (typeof window.innerWidth != 'undefined')
 {
      viewportwidth = window.innerWidth,
      viewportheight = window.innerHeight
 }
 

 else if (typeof document.documentElement != 'undefined'
     && typeof document.documentElement.clientWidth !=
     'undefined' && document.documentElement.clientWidth != 0)
 {
       viewportwidth = document.documentElement.clientWidth,
       viewportheight = document.documentElement.clientHeight
 }
 

 
 else
 {
       viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
       viewportheight = document.getElementsByTagName('body')[0].clientHeight
 }
x=viewportwidth;
y=viewportheight;
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function expand2()
{
	expand2activ();
viewport();


var output=document.getElementById("content");
//output2.style.left=Math.round(x/2)-255;
//output2.style.top=205;
var output2=document.getElementById("use2");
var whichw=Math.round(x/2)-265;
var whichh=265;


output2.innerHTML=("<div id='use2area' style='width:150px; height:40px; position:absolute; top:"+whichh+"px; left:"+whichw+"px; '; id='use'></div>")
var output3=document.getElementById("use2area");
output3.innerHTML=("<A HREF='leadedtrad.html'><span onMouseOut='clearactive2()' onMouseover='expand2activ()' class='indexbutton'>Traditional</span></A>");
output3.innerHTML+=("<A HREF='leadedpro.html'><span onMouseOut='clearactive2()' onMouseover='expand2activ()' class='indexbutton'>Progressive</span></A>");
//output2.style.color="white";
}
var expand2active=false;
function expand2activ()
{
	expand2active=true;
	if(alreadyactive2==false)
{checkactive2();
}
}
function clearactive2()
{
	expand2active=false;
}
var alreadyactive2=false;
function checkactive2()
{
	alreadyactive2=true;
	var use=document.getElementById("use2");
	if (expand2active == false) {
		use.innerHTML = ("");
		alreadyactive2=false;
	}
	else 
		setTimeout('checkactive2()', 10);
	
}
function expand3()
{
	expand3activ();
viewport();


var output=document.getElementById("content");

var output2=document.getElementById("use3");
//alert(Math.round(x/2)-255);
//var thewidth=Math.round(x/2)-255;
//var theheight=243;
var whichw=Math.round(x/2)-265;
var whichh=308;


output2.innerHTML=("<div id='use3area' style='width:150px; height:40px; position:absolute; top:"+whichh+"px; left:"+whichw+"px; '; id='use'></div>")
var output3=document.getElementById("use3area");

//output2.style.leftoutput2.style.top=243;
output3.innerHTML=(" <A HREF='facetedsymbol.html'><span onMouseOut='clearactive3()' onMouseover='expand3activ()' class='indexbutton'>Symbols</span></A>");
output3.innerHTML+=("<A HREF='facetedfigure.html'><span onMouseOut='clearactive3()' onMouseover='expand3activ()' class='indexbutton'>Figures</span></A>");
//output2.style.color="white";
}
var expand3active=false;
function expand3activ()
{
	expand3active=true;
	if(alreadyactive3==false)
{checkactive3();
}
}
function clearactive3()
{
	expand3active=false;
}
var alreadyactive3=false;
function checkactive3()
{
	alreadyactive3=true;
	var use=document.getElementById("use3");
	if (expand3active == false) {
		use.innerHTML = ("");
		alreadyactive3=false;
	}
	else 
		setTimeout('checkactive3()', 10);
	
}
<!--Expand 4-->
function expand4()
{
	expand4activ();
viewport();


var output=document.getElementById("content");

var output2=document.getElementById("use4");
//output2.style.left=Math.round(x/2)-255;
//output2.style.top=285;
var whichw=Math.round(x/2)-255;
var whichh=285;


output2.innerHTML=("<div id='use4area' style='width:150px; height:40px; position:absolute; top:"+whichh+"px; left:"+whichw+"px; '; id='use'></div>")
var output3=document.getElementById("use4area");
output3.innerHTML=("<A HREF='archresleaded.html'><span  onMouseOut='clearactive4()' onMouseover='expand4activ()' class='indexbutton'>Leaded Glass</span></A>");
output3.innerHTML+=("<A HREF='archresfaceted.html'><span onMouseOut='clearactive4()' onMouseover='expand4activ()' class='indexbutton'>Faceted Glass</span></A>");
//output2.style.color="white";
}
var expand4active=false;
function expand4activ()
{
	expand4active=true;
	if(alreadyactive4==false)
{checkactive4();
}
}
function clearactive4()
{
	expand4active=false;
}
var alreadyactive4=false;
function checkactive4()
{
	alreadyactive4=true;
	var use=document.getElementById("use4");
	if (expand4active == false) {
		use.innerHTML = ("");
		alreadyactive4=false;
	}
	else 
		setTimeout('checkactive4()', 1);
	
}

function insertindex()
{
	var output=document.getElementById("index");
	
output.innerHTML=("<A HREF='index.html'><span id='button1' class='indexbutton'>Home</span></A><span id='button2' onMouseOut='clearactive2()'; onMouseover='expand2()' class='indexbutton'>Leaded Glass</span><span onMouseOut='clearactive3()'; onMouseover='expand3()' id='button3' class='indexbutton'>Faceted Glass</span><A HREF='archresleaded.html'><span id='button4' class='indexbutton'>Architectural Restoration </span></A> <A HREF='mosaic.html'><span id='button5' class='indexbutton'>Mosaics</span></A><A HREF='etched.html'><span id='button9' class='indexbutton'>Etched Glass</span></A><A HREF='protec.html'><span id='button6' class='indexbutton'>Exterior Protective Glazing</span></A><A HREF='forsale.html'><span id='button7' class='indexbutton'>Historic Munich Leaded Glass Church Windows For Sale</span></A><A HREF='recentproject.html'><span id='button8' class='indexbutton'>Recent Commissions</span></A><A HREF='consultations.html'><span id='button10' class='indexbutton'>Free Consultation and Cost Analysis</span></A><center><span style=' font-size:1.3em;'>(210) 733-8161</span></center>")
}
//<div id="insertuse"></div>
function insertfooter()
{
	var output=document.getElementById("footer");
	var counterdisplay="";
	output.innerHTML=("<span style='cursor:pointer; float:left'><A class='blank' HREF='index.html'>Home</A> | <A class='blank' HREF='aboutus.html'>About Us</A> | <A class='blank' HREF='references.html'>References</A> | <A class='blank' HREF='contactus.html'>Contact Us</A> | <A HREF='support.html'>Webpage Support</A></span><center>"+counterdisplay+"</center><span style='float:right;'>&copy; 2010 The Cavallini Co., Inc. All Rights Reserved</span><div id='insertuse'></div>");

}
function addtemplate()
{
	googleanalyze()
	headerinsertcode();
	insertindex();
	insertfooter();
	insertuses();
	textchanger();
	
	
	
}
function insertuses()
{
	var output=document.getElementById("insertuse");
	output.innerHTML=("<div style='width:150px; height:40px; position:absolute; top:0px; left:0px; '; id='use2'></div><div style='width:150px; height:40px; position:absolute; top:0px; left:0px; '; id='use3'></div><div style='width:150px; height:40px; position:absolute; top:0px; left:0px; '; id='use4'></div><div style='width:150px; height:40px; position:absolute; top:0px; left:0px; '; id='mainpiclargearea'></div>");
}
//the firsttime/secnd time attempt stuff had to be added because the subtitles were being updated after the first imgage was displayed...
var firsttimeattempting=true;
function secondattemptslideshow()
{
	//startslideshow2(ss1,ss2,ss3,ss4);
	startslideshow2();
setTimeout('trytofixphoto()',500);

}
function trytofixphoto()
{
toolbarbutton(5);
toolbarbutton(3);
}
function startslideshow(picstorage,picstorageEXT,numberofslides,divoutputtag)
{
	ss1=picstorage;
	ss2=picstorageEXT;
	ss3=numberofslides;
	ss4=divoutputtag;
	

	var output=document.getElementById(ss4);
	output.innerHTML="Loading Images 1/"+ss3;
	preloadingimages();
}
var loadedpictures= new Array();
var currentloadingimage=0;
function preloadingimages()
{
	var preimage= new Image();
	preimage.src=ss1+currentloadingimage+ss2;
	loadedpictures[currentloadingimage]=preimage;
	
	
		
	
	currentloadingimage++;
var output=document.getElementById(ss4)
if(currentloadingimage<=ss3)
	output.innerHTML="Loading Images: "+currentloadingimage+"/"+ss3;
	
	if(currentloadingimage-1<ss3)
	preimage.onLoad=preloadingimages();
	else 
	startslideshow2();
	
	
}

function startslideshow2()
{
	
	if(firsttimeattempting==true)
	{
	
	
		
		firsttimeattempting=false;
		setTimeout('secondattemptslideshow()',1000);

	}
	else{
			var output=document.getElementById(ss4);
	output.innerHTML=("<span style='  overflow:hidden; float:left; border:0px white solid; width:450px; height:410px' id='mainpicspot'/></span>")
	output.innerHTML+=("<span style='margin-bottom:20px; overflow:hidden; float:left; float:left; border:0px white solid; width:150px; height:380px; 'id='smallpics'></span>");
	output.innerHTML+=("<span style='float:left; width:99%; height:30px; ' id='toolbar'></span>")



	starttimer();
	changemainpic(1);
	changemainpic(1);
	setslideshowtoolbar();
	
	}
}

var cursetslide=1;
var curslide=1;

function setslideshowtoolbar()
{
		var output=document.getElementById("toolbar");
	var outputs="";
	outputs="<div style='margin-left:30px; float:left'><span id='backtool'><input type='button' class='slideshowtools' value='Back' onClick='toolbarbutton(1)'/></span>";
	outputs+=("<span id='lastsettool'><input type='button' class='slideshowtools' value='<<' onClick='toolbarbutton(2)'/></span>");
	outputs+=("<span id='lastimagetool'><input type='button' class='slideshowtools' value='<' onClick='toolbarbutton(3)'/></span>");
	if(switchtime==-1)
	outputs+=("<span id='autotool'><input type='button' class='slideshowtools' value='Play' onClick='toolbarbutton(4)'/></span>");
	else
	outputs+=("<span id='autotool'><input type='button' class='slideshowtools' value='Pause' onClick='toolbarbutton(4)'/></span>");
	outputs+=("<span id='nextimagetool'><input type='button' class='slideshowtools' value='>' onClick='toolbarbutton(5)'/></span>");
	outputs+=("<span id='nextsettool'><input type='button' class='slideshowtools' value='>>' onClick='toolbarbutton(6)'/></span></div>");
	output.innerHTML=outputs;
}
function toolbarbutton(which)
{
	switch(which)
	{
		case 1:
		for(x=0;x<ss1.length;x++)
		{
			var y=x;
			if(ss1.charAt(y)=='p')
			if(ss1.charAt(y+1)=='a')
			if(ss1.charAt(y+2)=='g')
			if(ss1.charAt(y+3)=='e')
			{
			
				for(z=0;z<ss1.length;z++)
					if(ss1.charAt(z)=='/')
					var w=z+1;
					
					
				var link=ss1.substring(w,y);
				window.location = link+".html";

			}
	
		}
		break;
		case 2:
		if(cursetslide!=1)
		{
		cursetslide--;
		updatecursetslide();	
		}
		break;
		case 3:
		if(curslide!=1)
		{
		curslide--;
		changemainpic(curslide);	
		}
		break;
		case 4:
		if(switchtime==-1)
		{
			switchtime=currenttime+2;
		}
		else
		{
			switchtime=-1;
		}
		setslideshowtoolbar();
		break;
		case 5:
		if(curslide!=ss3)
		{
		curslide++;
		changemainpic(curslide);	
		}
		break;
		case 6:
		if(cursetslide!=Math.ceil(ss3/3))
		{
		cursetslide++;
		updatecursetslide();	
		}
		break;
		
		
		
		
	}
}
var currenttime=0;
var switchtime=-1;
var slidespeed=3;
function starttimer()
{
	var currenttime=0;
	setTimeout('raisechecktime()',1000);
	
}
function raisechecktime()
{
	currenttime++;
	if(switchtime==currenttime)
	{
		//alert(switchtime+" "+currenttime);
		switchtime+=slidespeed;
		if(curslide!=ss3)
		toolbarbutton(5);
		else
		changemainpic(1);
	}
	
	setTimeout('raisechecktime()',1000);
}

function updatecursetslide(){
	var leastslide=ss3;
	var out = document.getElementById("smallpics");
	out.innerHTML = ("Set " + cursetslide + "/" + Math.ceil(ss3 / 3) + "<br>");
	for (x = 1; x <= ss3; x++) 
		if (x / 3 > cursetslide - 1 && x / 3 <= cursetslide) {
			if(x<leastslide)
			leastslide=x;
			var height=100;
			var width=100;
			
			
			
		
			var backgroundcolor="inherit";
			if(x==curslide)
			backgroundcolor="white";
			out.innerHTML += ("<span id='smallspotpoint" + (x) + "' style=' background-color:"+backgroundcolor+";border-bottom:1px white solid; width:120px; height:110px; display:block;  margin-bottom:10px;'  ><center><img id='smpicspotswap"+x+"' style='background-color:white;'  src='" + ss1 + "" + x + "" + ss2+ "'/></center></span>")
			
			
			img = document.getElementById('smpicspotswap'+x);
//img.src=ss1+x+ss2;
img.src=loadedpictures[x].src;
var width = img.width;
var height = img.height;

var newx = 120; // set to whatever you want the images max width to be.
var newy = 110; // whatever you want the images maximum height to be.
if ( width >= height ) {

// landscape
var tmpy = height*newx/width;
if ( tmpy <= newy )
newy = tmpy;
else
newx = width*newy/height;
}
else {
// portrait

tmpx = width*newy/height;

if ( tmpx <= newx )
{newx = tmpx;
}

else
{newy = height*newx/width;
}

}

img.width = newx;
img.height = newy;


			
		}
		
		if(curslide / 3 > cursetslide - 1 && curslide / 3 <= cursetslide)
		{
			
		}
		else
		changemainpic(leastslide);
}
	
	



var ss1;
var ss2;
var ss3;
var ss4;

var currentchangemainpic=0;
function changemainpic(which)
{
	currentchangemainpic=which;
	curslide=which;
	cursetslide=Math.ceil(which/3);
	updatecursetslide();
	selectmainpic(ss1,ss2,ss3,ss4,which);
	
	setTimeout('changemainpic2()',5);
}
function changemainpic2()
{
	updatecursetslide();
	selectmainpic(ss1,ss2,ss3,ss4,currentchangemainpic);
}


function selectmainpic(picstorage,picstorageEXT,numberofslides,divoutputtag,whichone)
{
var imgPath = picstorage + whichone + picstorageEXT;


	var mainpicspot=document.getElementById("mainpicspot");
	var imagestring=("<A  target='new' HREF='"+picstorage+""+whichone+""+picstorageEXT+"'><img id='swapme6541'style='background-color:white;' alt='Click me to enlarge' border='0'  src='"+picstorage+""+whichone+""+picstorageEXT+"'/></A>");
	mainpicspot.innerHTML=("<center><span >"+imagestring+"</span></center>");
	if(picturesbt[whichone]!=undefined)
	mainpicspot.innerHTML+=("<center><span style='color:white;'>"+picturesbt[whichone]+"</center></span><br>");
img = document.getElementById('swapme6541');
//img.src=imgPath;
img.src=loadedpictures[whichone].src;

var width = img.width;
var height = img.height;

var newx = 440; // set to whatever you want the images max width to be.
var newy = 380; // whatever you want the images maximum height to be.
if ( width >= height ) {

// landscape
var tmpy = height*newx/width;
if ( tmpy <= newy )
newy = tmpy;
else
newx = width*newy/height;
}
else {
// portrait

tmpx = width*newy/height;

if ( tmpx <= newx )
{newx = tmpx;
}

else
{newy = height*newx/width;
}

}

img.width = newx;
img.height = newy;


}

function headerinsertcode()
{
	//<span style='float:left; height:5%; width:100%; font-size:3.5em;'>Cavallini Co., Inc</span><span style='font-size:1.0em'><br></span><span style='font-style:italic; margin-left:40px; float:left; width:100%;font-size:2.5em;'><br>Stained Glass Studio</span><br><span style='font-weight:bold; font-size:1.2em; margin-left:40px; '>Family Owned and Operated Since 1953</span>
	var output=document.getElementById("headerinsert");
	var outputstring="";
	outputstring=("<div style='float:left; font-family:arial; width:59%; height:135px'><img style='margin-left:50px;' width='500' height='135' src='header3.jpg'></div><span style='float:left; width:40%; height:135px; '><img style='margin-top:10px; margin-left:15px;' src='header2.jpg'/></span></div>");
	
	outputstring+=("<span style='overflow:hidden; float:left; padding-top:10px; margin-left:50px; height:50px; width:99%;'>")
outputstring+=("<form style='overflow:hidden; float:left; 'method='get' action='http://www.google.com/search'><div style='border:0px solid black;padding:4px;width:300px'><table border='0' cellpadding='0'><tr><td><input type='text' name='q' size='25' maxlength='255' value='' /><input type='submit' value='Google Search' /></td></tr><tr><td align='center' style='font-size:75%'><input type='radio' name='sitesearch'value='cavallinistudios.com' checked /> <span style='font-size:0.9em;'>Search this webpage only</span></td></tr></table></div></form>");
outputstring+=("<span id='changingtexthere' style=' margin-top:7px; float:left; width:480px; border:1px white solid; overflow:hidden; height:40px;'></span>")
	outputstring+=("</span><div style='overflow:hidden;'; id='border'></div>");
	output.innerHTML=outputstring;
}
function insertonpagetitle(word)
{
	//alert(word);
	var output=document.getElementById("onpagetitle");
	var outputs="";
	outputs="<span style='font-weight:bold; text-align:center; font-size:1.1em; float:left; width:20px; height:100%;'>";
	for(x=0;x<word.length;x++)
	outputs+=word.charAt(x)+"<br>";
	
	outputs+=("</span>");
	output.innerHTML=outputs;
}

//id='changingtexthere'
function textchanger()
{
	var specificaddress="";
	var stopcollecting=false;
	var currentpageurl=document.URL;
	//alert(currentpageurl);
	for(x=currentpageurl.length-1;x>0;x--)
	{
		
		var cl=toUnicode(currentpageurl.charAt(x));
		cl=cl.charAt(cl.length-2)+cl.charAt(cl.length-1);
		cl=cl.toString();
		if(currentpageurl.charAt(x)=='/')
		cl="5C";
   if(cl!="5C"&&stopcollecting==false)
	{
		
		//alert(cl);
		specificaddress=currentpageurl.charAt(x)+specificaddress;
	}
	else
	stopcollecting=true;
	}
	
	//alert(specificaddress);
	identifyaddresscat(specificaddress)
	
}

function toUnicode(theString) {  var unicodeString = '';  for (var i=0; i < theString.length; i++) {    var theUnicode = theString.charCodeAt(i).toString(16).toUpperCase();    while (theUnicode.length < 4) {      theUnicode = '0' + theUnicode;    }    theUnicode = '\\u' + theUnicode;    unicodeString += theUnicode;  }  return unicodeString;}

function identifyaddresscat(address)
{
	
	var cat=0;//catogory
	var catfound=false;
	
	var nadd="";
	var sc=false; //stop collecting
	//This section deletes the extension
	for(x=0;x<address.length;x++)
	{
	if(address.charAt(x)!='.'&&sc==false)
	{
		nadd+=address.charAt(x);
	}
	else
	sc=true;	
	}
	
	address=nadd;
	var al=address.length; //al = address length
	
		if(address.charAt(al-5)=='p')
		if(address.charAt(al-4)=='a')
		if(address.charAt(al-3)=='g')
		if(address.charAt(al-2)=='e')
		{
			cat=3;
		}
		
		if(address=="index"){cat=1;}
		if(address=="contactus"){cat=4;}
		if(address=="references"){cat=5;}
		if(address=="aboutus"){cat=6;}
		if(address=="forsale"){cat=7;}
		if(address=="recentproject"){cat=8;}
		if(address=="consultations"){cat=9;}
		
		if(address=="leadedtrad"){cat=2;}
		if(address=="leadedpro"){cat=2;}
		if(address=="facetedsymbol"){cat=2;}
		if(address=="facetedfigure"){cat=2;}
		if(address=="archresleaded"){cat=2;}
		if(address=="mosaic"){cat=2;}
		if(address=="etched"){cat=2;}
		if(address=="protec"){cat=2;}
	
	beginuploadingtext(cat);

}

	//0-Unkown
	//1-Home
	//2-Any Primary Page
	//3-Any Slideshow specific Page
	//4-Contact Us
	//5-References
	//6-About Us
	//7-For Sale
	//8-recent project
	//9-Consultations
	
var defaultchangetime=10 //secs
var dct=defaultchangetime; //dct is for short version

// 0-"" Message
// 1-int Priority Level //1-least important, 10-most important
// 2-int Time till change (0=skip) (-1=Neverchange)
var basetext=new Array(
new Array("This is the "+document.title+" page.",10,dct+5),
new Array("The Cavallini Company, our Reputation is your Best Guarantee",1,dct),
new Array("For our residential and custom work visit our other website, press <A href='http://www.cavalliniartglass.com'><u>here</u></a>. ",1,dct),
new Array("3 Generations of Cavallini and Counting",1,dct),
new Array("If you are experiencing errors please visit <a href='support.html'><u>here</u></a>.",1,dct),
new Array("This webpage was designed and developed by Joseph Cavallini",1,dct));

var cat1text=new Array(
new Array("Welcome to the New and Improved Version of CavalliniStudios.com",11,dct));
var cat2text=new Array(
new Array("Each box below is a link to another page, with more pictures from the same location.",11,dct));
var cat3text=new Array(
new Array("Each picture has been compressed for pratical downloading times.",2,dct));
var cat4text=new Array(
new Array("Please call us for any questions!",1,dct));
var cat5text=new Array(
new Array("",0,0));
var cat6text=new Array(
new Array("",0,0));
var cat7text=new Array(
new Array("",0,0));
var cat8text=new Array(
new Array("",0,0));
var cat9text=new Array(
new Array("",0,0));

var masterplaylist=new Array();
function beginuploadingtext(cat)
{
	//upload mastertext into 
	for(x=0;x<basetext.length;x++)
	masterplaylist[masterplaylist.length]=basetext[x];
	
	//upload catspecificdata
	if(cat!=0)
	{
	var temparraycat=new Array();
	switch(cat)
	{
		case 1:
		temparraycat=cat1text;
		break;
		case 2:
		temparraycat=cat2text;
		break;
		case 3:
		temparraycat=cat3text;
		break;
		case 4:
		temparraycat=cat4text;
		break;
		case 5:
		temparraycat=cat5text;
		break;
		case 6:
		temparraycat=cat6text;
		break;
		case 7:
		temparraycat=cat7text;
		break;
		case 8:
		temparraycat=cat8text;
		break;
		case 9:
		temparraycat=cat9text;
		break;
	}
	
	if(cat==2)
	addtexttocheckertag();
	
		for(x=0;x<temparraycat.length;x++)
	masterplaylist[masterplaylist.length]=temparraycat[x];
	
	}
	
	
	//organize
	for(y=0;y<masterplaylist.length-1;y++)
	for(z=0;z<masterplaylist.length-1;z++)
	{
		if(masterplaylist[z][1]<masterplaylist[z+1][1])
		{
			var temp=masterplaylist[z];
			masterplaylist[z]=masterplaylist[z+1];
			masterplaylist[z+1]=temp;
		}
	}
	//randomnize equal value ones
	for(e=0;e<masterplaylist.length-1;e++)
	{
		var ranord=Math.round(Math.random());
		if(ranord==1)
		{
			if(masterplaylist[e][1]==masterplaylist[e+1][1])
		{
			var temp=masterplaylist[e];
			masterplaylist[e]=masterplaylist[e+1];
			masterplaylist[e+1]=temp;
		}
		
		}
		
	}
	uploadnewtextslide();
}

var currentchangingtextslide=0;
function uploadnewtextslide(){

	
	var out=document.getElementById("changingtexthere");
	out.innerHTML=("<center>"+masterplaylist[currentchangingtextslide][0]+"</center>");
		var changetime=masterplaylist[currentchangingtextslide][2]
		
		currentchangingtextslide++;
	if(currentchangingtextslide==masterplaylist.length)
	currentchangingtextslide=0;
	
	setTimeout('uploadnewtextslide()',changetime*1000);
	
}

function googleanalyze()
{
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-21064244-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

}



	function addtexttocheckertag()
	{
	
		for(var i=0;i<document.getElementsByTagName('*').length;i++)
		{
			if(document.getElementsByTagName('*')[i].className=="checkertag")
			{
				//document.getElementsByTagName('*')[i].innerHTML=("Press here to view more pages.");
				var itemx=findPosX(document.getElementsByTagName('*')[i])+2;
				var itemy=findPosY(document.getElementsByTagName('*')[i])+128;
				
				var out=document.body;
				out.innerHTML+=("<div id='' style='background-color:black; color:white; height:20px; width:198.5px; font-size:0.8em; overflow:hidden; position:absolute; left:"+itemx+"px; top:"+itemy+"px;'/>Press on this image to see more.</div>")
				
			}
			
		}
	}
	
	function findPosX(obj)
	{
		var curleft=0;
		if(obj.offsetParent)
		while(1)
		{
			curleft += obj.offsetLeft
			if(!obj.offsetParent)
			break;
			obj=obj.offsetParent;
		}
		else if(obj.x)
		curleft+=obj.x;
		
		return curleft;
	}
		function findPosY(obj)
	{
		var curtop=0;
		if(obj.offsetParent)
		while(1)
		{
			curtop += obj.offsetTop
			if(!obj.offsetParent)
			break;
			obj=obj.offsetParent;
		}
		else if(obj.y)
		curtop+=obj.y;
		
		return curtop;
	}

