
///// Favicon ///////////////////////////////////////////////////////////////////

document.write('<link REL="SHORTCUT ICON" HREF="http://www.rsphotographic.co.uk/rs_icon.ico">')
//document.write('<link REL="SHORTCUT ICON" HREF="http://10.0.0.11/rsphoto_2012/rs_icon.ico">')

////// Baseroot /////////////////////////////////////////////////////////////////

//var baseroot="/rsphoto_2012"
var baseroot=""

////// Domainroot ///////////////////////////////////////////////////////////////

var rootdomain="http://"+window.location.hostname+baseroot

////// Top buttons /////////////////////////////////////////////////////////////


document.write('<table width="100%" border=" 0" cellpadding="0" cellspacing="0" bgcolor="" class="topbuttonarea"><tr><td valign="middle" align="center">')
document.write('<table width="1050" border=" 0" cellpadding="0" cellspacing="0" bgcolor=""><tr>')
document.write('<td><div class="brand_home_selected" style="HEIGHT: 28px"><a href="'+rootdomain+'/home/index.cgi?itemname=index"target="_parent">Home</a></div></td>')
document.write('<td><div class="brand_home" style="HEIGHT: 28px"><a href="'+rootdomain+'/home/index.cgi?itemname=about" target="_parent">About Us</a></div></td>')
document.write('<td><div class="brand_home" style="HEIGHT: 28px"><a href="'+rootdomain+'/home/index.cgi?itemname=contact" target="_parent">Contact Us</a></div></td>')
document.write('<td><div class="brand_home" style="HEIGHT: 28px"><a href="'+rootdomain+'/home/index.cgi?itemname=pricelists" target="_parent">Price List</a></div></td>')
document.write('<td><div class="brand_home" style="HEIGHT: 28px"><a href="'+rootdomain+'/home/index.cgi?itemname=links" target="_parent">Useful Links</a></div></td>')
document.write('<td><div class="brand_home" style="HEIGHT: 28px"><a href="'+rootdomain+'/home/index.cgi?itemname=offers" target="_parent">Special Offers</a></div></td>')
document.write('<td><div class="brand_home" style="HEIGHT: 28px"><a href="'+rootdomain+'/home/index.cgi?itemname=comps" target="_parent">Competitions</a></div></td>')
//document.write('<tr><td><br></td></tr>')
document.write('</tr></table>')
document.write('</tr></table>')

// LOGO image ///////////////////////////////////////////////////////////////////

function toplogo(){
document.write('<a href="'+rootdomain+'/home/index.cgi?itemname=index" title="Go To Home Page" target="_parent"><img src="'+rootdomain+'/pics/logo.gif" border="0" align="left" id="logoid"></a>')
//document.write('<a href="'+rootdomain+'/home/index.cgi?itemname=index" title="Go To Home Page" target="_parent"><img src="'+rootdomain+'/pics/home_button.gif" border="0" align="left" id="logoid"></a>')
//document.write('<a href="'+rootdomain+'/home/index.cgi?itemname=contact" title="Contact Us" target="_parent"><img src="'+rootdomain+'/pics/contact_button.gif" border="0" align="left" id="logoid"></a>')
//document.write('<a href="'+rootdomain+'/home/index.cgi?itemname=about" title="About Us" target="_parent"><img src="'+rootdomain+'/pics/about_button.gif" border="0" align="left" id="logoid"></a>')
//document.write('<a href="'+rootdomain+'/home/index.cgi?itemname=pricelists" title="Price Lists" target="_parent"><img src="'+rootdomain+'/pics/price_button.gif" border="0" align="left" id="logoid"></a>')
}

// LOGO /////////////////////////////////////////////////////////////////////////

function rightlogo(){
document.write('<div class="media">')
document.write('<a href="http://www.facebook.com/RSPhotographic" target="_blank" title="Find Us On Facebook"><img src="../pics/facebook_top.png" border="0"></a> ')
document.write('<a href="http://www.twitter.com/RSPhotographic" target="_blank" title="Find Us On Twitter"><img src="../pics/twitter_top.png" border="0"></a> ')
document.write('<a href="http://www.rsphotographic.blogspot.com/" target="_blank" title="Read Our Blogg"><img src="../pics/blogger_top.png" border="0"></a> ')
document.write('<a href="http://www.ukbride.co.uk/supplier/rs-photographic/home" target="_blank" title="Find Us on UKbride"><img src="../pics/ukbride_top.png" border="0"></a>')
document.write('<br><br></div>')

}

