/******************************************************************************************/

//AGREGAR A FAVORITOS
function agregarFavoritos(){
  if ((navigator.appName=="Microsoft Internet Explorer") && (parseInt(navigator.appVersion)>=4)) {
      var url="http://www.consur.com.py/";
      var titulo="Consur SRL";
      window.external.AddFavorite(url,titulo);
  } else {
      if(navigator.appName == "Netscape");
      alert ("Presione Ctrl+D para agregar este sitio a sus Bookmarks");
  }
}

/******************************************************************************************/

// CODIGO DE DETECCION DE LA RESOLUCION PARA DETERMINAR EL TAMAÑO DEL POPUP

agent = navigator.userAgent;
if (parseInt(agent.substring(8,9)) > 3) {
if (screen.width >= 800) {
winwidth = 760;
winheight = 550;
} else {
winwidth = 620;
winheight = 420;
}
}
if (parseInt(agent.substring(8,9)) <= 3) {
winwidth = 620;
winheight = 420;
}

/******************************************************************************************/

// CODIGO DEL POPUP NORMAL CENTRADO

function popup(url,name,width,height,resize,scroll) {
var dialogWin = new Object();
dialogWin.width = width;
dialogWin.height = height;
now = new Date();
var millis=now.getTime();
var mstr=""+millis;
if (navigator.appName == "Netscape") {
dialogWin.left = window.screenX + ((window.outerWidth - dialogWin.width) / 2);
dialogWin.top = window.screenY + ((window.outerHeight - dialogWin.height) / 2);
var attr = 'screenX=' + dialogWin.left + ',screenY=' + dialogWin.top + ',resizable=' + resize + ',width=' + dialogWin.width + ',height=' + dialogWin.height + ',scrollbars=' + scroll + ',menubar=no,location=no,toolbar=no,statusbar=no,directories=no';
} else if (document.all) {
dialogWin.left = (screen.width - dialogWin.width) / 2;
dialogWin.top = (screen.height - dialogWin.height) / 2;
var attr = 'left=' + dialogWin.left + ',top=' + dialogWin.top + ',resizable=' + resize + ',width=' + dialogWin.width + ',height=' + dialogWin.height + ',scrollbars=' + scroll + ',menubar=no,location=no,toolbar=no,statusbar=no,directories=no';
}

// AGREGA EL CODIGO ANTI-CACHING

tienesp=false;
for (i=0; i<url.length; i++)
if (url.charAt(i)=='?')
tienesp=true;
if (tienesp)
nocach='&nocache='+mstr;
else
nocach='?nocache='+mstr;
window.open(url + nocach ,name,attr);
}

/******************************************************************************************/

// FUNCIONES DE POPUP

function recomendar(){
	popup('shared/recomendar.php','recomendar','400','435','no','no');
}

function recomendarPropio(){
	popup('recomendar.php','recomend','400','435','no','no');
}

function mapa(){
	popup('shared/mapa.html','mapa','599','351','no','no');
}

function mapaHeredado(){
	popup('../shared/mapa.html','mapa','599','351','no','no');
}

// POPUP DEL AREA DE SERVICIO TECNICO

function popupSerTec(url){
	popup(url,'none','516','400','no','yes');
}

//POPUPS de Productos
function nuevaHilux(){
	popup('productoHilux/introHilux.html','Hilux','616','383','no','yes');
}

function nuevaHino300(){
	popup('nuevaHino300/index.html','Hilux','616','383','no','yes');
}

function nuevaCamry(){
	popup('nuevaCamry/index.php','Hilux','616','383','no','yes');
}


function newCorolla(){
	popup('productoCorolla08/introCor.html','Corolla','616','383','no','yes');
}

function nuevaRav4(){
	popup('productoRav4/introRav4.html','Rav4','617','385','no','yes');
}

<!-- NUEVA PRIUS -->
function nuevaPrius(){
	popup('productoPrius/intro.html','Toyota Prius','617','385','no','yes');
}

function nuevaFortuner(){
	popup('productoFortuner/introFortuner.html','Fort','617','385','no','yes');
}

function nuevaPrado(){
	popup('productoPrado/introPrado.html','Prado','617','385','no','yes');
}

function nuevaHino(){
	popup('productoHino/introHino.php','Hino','617','385','no','yes');
}
//POPUPS DE LA PARTE FINAL DE LAS PAGINAS PRINCIPALES

function privacidad(){
	popup('shared/privacy.html','priv','500','400','no','yes');
}

function terminos(){
	popup('shared/useterms.html','uset','500','400','no','yes');
}

function newsletterPop(){
	popup('shared/newsletter.php','news','300','100','no','no');
}

function moda(){
	popup('moda.php','moda','600','500','no','no');
}

function turismo(){
	popup('turismo.php','turi','616','500','no','yes');
}

function filosofia(){
	popup('filosofia.php','filo','616','500','no','yes');
}

function produccion(){
	popup('produccion.php','prod','616','500','no','yes');
}

function rally(){
	popup('motorsport.php','rall','616','500','no','yes');
}

function noticias(url){
	popup(url ,'news','600','300','no','yes');
}


//AUTODEALER
function privacidadAuto(){
	popup('../shared/privacy.html','priv','500','400','no','yes');
}

function terminosAuto(){
	popup('../shared/useterms.html','uset','500','400','no','yes');
}



/******************************************************************************************/

// ROLLOVER DE CELDAS EN UNA TABLA

function mOvr(src,clrOver) {
   if (!src.contains(event.fromElement)) {
      src.style.cursor = 'hand';
      src.bgColor = clrOver;
   }
}

function mOut(src,clrIn) {
   if (!src.contains(event.toElement)) {
      src.style.cursor = 'default';
      src.bgColor = clrIn;
   }
}

function mClk(src) {
   if(event.srcElement.tagName=='TD'){
   src.children.tags('A')[0].click();
   }
}

/******************************************************************************************/

// VALIDAR SUSCRIPCION A NEWSLETTER

function validarNewsletter(){
		form = document.newsletter;
		
		if (form.email.value == ""){
			alert("El campo de E-mail es obligatorio para poder suscribirse a nuestro Newsletter.");
			form.email.focus();
			return false;
		}
				
		var exp=new RegExp(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/);
		var test=exp.test(form.email.value);
		
		if (!test){
			alert("El formato de E-mail es incorrecto. Ingrese una dirección válida.");
			form.email.focus();
			return false;
		}		
		
		form.submit();
		return true;
}