



	function random(howMany) { 
		var choice;
		var range = howMany; 

		if (Math.random) {
			choice = Math.round(Math.random() * (range-1));
			}
			else {
				var now = new Date();
				choice = (now.getTime() / 1000) % range;
			}
		choice = choice+1;
		return choice;
	}

	function PopUpCM(url) 
	{
		var xheight = '500';
		var xwidth = '700';
		popupCM = window.open(url,'popupCM','height='+xheight+',width='+xwidth+',scrollbars=0,resizable=0,menubar=0,toolbar=0,location=0,directories=0,status=0,left='+(parseInt((screen.availWidth-xwidth)/2))+',top='+(parseInt(((screen.availHeight-xheight)/2)-30))+'');
		popupCM.document.close();
		popupCM.focus();
	}

	function PopUpPhoto(img,title,width,height) 
	{
		var yheight = (height+45);
		var s1 = "<html><head><title>"+title+"</title><link rel=stylesheet href='../incluir/web/js/sm/style_global.css' type='text/css'>"+
				 "</head><body onBlur='self.close()'>";
		var s2 = "<div><img src='../incluir/web/js/sm/%22+img+%22' border='0' width='"+width+"' height='"+height+"' alt=''></div>";
		var s3 = "<div align='center'><p>[ <a href = '#' onClick='window.close(self);'>.</a> ]</p></div></body></html>";
	
		popupphoto = window.open('','','height='+yheight+',width='+width+',scrollbars=0,resizable=0,menubar=0,toolbar=0,location=0,directories=0,status=0,left='+(parseInt((screen.availWidth-width)/2))+',top='+(parseInt(((screen.availHeight-yheight)/2)-30))+'');
		popupphoto.document.write(s1+s2+s3);
		popupphoto.document.close();
	}
	
//  comenzamos con el Swap de imagenes

	var firstImg = true
	var X2;
	var Y2;
	
	function GallerySwap(ubicacion,model,which,X2,Y2) 
	{
		this.X2 = X2
		this.Y2 = Y2
		
		NewImage = ubicacion + model + "_" + which + "_sm.jpg";
		PopupImage = ubicacion + model + "_" + which + "_lg.jpg";
			
		document.mediumPhoto.src = NewImage;

		return firstImg = false;
		return PopupImage;
	}	
	
function GalleryPop(ubicacion,model,X1,Y1) {
		if (firstImg == true) { 
		GalleryOpen(ubicacion + model + '_azu_lg.jpg','Honda de Venezuela',X1,Y1); 
		}
		else { 
		GalleryOpen(PopupImage,'Honda de Venezuela',X2,Y2);		
		
		}
	}


	function GalleryOpen(img,title,width,height) 
	{
		var imagen = (img);
		var myWidth = (width);
		var myHeight = (height+16); // adjusts window height		
		var LeftPos = (parseInt((screen.availWidth-myWidth)/2));
		var TopPos = (parseInt(((screen.availHeight-myHeight)/2)-40));
		var css_src = 'css/style_global.css';  // location of css for style


	//creamos la variables para escribirlas  con el document.write
		
		var g1 = "<html><head><title>"+title+"</title>"+ "<link rel=stylesheet href="+css_src+" type='text/css'>";
		var g2 = "</head><body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0' onBlur='window.close(self);'> <div><img src='"+imagen+"' border='0'" + "width='"+width+"' height='"+height+"' alt=''></div>";
		var g3 = "<div align='center'><a href = '#' onClick='window.close(self);'><font size='1' face='Arial, Helvetica, sans-serif'>"+"Cerrar Ventana</font></a></div></body></html>";
		
		popupgallery = window.open('../../pop.htm','popupgallery','height='+myHeight+',width='+myWidth+',scrollbars=0,resizable=0,menubar=0,toolbar=0,location=0,directories=0,'+'status=0,left='+LeftPos+',top='+TopPos+'');
		popupgallery.document.write(g1+g2+g3);
		popupgallery.document.close();
		popupgallery.focus();
		}
		
		
		function GalleryOpen2(img,title,width,height) {	
		var imagen = (img);
		var myWidth = (width);
		var myHeight = (height+16); // adjusts window height		
		var LeftPos = (parseInt((screen.availWidth-myWidth)/2));
		var TopPos = (parseInt(((screen.availHeight-myHeight)/2)-40));
		var css_src = 'css/screencss.css';  // location of css for style


	//creamos la variables para escribirlas  con el document.write
		
		var g1 = "<html><head><title>"+title+"</title>"+ "<link rel=stylesheet href="+css_src+" type='text/css'>";
		var g2 = "</head><body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0' onBlur='window.close(self);'><img src='"+imagen+"' border='0'" + "width='"+width+"' height='"+height+"' alt=''>";
		var g3 = "<div align='center'><a class='enlace_activo_html' href = '#' onClick='window.close(self);'><font size='1' face='Arial, Helvetica, sans-serif'>"+"Cerrar Ventana</font></a></div></body></html>";
		
		popupgallery = window.open('../../pop.htm','popupgallery','height='+myHeight+',width='+myWidth+',scrollbars=0,resizable=0,menubar=0,toolbar=0,location=0,directories=0,'+'status=0,left='+LeftPos+',top='+TopPos+'');
		popupgallery.document.write(g1+g2+g3);
		popupgallery.document.close();
		popupgallery.focus();
		}
		