// Search Feature //////////////////////////////////////////////////////////////

function searchfeatures(){
document.write+tapfeatures()
document.write+spacer()
document.write+sinkfeatures()
document.write+spacer()
document.write+solutionfeatures()
document.write+spacer()
document.write+popularfeatures()
}

// Top Banner /////////////////////////////////////////////////////////////////////////

function topbanner(){
document.write('')
}

////// address //////////////////////////////////////////////////////////////////

function address(){
document.write('<span class="address">RS PHOTOGRAPHIC, 30 West Street, STORRINGTON, RH20 4EE<BR>sales@rsphotographic.co.uk, (T) 01903 748899<br>Normal office hours 09.00 - 17.00 Mon - Fri / 09.30 - 12.30 - Sat / Closed Sun</p>')
}

////// NAV //////////////////////////////////////////////////////////////////////


var mytext=new Array()

//specify text below. You can have as many as you wish
mytext[1]="Weddings"
mytext[2]="Portraits"
mytext[3]="Portrait Parties"
mytext[4]="Emma's diary"
mytext[5]="Other Services"
mytext[6]="Studio Hire"
mytext[7]="Products"
mytext[8]="Galleries"
mytext[9]="My Pictures"
//buttons for my pics
mytext[10]="Home"
mytext[11]="Print Order Form"


//specify corresponding links below
var textlinks=new Array()
textlinks[1]="/home/index.cgi?itemname=weddings"
textlinks[2]="/home/index.cgi?itemname=portraits"
textlinks[3]="/home/index.cgi?itemname=portraitsparties"
textlinks[4]="/home/index.cgi?itemname=emmasdiary"
textlinks[5]="/home/index.cgi?itemname=otherphotography"
textlinks[6]="/home/index.cgi?itemname=studiohire"
textlinks[7]="/home/index.cgi?itemname=products"
textlinks[8]="/home/index.cgi?itemname=galleries"
textlinks[9]="/home/index.cgi?itemname=mypictures"
//buttons for my pics
textlinks[10]="/home/index.cgi?itemname=index"
textlinks[11]="../pdfs/Basic Print Order Form.pdf"

function navhome(){
//document.write('<li class="selected"><a href="'+rootdomain+''+textlinks[1]+'" >'+mytext[1]+'</a></li>')
for ( var i=1; i<=8; i++ ) 
document.write('<li><a href="'+rootdomain+''+textlinks[i]+'" >'+mytext[i]+'</a></li>')
document.write('<li class="selectedred"><a href="'+rootdomain+''+textlinks[9]+'" >'+mytext[9]+'</a></li>')
}

function navwedding(){
document.write('<li class="selected"><a href="'+rootdomain+''+textlinks[1]+'" >'+mytext[1]+'</a></li>')
for ( var i=2; i<=8; i++ ) 
document.write('<li><a href="'+rootdomain+''+textlinks[i]+'" >'+mytext[i]+'</a></li>')
document.write('<li class="selectedred"><a href="'+rootdomain+''+textlinks[9]+'" >'+mytext[9]+'</a></li>')
}

function navportraits(){
for ( var i=1; i<=1; i++ ) 
document.write('<li><a href="'+rootdomain+''+textlinks[i]+'" >'+mytext[i]+'</a></li>')
document.write('<li class="selected"><a href="'+rootdomain+''+textlinks[2]+'" >'+mytext[2]+'</a></li>')
for ( var i=3; i<=8; i++ ) 
document.write('<li><a href="'+rootdomain+''+textlinks[i]+'" >'+mytext[i]+'</a></li>')
document.write('<li class="selectedred"><a href="'+rootdomain+''+textlinks[9]+'" >'+mytext[9]+'</a></li>')
}

