var pressed=0;
var press=0;
var clic=3;
var svgoverviewbox;
var beginx;
var beginy;
var help=0;
var nWidth;
var nHeight;
var xa;
var ya;
var wa;
var ha;
var bupress=0;
var oox;
var ooy;
var oow;
var ooh;
var cd;
var sh;
var ss;
var sb;
var cc;
var mc;
var pc;
var pr;
var scale2=0;
var rectXCorner;
var rectYCorner;
var allWidth;
var allHeight;
var newEX;
var newEY;
var side;
var elems = {
            tracker: false,
            cursor:  false,
            trans:   true,
            scale:   true,
            mx:      true,
            my:      true,
            ux:      true,
            uy:      true
        };
var frame = {
            x_trans: 0,
            y_trans: 0,
            zoom   : 1,
            x_scale: 1,
            y_scale: 1
        };
function checkSVGes(){
if (!blaxxun){document.all.svgfig.innerHTML="<img src='../common/images/warning.bmp'>";document.all.svgtext.innerHTML="No podríamos detectar el adobe SVG Viewer 3.0.  El SVG Viewer 3,0 plugin se requiere para visión los mapas contenidos en este site.<a href='http://www.adobe.com/svg/viewer/install/auto/'  >Chasque aquí</a> para ir a la zona del adobe SVG para descargar el plugin.  El adobe SVG Viewer 3.0 está disponible libremente de coste.  <a href='help.htm#svg' target='_blank'> Chasque aquí </a> para las instrucciones en cómo descargar el adobe SVGViewer 3.0.";}
}
function checkSVG(){

if (!blaxxun){document.all.svgfig.innerHTML="<img src='../common/images/warning.bmp'>";document.all.svgtext.innerHTML="It appears that Adobe SVG Viewer 3.0 is not installed on your system. SVG Viewer 3.0 is required to view maps on this site. <a href='http://www.adobe.com/svg/viewer/install/auto'  >Click here</a> to install the free plug-in or <a href='help.htm#svg' target='_blank'>Click here</a> to first review instructions for installing Adobe SVG Viewer 3.0.";}
}
function colorit() {
if (!blaxxun){
 var svgviewer=confirm("You are about to be redirected to the SVGZone to install Adobe SVG Viewer 3.0. Do you wish to continue?")
 if(svgviewer){window.location="http://www.adobe.com/svg/viewer/install/auto/";}
 else{window.location="index.php";} 
 }
 else{
	svgdoc = svgFile1.getSVGDocument();
	svgoverviewdoc = svgOverview.getSVGDocument();	
	overviewViewport = svgoverviewdoc.getElementById("overviewmap");
	pluginPixWidth = overviewViewport.getAttribute("width");
	pluginPixHeight = overviewViewport.getAttribute("height");
	svgRect = svgoverviewdoc.getElementById("rectForPlace");
	svgMainViewport = svgdoc.getElementById("mainMap");
	var	svgviewbox = svgMainViewport.getAttribute("viewBox");
svgoverviewbox=overviewViewport.getAttribute("viewBox");


temp1=svgoverviewbox.split(" ");
orix=parseFloat(temp1[0]);
oriy=parseFloat(temp1[2]);
oriw=parseFloat(temp1[4]);
orih=parseFloat(temp1[6]);

temp = svgviewbox.split(" ");
xOriginCorner = parseFloat(temp[0]);
yOriginCorner = parseFloat(temp[2]);
allWidth = parseFloat(temp[4]);
allHeight = parseFloat(temp[6]);
nWidth=allWidth;
nHeight=allHeight;

oox = parseFloat(svgRect.getAttribute("x"));
ooy = parseFloat(svgRect.getAttribute("y"));
oow = parseFloat(svgRect.getAttribute("width"));
ooh = parseFloat(svgRect.getAttribute("height"));
document.all.zout.disabled=true
document.images['out'].src='../common/images/out1.gif'
if(document.selectMapLayersc){
fol=document.selectMapLayersc.length;
//alert(fol);
for (i=0;i<fol-4;i++){
document.selectMapLayersc[i].checked=false;
document.selectMapLayersc[i+1].checked=false;
document.selectMapLayersc[i+1].disabled=true;
document.selectMapLayersc[i+2].disabled=true;
document.selectMapLayersc[i+3].disabled=true;
document.selectMapLayersc[i+3].value=" X ";
//document.selectMapLayers[i+3].style.background="#D4D0C8";
i=i+3;}
document.selectMapLayersc[fol-4].checked=true;
document.selectMapLayersc[fol-3].checked=true;
document.selectMapLayersc[fol-2].disabled=false;
document.selectMapLayersc[fol-1].disabled=false;
}
}}
function zoom(name){
	svgdoc1 = svgFile1.getSVGDocument();
	svgMainViewport1 = svgdoc1.getElementById("mainMap");
	svgviewbox1 = svgMainViewport1.getAttribute("viewBox");
	svgDocument = svgFile1.getSVGDocument();
	 
	var SVGRoot = svgdoc1.documentElement;
	var trans = SVGRoot.currentTranslate;
	var scale = SVGRoot.currentScale;
	var svgoverviewdoc = svgOverview.getSVGDocument();
	var svgRect = svgoverviewdoc.getElementById("rectForPlace");
	xulcorner = parseFloat(svgRect.getAttribute("x"));
	yulcorner = parseFloat(svgRect.getAttribute("y"));
	width = parseFloat(svgRect.getAttribute("width"));
	height = parseFloat(svgRect.getAttribute("height"));
	xcenter = xulcorner + width / 2;
	ycenter = yulcorner + height / 2;
	var SVGRooter=document.embeds['svgFile1'].getSVGDocument().getDocumentElement();			
			if(trans.x||trans.y !=0||scale!=1){
			SVGRooter.currentTranslate.x=0;
			SVGRooter.currentTranslate.y=0;
			SVGRooter.currentScale=1;
			newViewport = xulcorner + " " + yulcorner + " " + width + " " + height;
			svgMainViewport.setAttribute("viewBox",newViewport); 			
			}
			
	if(name=="in"){	
			nWidth =width/2;
			nHeight =height/2;
			xnulcorner = xcenter - nWidth/2 ;
			ynulcorner = ycenter - nHeight/2 ;
			document.all.zout.disabled=false;
			document.images['out'].src='../common/images/out.gif';
			//alert(nWidth)	
	}
	if(name=="out"){		
		if (width<oriw)
		{		
			nWidth =nWidth*2;
			nHeight =nHeight*2;			
			var xnul = xcenter - nWidth/2 ;
			var ynul = ycenter - nHeight/2 ;
			if (xnul<orix){xnulcorner=orix}
				else if(xnul+nWidth>orix+oriw){xnulcorner=orix}
					else {xnulcorner=xnul}
			if (ynul<oriy){ynulcorner=oriy}
				else if(ynul+nHeight>oriy+orih){ynulcorner=oriy}
					else {ynulcorner=ynul}
		}
		else
		{
			//xnulcorner = xOriginCorner ;
			//ynulcorner = yOriginCorner  ;
			resetMap();		
			document.all.zout.disabled=true;
			document.images['out'].src='../common/images/out1.gif'
		}	
	}
			
		if(name=="all"){
			//var SVGRooter=document.embeds['svgFile1'].getSVGDocument().getDocumentElement();
		
			SVGRooter.currentTranslate.x=0;
			SVGRooter.currentTranslate.y=0;
			SVGRooter.currentScale=1;
			xnulcorner = xOriginCorner;
			ynulcorner = yOriginCorner;
			nWidth=allWidth;
			nHeight=allHeight;
			document.all.zout.disabled=true;
			document.images['out'].src='../common/images/out1.gif'
			
			}
				
				
		if(nWidth>nHeight){side=nWidth;}else{side=nHeight;}
			
		svgRect.setAttribute("x",xnulcorner);
		svgRect.setAttribute("y",ynulcorner);
		svgRect.setAttribute("width",side);
		svgRect.setAttribute("height",side); 
		xulcorner = parseFloat(svgRect.getAttribute("x"));
	yulcorner = parseFloat(svgRect.getAttribute("y"));
	width = parseFloat(svgRect.getAttribute("width"));
	height = parseFloat(svgRect.getAttribute("height"));
	newViewport = xulcorner + " " + yulcorner + " " + width + " " + height;
	svgMainViewport.setAttribute("viewBox",newViewport); 
	
	}
