function personalizedView(alRecordSet,mapviewer,siteExt,page,locale,siteLocale,sResultmatch,previous,next,results,Disfromsearch,sTel,sEmail,sAddress,sDealerinfo,sImage,sManager,sWebsite,s24Phn,sFax,sMoreinfo,sDirection,sTdirection,sTdistance,sTotaltime,sGetdir,sSunday,sMonday,sTuesday,sWednesday,sThursday,sFriday,sSaturday,sMinutes,sLabel,sEmailloc,sTime,sPrintpage,sHoliday)
{
	this._userRec = null;
	this._ballons = new DLBalloons('mapviewer');
 	this._recordSet = alRecordSet;
	//alert(alRecordSet.records);
 	this._recOrds = alRecordSet.records;
	this._recCNT = gblRecIdx-1; //0;
	this.siteExt = siteExt;
	this.page = page;
	this.locale = locale;
	this.siteLocale = siteLocale;
	this.sResultmatch=sResultmatch;
	this.previous=previous;
	this.next=next;
	this.results=results;
	this._mapViewer=mapviewer;
	this.sTel=sTel;
	this.sEmail=sEmail;
	this.sAddress=sAddress;
	this.sDealerinfo=sDealerinfo;
	this.sImage=sImage;
	this.sManager=sManager;
	this.sWebsite=sWebsite;
	this.s24Phn=s24Phn;
	this.sFax=sFax;
	this.Disfromsearch=Disfromsearch;
	this.sMoreinfo=sMoreinfo;
	this.sDirection=sDirection;
	this.sTotaltime=sTotaltime;
	this.sTdirection=sTdirection;
	this.sTdistance=sTdistance;
	this.sGetdir=sGetdir;
	this.sSunday=sSunday;
	this.sMonday=sMonday;
	this.sTuesday=sTuesday;
	this.sWednesday=sWednesday;
	this.sThursday=sThursday;
	this.sFriday=sFriday;
	this.sSaturday=sSaturday;
	this.sMinutes=sMinutes;
	this.sLabel=sLabel;
	this.sEmailloc=sEmailloc;
	this.sTime=sTime;
	this.sPrintpage=sPrintpage;
	this.sHoliday=sHoliday;
	
}

personalizedView.prototype.view = function() 
{
	with (this)
	{
	 	_viewLoyaltyDealers('recLoyalty');
 		//_viewNormalDealers('recNormal');
		//if(pagination==false) {
	 	_viewPaginationLinks('pageLinks');
		_viewPaginationLinks('toppageLinks');
	 	//}
 		if(_userRec) 
 		{
			_ballons.addTargetUser(_userRec, "<img src='/DealerLocator/images/Target.gif'>");
		}
		
		
 	}
}

personalizedView.prototype.targetUser = function(userRec) 
{
	this._userRec=userRec;
	//alert("Inside Target User before displaying actual results on map");
	//alert(userRec);
}    