function navportraitparties(){
for ( var i=1; i<=2; i++ ) 
document.write('<li><a href="'+rootdomain+''+textlinks[i]+'">'+mytext[i]+'</a></li>')
document.write('<li class="selected"><a href="'+rootdomain+''+textlinks[3]+'" >'+mytext[3]+'</a></li>')
for ( var i=4; i<=8; i++ ) 
document.write('<li><a href="'+rootdomain+''+textlinks[i]+'" >'+mytext[i]+'</a></li>')
document.write('<li class="selectedred"><a href="'+rootdomain+''+textlinks[9]+'" >'+mytext[9]+'</a></li>')
}

function navemmasdiary(){
for ( var i=1; i<=3; i++ ) 
document.write('<li><a href="'+rootdomain+''+textlinks[i]+'" >'+mytext[i]+'</a></li>')
document.write('<li class="selected"><a href="'+rootdomain+''+textlinks[4]+'" >'+mytext[4]+'</a></li>')
for ( var i=5; i<=9; i++ ) 
document.write('<li><a href="'+rootdomain+''+textlinks[i]+'" >'+mytext[i]+'</a></li>')
}

function navotherphotography(){
for ( var i=1; i<=4; i++ ) 
document.write('<li><a href="'+rootdomain+''+textlinks[i]+'" >'+mytext[i]+'</a></li>')
document.write('<li class="selected"><a href="'+rootdomain+''+textlinks[5]+'" >'+mytext[5]+'</a></li>')
for ( var i=6; i<=8; i++ ) 
document.write('<li><a href="'+rootdomain+''+textlinks[i]+'" >'+mytext[i]+'</a></li>')
document.write('<li class="selectedred"><a href="'+rootdomain+''+textlinks[9]+'" >'+mytext[9]+'</a></li>')
}

function navstudiohire(){
for ( var i=1; i<=5; i++ ) 
document.write('<li><a href="'+rootdomain+''+textlinks[i]+'" >'+mytext[i]+'</a></li>')
document.write('<li class="selected"><a href="'+rootdomain+''+textlinks[6]+'" >'+mytext[6]+'</a></li>')
for ( var i=7; i<=8; i++ ) 
document.write('<li><a href="'+rootdomain+''+textlinks[i]+'" >'+mytext[i]+'</a></li>')
document.write('<li class="selectedred"><a href="'+rootdomain+''+textlinks[9]+'" >'+mytext[9]+'</a></li>')
}

function navproducts(){
for ( var i=1; i<=6; i++ ) 
document.write('<li><a href="'+rootdomain+''+textlinks[i]+'" >'+mytext[i]+'</a></li>')
document.write('<li class="selected"><a href="'+rootdomain+''+textlinks[7]+'" >'+mytext[7]+'</a></li>')
for ( var i=8; i<=8; i++ ) 
document.write('<li><a href="'+rootdomain+''+textlinks[i]+'" >'+mytext[i]+'</a></li>')
document.write('<li class="selectedred"><a href="'+rootdomain+''+textlinks[9]+'" >'+mytext[9]+'</a></li>')
}

function navgalleries(){
for ( var i=1; i<=7; i++ ) 
document.write('<li><a href="'+rootdomain+''+textlinks[i]+'" >'+mytext[i]+'</a></li>')
document.write('<li class="selected"><a href="'+rootdomain+''+textlinks[8]+'" >'+mytext[8]+'</a></li>')
for ( var i=9; i<=9; i++ ) 
document.write('<li class="selectedred"><a href="'+rootdomain+''+textlinks[9]+'" >'+mytext[9]+'</a></li>')
}

function navmypictures(){
for ( var i=1; i<=8; i++ ) 
document.write('<li><a href="'+rootdomain+''+textlinks[i]+'" >'+mytext[i]+'</a></li>')
document.write('<li class="selectedred"><a href="'+rootdomain+''+textlinks[9]+'" >'+mytext[9]+'</a></li>')
}

function navmyimages(){
document.write('<li class="selected"><a href="'+rootdomain+''+textlinks[10]+'" target="_parent">'+mytext[10]+'</a></li>')
for ( var i=11; i<=11; i++ ) 
document.write('<li><a href="'+rootdomain+''+textlinks[i]+'" target="_blank">'+mytext[i]+'</a></li>')
}