function resetMap(){
svgdoc = svgFile1.getSVGDocument();
	var SVGRoot = svgdoc.documentElement;
	var trans = SVGRoot.currentTranslate;
	var scale = SVGRoot.currentScale;
	var svgoverviewdoc = svgOverview.getSVGDocument();
	var svgRect = svgoverviewdoc.getElementById("rectForPlace");
	xulcorner = parseFloat(svgRect.getAttribute("x"));
	yulcorner = parseFloat(svgRect.getAttribute("y"));
	width = parseFloat(svgRect.getAttribute("width"));
	height = parseFloat(svgRect.getAttribute("height"));
	var SVGRooter=document.embeds['svgFile1'].getSVGDocument().getDocumentElement();
	if(trans.x||trans.y !=0||scale!=1)
		{
		SVGRooter.currentTranslate.x=0;
		SVGRooter.currentTranslate.y=0;
		SVGRooter.currentScale=1;
		newViewport = xulcorner + " " + yulcorner + " " + width + " " + height;
		svgMainViewport.setAttribute("viewBox",newViewport); 			
		}
}
function beginPan(evt) {
	pressed = 1;
	width = parseFloat(svgRect.getAttribute("width"));
	height = parseFloat(svgRect.getAttribute("height"));
	evtX = parseFloat(evt.getClientX());
	evtY = parseFloat(evt.getClientY());
	rectUlXCorner = parseFloat(svgRect.getAttribute("x"));
	rectUlYCorner = parseFloat(svgRect.getAttribute("y"));
}
function doPan(evt) {
	if (pressed == 1) {
	resetMap();
		window.status = "panning map - please be patient ...";
		newEvtX = parseFloat(evt.getClientX());
		newEvtY = parseFloat(evt.getClientY());
		toMoveX = rectUlXCorner + (newEvtX - evtX) * allWidth / pluginPixWidth;
		toMoveY = rectUlYCorner + (newEvtY - evtY) * allHeight / pluginPixHeight;
		//restrict to borders of overviewmap
		if (toMoveX < xOriginCorner) {
			svgRect.setAttribute("x",xOriginCorner);
		}
		else if ((toMoveX + width) > (xOriginCorner + allWidth)) {
			svgRect.setAttribute("x",xOriginCorner + allWidth - width);
		}
		else {
			svgRect.setAttribute("x",toMoveX);
		}
		if (toMoveY < yOriginCorner) {
			svgRect.setAttribute("y",yOriginCorner);
		}
		else if ((toMoveY + height) > (yOriginCorner + allHeight)) {
			svgRect.setAttribute("y",yOriginCorner + allHeight - height);
		}
		else {
			svgRect.setAttribute("y",toMoveY);
		}
		evtX = newEvtX;
		beginy = newEvtY;
		rectUlXCorner = parseFloat(svgRect.getAttribute("x"));
		rectUlYCorner = parseFloat(svgRect.getAttribute("y"));
	xulcorner = parseFloat(svgRect.getAttribute("x"));
	yulcorner = parseFloat(svgRect.getAttribute("y"));
	width = parseFloat(svgRect.getAttribute("width"));
	height = parseFloat(svgRect.getAttribute("height"));
	newViewport = xulcorner + " " + yulcorner + " " + width + " " + height;
	svgMainViewport.setAttribute("viewBox",newViewport);
}}
	
function endPan() {
	pressed = 0;
	window.status = "Done";
}

function beginPan1(evt) {
bupress=1;
	press = 1;
		clic=evt.button;
		var pres=evt.pageX;
		beginx = evt.clientX;
     	beginy = evt.clientY;
		wid = parseFloat(svgRect.getAttribute("width"));
					
					heig = parseFloat(svgRect.getAttribute("height"));
					rectXCorner = parseFloat(svgRect.getAttribute("x"));
					rectYCorner = parseFloat(svgRect.getAttribute("y"));
					
				
}

