// xp_progressbar
// Copyright 2004 Brian Gosselin of ScriptAsylum.com
//
// v1.0 - Initial release
// v1.1 - Added ability to pause the scrolling action (requires you to assign
//        the bar to a unique arbitrary variable).
//      - Added ability to specify an action to perform after a x amount of
//      - bar scrolls. This requires two added arguments.
// v1.2 - Added ability to hide/show each bar (requires you to assign the bar
//        to a unique arbitrary variable).

// var xyz = createBar(
// total_width,
// total_height,
// background_color,
// border_width,
// border_color,
// block_color,
// scroll_speed,
// block_count,
// scroll_count,
// action_to_perform_after_scrolled_n_times
// )

var w3c=(document.getElementById)?true:false;
var ie=(document.all)?true:false;
var N=-1;

function createBar(w,h,bgc,brdW,brdC,blkC,speed,blocks,count,action){
if(ie||w3c){
var t='<div id="_xpbar'+(++N)+'" style="visibility:visible; position:relative; overflow:hidden; width:'+w+'px; height:'+h+'px; background-color:'+bgc+'; border-color:'+brdC+'; border-width:'+brdW+'px; border-style:solid; font-size:1px;">';
t+='<span id="blocks'+N+'" style="left:-'+(h*2+1)+'px; position:absolute; font-size:1px">';
for(i=0;i<blocks;i++){
t+='<span style="background-color:'+blkC+'; left:-'+((5*i))+'px; font-size:1px; position:absolute; width:'+'5'+'px; height:'+h+'px; '
t+=(ie)?'filter:alpha(opacity='+(100-i*(100/blocks))+')':'-Moz-opacity:'+((100-i*(100/blocks))/100);
t+='"></span>';
}
t+='</span></div>';
document.write(t);
var bA=(ie)?document.all['blocks'+N]:document.getElementById('blocks'+N);
bA.bar=(ie)?document.all['_xpbar'+N]:document.getElementById('_xpbar'+N);
bA.blocks=blocks;
bA.N=N;
bA.w=w;
bA.h=h;
bA.speed=speed;
bA.ctr=0;
bA.count=count;
bA.action=action;
bA.togglePause=togglePause;
bA.showBar=function(){
this.bar.style.visibility="visible";
}
bA.hideBar=function(){
this.bar.style.visibility="hidden";
}
bA.tid=setInterval('startBar('+N+')',speed);
return bA;
}}

function startBar(bn){
var t=(ie)?document.all['blocks'+bn]:document.getElementById('blocks'+bn);
if(parseInt(t.style.left)+t.h+1-(t.blocks*t.h+t.blocks)>t.w){
t.style.left=-(t.h*2+1)+'px';
t.ctr++;
if(t.ctr>=t.count){
eval(t.action);
t.ctr=0;
}}else t.style.left=(parseInt(t.style.left)+t.h+1)+'px';
}

function togglePause(){
if(this.tid==0){
this.tid=setInterval('startBar('+this.N+')',this.speed);
}else{
clearInterval(this.tid);
this.tid=0;
}}

function togglePause(){
if(this.tid==0){
this.tid=setInterval('startBar('+this.N+')',this.speed);
}else{
clearInterval(this.tid);
this.tid=0;
}}


















function abrirscan(){window.open("http://www.pandasoftware.com/activescan/es/default.asp?IdVendor=1&IdLang=1&IdPais=62","AvScan","height=435,width=600,status=yes,toolbar=no,menubar=no,location=no,resizable=no");}


function abriravc(){window.open("http://www.pandasoftware.es/avchecker/es/default.asp?track=645","AvDet","height=446,width=681,status=yes,toolbar=no,menubar=no,location=no,resizable=no");}



function printPage() {
if (window.print)
window.print();
else
alert("Su navegador no permite la opcion de imprimir.!");
}




var OpenWin=0;

function popUp(URL,w,h,t,l) {

if(OpenWin)
{
  if(!OpenWin.closed) OpenWin.close();
}

windowstring="toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=0,width="+w+",height="+h+",top="+t+",left="+l;
OpenWin = window.open(URL, 'CtrlWindow',  windowstring );
OpenWin.focus();
}


var OpenWin=0;

function popup(URL,w,h,t,l) {

if(OpenWin)
{
  if(!OpenWin.closed) OpenWin.close();
}

windowstring="toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable=0,width="+w+",height="+h+",top="+t+",left="+l;
OpenWin = window.open(URL, 'CtrlWindow',  windowstring );
OpenWin.focus();
}




var OpenWin=0;

function popUp2(URL,w,h,t,l) {

if(OpenWin)
{
  if(!OpenWin.closed) OpenWin.close();
}

windowstring="toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=0,width="+w+",height="+h+",top="+t+",left="+l;
OpenWin = window.open(URL, 'CtrlWindow2',  windowstring );
OpenWin.focus();
}


var OpenWin=0;