////// Left ad //////////////////////////////////////////////////////////////////

function leftad(){
document.write+features()
document.write+spacer()
}


////// home page rotate /////////////////////////////////////////////////////////

var ultimateshow=new Array()

//ultimateshow[x]=["path to image", "OPTIONAL link for image", "OPTIONAL link target"]
ultimateshow[0]=['../pics/home_01.jpg', '', '']
ultimateshow[1]=['../pics/home_02.jpg', '', '']
ultimateshow[2]=['../pics/home_03.jpg', '', '']
ultimateshow[3]=['../pics/home_04.jpg', '', '']
ultimateshow[4]=['../pics/home_05.jpg', '', '']
ultimateshow[5]=['../pics/home_06.jpg', '', '']
ultimateshow[6]=['../pics/home_07.jpg', '', '']
ultimateshow[7]=['../pics/home_08.jpg', '', '']
ultimateshow[8]=['../pics/home_09.jpg', '', '']
ultimateshow[9]=['../pics/home_10.jpg', '', '']
ultimateshow[10]=['../pics/home_11.jpg', '', '']
ultimateshow[11]=['../pics/home_12.jpg', '', '']

//configure the below 3 variables to set the dimension/background color of the slideshow

var slidewidth="615px" //set to width of LARGEST image in your slideshow
var slideheight="263px" //set to height of LARGEST iamge in your slideshow
var slidecycles="continous" //number of cycles before slideshow stops (ie: "2" or "continous")
var randomorder="no" //randomize the order in which images are displayed? "yes" or "no"
var preloadimages="yes" //preload images? "yes" or "no"
var slidebgcolor='white'

//configure the below variable to determine the delay between image rotations (in miliseconds)
var slidedelay=4500

//Wedding Buttons ///////////////////////////////////////////////////////////////

function weddingbuttons(){
document.write('<div class="brand_home2" ><a href="index.cgi?itemname=weddings">Weddings Home</a></div>')
document.write('<div class="brand_home2" ><a href="index.cgi?itemname=weddingpackages">Packages</a></div>')
document.write('<div class="brand_home2" ><a href="index.cgi?itemname=weddingservices">Additional Services</a></div>')
document.write('<div class="brand_home2" ><a href="../pdfs/Wedding Leaflet new.pdf" target="_blank">PDF of Packages</a></div>')
document.write('<br>')
document.write('<div class="brand_home2" ><a href="../picsearch/picsearch.cgi?search=wedding">&gt; Go To Wedding Gallery</a></div>')
}

//Portraits Buttons ///////////////////////////////////////////////////////////////

function portraitbuttons(){
document.write('<div class="brand_home2" ><a href="index.cgi?itemname=portraits">Portraits Home</a></div>')
document.write('<div class="brand_home2" ><a href="index.cgi?itemname=studio">Studio Session</a></div>')
document.write('<br>')
document.write('<div class="brand_home2" ><a href="../picsearch/picsearch.cgi?search=portraits">&gt; Go To Portraits Gallery</a></div>')
}

//Portraits Parties Buttons /////////////////////////////////////////////////////

function portraitpartiesbuttons(){
document.write('<div class="brand_home2" ><a href="index.cgi?itemname=portraitsparties">Portraits Parties Home</a></div>')
document.write('<div class="brand_home2" ><a href="index.cgi?itemname=wear">What To Wear & Bring</a></div>')
document.write('<br>')
document.write('<div class="brand_home2" ><a href="../picsearch/picsearch.cgi?search=portraitparties">&gt; Go To Parties Gallery</a></div>')
}

//Other Services Buttons /////////////////////////////////////////////////////