function doPan1(evt) {svgDocument = svgFile1.getSVGDocument();
				var SVGRoot = svgDocument.documentElement;
				var trans = SVGRoot.currentTranslate;
				var scale = SVGRoot.currentScale;			
				var vbox = SVGRoot.getAttributeNS(null, "viewBox");
if(press==1 && evt.ctrlKey && evt.shiftKey){//alert("panning")		
				
				
				//alert(scale)
				frame.x_trans = ( 0.0 - trans.x ) / scale;
	            frame.y_trans = ( 0.0 - trans.y ) / scale;
  				frame.zoom = scale;
    	        frame.x_scale = 1 / scale;
        	    frame.y_scale = 1 / scale;
            	if ( vbox ) {                
                	var params  = vbox.split(/\s+/); 
					svgMainViewport = svgdoc.getElementById("mainMap");
			var www=  parseFloat(svgMainViewport.getAttribute("width"));
			var hhh=parseFloat(svgMainViewport.getAttribute("height"));
			//alert(vbox);
	                var h_scale =450/ params[2];
    	            var v_scale = 450/ params[3];
					
        	        frame.x_trans = frame.x_trans / h_scale + parseFloat(params[0]);
            	    frame.y_trans = frame.y_trans / v_scale + parseFloat(params[1]);
                	frame.x_scale = frame.x_scale / h_scale;
   					frame.y_scale = frame.y_scale / v_scale;			
					var x = evt.clientX;
        		    var y = evt.clientY;			
		            var nx = x * frame.x_scale + frame.x_trans;
        		    var ny = y * frame.y_scale + frame.y_trans;
					var xco;
					var yco;
											var SVGR=document.embeds['svgFile1'].getSVGDocument().getDocumentElement();					
					var svgMain = SVGR.getElementById("mainMap");
					var	svgviewMain = svgMain.getAttribute("viewBox");
					var viewsplit = svgviewMain.split(" ");
					var xCorner = parseFloat(temp[0]);
					var yCorner = parseFloat(temp[2]);
					var VWidth = parseFloat(temp[4]);
					var VHeight = parseFloat(temp[6]);
				//	alert(evt.button);
					var SVGRo=document.embeds['svgOverview'].getSVGDocument().getDocumentElement();
					svgPbox = SVGRo.getElementById("rectForPlace");
					width = parseFloat(svgPbox.getAttribute("width"));
					height = parseFloat(svgPbox.getAttribute("height"));
					nxulcorner = parseFloat(svgPbox.getAttribute("x"));
					nyulcorner = parseFloat(svgPbox.getAttribute("y"));
					if(xCorner!=nxulcorner||yCorner!=nyulcorner ||VWidth!=width||VHeight!=height){	
					var noriw = parseFloat(svgPbox.getAttribute("width"));
					var norih = parseFloat(svgPbox.getAttribute("height"));
					var nnxulcorner = parseFloat(svgPbox.getAttribute("x"));
					var nnyulcorner = parseFloat(svgPbox.getAttribute("y"));}
					else{
					noriw=oriw;
					norih=orih;
					
					}
					
				
					//alert(scale);
									scale2=2*scale;
									if(scale<16){					
						if (scale<1)
						{
							nWidth=noriw;
							nHeight= norih;
							xco=orix;
							yco=oriy;
							if(nWidth>nHeight){side=nWidth;}else{side=nHeight;}					
						}
						else 
						if(scale>=1)
							{
								if(scale2>scale)
									{			
										nWidth= noriw*scale;
										nHeight= norih*scale;										
									}
								else
									{
										nWidth= noriw/scale;
										nHeight= norih/scale;										
									}
								if(nWidth>nHeight){side=nWidth;}else{side=nHeight;}
							}				 
						}	
									xco=nx-side/2;
									yco=ny-side/2;
				
							
						svgPbox.setAttribute("x",xco);
						svgPbox.setAttribute("y",yco);	
						svgPbox.setAttribute("width",side);
						svgPbox.setAttribute("height",side);
						press=0;
						document.all.zout.disabled=false;
						document.images['out'].src='../common/images/out.gif';
						}
					}
					
					
if(press==1 && evt.ctrlKey){//alert("panning")		
				//svgDocument = svgFile1.getSVGDocument();
				//var SVGRoot = svgDocument.documentElement;
				//var trans = SVGRoot.currentTranslate;
				//var scale = SVGRoot.currentScale;			
				//var vbox = SVGRoot.getAttributeNS(null, "viewBox");
				
				//alert(scale)
				frame.x_trans = ( 0.0 - trans.x ) / scale;
	            frame.y_trans = ( 0.0 - trans.y ) / scale;
  				frame.zoom = scale;
    	        frame.x_scale = 1 / scale;
        	    frame.y_scale = 1 / scale;
            	if ( vbox ) {                
                	var params  = vbox.split(/\s+/); 
					svgMainViewport = svgdoc.getElementById("mainMap");
			var www=  parseFloat(svgMainViewport.getAttribute("width"));
			var hhh=parseFloat(svgMainViewport.getAttribute("height"));
			//alert(vbox);
	                var h_scale =450/ params[2];
    	            var v_scale = 450/ params[3];
					
        	        frame.x_trans = frame.x_trans / h_scale + parseFloat(params[0]);
            	    frame.y_trans = frame.y_trans / v_scale + parseFloat(params[1]);
                	frame.x_scale = frame.x_scale / h_scale;
   					frame.y_scale = frame.y_scale / v_scale;			
					var x = evt.clientX;
        		    var y = evt.clientY;			
		            var nx = x * frame.x_scale + frame.x_trans;
        		    var ny = y * frame.y_scale + frame.y_trans;
					var xco;
					var yco;
											var SVGR=document.embeds['svgFile1'].getSVGDocument().getDocumentElement();					
					var svgMain = SVGR.getElementById("mainMap");
					var	svgviewMain = svgMain.getAttribute("viewBox");
					var viewsplit = svgviewMain.split(" ");
					var xCorner = parseFloat(temp[0]);
					var yCorner = parseFloat(temp[2]);
					var VWidth = parseFloat(temp[4]);
					var VHeight = parseFloat(temp[6]);
				//	alert(evt.button);
					var SVGRo=document.embeds['svgOverview'].getSVGDocument().getDocumentElement();
					svgPbox = SVGRo.getElementById("rectForPlace");
					width = parseFloat(svgPbox.getAttribute("width"));
					height = parseFloat(svgPbox.getAttribute("height"));
					nxulcorner = parseFloat(svgPbox.getAttribute("x"));
					nyulcorner = parseFloat(svgPbox.getAttribute("y"));
					if(xCorner!=nxulcorner||yCorner!=nyulcorner ||VWidth!=width||VHeight!=height){	
					var noriw = parseFloat(svgPbox.getAttribute("width"));
					var norih = parseFloat(svgPbox.getAttribute("height"));
					var nnxulcorner = parseFloat(svgPbox.getAttribute("x"));
					var nnyulcorner = parseFloat(svgPbox.getAttribute("y"));}
					else{
					noriw=oriw;
					norih=orih;
					
					}
					
				
					//alert(scale);
					if(scale<16){
									scale2=2*scale;					
						if (scale<=1)
						{
							nWidth=noriw;
							nHeight= norih;
							xco=orix;
							yco=oriy;
							if(nWidth>nHeight){side=nWidth/2;}else{side=nHeight/2;}					
						}
						else 
						if(scale>1)
							{
								if(scale2>scale)
									{			
										nWidth= noriw/scale;
										nHeight= norih/scale;										
									}
								else
									{
										nWidth= noriw*scale;
										nHeight= norih*scale;										
									}
								if(nWidth>nHeight){side=nWidth;}else{side=nHeight;}
							}				 
						}	
									xco=nx-side/2;
									yco=ny-side/2;
				
							
						svgPbox.setAttribute("x",xco);
						svgPbox.setAttribute("y",yco);	
						svgPbox.setAttribute("width",side);
						svgPbox.setAttribute("height",side);
						press=0;
						document.all.zout.disabled=false;
						document.images['out'].src='../common/images/out.gif';
						}
					}			
						
			
if(press==1 && evt.altKey){
		
				svgDocument = svgFile1.getSVGDocument();
				var SVGRoot = svgDocument.documentElement;
				var trans = SVGRoot.currentTranslate;
				var scale = SVGRoot.currentScale;			
				var vbox = SVGRoot.getAttributeNS(null, "viewBox");
				
				//alert(scale)
				frame.x_trans = ( 0.0 - trans.x ) / scale;
	            frame.y_trans = ( 0.0 - trans.y ) / scale;
  				frame.zoom = scale;
    	        frame.x_scale = 1 / scale;
        	    frame.y_scale = 1 / scale;
            	if ( vbox ) {                
                	var params  = vbox.split(/\s+/); 
					svgMainViewport = svgdoc.getElementById("mainMap");
			var www=  parseFloat(svgMainViewport.getAttribute("width"));
			var hhh=parseFloat(svgMainViewport.getAttribute("height"));
			//alert(vbox);
	                var h_scale =450/ params[2];
    	            var v_scale = 450/ params[3];
					
        	        frame.x_trans = frame.x_trans / h_scale + parseFloat(params[0]);
            	    frame.y_trans = frame.y_trans / v_scale + parseFloat(params[1]);
                	frame.x_scale = frame.x_scale / h_scale;
   					frame.y_scale = frame.y_scale / v_scale;			
					var x = evt.clientX;
        		    var y = evt.clientY;
					//alert(x);			
		            var nx = x * frame.x_scale + frame.x_trans;
        		    var ny = y * frame.y_scale + frame.y_trans;
					var xco;
					var yco;
					
					
					var SVGRo=document.embeds['svgOverview'].getSVGDocument().getDocumentElement();
					svgPbox = SVGRo.getElementById("rectForPlace");
					width = parseFloat(svgPbox.getAttribute("width"));
					height = parseFloat(svgPbox.getAttribute("height"));
					nxulcorner = parseFloat(svgPbox.getAttribute("x"));
					nyulcorner = parseFloat(svgPbox.getAttribute("y"));
				
						}
						
									xco=nx-width/2;
									yco=ny-height/2;
							
						svgPbox.setAttribute("x",xco);
						svgPbox.setAttribute("y",yco);	
						//svgPbox.setAttribute("width",side);
						//svgPbox.setAttribute("height",side);
						press=0;
						document.all.zout.disabled=false;
						document.images['out'].src='../common/images/out.gif';
					/*
					newEX = parseFloat(evt.clientX);
					newEY = parseFloat(evt.clientY);
					 tMoveX = rectXCorner - (newEX - beginx) * allWidth / pluginPixWidth;
					 tMoveY = rectYCorner - (newEY - beginy) * allHeight / pluginPixHeight;
					//alert(beginx)
					//if (tMoveX < xOriginCorner) {//alert("1")
					//	svgRect.setAttribute("x",xOriginCorner);
					//}
					//else 
					//if ((tMoveX + width) > (xOriginCorner + allWidth)) {//alert("2")
					//	svgRect.setAttribute("x",xOriginCorner + allWidth +width);
					//}
					//else {//alert("3")
						svgRect.setAttribute("x",tMoveX);
					//}
					//if (tMoveY < yOriginCorner) {
					//	svgRect.setAttribute("y",yOriginCorner);
					//}
					//else
				//	if ((tMoveY + height) > (yOriginCorner + allHeight)) {
				//	svgRect.setAttribute("y",yOriginCorner + allHeight + height);
				//	}
				//	else {
						svgRect.setAttribute("y",tMoveY);
				//	}*/
					
								
								press=0;
								}
									
}



