// JavaScript Document

var qry = new Object();


//all of the fields in which the search was performed on.... stored in the coord array..
query = function(parcelID,saleDate,salePrice,appraisedValue,size,X,Y)
{
this.parcelID = parcelID;
this.saleDate = saleDate
this.salePrice = salePrice;
this.appraisedValue = appraisedValue;
this.size= size;
this.x = X;
this.y = Y;
}




qry.Location = function(x,y,pid)
{
 this.x = x;
 this.y = y;
 this.pid  =pid;
}

qry.MapPin = function(query)
{
	this.pinBlock =null;
	this.id = query.parcelID;
	this.image;
	this.location = new qry.Location(query.x,query.y,query.parcelID);
}




qry.MapPin.prototype.showCall = function(vMap)
{
      this.pin = document.createElement("img");
	  this.pinshad = document.createElement("img");
	  this.pin.style.height=35;
	  this.pin.style.width = 20;
	  
	  		
	           if(this.location.x > vMap.wXMin && this.location.x < vMap.wXMax && this.location.y < vMap.wYMax && this.location.y > vMap.wYMin)
	              { 
	                var pPoint = vMap.toViewPoint(this.location.x,this.location.y)
	                var xLeft = pPoint.X;
	                var xTop = pPoint.Y;
					var vLeft=xLeft+"px"
	                var vTop=xTop+"px";
					 
					 this.pinBlock = document.createElement("div");
						
					 this.pinBlock.id = this.id;	
					 this.pinBlock.style.position = "absolute";
					 this.pinBlock.name= "pin";
					 //add the images to the pinBloc div and set their proporties----------------------
					 this.pinBlock.appendChild(this.pin);
					 this.pinBlock.appendChild(this.pinshad);
					 //this.pinloc = document.createElement("span");
					
					 this.pin.style.position = "absolute";
	                 this.pinshad.style.position = "absolute";
					 this.pin.style.top="0px";
					 this.pin.style.left = "0px"
					 this.pinshad.style.top="5px";
					 this.pinshad.style.left = "5px"
					 this.pin.style.zIndex = "3"
					 this.pinshad.style.zIndex = "4";
	                  this.pinBlock.style.left= vLeft
	                  this.pinBlock.style.top= vTop
					  this.pinBlock.style.width=35;
					  this.pinBlock.style.height=38;
	                  //this.pin.id = this.id;
					  //this.pinBlock.style.border = "solid 2px #990000"
					  
					  this.pinBlock.x = xLeft+15;
					  this.pinBlock.y = xTop+25;
	                  
					  if(this.id)
					  {
	                     this.pinBlock.onmouseover=showReqInfo;
	                     this.pinBlock.onmouseout=Hideinfo;
	                  }
					 this.pin.src = "images/bluepin.png"	  
	                 this.pinshad.src = "images/pinshadow.png"
	                 
	                 
					  if (zoomReqID == this.id)
					   {
					    this.pin.src = "images/yellowpin.png"
					   }
	                 this.pinBlock.style.zIndex="3";
	            }
	
}


qry.MapPin.prototype.showReqInfo = function showReqInfo()
{

	for(i=0;i<parcelArray.length;i++)
	{
		if(parcelArray[i].parcelID == this.id)
		{ 
			this.sh = document.createElement("span");
			this.sp = document.createElement("div");
			this.sp.id="reqInfo";
			this.inner = document.createElement("span");
			
		    var info = "<strong>Parcel ID:</strong> "+parcelArray[i].parcelID+"<br><strong>Sale Date: </strong> "+parcelArray[i].saleDate;
		    info += "<br><strong>Sale Price: $</strong> "+parcelArray[i].salePrice+"<br><strong>Value: $</strong> "+parcelArray[i].appraisedValue
		    info += "<br><strong>Lot Size:</strong> "+parcelArray[i].size+"</div></span>" 
	
			this.inner.innerHTML =info;
			
			
			this.inner.id = "reqin"
			this.im = document.createElement("img");
			this.im.src = "images/leftNub.gif"
			this.im.id = "nub"
			this.sp.appendChild(this.inner);
			this.sp.appendChild(this.im);
			this.sp.appendChild(this.sh);
			var image = document.getElementById('mapImage');
			image.parentNode.appendChild(this.sp);
			
			this.sh.id = "reqInfoShadow"
			this.sh.style.height = this.inner.offsetHeight;
			this.sp.style.top = (this.y-40)+"px";
			this.sp.style.left = (this.x+ 3)+"px";
			this.sp.style.filter ="progid:DXImageTransform.Microsoft.Fade(duration=1)"
			this.sp.filters[0].Apply();  
			this.sp.style.visibility="visible";
			
			
			this.sp.filters[0].Play(); 
			//updateShadow('reqInfoShad','reqInfo');
		}
	}
}



function Hideinfo(){
	//this.sp.removeChild(this.inner);
	//this.sp.removeChild(this.im);
	//this.sp.removeChild(this.sh);
	//this.sp.innerHTML="";
	
	this.sp.style.visibility="hidden";
	//this.updateShadow('reqInfoShad','reqInfo')
}