function otherservicesbuttons(){
document.write('<div class="brand_home2" ><a href="index.cgi?itemname=otherphotography">Other Services Home</a></div>')
document.write('<div class="brand_home2" ><a href="index.cgi?itemname=event" >Events / Concert</a></div>')
document.write('<div class="brand_home2" ><a href="index.cgi?itemname=sports" >School / Sports Team</a></div>')
document.write('<div class="brand_home2" ><a href="index.cgi?itemname=flyerdesign" >Flyer / Poster Design</a></div>')
document.write('<div class="brand_home2" ><a href="index.cgi?itemname=webdesign" >Website Design</a></div>')
document.write('<div class="brand_home2" ><a href="index.cgi?itemname=passport" >Passport / ID / Visa</a></div>')
document.write('<div class="brand_home2" ><a href="index.cgi?itemname=restoration" >Image Restoration</a></div>')
document.write('<br>')
document.write('<div class="brand_home2" ><a href="../picsearch/picsearch.cgi?search=services">&gt; Go To Other Services Gallery</a></div>')
}

// My Pictures Buttons /////////////////////////////////////////////////////////

function mypicturesbuttons(){
document.write('<div class="brand_home2" ><a href="index.cgi?itemname=mypictures">My Pictures Home</a></div>')
document.write('<div class="brand_home2" ><a href="index.cgi?itemname=order">How To Order Prints</a></div>')
document.write('<div class="brand_home2" ><a href="../pdfs/Basic Print Order Form.pdf" target="_blank">Print Order Form</a></div>')
}

// About Us Buttons ////////////////////////////////////////////////////////////

function aboutbuttons(){
document.write('<div class="brand_home2" ><a href="index.cgi?itemname=about">About Us Home</a></div>')
document.write('<div class="brand_home2" ><a href="index.cgi?itemname=robin">Robin Sims</a></div>')
document.write('<BR><BR>')
}

// Dog Comp Buttons ////////////////////////////////////////////////////////////

function dogbuttons(){
document.write('<div class="brand_home2" ><a href="index.cgi?itemname=comps">Competitions Home</a></div>')
document.write('<div class="brand_home2" ><a href="../pdfs/Facebook Comp_cutest dog.pdf" target="_blank">Cutest Dog Comp T&C\'s</a></div>')
document.write('<div class="brand_home2" ><a href="../picsearch/picsearch.cgi?search=portraitsanimals">Dog Gallery</a></div>')
document.write('<div class="brand_home2" ><a href="http://www.facebook.com/RSPhotographic" target="_blank">Go To Our Facbook Page</a></div>')
document.write('<BR><BR>')
}

/////////////////////////////////////////////////////////////////////////////////

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)
}



///////////////////////////////////////////////


var loadedobjects=""
//var rootdomain="http://"+window.location.hostname

function ajaxpage(url, containerid){
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.onreadystatechange=function(){
loadpage(page_request, containerid)
}
page_request.open('GET', url, true)
page_request.send(null)
}

function loadpage(page_request, containerid){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
document.getElementById(containerid).innerHTML=page_request.responseText
}

function loadobjs(){
if (!document.getElementById)
return
for (i=0; i<arguments.length; i++){
var file=arguments[i]
var fileref=""
if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
if (file.indexOf(".js")!=-1){ //If object is a js file
fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", file);
}
else if (file.indexOf(".css")!=-1){ //If object is a css file
fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", file);
}
}
if (fileref!=""){
document.getElementsByTagName("head").item(0).appendChild(fileref)
loadedobjects+=file+" " //Remember this object as being already added to page
}
}
}


///// Spacer ////////////////////////////////////////////////////////////////////

function spacer(){
document.write('<img src="../backgrounds/spacer.gif" width="150" height="5" border="0">')
}


/// GO Link /////////////////////////////////////////////////////////////////////////////////////////

function golink(url){
window.location=url
}

/////// Block java errors //////////////////////////////////

function blockError(){return true;}
window.onerror = blockError;





// -------------------------------------------------------------------
// Virtual Pagination Script- By Dynamic Drive, available at: http://www.dynamicdrive.com
// Last updated: May 31st, 2007
//
// PUBLIC: virtualpaginate(className, chunksize)
// Main Virtual Paginate Object function.
// -------------------------------------------------------------------