function endPan1(evt) {
if (clic==2&&press==1){
		document.all.zout.disabled=false;
		document.images['out'].src='../common/images/out.gif';
		 svgDocument = svgFile1.getSVGDocument();
				var SVGRoot = svgDocument.documentElement;
				var trans = SVGRoot.currentTranslate;
				var scale = SVGRoot.currentScale;			
				var vbox = SVGRoot.getAttributeNS(null, "viewBox");
				//alert(scale);
				frame.x_trans = ( 0.0 - trans.x ) / scale;
	            frame.y_trans = ( 0.0 - trans.y ) / scale;
  				frame.zoom = scale;
    	        frame.x_scale = 1 / scale;
        	    frame.y_scale = 1 / scale;
			
            	if ( vbox ) {                
                	var params  = vbox.split(/\s+/);  
					//alert(params);
					svgMainViewport = svgdoc.getElementById("mainMap");
					var www=  parseFloat(svgMainViewport.getAttribute("width"));
					var hhh=parseFloat(svgMainViewport.getAttribute("height"));            
	                var h_scale =450/ params[2];
    	            var v_scale = 450/ params[3];
					
        	        frame.x_trans = frame.x_trans / h_scale + parseFloat(params[0]);
            	    frame.y_trans = frame.y_trans / v_scale + parseFloat(params[1]);
                	frame.x_scale = frame.x_scale / h_scale;
					frame.y_scale = frame.y_scale / v_scale;
   			
					var x = evt.clientX;
        		    var y = evt.clientY;			
		            var nx = x * frame.x_scale + frame.x_trans;
        		    var ny = y * frame.y_scale + frame.y_trans;
								
					width = parseFloat(svgRect.getAttribute("width"));
					height = parseFloat(svgRect.getAttribute("height"));
					nxulcorner = parseFloat(svgRect.getAttribute("x"));
					nyulcorner = parseFloat(svgRect.getAttribute("y"));
					//alert(scale2);
					//alert(scale);
						scale2=2*scale;
						//alert(scale2);					
						if (scale<=1)
						{						
							nWidth=oriw;
							nHeight= orih;
							xco=orix;
							yco=oriy;					
						}
						else 
						if(scale>1)
							{
							
								if(scale2>=scale)
									{//alert("1")			
										nWidth= oriw/scale2;
										nHeight= orih/scale2;										
									}
								else
									{//alert("2")
										nWidth= oriw*scale2;
										nHeight= orih*scale2;										
									}
									xco=nx-nWidth/2;
									yco=ny-nHeight/2;
							}				 
						
					//	else if(scale==1)
					//	{
					//	nWidth= oriw/2;
					//	nHeight= orih/2;
						//xco=nx-nWidth/2;
						//yco=ny-nHeight/2;
						//}	
						if(nWidth>nHeight){side=nWidth;}else{side=nHeight;}	
						svgRect.setAttribute("x",xco);
						svgRect.setAttribute("y",yco);	
						svgRect.setAttribute("width",side);
						svgRect.setAttribute("height",side);
						press=0;
						
						}				
				
			
	}
press=0;
}