function popup2(URL,w,h,t,l) {

if(OpenWin)
{
  if(!OpenWin.closed) OpenWin.close();
}

windowstring="toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=0,width="+w+",height="+h+",top="+t+",left="+l;
OpenWin = window.open(URL, 'CtrlWindow2',  windowstring );
OpenWin.focus();
}





function mostrarnuevo(maxdays, addDate, texto){
var getOldDate = new Date(addDate);
var getNewDate = new Date();
var isItNew = maxdays*24*60*60*1000;
if ((getNewDate.getTime()-getOldDate.getTime()) <=  isItNew) {
document.write("<p align='center'><font color='red' face='Arial' size=1 ><b><i>"+texto+"</i></b></p></font>")
; } }




var OpenWin=0;

function Help01(titulo,text,h) {
if(OpenWin)
{
  if(!OpenWin.closed) OpenWin.close();
}

text1 =  "<html>\n<head>\n<title>Información del Portal</title>\n<body bgcolor='#ffffff' alink='#ff0000' link='#0000ff' vlink='#0000ff'>\n<STYLE type='text/css'> <!-- BODY { scrollbar-face-color:#235C96; scrollbar-highlight-color:#00FFFF; scrollbar-3dlight-color:#B5D1EE; scrollbar-darkshadow-color:#B5D1EE; scrollbar-shadow-color:#00FFFF; scrollbar-arrow-color:#FFFFFF; scrollbar-track-color:#FFFFFF; } --> </STYLE><STYLE TYPE='text/css'> <!-- A {text-decoration: none;} A:hover { color: red; text-decoration: underline;} --> </STYLE></body>\n</html>\n";
OpenWin=open("a","DisplayWindow","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=0,width=300,height="+h+",top=20,left=20");
OpenWin.document.write(text1+"<font color='red' face='Arial' size=3 ><b>"+titulo+"</font>"+"</b><br><font color='navy' face='Arial' size=1 >"+text+"</font><br>"+"<font face='Arial' size=2 color='#000080'><B><I><a href='javascript:window.close()'>Cerrar ventana</a><br></I></B></font>");
OpenWin.focus();
}




function cargaframe(destino)
{
document.frames.centro.location=destino;
}




function correo(usr,serv,dot)
{
onclick=location.href='mail'+'to'+':'+usr+unescape('%40')+serv+dot;

}








var requiredMajorVersion = 6;
var requiredMinorVersion = 0;
var requiredRevision = 0;
var jsVersion = 1.0;


var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
jsVersion = 1.1;

function JSGetSwfVer(i){
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
        		var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			descArray = flashDescription.split(" ");
			tempArrayMajor = descArray[2].split(".");
			versionMajor = tempArrayMajor[0];
			versionMinor = tempArrayMajor[1];
			if ( descArray[3] != "" ) {
				tempArrayMinor = descArray[3].split("r");
			} else {
				tempArrayMinor = descArray[4].split("r");
			}
      	 	versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
            flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
      	} else {
			flashVer = -1;
		}
	}
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else {
		
		flashVer = -1;
	}
	return flashVer;
} 



function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) 
{
 	reqVer = parseFloat(reqMajorVer + "." + reqRevision);
	for (i=25;i>0;i--) {	
		if (isIE && isWin && !isOpera) {
			versionStr = VBGetSwfVer(i);
		} else {
			versionStr = JSGetSwfVer(i);		
		}
		if (versionStr == -1 ) { 
			return false;
		} else if (versionStr != 0) {
			if(isIE && isWin && !isOpera) {
				tempArray         = versionStr.split(" ");
				tempString        = tempArray[1];
				versionArray      = tempString .split(",");				
			} else {
				versionArray      = versionStr.split(".");
			}
			versionMajor      = versionArray[0];
			versionMinor      = versionArray[1];
			versionRevision   = versionArray[2];
			
			versionString     = versionMajor + "." + versionRevision;
			versionNum        = parseFloat(versionString);
			if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {
				return true;
			} else {
				return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false );	
			}
		}
	}	
	return (reqVer ? false : 0.0);
}




function agregar(){
   if ((navigator.appName=="Microsoft Internet Explorer") && 
         (parseInt(navigator.appVersion)>=4)) {
      var url2="http://www.softersoluciones.com"; 
      var titulo="Softer Soluciones - Diseño Web Profesional";
      window.external.AddFavorite(url2,titulo);
   } else { 
      if(navigator.appName == "Netscape") 
         alert("Presione Crtl+D para agregar este sitio en sus Bookmarks"); 
   }
} 










function agregarfavoritos(url2,titulo){
   if ((navigator.appName=="Microsoft Internet Explorer") && 
         (parseInt(navigator.appVersion)>=4)) {
      window.external.AddFavorite(url2,titulo);
   } else { 
      if(navigator.appName == "Netscape") 
         alert("Presione Crtl+D para agregar este sitio en sus Bookmarks"); 
   }
} 