function virtualpaginate(className, chunksize, elementType){
var elementType=(typeof elementType=="undefined")? "div" : elementType //The type of element used to divide up content into pieces. Defaults to "div"
this.pieces=virtualpaginate.collectElementbyClass(className, elementType) //get total number of divs matching class name
//Set this.chunksize: 1 if "chunksize" param is undefined, "chunksize" if it's less than total pieces available, or simply total pieces avail (show all)
this.chunksize=(typeof chunksize=="undefined")? 1 : (chunksize>0 && chunksize <this.pieces.length)? chunksize : this.pieces.length
this.pagecount=Math.ceil(this.pieces.length/this.chunksize) //calculate number of "pages" needed to show the divs
this.showpage(-1) //show no pages (aka hide all)
this.currentpage=0 //Having hidden all pages, set currently visible page to 1st page
this.showpage(this.currentpage) //Show first page
}

// -------------------------------------------------------------------
// PRIVATE: collectElementbyClass(classname)- Returns an array containing DIVs with the specified classname
// -------------------------------------------------------------------

virtualpaginate.collectElementbyClass=function(classname, element){ //Returns an array containing DIVs with specified classname
var classnameRE=new RegExp("(^|\\s+)"+classname+"($|\\s+)", "i") //regular expression to screen for classname within element
var pieces=[]
var alltags=document.getElementsByTagName(element)
for (var i=0; i<alltags.length; i++){
if (typeof alltags[i].className=="string" && alltags[i].className.search(classnameRE)!=-1)
pieces[pieces.length]=alltags[i]
}
return pieces
}

// -------------------------------------------------------------------
// PUBLIC: showpage(pagenumber)- Shows a page based on parameter passed (0=page1, 1=page2 etc)
// -------------------------------------------------------------------

virtualpaginate.prototype.showpage=function(pagenumber){
var totalitems=this.pieces.length //total number of broken up divs
var showstartindex=pagenumber*this.chunksize //array index of div to start showing per pagenumber setting
var showendindex=showstartindex+this.chunksize-1 //array index of div to stop showing after per pagenumber setting
for (var i=0; i<totalitems; i++){
if (i>=showstartindex && i<=showendindex)
this.pieces[i].style.display="block"
else
this.pieces[i].style.display="none"
}
this.currentpage=parseInt(pagenumber)
if (this.cpspan) //if <span class="paginateinfo> element is present, update it with the most current info (ie: Page 3/4)
this.cpspan.innerHTML='Page '+(this.currentpage+1)+'/'+this.pagecount
}

// -------------------------------------------------------------------
// PRIVATE: paginate_build_() methods- Various methods to create pagination interfaces
// paginate_build_selectmenu(paginatedropdown)- Accepts an empty SELECT element and turns it into pagination menu
// paginate_build_regularlinks(paginatelinks)- Accepts a collection of links and screens out/ creates pagination out of ones with specific "rel" attr
// paginate_build_flatview(flatviewcontainer)- Accepts <span class="flatview"> element and replaces it with sequential pagination links
// paginate_build_cpinfo(cpspan)- Accepts <span class="paginateinfo"> element and displays current page info (ie: Page 1/4)
// -------------------------------------------------------------------

virtualpaginate.prototype.paginate_build_selectmenu=function(paginatedropdown, anchortext){
var instanceOfBox=this
var anchortext=anchortext || new Array()
this.selectmenupresent=1
for (var i=0; i<this.pagecount; i++){
if (typeof anchortext[i]!="undefined") //if custom anchor text for this link exists, use anchor text as each OPTION's text
paginatedropdown.options[i]=new Option(anchortext[i], i)
else //else, use auto incremented, sequential numbers
paginatedropdown.options[i]=new Option("Page "+(i+1)+" of "+this.pagecount, i)
}
paginatedropdown.selectedIndex=this.currentpage
paginatedropdown.onchange=function(){
instanceOfBox.showpage(this.selectedIndex)
}
}

virtualpaginate.prototype.paginate_build_regularlinks=function(paginatelinks){
var instanceOfBox=this
for (var i=0; i<paginatelinks.length; i++){
var currentpagerel=paginatelinks[i].getAttribute("rel")
if (currentpagerel=="previous" || currentpagerel=="next" || currentpagerel=="first" || currentpagerel=="last") //screen for these "rel" values
paginatelinks[i].onclick=function(){
instanceOfBox.navigate(this.getAttribute("rel"))
return false
}
}
}