function SMI(id) {
dam=document.all.candidate(0).checked
		if(dam){
		//alert(id)			
		incumbent(id)
		}else
		candidate(id)
		}	
function CI(id) {
//svgprec = svgdoc.getElementById(id);
		//svgprec.setAttribute("fill","none");
		}
function toggleSVGElements(id, checkVal) {
        var svgObj;
        var svgStyle;
		var svgdoc1;
        svgObj = svgdoc.getElementById(id);
 		if(svgObj !=null){
        svgStyle = svgObj.getStyle();
	if (checkVal == true) {
		svgStyle.setProperty('visibility','visible');
	}
	else {
		svgStyle.setProperty('visibility','hidden');
}	}
}
var cou=0;
var dj=0;
var cs=new Array(8);
function toggleSVGElements1(id,ida,checkVal,nu) {
//alert(checkVal);
id1=id+1;
id2=id+2;
id3=id+3;
        var svgObj;
        var svgStyle;
		var svgdoc1;
		svgdoc = svgFile1.getSVGDocument();
       	svgObj = svgdoc.getElementById(id);
	   	svgObj1 = svgdoc.getElementById(ida);		
	   
		if (checkVal == true) {
					if(svgObj1 !=null){
        svgStyle1 = svgObj1.getStyle();
			svgStyle1.setProperty('visibility','visible');
			document.all[id1].disabled=false;
			document.all[id1].checked=true;}
			else{document.all[id1].disabled=true;}						
			document.all[id2].disabled=false;
			document.all[id3].disabled=false;			
			document.all[id2].value="     ";			
				if(cs[nu]){		
			document.all[id2].style.background=cs[nu];
			}
			document.all.dropin.innerHTML = "";	
			}else{		
			document.all.dropin.innerHTML = "";
				if(svgObj1 !=null){
        svgStyle1 = svgObj1.getStyle();
			svgStyle1.setProperty('visibility','hidden');
			document.all[id1].disabled=true;
			document.all[id1].checked=false;}
			//else{//document.all[id1].disabled=false;}						
			document.all[id2].disabled=true;
			document.all[id3].disabled=true;
			cs[nu]=document.all[id2].style.background;
			//document.all[id2].style.background="#D4D0C8";
			document.all[id2].value=" X ";
			}
			
	
		
 		if(svgObj !=null){
        	svgStyle = svgObj.getStyle();
			if (checkVal == true) {
			svgStyle.setProperty('visibility','visible');
			}
			else {
			svgStyle.setProperty('visibility','hidden');
			}	
		}
		else{//alert("UNDER CONSTRUCTION");
		}
}
function toggleSVGElements2(idla, checkVal) {
        var svgObj;
        var svgStyle;
		var svgdoc1;
       //svgObj = svgdoc.getElementById(id);
	   svgObj2 = svgdoc.getElementById(idla);
	   if(svgObj2 !=null){
        svgStyle2 = svgObj2.getStyle();
	   //alert( svgStyle2);
	if (checkVal == true) {
		svgStyle2.setProperty('visibility','visible');
		}
		else {
		svgStyle2.setProperty('visibility','hidden');
		
		}	
}   //alert(svgObj);
 
else{
//alert("UNDER CONSTRUCTION");
}
}
function chacol(id,co){
var col="#"+co;
var lid;
//if(id != "PRECINCT")
//{
lid=id+"LABELS";
//}else
//{
//lid="LABELS";
//}
svgdoc = svgFile1.getSVGDocument();
svgline=svgdoc.getElementById(id);
svgline1=svgdoc.getElementById(lid);
svgline.setAttribute('stroke',col);
svgline1.setAttribute('fill',col);
}
function chawid(id,wi){
svgdoc = svgFile1.getSVGDocument();
svgline=svgdoc.getElementById(id);
svgline.setAttribute('stroke-width',wi);
}
function MM_openBrWindow(theURL,winName,features) { 
var win;
   if(winName=="wmv"){

   var message="Requires Windows Media Player version 9 or later. Click OK to continue or Cancel for further instructions";
  		var x=  confirm(message)
			if (x){
 			win=window.location=theURL
			}else{
		win= window.open('help.htm#media','htm','toolbar=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
			  win.window.focus();	}  				
			} else {	
		 win= window.open(theURL,winName,features);
		  win.window.focus();
		
 }
}
function MM_openBrWindowes(theURL,winName,features) { 
var win;
   if(winName=="wmv"){

   var message="Requires Windows Media Player version 9 or later. Click OK to continue or Cancel for further instructions";
  		var x=  confirm(message)
			if (x){
 			win=window.location=theURL
			}else{
		win= window.open('aayuda.htm#media','htm','toolbar=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes');
			  win.window.focus();	}  				
			} else {	
		 win= window.open(theURL,winName,features);
		  win.window.focus();
		
 }
}
function goTo ( urlSelector ) {
   var toGoURL = urlSelector[urlSelector.selectedIndex].value;
   if ( toGoURL!="" )
     document.location = toGoURL;

}

var selectedOption = 0;
var KeyPressEnabled = true;
function SelectChange()
{
   
   
   if (KeyPressEnabled)
   {
      main.streetName.selectedIndex = selectedOption;   
   }
}
   

function KeyPress()
{

   KeyPressEnabled = true;

   var streetName = main.streetName;

   if (event.keyCode == 38)
   {
      main.Typed.value = "";
      selectedOption = streetName.selectedIndex - 1;
      return;
   }
   
   if (event.keyCode == 40)
   {
      main.Typed.value = "";
      selectedOption = streetName.selectedIndex + 1;
      return;
   }


  
   if (event.keyCode == 27)
   {
      streetName.selectedIndex = 0;
      main.Typed.value = "";
      return;
   }


 
   if (event.keyCode != 32)
   {
      
      if (event.keyCode < 65 || event.keyCode > 90)
         return;
   }
   
   main.Typed.value += String.fromCharCode(event.keyCode).toLowerCase();


   for (x = 0; x < main.streetName.length; x++)
   {
   
     var OptionText = streetName.options[x].text;
     var tmpOptionText = "";       
     
      for (y = 0; y < OptionText.length; y ++)
      {
         tmpOptionText += OptionText.charAt(y).toLowerCase();
      
         if (tmpOptionText == main.Typed.value)
         {
            streetName.selectedIndex = x;
            selectedOption = x;
            return;
         }
      }
   }
}
var colors= new Array("#FFFFFF","#C0C0C0","#808080","#000000","#FF0000","#FFFF00","#00FF00","#00FFFF","#0000FF","#FF00FF","#800000","#808000","#008000","#008080","#000080","#800080","#F0F0F0","#FFD0D0","#FFDCD0","#FFE8D0","#FFF4D0","#FFFFD0","#EDFFD0","#D0FFD0","#D0FFE8","#D0FFFF","#D0F0FF","#D0E0FF","#D0D0FF","#E8D0FF","#FFD0FF","#FFD0E8","#E0E0E0","#FFB0B0","#FFC4B0","#FFD8B0","#FFECB0","#FFFFB0","#E0FFB0","#B0FFB0","#B0FFD8","#B0FFFF","#B0E5FF","#C0D5FF","#C0C0FF","#D8B0FF","#FFB0FF","#FFB0D8","#D0D0D0","#FFA0A0","#FFB8A0","#FFD0A0","#FFE490","#FFFF90","#D3FF90","#A0FFA0","#A0FFD0","#A0FFFF","#A0E0FF","#A0C0FF","#A0A0FF","#D0A0FF","#FFA0FF","#FFA0D0","#C0C0C0","#FF9090","#FFA080","#FFC080","#FFDC70","#FFFF70","#CDFF80","#90FF90","#90FFC8","#80FFFF","#90DBFF","#90B5FF","#9090FF","#C890FF","#FF80FF","#FF90C8","#B0B0B0","#FF8080","#FF9470","#FFB060","#FFD860","#FFFF40","#C0FF60","#70FF70","#70FFB8","#70FFFF","#80D5FF","#80ABFF","#8080FF","#C080FF","#FF70FF","#FF80C0","#A0A0A0","#FF6060","#FF7C50","#FFA850","#FFD040","#FFFF00","#B3FF40","#66FF60","#60FFB0","#50FFFF","#60CBFF","#70A0FF","#7070FF","#B060FF","#FF50FF","#FF60B0","#909090","#FF5050","#FF7040","#FF9830","#FFC000","#F0F000","#9AFF00","#50FF50","#50FFA8","#00FFFF","#50C5FF","#508BFF","#6060FF","#A850FF","#FF40FF","#FF50A8","#707070","#FF4040","#FF5820","#FF8000","#F0B400","#E0E000","#90F000","#00FF00","#00FF80","#00F0F0","#40C0FF","#4080FF","#5050FF","#A040FF","#FF20FF","#FF40A0","#606060","#FF2020","#FF4000","#E07000","#D09C00","#C0C000","#7DD000","#00E000","#00E070","#00D0D0","#00ABFF","#3075FF","#3030FF","#9020FF","#FF00FF","#FF2090","#505050","#FF0000","#E03800","#D06800","#C09000","#B0B000","#73C000","#00D000","#00D068","#00C0C0","#0095E0","#0055FF","#2020FF","#8000FF","#E000E0","#FF0080","#404040","#E00000","#C03000","#B05800","#A07800","#A0A000","#60A000","#00B000","#00B058","#00A0A0","#0080C0","#004BE0","#0000FF","#7000E0","#C000C0","#E00070","#303030","#C00000","#A02800","#A05000","#906C00","#909000","#569000","#00A000","#00A050","#009090","#006BA0","#0040C0","#0000D0","#6000C0","#A000A0","#C00060","#202020","#900000","#902400","#804000","#806000","#707000","#4D8000","#008000","#008040","#008080","#006090","#003090","#0000A0","#480090","#900090","#900048","#101010","#700000","#701C00","#60300","#604800","#606000","#3A6000","#006000","#006030","#006060","#004B70","#002570","#000080","#380070","#700070","#700038","#000000","#500000","#501400","#502800","#503C00","#505000","#305000","#005000","#005028","#005050","#003550","#001B50","#000050","#280050","#500050","#500028");
var ie=document.all
var dom=document.getElementById
var ns4=document.layers
function popUpWindow(val)
{
var opx= event.x+document.body.scrollLeft;
var opy=event.y+document.body.scrollTop;
//alert(document.body.scrollTop);
var i=0;
		var j=0;
		var k=16;
		var l=0;
		var tc=val;
		var info=""

info+='<TABLE width=150  height=150 border=0 cellpadding=0 cellspacing=1 bgcolor=#000000>'
//info+='<tr><td align=right colspan=16 height=5 bgcolor=#0066cc onclick=\'javascript:closediv();\'> Exit <img src=../../Newt//%27images/exit.bmp/%27 border=\'none\'></td></tr>'
for(j=0; j<colors.length/16;j++){
info+='<tr>'
for(i=l; i<k;i++){
//+'td>hello</td>'
info+='<TD onClick='
info+='\'changeColor("'
info+=colors[i]
info+='","'
info+=tc
info+='")\'  bgcolor="'
info+=colors[i]
info+='"></TD>'
}
k=k+16;
l=l+16;
info+='</tr>'
}
info+='</table>'
		if (ie) {
	document.all.dropin.innerHTML = info;
	//document.all.dropin.style.hidden='visible';
	document.all.dropin.style.left=opx;
	document.all.dropin.style.top=opy;
  }	
  	else if (ns4) {
		document.layers['dropin'].document.open();
		document.layers['dropin'].document.write(info);
		document.layers['dropin'].document.close();
	}
	else if (dom) {
		document.getElementById('dropin').innerHTML= info;
	}//alert(document.all.dropin.style.top);
	initbox();
}

function initbox(){
if (!dom&&!ie&&!ns4)
return
//cen=(ie)? document.body.clientWidth/2-155 : (dom)?window.innerWidth/2-155  : window.innerWidth/2-155
crossobj=(dom)?document.getElementById("dropin").style : ie? document.all.dropin : document.dropin
//scroll_top=(ie)? document.body.scrollTop : window.pageYOffset
//crossobj.top=scroll_top-250
//crossobj.width=310
//crossobj.left=cen

crossobj.visibility=(dom||ie)? "visible" : "show"
//dropstart=setInterval("dropin()",50)
}
function closediv(){
if (ie) {
	document.all.dropin.innerHTML = "";
	
  }	
  	else if (ns4) {
	var infonull=""
		document.layers['dropin'].document.open();
		document.layers['dropin'].document.write(infonull);
		document.layers['dropin'].document.close();
	}
	else if (dom) {
		document.getElementById('dropin').innerHTML= "";
	}
}
function changeColor(col,id){
bid=id+2;
//alert(col)
var c=id;
var lid;
//if(id != "PRECINCT")
//{
lid=id+"LABELS";
//}else
//{
//lid="LABELS";
//}
//alert(window.opener.svgFile1)
svgdoc=svgFile1.getSVGDocument();

svgline=svgdoc.getElementById(id);
svgline1=svgdoc.getElementById(lid);
if (svgline){svgline.setAttribute('stroke',col);}else {alert("Layer doesnot exist")}
if (svgline1){svgline1.setAttribute('fill',col);}//else {alert("Label doesnot exist")}
if(id){document.all[bid].style.background=col;
}else{//window.close()}
}
//window.close();
//document.all.dropin.innerHTML = "";
closediv();

}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
// Browser detection library
// Capabilities detection
// Author:	Roland Smeenk
// Website: www.smeenk.com
var is;
var caps;
var isIE3Mac = false;
if ((navigator.appVersion.indexOf("Mac")!=-1) && 
    (navigator.userAgent.indexOf("MSIE")!=-1)
    && (parseInt(navigator.appVersion)==3))
    isIE3Mac = true;
else
{
    is = new Is();
    caps = new Caps();
}
function doError(a1,a2,a3) {
	str = 'An error occured on this page.\n';
	str += 'Error: ' + a1;
	str += '\nFile: ' + a2;
	str += '\nLine: ' + a3;
	alert(str);
	return true;
}
window.onerror = doError;

function Is ()
{   
var agt=navigator.userAgent.toLowerCase();
var apv=navigator.appVersion;
// Detect browser version
this.major = parseInt(apv);
this.minor = parseFloat(apv);
// Detect browser type
this.nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
 && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) 
 && (agt.indexOf('webtv')==-1));
