
/***********************************************
* Dynamic Ajax Content- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var bustcachevar=1 //bust potential caching of external pages after initial request? (1=yes, 0=no)
var loadedobjects=""
var rootdomain="http://"+window.location.hostname
var bustcacheparameter=""

function ajaxpage(url, containerid){
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
} 
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.onreadystatechange=function(){
loadpage(page_request, containerid)
}
if (bustcachevar) //if bust caching of external page
bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
page_request.open('GET', url+bustcacheparameter, true)
page_request.send(null)

setTimeout(
		   
        function() 
		          {
			$("#mapavina").fancybox({ 
									'type': 'iframe',
  			'height'	: 350,
			  'width'		: 425
			 }); 
			$("#mapaalemana").fancybox({
  
  			'type': 'iframe',
  			'height'	: 350,
			  'width'		: 425
			 }); 
			$("#quilpue").fancybox({
  
  			'type': 'iframe',
  			'height'	: 350,
			  'width'		: 425
			 }); 
			$("#valparaiso").fancybox({
  
  			'type': 'iframe',
  			'height'	: 350,
			  'width'		: 425
			 }); 
			$("#valpo").fancybox({
  
  			'type': 'iframe',
  			'height'	: 350,
			  'width'		: 425
			 }); 
			$("#losandes").fancybox({
  
  			'type': 'iframe',
  			'height'	: 350,
			  'width'		: 425
			 }); 
			$("#sanfelipe").fancybox({
  
  			'type': 'iframe',
  			'height'	: 350,
			  'width'		: 425
			 }); 
			$("#envina").fancybox({
  
  			'type': 'iframe',
  			'height'	: 350,
			  'width'		: 425
			 }); 
			$("#envalpo").fancybox({
  
  			'type': 'iframe',
  			'height'	: 350,
			  'width'		: 425
			 }); 
			$("#entalca").fancybox({
  
  			'type': 'iframe',
  			'height'	: 350,
			  'width'		: 425
			 }); 
			$("#enlosandes").fancybox({
  
  			'type': 'iframe',
  			'height'	: 350,
			  'width'		: 425
			 }); 
			$("#ensanfelipe").fancybox({
  
  			'type': 'iframe',
  			'height'	: 350,
			  'width'		: 425
			 }); 
				$("a#tiempo").fancybox({
				'hideOnContentClick': true
								
			      });
			
		    	$("a[rel=fotosinterior]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});
				$("a[rel=interurbano]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});
				$("a[rel=fotosindustrial]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});
				$("a[rel=empresaf]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});
				$("a[rel=fotosturismo]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
				}
			});
				$("a[rel=video]").fancybox({
				'width'				: 425,
				'height'			: 350,
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'

				
			                     });
			$("#agregarcarro").fancybox({
										
				'width'				: 292,
				'height'			: 136,
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
				
			                           });
			$("a[rel=galeria]").fancybox({
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'titlePosition' 	: 'over'
										});
			
$("#resultado").fancybox({
  'width': 800,
  'height': 700,
  'type': 'iframe'
 });
$("#reclamos").fancybox({
  
  'type': 'iframe',
   'height'	: 600
 });
 $("#formulario").fancybox({
  
  'type': 'iframe',
  'height'	: 600
   
 });
 $("#formulario2").fancybox({
  
  'type': 'iframe',
  'height'	: 600
   
 });

			$("a[rel=directorio]").fancybox({
					'transitionIn'		: 'none',
					'transitionOut'		: 'none',
					'titlePosition' 	: 'over'
		
											});

			$("#comenzar").fancybox({
									onCleanup	:	function() {
            return window.confirm('Desea Cancelar Identificacion?');
		},
				'width'				: 300,
				'height'			: 300,
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
				
			});
		
		
		},
        1500
    );

}

function loadpage(page_request, containerid){
 if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)) {
document.getElementById(containerid).innerHTML=page_request.responseText
 }
 
 else {
   document.getElementById(containerid).innerHTML = '<img src="./imagenes/loading.gif"> Cargando...';
 }
}


function loadobjs(){
if (!document.getElementById)
return
for (i=0; i<arguments.length; i++){
var file=arguments[i]
var fileref=""
if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
if (file.indexOf(".js")!=-1){ //If object is a js file
fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", file);
}
else if (file.indexOf(".css")!=-1){ //If object is a css file
fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", file);
}
}
if (fileref!=""){
document.getElementsByTagName("head").item(0).appendChild(fileref)
loadedobjects+=file+" " //Remember this object as being already added to page
}
}
}