virtualpaginate.prototype.paginate_build_flatview=function(flatviewcontainer, anchortext){
var instanceOfBox=this
var flatviewhtml=""
var anchortext=anchortext || new Array()
for (var i=0; i<this.pagecount; i++){
if (typeof anchortext[i]!="undefined") //if custom anchor text for this link exists
flatviewhtml+='<a href="#flatview" rel="'+i+'">'+anchortext[i]+'</a> ' //build pagination link using custom anchor text
else
flatviewhtml+='<a href="#flatview" rel="'+i+'">'+(i+1)+'</a> ' //build  pagination link using auto incremented sequential number instead
}
flatviewcontainer.innerHTML=flatviewhtml
this.flatviewlinks=flatviewcontainer.getElementsByTagName("a")
for (var i=0; i<this.flatviewlinks.length; i++){
this.flatviewlinks[i].onclick=function(){
instanceOfBox.flatviewlinks[instanceOfBox.currentpage].className="" //"Unhighlight" last flatview link clicked on...
this.className="selected" //while "highlighting" currently clicked on flatview link (setting its class name to "selected"
instanceOfBox.showpage(this.getAttribute("rel"))
return false
}
}
this.flatviewlinks[this.currentpage].className="selected" //"Highlight" current page
this.flatviewpresent=true //indicate flat view links are present
}

virtualpaginate.prototype.paginate_build_cpinfo=function(cpspan){
this.cpspan=cpspan
cpspan.innerHTML='Page '+(this.currentpage+1)+'/'+this.pagecount
}


// -------------------------------------------------------------------
// PRIVATE: buildpagination()- Create pagination interface by calling one or more of the paginate_build_() functions
// -------------------------------------------------------------------

virtualpaginate.prototype.buildpagination=function(divid, optnavtext){
var instanceOfBox=this
var paginatediv=document.getElementById(divid)
if (this.chunksize==this.pieces.length){ //if user has set to display all pieces at once, no point in creating pagination div
paginatediv.style.display="none"
return
}
var paginationcode=paginatediv.innerHTML //Get user defined, "unprocessed" HTML within paginate div
if (paginatediv.getElementsByTagName("select").length>0) //if there's a select menu in div
this.paginate_build_selectmenu(paginatediv.getElementsByTagName("select")[0], optnavtext)
if (paginatediv.getElementsByTagName("a").length>0) //if there are links defined in div
this.paginate_build_regularlinks(paginatediv.getElementsByTagName("a"))
var allspans=paginatediv.getElementsByTagName("span") //Look for span tags within passed div
for (var i=0; i<allspans.length; i++){
if (allspans[i].className=="flatview")
this.paginate_build_flatview(allspans[i], optnavtext)
else if (allspans[i].className=="paginateinfo")
this.paginate_build_cpinfo(allspans[i])
}
this.paginatediv=paginatediv
}

// -------------------------------------------------------------------
// PRIVATE: navigate(keyword)- Calls this.showpage() with the currentpage property preset based on entered keyword
// -------------------------------------------------------------------

virtualpaginate.prototype.navigate=function(keyword){
if (this.flatviewpresent)
this.flatviewlinks[this.currentpage].className="" //"Unhighlight" previous page (before this.currentpage increments)
if (keyword=="previous")
this.currentpage=(this.currentpage>0)? this.currentpage-1 : (this.currentpage==0)? this.pagecount-1 : 0
else if (keyword=="next")
this.currentpage=(this.currentpage<this.pagecount-1)? this.currentpage+1 : 0
else if (keyword=="first")
this.currentpage=0
else if (keyword=="last")
this.currentpage=this.pieces.length-1
this.showpage(this.currentpage)
if (this.selectmenupresent)
this.paginatediv.getElementsByTagName("select")[0].selectedIndex=this.currentpage
if (this.flatviewpresent)
this.flatviewlinks[this.currentpage].className="selected" //"Highlight" current page
}




////////////////////////////////

function gone()
{
location=document.jumpy.example.options[document.jumpy.example.selectedIndex].value
}