this.nav2 = (this.nav && (this.major == 2));
this.nav3 = (this.nav && (this.major == 3));
this.nav3up = (this.nav && (this.major >= 3));
this.nav4 = (this.nav && (this.major == 4));
this.nav4up = this.nav && (this.major >= 4);
this.nav5 = (this.nav && (this.major == 5));
this.nav5up = (this.nav && (this.major >= 5));
this.navonly  = (this.nav && ((agt.indexOf(";nav") != -1) || (agt.indexOf("; nav") != -1)));

this.ie   = (agt.indexOf("msie") != -1);
this.ie3  = (this.ie && (this.major < 4));
this.ie4  = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.0")==-1) );
this.ie4up  = (this.ie  && (this.major >= 4));
this.ie5  = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.0")!=-1) );
this.ie5up  = (this.ie  && !this.ie3 && !this.ie4);

this.aol   = (agt.indexOf("aol") != -1);
this.aol3  = (this.aol && this.ie3);
this.aol4  = (this.aol && this.ie4);

this.opera = (agt.indexOf("opera") != -1);
this.webtv = (agt.indexOf("webtv") != -1);

// Low level javascript (ie3.02)
this.low = (!this.nav && !this.ie && !this.opera) ? true:false
     
// Detect Javascript version
if (this.nav2 || this.ie3) this.js = 1.0
else if (this.nav3 || this.opera) this.js = 1.1
else if ((this.nav4 && (this.minor <= 4.05)) || this.ie4) this.js = 1.2
else if ((this.nav4 && (this.minor > 4.05)) || this.ie5) this.js = 1.3
else if (this.nav5) this.js = 1.4
else if (this.nav && (this.major > 5)) this.js = 1.4
else if (this.ie && (this.major > 5)) this.js = 1.3
else this.js = 0.0;