/*
//gets the coordinates and id
qry.Location = function(){	          
	           this.x; 
	           this.y; 
	           this.pid;   
}
qry.MapPin = function(location)
{
	this.pinBlock;
	this.id = location.pid;
	this.image;
	this.location = location;
}

qry.MapPin.prototype.showCall = function(image){

			   this.image = image;
               this.pin = document.createElement("img");
	           this.pinshad = document.createElement("img");
			   this.pin.style.height=35;
			   this.pin.style.width = 20;
	          var loc = new qry.Loc();
			// this.mode = mode;
	           if(this.location.x>vMap.wXMin &&this.location.x<vMap.wXMax&&this.location.y<vMap.wYMax&&this.location.y>vMap.wYMin)
			   	{
				//	 var xLeft=Math.round((this.x-map.wXMin)/map.xFact-5)
				//	 var xTop = Math.round((map.wYMax - this.y)/map.yFact+25 )
				//	 var vLeft=xLeft+"px"
	             //    var vTop=xTop+"px";
					 
					 this.pinBlock = document.createElement("div");
					this.pinBlock.id = this.id;
					 this.pinBlock.style.position = "absolute";
					 this.pinBlock.name= "pin";
					 //add the images to the pinBloc div and set their proporties----------------------
					 this.pinBlock.appendChild(this.pin);
					 this.pinBlock.appendChild(this.pinshad);
					 this.pinloc = document.createElement("span");
					 
					 
					 this.pin.style.position = "absolute";
	                 this.pinshad.style.position = "absolute";
					 this.pin.style.top="0px";
					 this.pin.style.left = "0px"
					 this.pinshad.style.top="5px";
					 this.pinshad.style.left = "5px"
					 
					  var pt = vMap.toViewPoint(this.location.x, this.location.y); 
	                  this.pinBlock.style.left= pt.X;
	                  this.pinBlock.style.top= pt.Y;
					  this.pinBlock.style.width=35;
					  this.pinBlock.style.height=38;
	                  this.pin.id = this.id;
				//	  alert(this.pin.id)
					  //this.pinBlock.style.border = "solid 2px #990000"
					  
			//		  this.pinBlock.x = xLeft+15;
			//		  this.pinBlock.y = xTop+25;
	                  
	                  //-----mouse over-------------------------------------------------------------------
					  if(this.pin.id)
					  {
	                  //this.pinBlock.onmouseover=showqryInfo;
	                  //this.pinBlock.onmouseout=Hideinfo;
					//  this.pinshad.onmouseover=showqryInfo;
	               //   this.pinshad.onmouseout=Hideinfo;
					  }
	                  
					 //the default pin color is blue -----------------------------------------------------
					 this.pin.src = "images/bluepin.png"
					   //------make the pin yellow if the user uses the zoom tool ---------------------------
					 
					 zoomID = top.mapframe.zoomID
					  if (zoomID == this.pin.id) {
					    // alert(zoomID + " , " + this.pin.id)
						  this.pin.src = "images/yellowpin.png"
					  }
					 
					  //alert(zoomID)
					  //pin shadow properties ---------------------------------------------------------------
	                    this.pinshad.src = "images/pinshadow.png"
	                    this.pinshad.className = "shadow";
	                    this.pinBlock.style.zIndex="4";
					    this.pinshad.style.zIndex="3";
					    loc.pinBlock = this.pinBlock;
					    loc.pinshad = this.pinshad;            
	               
	        }
	// return this; 		
}


qry.Location.prototype.showqryInfo = function showqryInfo(){
//alert(printTable.length)
alert(parcelArray.length)
   var pidx = this.id


	for(i=0;i<printTable.length;i++) 
	    {
	    //alert(printTable[i][1])
		if (pidx == printTable[i][1]) 
		
		   {
		   this.y = printTable[i][8]
		   this.x = printTable[i][7]
		   
		//	alert(parcelArray[i].parcelID) 
		  

			this.sh = document.createElement("span");
			this.sp = document.createElement("div");
			this.sp.id="qryInfo";
			this.inner = document.createElement("span");
			var stat="";
	
			this.inner.innerHTML ="<strong>Parcel ID:</strong> "//+coordArray[i].qryID//+"<br><strong>Sale Date: $</strong> "+myQuery[i].qryType+"<br><strong>Sale Price: $</strong> "+myQuery[i].Description+"<strong>Value: $</strong> "+stat+"<br><strong>Lot Size:</strong> "+myQuery[i].qryType+"Acres</div></span>" 
			this.inner.id = "qryin"
			this.im = document.createElement("img");
			this.im.src = "images/leftNub.gif"
			this.im.id = "nub"
			this.sp.appendChild(this.inner);
			this.sp.appendChild(this.im);
			this.sp.appendChild(this.sh);
			var image = document.getElementById('mapImage');
			image.parentNode.appendChild(this.sp);
			
			//sets the offset for the pin shadow
			//this.sh.id = "qryInfoShadow"
			//this.sh.style.height = this.inner.offsetHeight;
			
			//sets the offset for the pin
			this.sp.style.top = (this.y-40)+"px";
			this.sp.style.left = (this.x+ 3)+"px";
			this.sp.style.filter ="progid:DXImageTransform.Microsoft.Fade(duration=1)"
			this.sp.filters[0].Apply();  
			this.sp.style.visibility="visible";
			
			
			this.sp.filters[0].Play(); 
			//updateShadow('qryInfoShad','qryInfo');
		}
		 
	}
}



function Hideinfo(){
	this.sp.removeChild(this.inner);
	this.sp.removeChild(this.im);
	this.sp.removeChild(this.sh);
	this.sp.innerHTML="";
	
	this.sp.style.visibility="hidden";
	//this.updateShadow('qryInfoShad','qryInfo')
}
*/
