function PopUpImage(Image1,caption,ImgWidth,ImgHeight) {
	var TheBrowserName = navigator.appName;
	var TheBrowserVersion = parseFloat(navigator.appVersion);
	var WinVars = '';
	var UseDefaults = false;
	// add 16 to the image width to account for browser width; 12 for margin
	var WinWidth = parseInt(ImgWidth) + 28;
	// add 32 to the image height to account for browser height; 12 for margin; 30 for caption
	var WinHeight = parseInt(ImgHeight) + 74;
	
	// MAX DIMENSIONS    ,width=800,height=572
	if (WinWidth > 800)
		WinWidth = 980;
	if (WinHeight > 572)
		WinHeight = 572;
	if (WinWidth <= 600)
		WinWidth = 600;
	if (WinHeight <= 400)
		WinHeight = 400;
		
	if ((WinWidth != 800) && (WinHeight != 572))
		WinVars = 'toolbar=no,menubar=no,resizable=yes,width='+escape(WinWidth)+',height='+escape(WinHeight)+',scrollbars=yes,top=0,left=0';
	else // for large images, use the users default browser size
		WinVars = 'toolbar=no,menubar=no,resizable=yes,scrollbars=yes,top=0,left=0';
	
	ImageWindow = window.open("", "WindowTitle", WinVars);
	ImageWindow.document.write("<HTML>\n<HEAD><TITLE>www.amerlease.com - "+caption+"</TITLE>\n");
	ImageWindow.document.write("<LINK rel='stylesheet' href='www.trucktraderonline.com/include/master_styles_v04.css' type='text/css'>\n");
	ImageWindow.document.write("<style type='text/css'><!-- \n");
	ImageWindow.document.write(".DetailCaption {	margin: 6px; padding: 3px; height: 34px; background-color: #EFEBD6; border: #105184 solid 1px; }\n");
	// ImageWindow.document.write(".CaptionClose {	margin: 6px; padding: 3px; background-color: #EFEBD6; border: #105184 solid 1px; }\n");
	ImageWindow.document.write(" --></style></HEAD>\n");
	ImageWindow.document.write("<BODY BGCOLOR='#EFEBD6' onload=focus('WindowTitle'); background='http://images.traderonline.com/img/ttol/detail_tile_bkg.gif' marginwidth='0' marginheight='0' leftmargin='0' topmargin='0' rightmargin='0' bottommargin='0'>\n");
	// write the caption
	ImageWindow.document.write("<div class='DetailCaption'>");
	if (((TheBrowserName == 'Netscape') && (TheBrowserVersion >= 5)) || 
		((TheBrowserName == 'Microsoft Internet Explorer') && (TheBrowserVersion >= 4) && (navigator.userAgent.indexOf("Mac") == -1))) {
		if (caption != "") {
			ImageWindow.document.write("<span class='TextT1Md' style='position:relative;float:left;width:340px;'>Caption: &nbsp;<b>"+caption+"</b></span>\n");
		}
		ImageWindow.document.write("<a href='javascript:window.opener.focus()' class='closelink' style='float:right;position:absolute;top:12px;right:118px;'>[ back to ad detail ]</a>\n<a href='javascript:top.window.close()' class='closelink' style='position:absolute;float:right;top:12px;right:12px;'>[ close window ]</a></div>\n");
	} else {
		if (caption != "") {
			ImageWindow.document.write("<span class='TextT1Md'>Caption: &nbsp;<b>"+caption+"</b></span>\n");
		}
		ImageWindow.document.write("<br /><a href='javascript:window.opener.focus()' class='closelink'>[ back to ad detail ]</a> &nbsp; \n<a href='javascript:top.window.close()' class='closelink'>[ close window ]</a></div>\n");
	}




	
	// show the image
	ImageWindow.document.write("<div align='center'><img src='"+Image1+"' border='1' alt='photo'></div>\n");
	
	ImageWindow.document.write("\n</BODY>\n</HTML>\n");
	ImageWindow.document.close();
	
	//  usage  --  href="javascript:PopUpImage('Image1','caption','width','height');"
}

// My Trader Function
counter = 0;

function saveIt(ad_id){
	var newWind;
	if(newWind)	{
	    newWind = window.close();
	}
	var ad_id1 = ad_id;
	
		var sendString = '?ad_id='+escape(ad_id1);
	
	
// redirect for cctol php save vehicle page

	
	var newurl = "www.trucktraderonline.com/include/save_vehicle.html"+sendString;
	newWind = window.open("www.trucktraderonline.com/include/save_vehicle.html"+sendString, "TraderOnline","toolbar=no,menubar=no,resizable=no,scrollbars=no,width=300,height=225,top=72,left=72");

	newWind.focus
	var logged_in=unescape(document.cookie);
	if(counter< 1) {
		newWind.focus();
	}
	else if (logged_in.indexOf('UID') == -1) {
		newWind.focus();
	}
	else {
		newWind = newWind.close();
	}
	counter++;
}