this.win   = ((agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1));
this.win95 = ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1));
this.win16 = ((agt.indexOf("win16")!=-1) ||
(agt.indexOf("16bit")!=-1) || (agt.indexOf("windows 3.1")!=-1) ||
(agt.indexOf("windows 16-bit")!=-1) );
this.win31 = ((agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1) ||
(agt.indexOf("windows 16-bit")!=-1));
this.win98 = ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1));
this.winnt = ((agt.indexOf("winnt")!=-1) || (agt.indexOf("windows nt")!=-1));
this.win32 = ( this.win95 || this.winnt || this.win98 ||
((this.major >= 4) && (navigator.platform == "Win32")) ||
(agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1) );
this.os2   = ((agt.indexOf("os/2")!=-1) ||
(apv.indexOf("OS/2")!=-1) ||
(apv.lastIndexOf("OS2") != -1) ||
(agt.indexOf("ibm-webexplorer")!=-1));
this.mac    = (agt.indexOf("mac")!=-1);
this.mac68k = (this.mac && ((agt.indexOf("68k")!=-1) ||
(agt.indexOf("68000")!=-1)));
this.macppc = (this.mac && ((agt.indexOf("ppc")!=-1) ||
(agt.indexOf("powerpc")!=-1)));
this.sun   = (agt.indexOf("sunos")!=-1);
this.sun4  = (agt.indexOf("sunos 4")!=-1);
this.sun5  = (agt.indexOf("sunos 5")!=-1);
this.suni86= (this.sun && (agt.indexOf("i86")!=-1));
this.irix  = (agt.indexOf("irix") !=-1);    // SGI
this.irix5 = (agt.indexOf("irix 5") !=-1);
this.irix6 = ((agt.indexOf("irix 6") !=-1) || (agt.indexOf("irix6") !=-1));
this.hpux  = (agt.indexOf("hp-ux")!=-1);
this.hpux9 = (this.hpux && (agt.indexOf("09.")!=-1));
this.hpux10= (this.hpux && (agt.indexOf("10.")!=-1));
this.aix   = (agt.indexOf("aix") !=-1);      // IBM
this.aix1  = (agt.indexOf("aix 1") !=-1);
this.aix2  = (agt.indexOf("aix 2") !=-1);
this.aix3  = (agt.indexOf("aix 3") !=-1);
this.aix4  = (agt.indexOf("aix 4") !=-1);
this.linux = (agt.indexOf("inux")!=-1);
this.sco   = (agt.indexOf("sco")!=-1) || (agt.indexOf("unix_sv")!=-1);
this.unixware = (agt.indexOf("unix_system_v")!=-1);
this.mpras    = (agt.indexOf("ncr")!=-1);
this.reliant  = (agt.indexOf("reliantunix")!=-1);
this.dec   = ((agt.indexOf("dec")!=-1) || (agt.indexOf("osf1")!=-1) ||
(agt.indexOf("dec_alpha")!=-1) || (agt.indexOf("alphaserver")!=-1) ||
(agt.indexOf("ultrix")!=-1) || (agt.indexOf("alphastation")!=-1));
this.sinix = (agt.indexOf("sinix")!=-1);
this.freebsd = (agt.indexOf("freebsd")!=-1);
this.bsd = (agt.indexOf("bsd")!=-1);
this.unix  = ((agt.indexOf("x11")!=-1) || this.sun || this.irix || this.hpux ||
 this.sco ||this.unixware || this.mpras || this.reliant ||
 this.dec || this.sinix || this.aix || this.linux || this.bsd || this.freebsd);
this.vms   = ((agt.indexOf("vax")!=-1) || (agt.indexOf("openvms")!=-1));
this.rhapsody = (agt.indexOf("rhapsody") != -1 );
this.openstep = (agt.indexOf("openstep") != -1 );
this.nextos =  (agt.indexOf("next") != -1);
this.solaris = (agt.indexOf("solaris") != -1);
}

