// JavaScript Document
function showtip2(current,e,text){
  if (document.all&&document.readyState=="complete"){
    document.all.tooltip2.innerHTML='<marquee style="border:1px solid black">'+text+'</marquee>'
    document.all.tooltip2.style.pixelLeft=event.clientX+document.body.scrollLeft+10
    document.all.tooltip2.style.pixelTop=event.clientY+document.body.scrollTop+10
    document.all.tooltip2.style.visibility="visible"
	}else if (document.layers){
    document.tooltip2.document.nstip.document.write('<b>'+text+'</b>')
    document.tooltip2.document.nstip.document.close()
    document.tooltip2.document.nstip.left=0
    currentscroll=setInterval("scrolltip()",100)
    document.tooltip2.left=e.pageX+10
    document.tooltip2.top=e.pageY+10
    document.tooltip2.visibility="show"
	}
}
function hidetip2(){
  if (document.all)
    document.all.tooltip2.style.visibility="hidden"
  else if (document.layers){
    clearInterval(currentscroll)
    document.tooltip2.visibility="hidden"
	}
}

function NewWindow(mypage, myname, w, h, scroll){
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',nonresizable'
	win = window.open(mypage, myname, winprops)
}


function QuickQuote(){
	NewWindow("QuickQuote.shtml","windowresults",468,435,"NO");
}

function QuickQuoteES(){
	NewWindow("QuickQuote_es.shtml","windowresults",470,455,"NO");
}

function ChangeCursor() {
	document.all("MyMenu").style.cursor = 'hand';
}

function Calculate(){
		var cant_pr
		var cant_ae
		var cant_ap
		var total_pr, total_ae, total_ap
	if (document.FQuickQuote.s_subject.value == 1) {
		cant_pr = document.FQuickQuote.t_cantidad.value * 0.02
	}else if (document.FQuickQuote.s_subject.value == 2) {
		cant_pr = document.FQuickQuote.t_cantidad.value * 0.05
	}
	
	total_pr = "" + cant_pr
	if (total_pr.indexOf(".") > -1){
		document.FQuickQuote.t_professional.value = total_pr.substring(0,total_pr.indexOf(".") + 3)
	}else{
		document.FQuickQuote.t_professional.value = total_pr
	}
}


function ChangeIdiom_ES(){ 
//Pasa al sitio en Espaņol
	var page = location.pathname;	
	location = (page.substring(9,page.length-6) + "_es.shtml");//Site
} 

function ChangeIdiom_EN(){ 
//Pasa al sitio en Ingles
	var page = location.pathname;	
	location = (page.substring(9,page.length-9) + ".shtml");//Site
} 