/***********************************************
* Random Content (from DIVs) script- by JavaScript Kit (www.javascriptkit.com)
* This notice must stay intact for usage
* Visit JavaScript Kit at http://www.javascriptkit.com/ for this script and 100s more
***********************************************/

if (document.getElementById)
document.documentElement.className = 'jsclass'; //hide content for DOM capable browsers


var randomcontentdisplay={
	divholders:new Object(),
	masterclass: "randomcontent",

	init:function(){
		if (!document.getElementById)
			return
		var alldivs=document.getElementsByTagName("div")
		var randomcontentsearch=new RegExp(this.masterclass+"\\s+(group\\d+)", "i") //check for CSS class="randomcontent groupX" (x=integer)
		for (var i=0; i<alldivs.length; i++){
			if (randomcontentsearch.test(alldivs[i].className)){
				if (typeof this.divholders[RegExp.$1]=="undefined") //if array to hold this group of divs doesn't exist yet
					this.divholders[RegExp.$1]=new Array() //create array first
					this.divholders[RegExp.$1].push(alldivs[i]) //add this div to the array
			}
		}
	this.showone()
	},

	showone:function(){
		for (group in this.divholders){ //loop thru each array within object
			var chosenOne=Math.floor(Math.random()*this.divholders[group].length) //randomly pick one entry from array
			this.divholders[group][chosenOne].style.display="block" //display content corresponding to the chosen entry
		}
	}
}


///// Dropdown menu code /////////////////////////////////////////////////////////////

var disappeardelay=250  //menu disappear speed onMouseout (in miliseconds)
var enableanchorlink=1 //Enable or disable the anchor link when clicked on? (1=e, 0=d)
var hidemenu_onclick=1 //hide menu when user clicks within menu? (1=yes, 0=no)

/////No further editting needed

var ie5=document.all
var ns6=document.getElementById&&!document.all

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function showhide(obj, e, visible, hidden){
if (ie5||ns6)
dropmenuobj.style.left=dropmenuobj.style.top=-500
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie5 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie5 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie5 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function dropdownmenu(obj, e, dropmenuID){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
if (typeof dropmenuobj!="undefined") //hide previous menu
dropmenuobj.style.visibility="hidden"
clearhidemenu()
if (ie5||ns6){
obj.onmouseout=delayhidemenu
dropmenuobj=document.getElementById(dropmenuID)
if (hidemenu_onclick) dropmenuobj.onclick=function(){dropmenuobj.style.visibility='hidden'}
dropmenuobj.onmouseover=clearhidemenu
dropmenuobj.onmouseout=ie5? function(){ dynamichide(event)} : function(event){ dynamichide(event)}
showhide(dropmenuobj.style, e, "visible", "hidden")
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}
return clickreturnvalue()
}

function clickreturnvalue(){
if ((ie5||ns6) && !enableanchorlink) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie5&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function delayhidemenu(){
delayhide=setTimeout("dropmenuobj.style.visibility='hidden'",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

/// Switch Menu ////////////////////////////////////////////////////////////////////////////////////////////////

/***********************************************
* Switch Menu script- by Martial B of http://getElementById.com/
* Modified by Dynamic Drive for format & NS4/IE4 compatibility
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

if (document.getElementById){ //DynamicDrive.com change
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"); //DynamicDrive.com change
		if(el.style.display != "block"){ //DynamicDrive.com change
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="submenu") //DynamicDrive.com change
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "block";
		}
	}
}


/***********************************************
* Switch Menu2 script- by Martial B of http://getElementById.com/
* Modified by Dynamic Drive for format & NS4/IE4 compatibility
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

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";
		}
	}
}

/***********************************************
* Switch Menu3 script- by Martial B of http://getElementById.com/
* Modified by Dynamic Drive for format & NS4/IE4 compatibility
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

if (document.getElementById){ //DynamicDrive.com change
document.write('<style type="text/css">\n')
document.write('.submenu3{display: none;}\n')
document.write('</style>\n')
}

function SwitchMenu3(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=="submenu3") //DynamicDrive.com change
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}



// Iframe ///////

/***********************************************
* 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=["myframe"]

//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"

var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers

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+FFextraHeight; 
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.detachEvent("onload", readjustIframe) // Bug fix line
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