personalizedView.prototype._viewPaginationLinks = function (tblID)
{
	with (this) 
	{ 
		if(tblID=='toppageLinks')
		{
			_cleanUp('toppageLinks');	
		}
		else if(tblID=='pageLinks'){
			_cleanUp('pageLinks');	
		}
		//_cleanUp('pageLinks');	
		////var noLinks = Math.ceil(_recordSet.totalRecordCount/recPerpage);
		//alert("Total Records: "+_recordSet.totalRecordCount+"per page: "+recPerpage+"No of links: "+noLinks);	
	    var tblBody = document.getElementById(tblID);	
		
		var row = document.createElement('tr');
		row.setAttribute('width','900px');
		row.setAttribute('height','30px');
		var cell = document.createElement('td');
		
			
			
			cell.style.backgroundColor = "#cccccc";
			cell.style.color = "RED";
			cell.setAttribute('align','left');
		if(tblID=='toppageLinks')
		{
			//cell.appendChild(document.createTextNode(_recordSet.totalRecordCount+' Results match your search criteria')); 
			cell.appendChild(document.createTextNode(' ')); 
			cell.appendChild(document.createTextNode(_recordSet.totalRecordCount+' '+sResultmatch)); 
		}
		
			row.appendChild(cell);
		
		


//		if(noLinks > 1)
//		{
			pagination = true;
			/*for(var irec=1; irec<=noLinks; irec++)
			{
				var vCell = document.createElement('td');
			    var anchor = document.createElement('a');
			    anchor.href = 'javascript:searchAgain('+irec+');'; //'#';
			    anchor.appendChild(document.createTextNode(irec)); 
				vCell.appendChild(anchor);
				row.appendChild(vCell);
			}
			tblBody.appendChild(row);
			document.getElementById('pageDiv').style.display = "inline";
			*/
            if(_recordSet.totalRecordCount>10)
            {
			var vCellPrev = document.createElement('td'); 
			
				vCellPrev.style.backgroundColor = "#cccccc";
			vCellPrev.style.color = "RED";
			
			vCellPrev.setAttribute('align','right');
			if(gblRecIdx > 1)
			{
			    var anchor = document.createElement('a');
			    anchor.href = 'javascript:searchPrev();'; 
			    anchor.appendChild(document.createTextNode(previous+' '+recPerpage+' '+results)); 
				vCellPrev.appendChild(anchor);
			}
			else
			{
				vCellPrev.appendChild(document.createTextNode(previous+' '+recPerpage+' '+results)); 
			}
			//row.appendChild(vCellPrev);
			var vCellDiv = document.createElement('td');
		
				vCellDiv.style.backgroundColor = "#cccccc";
				vCellDiv.style.color = "RED";
			
			vCellDiv.setAttribute('align','center');
			vCellPrev.appendChild(document.createTextNode('  |  '));
			//row.appendChild(vCellDiv);
			var vCellNext = document.createElement('td');
			
				vCellNext.style.backgroundColor = "#cccccc";
				vCellNext.style.color = "RED";
			
			vCellNext.setAttribute('align','left');
			if ((gblRecIdx+recPerpage-1) < _recordSet.totalRecordCount)
			{
			    anchor = document.createElement('a');
			    anchor.href = 'javascript:searchNext();'; 
			    anchor.appendChild(document.createTextNode(next+' '+recPerpage+' '+results)); 
				vCellPrev.appendChild(anchor);
			}
			else
			{
				vCellPrev.appendChild(document.createTextNode(next+' '+recPerpage+' '+results)); 			
			}
			//row.appendChild(vCellNext);
		//	row.appendChild(cell);
			
			//document.getElementById('pageDiv').style.display = "inline";
			row.appendChild(vCellPrev);
//		}
//		else
//		{
//			document.getElementById('pageDiv').style.display = "none";		
//		}
	}
	tblBody.appendChild(row);
}


}
personalizedView.prototype._viewLoyaltyDealers = function (tblID)
{
	with (this) 
	{
		_cleanUp(tblID);
		var showFlag = false;
		for (var count = 0, rl = _recOrds.length; count < rl; count++ ) 
		{
			var record = _recOrds[count];
			//alert("Inside view loyalty dealers");
			//alert(_recOrds[count]);     
			//if(record.loyalty=='y' || record.loyalty == 'Y') 
			//if(record.fst=='y' || record.fst == 'Y' || record.bc=='y' || record.bc == 'Y' || record.tkp=='y' || record.tkp == 'Y' || record.agp=='y' || record.agp == 'Y' || record.fd=='y' || record.fd == 'Y') 
			//{
				
			//	 if(document.getElementById('maxDist').value=='' || parseFloat(document.getElementById('maxDist').value)>parseFloat(record.driving_distance.km))
			//	{
					_recCNT = _recCNT + 1; // Incrementing the record counter
					_DLMultiView(record, tblID);
					_ballons.addDealer(record, _recCNT,sTel,sEmail,sAddress,sDealerinfo,sImage,sManager,sWebsite,s24Phn) ; //(count+1));sTel,sEmail,sAddress,sDealerinfo,sImage,sManager,sWebsite,s24Phn)
					showFlag = true;
			//	}
				
			//}
		}
		if(showFlag) 
		{
			document.getElementById('loyaltyDiv').style.display = "inline";
			document.getElementById('spaceDiv').style.display = "inline";	
		}
		else 
		{
			document.getElementById('loyaltyDiv').style.display = "none";	
			document.getElementById('spaceDiv').style.display = "none";
		}
	}
}
/* Not in use...
personalizedView.prototype._viewNormalDealers = function (tblID)
{
	with (this) 
	{
		_cleanUp(tblID);	
		var showFlag = false;
		for (var count = 0, rl = _recOrds.length; count < rl; count++ ) 
		{
			var record = _recOrds[count];    
			//if(record.fst=='n' && record.fst == 'N' && record.bc=='n' && record.bc == 'N' && record.tkp=='n' && record.tkp == 'N' && record.agp=='n' && record.agp == 'N' && record.fd=='n' && record.fd == 'N') 
			if(!(record.fst=='y' || record.fst == 'Y' || record.bc=='y' || record.bc == 'Y' || record.tkp=='y' || record.tkp == 'Y' || record.agp=='y' || record.agp == 'Y' || record.fd=='y' || record.fd == 'Y'))
			{
			
				_recCNT = _recCNT + 1; // Incrementing the record counter			
				_DLMultiView(record, tblID);
				_ballons.addDealer(record, _recCNT) ; //(count+1));				
				showFlag = true;			
			//	}
			}
		}
		if(showFlag) 
		{
			document.getElementById('normalDiv').style.display = "inline";
			
			}
		else
		{
			document.getElementById('normalDiv').style.display = "none";
			
			}	
	}
}
*/
personalizedView.prototype._DLMultiView = function(record, tblID) 
{
	//alert(record.name);
	var uLat = this._userRec.coords.lat;
	var uLon = this._userRec.coords.lon;
	var sTdistance=this.sTdistance;
    var sTdirection=this.sTdirection;
    var sTotaltime=this.sTotaltime;
    var sGetdir=this.sGetdir;
	var sSunday=this.sSunday;
	var sMonday=this.sMonday;
	var sTuesday=this.sTuesday;
	var sWednesday=this.sWednesday;
	var sThursday=this.sThursday;
	var sFriday=this.sFriday;
	var sSaturday=this.sSaturday;
	var sMinutes=this.sMinutes;
	var sLabel=this.sLabel;
	var sEmailloc=this.sEmailloc;
	var sTime=this.sTime;
	var sPrintpage=this.sPrintpage;
	var sHoliday=this.sHoliday;
	var sTel=this.sTel;
	var sEmail=this.sEmail;
	var sAddress=this.sAddress;
	var sDealerinfo=this.sDealerinfo;
	var sImage=this.sImage;
	var sManager=this.sManager;
	var sWebsite=this.sWebsite;
	var s24Phn=this.s24Phn;
	var sFax=this.sFax;
	var Disfromsearch=this.Disfromsearch;
	var sMoreinfo=this.sMoreinfo;
	var sDirection=this.sDirection;
	var sLocale = this.siteLocale;
	//alert(uLat);
	//alert(uLon);
	//alert(record.point.lat);
	//alert(record.point.lon);
		
	//
	
    var tblBody = document.getElementById(tblID);
	var row = document.createElement('tr');
	//First column
	var vCell = document.createElement('td');
	//vCell.setAttribute('width','400px');
	//vCell.setAttribute('height','50px');
	vCell.style.backgroundColor = "#cccccc";
	vCell.style.color = "RED";
	var	image = document.createElement('img');
	var tbl= document.createElement('table');
	
	var tablebody = document.createElement('tbody');
	tbl.setAttribute("width","100%");
	
	var Frow = document.createElement('tr');
	var Fcell = document.createElement('td');
	Fcell.setAttribute('align','left');
	
	Fcell.style.fontWeight="bold";//('font-wight','bold');		
	
	//var anchor = document.createElement('a');
	//anchor.href = '#';
	//anchor.record_id = record.id;
	//anchor.setAttribute('id','dlAnchor');
	//anchor.appendChild(document.createTextNode(record.name)); 
	//var stExt = this.siteExt;
	//var spage = this.page;
	//anchor.onclick = function () { 
		//alert('Shows you dealer information...'+'<%=portalContext.createDisplayURL(\"dealer_info?clientID=\"+record.client_id)%>');// return false;
	//	window.open("/portal/site/DealerLocator/template.dealer_info?clientID="+record.client_id+"&distSearch="+record.distance.km+"&cLat="+record.point.lat+"&cLon="+record.point.lon+"&uLat="+uLat+"&uLon="+uLon+"&siteExt="+stExt+"&page="+spage, "DealerInformation", "height=550,width=700,menubar=no, status=no, location=no, toolbar=no, scrollbars=yes, resizable=yes");
		//window.open("DL_dealerInfo.jsp?clientID="+record.client_id, "DealerInformation", "height=550,width=700,menubar=no, status=no, location=no, toolbar=no, scrollbars=yes, resizable=yes");
	//};	
	Fcell.appendChild(document.createTextNode((this._recCNT) + '. '));
	Fcell.appendChild(document.createTextNode(record.name)); 
	Frow.appendChild(Fcell);
		
	//Second column
	var vCell2 = document.createElement('td');
	vCell2.setAttribute('align','right');
	if(record.psr=='y' || record.psr == 'Y') 
	{
		image = document.createElement('img');
		image.setAttribute('src','/DealerLocator/images/ico_grey_car_2.gif');
		image.setAttribute('alt','Car');
		vCell2.appendChild(image);
		vCell2.appendChild(document.createTextNode('  '));
	}
	
	if(record.mc=='y' || record.mc == 'Y') 
	{
		image = document.createElement('img');
		image.setAttribute('src','/DealerLocator/images/ico_grey_motorcycle_2.gif'); 
		image.setAttribute('alt','Motorcycle');
		vCell2.appendChild(image);
		vCell2.appendChild(document.createTextNode('  '));		
	}
	
	if(record.agri=='y' || record.agri == 'Y') 
	{
		image = document.createElement('img');
		image.setAttribute('src','/DealerLocator/images/ico_grey_agri_2.gif'); 
		image.setAttribute('alt','Agricutur');
		vCell2.appendChild(image);
		vCell2.appendChild(document.createTextNode('  '));
	}
	
	if(record.tbr=='y' || record.tbr == 'Y') 
	{
		image = document.createElement('img');
		image.setAttribute('src','/DealerLocator/images/ico_grey_truck_2.gif'); 
		image.setAttribute('alt','Truck');
		vCell2.appendChild(image);
		vCell2.appendChild(document.createTextNode('  '));
	}
	
	if(record.otr=='y' || record.otr == 'Y') 
	{
		image = document.createElement('img');
		image.setAttribute('alt','Off The Road');
		image.setAttribute('src','/DealerLocator/images/ico_grey_offroad_2.gif'); 
		vCell2.appendChild(image);
		vCell2.appendChild(document.createTextNode('  '));
	}
	
	Frow.appendChild(vCell2);
	

	tablebody.appendChild(Frow);
	tbl.appendChild(tablebody);
	vCell.appendChild(tbl);
	row.appendChild(vCell);

	var row10 = document.createElement('tr');
	vCell = document.createElement('td');
	if(record.fst=='y' || record.fst == 'Y') 
	{	
		anchor = document.createElement('a');
	    anchor.href = '#';
		anchor.onclick = function () { 
				callForLegends("firststop",stExt);
		};
			   
		image = document.createElement('img');
		image.setAttribute('src','/DealerLocator/images/ico_FS.gif');
		image.setAttribute('alt','Firststop');
		image.setAttribute("border","0");
		anchor.appendChild(image);
		 		
		vCell.appendChild(anchor); 
		vCell.appendChild(document.createTextNode('  '));
	}

	if(record.bc=='y' || record.bc == 'Y') 
	{	
		anchor = document.createElement('a');
		anchor.href = '#';
		anchor.onclick = function () { 
				callForLegends("bikersclub",stExt);
		};	    						
		image = document.createElement('img');
		image.setAttribute('src','/DealerLocator/images/ico_bc.gif');
		image.setAttribute('alt','BikersClub');
		image.setAttribute("border","0");
		anchor.appendChild(image);
					
		vCell.appendChild(anchor); 
		vCell.appendChild(document.createTextNode('  '));			
	}

	if(record.tkp=='y' || record.tkp == 'Y') 
	{	
		anchor = document.createElement('a');
	    anchor.href = '#';
		anchor.onclick = function () { 
				callForLegends("truckpoint",stExt);
		};	 
		image = document.createElement('img');
		image.setAttribute('src','/DealerLocator/images/ico_TP.gif');
		image.setAttribute('alt','TruckPoint');
		image.setAttribute("border","0");
		anchor.appendChild(image);
					
		vCell.appendChild(anchor); 
		vCell.appendChild(document.createTextNode('  '));			
	}

	if(record.agp=='y' || record.agp == 'Y') 
	{	
		anchor = document.createElement('a');
	    anchor.href = '#';
		anchor.onclick = function () { 
				callForLegends("agripoint",stExt);
		};	 

		image = document.createElement('img');
		image.setAttribute('src','/DealerLocator/images/ico_AP.gif');
		image.setAttribute('alt','AgriPoint');
		image.setAttribute("border","0");
		anchor.appendChild(image);
					
		vCell.appendChild(anchor); 
		vCell.appendChild(document.createTextNode('  '));			
	}

	if(record.fd=='y' || record.fd == 'Y') 
	{	
		anchor = document.createElement('a');
	   anchor.href = '#';
		anchor.onclick = function () { 
				callForLegends("rft",stExt);
		};	 

		image = document.createElement('img');
		image.setAttribute('src','/DealerLocator/images/ico_runflat.gif');
		image.setAttribute('alt','Run Flat');
		image.setAttribute("border","0");
		anchor.appendChild(image);
					
		vCell.appendChild(anchor);
		vCell.appendChild(document.createTextNode('  '));			
	}
	if(record.rft=='y' || record.rft == 'Y') 
	{	
		anchor = document.createElement('a');
	   anchor.href = '#';
		anchor.onclick = function () { 
				callForLegends("rft",stExt);
		};	 

		image = document.createElement('img');
		image.setAttribute('src','/DealerLocator/images/ico_runflat.gif');
		image.setAttribute('alt','Elite');
		image.setAttribute("border","0");
		anchor.appendChild(image);
					
		vCell.appendChild(anchor);
		vCell.appendChild(document.createTextNode('  '));			
	}
	/*if(record.psr=='y' || record.psr == 'Y') 
	{
		image = document.createElement('img');
		image.setAttribute('src','/DealerLocator/images/CAR.jpg'); 
		vCell.appendChild(image);
	}
	if(record.mc=='y' || record.mc == 'Y') 
	{
		image = document.createElement('img');
		image.setAttribute('src','/DealerLocator/images/MC.jpg'); 
		vCell.appendChild(image);
	}
	if(record.agri=='y' || record.agri == 'Y') 
	{
		image = document.createElement('img');
		image.setAttribute('src','/DealerLocator/images/AG.jpg'); 
		vCell.appendChild(image);
	}
	if(record.tbr=='y' || record.tbr == 'Y') 
	{
		image = document.createElement('img');
		image.setAttribute('src','/DealerLocator/images/TRUCK.jpg'); 
		vCell.appendChild(image);
	}
	if(record.otr=='y' || record.otr == 'Y') 
	{
		image = document.createElement('img');
		image.setAttribute('src','/DealerLocator/images/OTR.jpg'); 
		vCell.appendChild(image);
	}*/
	if(record.otr_elite=='y' || record.otr_elite == 'Y') 
	{	
		anchor = document.createElement('a');
	    anchor.href = '#';
		anchor.onclick = function () { 
				callForLegends("otr_elite",stExt);
		};	 

		image = document.createElement('img');
		image.setAttribute('src','/DealerLocator/images/ico_offroad.gif');
		image.setAttribute('alt','OTR Elite');
		image.setAttribute("border","0");
		anchor.appendChild(image);
					
		vCell.appendChild(anchor); 
		vCell.appendChild(document.createTextNode('  '));			
	}
	row10.appendChild(vCell);

	var row2 = document.createElement('tr');
	//First column
	vCell = document.createElement('td');
	if(record.street==null)record.street="";

	vCell.appendChild(document.createTextNode(record.street));
	//Second column	
	vCell2 = document.createElement('td');
	vCell2.appendChild(document.createTextNode('')); 
	row2.appendChild(vCell);
	row2.appendChild(vCell2);

    
    var row3 = document.createElement('tr');
	//First column
	vCell = document.createElement('td');
	vCell.appendChild(document.createTextNode(record.town));
	//Second column
	vCell2 = document.createElement('td');
	vCell2.appendChild(document.createTextNode('')); 
	row3.appendChild(vCell);
	row3.appendChild(vCell2);

    
	var row4 = document.createElement('tr');
	//First column
	vCell = document.createElement('td');
	vCell.appendChild(document.createTextNode(record.pc));
	//Second column
	vCell2 = document.createElement('td');
	vCell2.appendChild(document.createTextNode('')); 
	row4.appendChild(vCell);
	row4.appendChild(vCell2);
	//for telephone
	var row5 = document.createElement('tr');
	//First column
	vCell = document.createElement('td');
	vCell.appendChild(document.createTextNode(this.sTel+': '+record.telephone));
	//Second column
	vCell2 = document.createElement('td');
	vCell2.appendChild(document.createTextNode(' ')); 
	row5.appendChild(vCell);
	row5.appendChild(vCell2);

//    for fax
var row6 = document.createElement('tr');
	//First column
	vCell = document.createElement('td');
	tbl= document.createElement('table');
	var tbody = document.createElement('tbody');
	tbl.setAttribute("width","100%");
	var trow = document.createElement('tr');
	var tcell = document.createElement('td');
		tcell.setAttribute("width","50%");
		tcell.setAttribute("align","left");
	tcell.appendChild(document.createTextNode(this.sFax+': '+record.fax));
	//Second column
	var tcell2 = document.createElement('td');
	tcell2.setAttribute("width","50%");
	tcell2.setAttribute("align","right");
	tcell2.appendChild(document.createTextNode(this.Disfromsearch+' '+record.distance.km+' km'));
	trow.appendChild(tcell);
	trow.appendChild(tcell2);
	tbody.appendChild(trow);
	tbl.appendChild(tbody);
	vCell.appendChild(tbl);
	row6.appendChild(vCell);
	
//	for email
var row7 = document.createElement('tr');
	
	vCell = document.createElement('td');
	
	tbl= document.createElement('table');
	var tbody = document.createElement('tbody');
		tbl.setAttribute("width","100%");
		
	var trow = document.createElement('tr');
	//First column
	var tcell = document.createElement('td');
		tcell.setAttribute("width","50%");
		tcell.setAttribute("align","left");
		if(record.email==null)record.email="No Email Available";
		tcell.appendChild(document.createTextNode(this.sEmail+' : '+record.email));
	//Second column
	var tcell2 = document.createElement('td');
		tcell2.setAttribute("width","50%");
		tcell2.setAttribute("align","right");
		var anchor = document.createElement('a');
	anchor.href = '#';
	anchor.record_id = record.id;
	anchor.setAttribute('id','dlAnchor');
	anchor.appendChild(document.createTextNode(this.sMoreinfo)); 
	var stExt = this.siteExt;
	var stLoc = this.locale;
	var spage = this.page;
	anchor.onclick = function () { 
		//alert('Shows you dealer information...'+'<%=portalContext.createDisplayURL(\"dealer_info?clientID=\"+record.client_id)%>');// return false;
		window.open("/portal/site/DealerLocator/template.dealer_info?clientID="+record.client_id+"&distSearch="+record.distance.km+"&cLat="+record.point.lat+"&cLon="+record.point.lon+"&uLat="+uLat+"&uLon="+uLon+"&siteExt="+stExt+"&page="+spage+"&distSearch="+record.distance.km+"&sTdistance="+sTdistance+"&sTdirection="+sTdirection+"&sTotaltime="+sTotaltime+"&sSunday="+sSunday+"&sMonday="+sMonday+"&sTuesday="+sTuesday+"&sWednesday="+sWednesday+"&sThursday="+sThursday+"&sFriday="+sFriday+"&sSaturday="+sSaturday+"&sLabel="+sLabel+"&sEmailloc="+sEmailloc+"&sTime="+sTime+"&sPrintpage="+sPrintpage+"&sHoliday="+sHoliday+"&sTLoc="+stLoc+"&siteLoc="+sLocale+"&sTel="+sTel+"&sFax="+sFax+"&sEmail="+sEmail+"&sWebsite="+sWebsite+"&s24Phn="+s24Phn+"&sManager="+sManager+"&sGetdir="+sGetdir+"&sMinutes="+sMinutes, "DealerInformation", "fullscreen=yes, menubar=no, status=no, location=no, toolbar=no, scrollbars=yes, resizable=yes");
		//window.open("DL_dealerInfo.jsp?clientID="+record.client_id, "DealerInformation", "height=550,width=700,menubar=no, status=no, location=no, toolbar=no, scrollbars=yes, resizable=yes");
	};	
	tcell2.appendChild(anchor);
	trow.appendChild(tcell);
	trow.appendChild(tcell2);
	tbody.appendChild(trow);
	tbl.appendChild(tbody);
	vCell.appendChild(tbl);
	row7.appendChild(vCell);
	//row7.appendChild(vCell2);
	
		//for website
	var row8 = document.createElement('tr');
	//First column
	vCell = document.createElement('td');
		tbl= document.createElement('table');
		tbody = document.createElement('tbody');
		tbl.setAttribute("width","100%");
			trow = document.createElement('tr');
			//First column
			tcell = document.createElement('td');
				tcell.setAttribute("width","50%");
				tcell.setAttribute("align","left");
				tcell.appendChild(document.createTextNode(this.sWebsite+' : '));
				anchor = document.createElement('a');
			    anchor.href = '#';
			    //anchor.record_id = record.id;
			    anchor.appendChild(document.createTextNode(record.url)); 
			     anchor.onclick = function () { 
				window.open(""+record.url, "DealerInformation", "fullscreen=yes, menubar=yes, status=no, location=yes, toolbar=yes, scrollbars=yes, resizable=yes");

				};
			    tcell.appendChild(anchor);
				//Second column
				tcell2 = document.createElement('td');
				tcell2.setAttribute("width","50%");
				tcell2.setAttribute("align","right");
				anchor = document.createElement('a');
			    anchor.href = '#';
			    //anchor.record_id = record.id;
			    anchor.appendChild(document.createTextNode(this.sDirection)); 
			    
			    var sLoc = this.locale;
			    anchor.onclick = function () {
				window.open("/portal/site/DealerLocator/template.get_directions?cLat="+record.point.lat+"&cLon="+record.point.lon+"&uLat="+uLat+"&uLon="+uLon+"&siteExt="+stExt+"&page="+spage+"&sLoc="+sLoc+"&distSearch="+record.distance.km+"&sTdistance="+sTdistance+"&sTdirection="+sTdirection+"&sTotaltime="+sTotaltime+"&sMinutes="+sMinutes, "DealerDirction", "fullscreen=yes, menubar=yes, status=no, location=yes, toolbar=yes, scrollbars=yes, resizable=yes");
		//window.open("DL_getDirections.jsp?cLat="+record.point.lat+"&cLon="+record.point.lon+"&uLat="+uLat+"&uLon="+uLon, "DealerInformation", "height=550,width=700,menubar=no, status=no, location=no, toolbar=no, scrollbars=yes, resizable=yes");
	};
	tcell2.appendChild(anchor); 
	trow.appendChild(tcell);
	trow.appendChild(tcell2);
	tbody.appendChild(trow);
	tbl.appendChild(tbody);
	vCell.appendChild(tbl);
	row8.appendChild(vCell);
	//row8.appendChild(vCell2);
	
	
	//var row9 = document.createElement('tr');
	//First column
	//vCell = document.createElement('td');
	//anchor = document.createElement('a');
    //anchor.href = '#';
    //anchor.record_id = record.id;
    //anchor.appendChild(document.createTextNode('Show on Map')); 
    //anchor.onclick = function () { 
	//	window.open("/portal/site/DealerLocator/template.get_directions?cLat="+record.point.lat+"&cLon="+record.point.lon+"&uLat="+uLat+"&uLon="+uLon, "DealerInformation", "height=550,width=700,menubar=no, status=no, location=no, toolbar=no, scrollbars=yes, resizable=yes");
		//window.open("DL_getDirections.jsp?cLat="+record.point.lat+"&cLon="+record.point.lon+"&uLat="+uLat+"&uLon="+uLon, "DealerInformation", "height=550,width=700,menubar=no, status=no, location=no, toolbar=no, scrollbars=yes, resizable=yes");
	//};
	//vCell2.appendChild(anchor); 
	//Second column
   // vCell2 = document.createElement('td');
	//vCell2.appendChild(document.createTextNode(''));
   // row9.appendChild(vCell);
    //row9.appendChild(vCell2);
    
	tblBody.appendChild(row);
	tblBody.appendChild(row10);
	//tblBody.appendChild(row1);
	tblBody.appendChild(row2);
	tblBody.appendChild(row3);
	tblBody.appendChild(row4);
	tblBody.appendChild(row5);
	tblBody.appendChild(row6);
	tblBody.appendChild(row7);
	tblBody.appendChild(row8);
	
	//tblBody.appendChild(row9);
	/*
	if(tblID=='recLoyalty')
	{
		var row10 = document.createElement('tr');
		//First column
		vCell = document.createElement('td');
		image = document.createElement('img');
		image.setAttribute('src','/DealerLocator/images/top.gif');
		image.setAttribute('alt','FIRSTSTOP');
		image.setAttribute('width','180px');
		vCell.appendChild(image);
		//Second column
		vCell2 = document.createElement('td');
		vCell2.appendChild(document.createTextNode(''));
		row10.appendChild(vCell);
	    row10.appendChild(vCell2);
		tblBody.appendChild(row10);
	}
	*/
}

personalizedView.prototype._cleanUp = function(clElement)
{
	var recEle = document.getElementById(clElement);
	while (recEle.firstChild) 
	{
		recEle.removeChild(recEle.firstChild);
	}       
}

personalizedView.prototype._showPopup = function(msg)
{
	//alert(msg);
}