function Caps ()
{   
this.midi = ((is.nav3up && navigator.mimeTypes["audio/x-midi"]) || is.ie4up)  ? true:false;
this.wav = ((is.nav3up && navigator.mimeTypes["audio/x-wav"]) || is.ie4up)  ? true:false;
this.navdhtml = (document.layers) ? true:false;
this.iedhtml = (document.all) ? true:false;
this.dhtml = (this.navdhtml || this.iedhtml);
this.image = (document.images) ? true:false;
this.width = 0;
this.height = 0;
this.colorDepth = 0;
if (screen)
{if (screen.width) this.width = screen.width;
if (screen.height) this.height = screen.height;
if (screen.colorDepth) this.colorDepth = screen.colorDepth;
if ((!screen.width) && (is.nav) && (navigator.javaEnabled()))
{var toolkit = java.awt.Toolkit.getDefaultToolkit();
var screen_size = toolkit.getScreenSize();
this.width = screen_size.width;
this.height = screen_size.height;
}
}

this.cp20 = (is.win32 && NavDetectObject("Cosmo Player 2.0")) ||
NavDetectObject("Cosmoplayer Plugin") ||
IEDetectObject("SGI.CosmoPlayer.1");
this.cp21 = (is.win32 && NavFindObject("Cosmo Player 2.1")) ||
IEDetectObject("SGI.CosmoPlayer.2");
this.cp = (is.irix && NavDetectObject("libcosmoplayer.so")) || this.cp20 || this.cp21;
this.pv = (NavDetectObject("Nexternet Player 1.0") || 
IEDetectObject("Nexternet.NexternetPlayer.1"));
this.wv20 = NavDetectObject("WorldView 2.0 for Netscape Navigator") ||
IEDetectObject("WorldView.WorldView VrmlViewer.1");
this.wv21 = IEDetectObject("WorldView.WorldView VrmlViewer.2");
this.ms = IEDetectObject("MSVRML2C.VRMLBrowserCtl.1");
this.wv = this.wv20 || this.wv21 || IEDetectObject("WORLDVIEW.WorldViewCtrl.1") || this.ms;
this.l3d = NavDetectObject("Live3D Plugin DLL");
this.vs = NavDetectObject("Viscape for Netscape Navigator") ||
IEDetectObject("Virtual_Worlds");
this.vsu = NavDetectObject("Viscape Universal") ||
IEDetectObject("Viscape VRML control");
this.bs = NavFindObject("blaxxun Contact (blaxxun CCpro)") || 
NavFindObject("blaxxun CC3D") ||
IEDetectObject("blaxxunCC3D.blaxxunCC3D.1");
this.ct = NavDetectObject("Cortona VRML Client") ||
IEDetectObject("Cortona.Control.1");
this.vrml = (this.cp || this.wv || this.vsu || this.bs || this.ct || this.pv);
blaxxun = (IEDetectObject("Adobe.SVGCtl.3")) ? true:false;

}

var result;
// Detection of a plugin inside Internet Explorer on Windows
function IEDetectObject(ClassID)
{
	result = false;
	if ((is.ie) && (is.win))
	{
		document.write('<SCRIPT LANGUAGE=VBScript\> \n');
		document.write('on error resume next \n');
		document.write('result = IsObject(CreateObject("' + ClassID + '")) \n');
		document.write('</SCRIPT\> \n');
	}
	return result;
}

// Detection of a plugin inside Netscape Navigator
// Only for exact matches of the teststring
function NavDetectObject(teststring)
{
	result = false;
	if (is.nav)
	{	
		result = (navigator.plugins[teststring]) ? true:false;
	}

	return result;
}

// Detection of a plugin inside Netscape Navigator
// Finds if a plugin containing the teststring is installed 
// Slower than NavDetectObject
function NavFindObject(teststring)
{
	result = false;
	if (is.nav)
	{	
		var numPlugins = 0;
		if (navigator.plugins)
			numPlugins = navigator.plugins.length;
	
		for (var i=0; i < numPlugins; i++) 
		{
			if (navigator.plugins[i].name.indexOf(teststring) != -1)
				return true;
		}
	}
	return result;
}
function changeCursor(id){

	if(id=="contexthelp"){
		document.body.style.cursor='help';
		document.all.contexthelp.style.cursor='help';
		window.status="Click on any item for context help";
		help=1;
	}
	else {
			if(help==1){
				document.body.style.cursor='none';
				document.all.contexthelp.style.cursor='none';
				window.status="";
				var page="../common/help.htm#"+id;
				MM_openBrWindow(page,'htm','toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
			}
		help=0;
	}
}
function changeCursores(id){

	if(id=="contexthelp"){
		document.body.style.cursor='help';
		document.all.contexthelp.style.cursor='help';
		window.status="Click on any item for context help";
		help=1;
	}
	else {
			if(help==1){
				document.body.style.cursor='none';
				document.all.contexthelp.style.cursor='none';
				window.status="";
				var page="aayuda.htm#"+id;
				MM_openBrWindowes(page,'htm','toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes');
			}
		help=0;
	}
}
function showtooltip(id){
if(help==1)
document.all[id].title='click here for context help on this item';
else
document.all[id].title='';
}
function showCal(){
//alert(gbal);

dataWindow=open("","","toolbar=0,directories=0,menu=0,scrollbars=0,location=0,resizable=1,status=0,top=50,left=50,width=330,height=100,menubar=0,dependent=1,hotkeys=0");
		dataWindow.document.open();
		dataWindow.document.write("<HTML><HEAD><TITLE>Calendar Information</TITLE>");
		dataWindow.document.write("<link rel=stylesheet type='text/css' href='styles.css'><SCRIPT LANGUAGE='Javascript' SRC='scr/test2.js'></SCRIPT></HEAD><BODY  onBlur='window.close()'>");
		dataWindow.document.write("<TABLE BGCOLOR='#FFEFB1' width='100%'><TR><TD>");
		dataWindow.document.write("<TABLE BGCOLOR='#DAFFDB' width='100%'>");		
		dataWindow.document.write("<TR><TD><div align=right><a href='javascript:window.close();'><img src='../common/images/exit.bmp' border='none'>&nbsp;Exit</a></div></TD></TR>");
		dataWindow.document.write("<TR><TD valign=top><b>Calendar information is currently not available.</b></TD></TR>");
		
				dataWindow.document.write("<TR><TD></TD></TR>");
		dataWindow.document.write("</TABLE></TD></TR></TABLE>");
		dataWindow.document.write("</BODY></HTML>");
		dataWindow.document.close();
//alert("Primary Ballot information for the "+ val +" party is not available for this address.");

}
var popUpWin=0;
function printsvg(URLStr)
{//var URLStr='map.htm';
var left=50;
var top=50;
var width=600;
var height=630;
//alert(document.getElementById("svgFile1").src)
 if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbar=no,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

