<!--

//Commented out as it caused a problem with Edit screen
//Edit screen would automatically redirect to a full page preview...
/*if (top.frames.length > 0)
{
        top.location.href = location.href;
}*/
   
//Ad Rotator Code
//DL 11/5/2003
var imageURL = new Array(5); //add new array entry here for image
imageURL[0] = "grapegrowerlarge.jpg";
imageURL[1] = "grapegrowerlarge.jpg";
imageURL[2] = "vinestowineslarge.jpg";
imageURL[3] = "genvitlarge.jpg";
imageURL[4] = "northerwineworklarge3.jpg";
imageURL[5] = "vscover.jpg";

var imageLink = new Array(5); //add new array entry here for the image link
imageLink[0] = "www.amazon.com/exec/obidos/ASIN/1890132829/bluedoorviney-20";
imageLink[1] = "www.amazon.com/exec/obidos/ASIN/1890132829/bluedoorviney-20";
imageLink[2] = "www.amazon.com/exec/obidos/ASIN/1580171052/bluedoorviney-20";
imageLink[3] = "www.amazon.com/exec/obidos/ASIN/0520025911/bluedoorviney-20";
imageLink[4] = "www.amazon.com/exec/obidos/ASIN/1891267663/bluedoorviney-20";
imageLink[5] = "www.amazon.com/exec/obidos/ASIN/0971766002/bluedoorviney-20";


var imageText = new Array(5); //add new array entry here for image text
imageText[0] = "<a href='http:\/\/www.amazon.com/exec/obidos/ASIN/1890132829/bluedoorviney-20'>The Grape Grower</a> by Lon Rombough";
imageText[1] = "<a href='http:\/\/www.amazon.com/exec/obidos/ASIN/1890132829/bluedoorviney-20'>The Grape Grower</a> by Lon Rombough";
imageText[2] = "<a href='http:\/\/www.amazon.com/exec/obidos/ASIN/1580171052/bluedoorviney-20'>From Vines to Wines</a> by Jeff Cox";
imageText[3] = "<a href='http:\/\/www.amazon.com/exec/obidos/ASIN/0520025911/bluedoorviney-20'>General Viticulture</a> by Albert Winkler";
imageText[4] = "<a href='http:\/\/www.amazon.com/exec/obidos/ASIN/1891267663/bluedoorviney-20'>Northern Winework</a> by Tom Plocher and Bob Parke";
imageText[5] = "<a href='http:\/\/www.amazon.com/exec/obidos/ASIN/0971766002/bluedoorviney-20'>Vineyard Simple</a> by Tom Powers";

var altTag = new Array(5); //add new array entry here for alt tag
altTag[0] = "The Grape Grower by Lon Rombough - Click to order!";
altTag[1] = "The Grape Grower by Lon Rombough - Click to order!";
altTag[2] = "From Vines to Wines by Jeff Cox - Click to order!";
altTag[3] = "General Viticulture by Albert Winkler - Click to order!";
altTag[4] = "Northern Winework by Tom Plocher and Bob Parke - Click to order!";
altTag[5] = "Vineyard Simple by Tom Powers - Click to order!";

var index=Math.round(Math.random()*5); //Change number after * to reflect number of highest element in array
var imageTag;
var adInfo;
adInfo = imageText[index] + "<br>";
imageTag = "<a href='http:\/\/" + imageLink[index] + "'>Click here to order this book on Amazon.com!</a><br><br><a href='http:\/\/" + imageLink[index] + "'><img src='images/" + imageURL[index] + "' border='0' alt='" + altTag[index] + "'></a><br><br>";

// original code by Bill Trefzger 12/12/96
// modified by Don Lundgren 4/29/02
function go1(){
	if (document.selecter1.select1.options[document.selecter1.select1.selectedIndex].value != "none") {
		url = document.selecter1.select1.options[document.selecter1.select1.selectedIndex].value;	window.open(url,'linkWindow','toolbar=yes,directories=no,location=no,status=yes,menubar=no,resizable=no,scrollbars=yes,width=800,height=600,screenX=100,screenY=75,left=100,top=75');
		url = "";
	}
}

function go2(selectInfo){
	if (selectInfo.options[selectInfo.selectedIndex].value != "none") {
		url = selectInfo.options[selectInfo.selectedIndex].value;	window.open(url,'linkWindow','toolbar=yes,directories=no,location=no,status=yes,menubar=no,resizable=no,scrollbars=yes,width=800,height=600,screenX=100,screenY=75,left=100,top=75');
		url = "";
	}
}

function popUp(url){
	window.open(url,'varietyWindow','toolbar=yes,directories=no,location=no,status=yes,menubar=no,resizable=no,scrollbars=yes,width=800,height=200,screenX=100,screenY=75,left=100,top=75');
}

function popUpWin(url){
	window.open(url,'linkWindow','toolbar=yes,directories=no,location=no,status=yes,menubar=no,resizable=no,scrollbars=yes,width=800,height=600,screenX=100,screenY=75,left=100,top=75');
}

function SplitIt( InString, SplitChar )
{
   var SplitStringArray = InString.split(SplitChar);
   for ( i=0; i<SplitStringArray.length; i++ )
   {
      alert ( "SplitStringArray[" + i + "]= " + SplitStringArray[i] );
   }
}

function popUpVarietyInfo(url){
	window.open(url,'varietyWindow','toolbar=yes,directories=no,location=no,status=yes,menubar=no,resizable=no,scrollbars=yes,width=575,height=550,screenX=100,screenY=75,left=100,top=75');
}

function popUpPlantInfo(url){
	window.open(url,'plantWindow','toolbar=yes,directories=no,location=no,status=yes,menubar=no,resizable=no,scrollbars=yes,width=575,height=550,screenX=100,screenY=75,left=100,top=75');
}

function dynPopup(url,w,h){
	var width;
	var height;
	var initWidth;
	var initHeight;

	initWidth = parseInt(w); //converts w to int
	initHeight = parseInt(h); //converts h to int
	width = initWidth + 40;
	height = initHeight + 30;

	window.open(url,'pictureWindow','toolbar=no,directories=no,location=no,status=no,menubar=no,resizable=no,scrollbars=yes,width=' + width + ',height=' + height + ',screenX=100,screenY=75,left=100,top=75');
}