function OpenWin(url, name, openstring) {
   NewWin = window.open(url, name, openstring);
   if (NewWin!=null && NewWin.opener==null)
         NewWin.opener=window;
   NewWin.focus()
}

function Login(){
var str = window.location.href ;
n=str.indexOf("#");
            if (n==-1) {
               substr=str ;
             window.location.replace(substr+"&login");
            }else{ 
               substr=str.substring(0, n);
             window.location.replace(substr+"&login");
              }
}

function LogOut(){
        if (confirm("Medina Development \n\nYou are about to Log Out from SalsaMedina.  Are you sure you want to Log Out?  ")) { 
window.location.href='/names.nsf?logout'
 //  oxm commented out 2.21.2004                 parent.close( self )
       } else { 
           window.location.reload()
          }
}
function WebMailLogin(){
 window.location='/login.nsf/preLaunch?OpenForm&login' 
}

function FullWin(url, name) {
   if (navigator.appName == 'Microsoft Internet Explorer')
         OpenWin(url,name,'menubar=0,scrollbars=1,resizable=1,left=0,top=0');
    else
         OpenWin(url,name,'menubar=1,scrollbars=1,resizable=1');
}

function MedinaWin(url, name, size) {
   if (size=='full') {FullWin(url, name); return}
   var width; var height; var top; var left;
   var menubar = 0;
   if (size=='small')
      {width=350; height=200;left=125;top=150; menubar=0;scrollbars=0;resizable=0 }
   else if (size=='help')
      {width=655; height=500;left=50;top=50;scrollbars=0 ;resizable=0 }
   else if (size=='feedback')
      {width=688; height=511;left=40;top=40; menubar=0;scrollbars=0;resizable=0}
   else if (size=='medium')
      {width=600; height=400;left=50;top=50;scrollbars=0;resizable=0}
   else if (size=='mediumcontact')
      {width=450; height=450;left=50;top=50;scrollbars=0;resizable=0}
   else if (size=='picklist')
      {width=400; height=450;left=250;top=50; menubar=0;scrollbars=0;resizable=0}
   else if (size=='large')
      {width=580; height=640;left=50;top=50; menubar=0;scrollbars=1;resizable=1}
   else if (size=='printlarge')
      {width=950; height=640;left=20;top=20; menubar=0;scrollbars=1;resizable=1}
   else if (size=='menularge')
      {width=850; height=640;left=20;top=20; menubar=1;scrollbars=1;resizable=1}
   else 
      {width=650; height=450;left=25;top=25;resizable=0};
   OpenWin(url, name, 'toolbar=0,location=0,directories=0,status=0,menubar='+menubar+', scrollbars='+scrollbars+' ,resizable='+resizable+',copyhistory=0,width='+width+',height='+height+',left='+left+',top='+top)
}

var thisurl = document.location;

function SBack() {
  window.close()
  }

function Forward(fwdurl,fwdsize) {
   MedinaWin('/intranet/all/BuPages.nsf/ForwardEmail?OpenForm&login&UNID='+fwdurl+'&HWin=1','forward','medium')
}

var coding = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMabcdefghijklmnopqrstuvwxyzabcdefghijklm';
function rot13(input) {
    if (!input) return '';
    for (var output = '',i=0;i<input.length;i++) {
        character = input.charAt(i);
        position = coding.indexOf(character);
        if (position > -1)
            character = coding.charAt(position + 13);
        output += character;
    }
    return output;
}
function SetCookie (name,value,expires,path,sitedomain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" : "; path=/") +
    ((sitedomain) ? "; domain=" + sitedomain : "") +
    ((secure) ? "; secure" : "");
}

function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
      var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break; 
  }
  return null;
}
function GrabCookie(cookiejar, cookiename) {
   if (cookiejar.indexOf(cookiename) <0) 
      return '';
   else {
      start = cookiejar.indexOf(cookiename)+cookiename.length+1;
      end = cookiejar.indexOf(';', start);
      if (end < start) end=cookiejar.length;
      return cookiejar.substring(start,end);
   }
}

 
function right(e) {
var msg = "Salsa Medina Development  \n \n  Sorry, copying this image is not permitted.";
if (navigator.appName == 'Netscape' && e.which == 3) {
alert(msg);
return false;
}
if (navigator.appName == 'Microsoft Internet Explorer' && event.button==2) {
alert(msg);
return false;
}
else return true;
}
function trap() 
  {
  if(document.images)
    {
    for(i=0;i<document.images.length;i++)
      {
      document.images[i].onmousedown = right;
      document.images[i].onmouseup = right;
      }
    }
  }


var no    = 58;  
var speed = 9; // speed of snowflakes, the lower the faster
  var ie4up = (document.all) ? 1 : 0; // browser sniffer
  var ns6up = (document.getElementById&&!document.all) ? 1 : 0;// browser sniffer

function iecompattest(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
	}

var dx, xp, yp;    // coordinate and position variables
var am, stx, sty;  // amplitude and step variables
var i;
var doc_width = 800, doc_height = 600;
/*if (ns6up) {
    doc_width = self.innerWidth;
    doc_height = self.innerHeight;
  } else if (ie4up) {
    doc_width = iecompattest().clientWidth;
    doc_height = iecompattest().clientHeight;
  }
  */

dx  = new Array();
xp  = new Array();
yp  = new Array();
am  = new Array();
stx = new Array();
sty = new Array();
// main animation function
function animate(filename) {   

     var snowflake = filename;

	for (i = 0; i < no; ++ i) {  
		dx[i] = 0;                             // set coordinate variables
		xp[i] = Math.random()*(doc_width-50);  // set position variables
		yp[i] = Math.random()*doc_height;
		am[i] = Math.random()*20;              // set amplitude variables
		stx[i] = 0.02 + Math.random()/10;      // set step variables
		sty[i] = 0.7 + Math.random();          // set step variables
		if (ie4up) {
			if (i == 0) {
				document.write("<div id=\"dot"+ i + "\" style=\"POSITION: ");
				document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
				document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");
				document.write(snowflake + "\" border=\"0\"></div>");
			} else {
				document.write("<div id=\"dot"+ i + "\" style=\"POSITION: ");
				document.write("absolute; Z-INDEX: "+ i +"; VISIBILITY: ");
				document.write("visible; TOP: 15px; LEFT: 15px;\"><img src=\"");
				document.write(snowflake + "\" border=\"0\"></div>");
			}
		}
	}
		snowIE();
	}
function snowIE() {
	for (i = 0; i < no; ++ i) {  // iterate for every dot
		yp[i] += sty[i];
		if (yp[i] > doc_height-50) {
			xp[i] = Math.random()*(doc_width-am[i]-30);
			yp[i] = 0;
			stx[i] = 0.02 + Math.random();;
			sty[i] = 0.7 + Math.random();
			doc_width = document.body.clientWidth;
			doc_height = document.body.clientHeight;
		}
		dx[i] += stx[i];
		document.all["dot"+i].style.pixelTop = yp[i];
		document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]);
	}
	setTimeout("snowIE()", speed);
	}

function FCancel(){
   history.go(-1)
}

function FSave(){
   Validate()
}



var aTimerInterval = null;
var enduser = "Anonymous" ;
function TimerPopUp() {
var userTimeout ;
window.focus();
userTimeout = window.confirm( "Medina Development \n\nDue to inactivity, you will be automatically logged off. \n\nPress OK to avoid being logged off.") 
if (userTimeout==true) window.location.reload() ;
}
if ( enduser != "Anonymous") 
aTimerInterval = window.setInterval("TimerPopUp()", 6960000) 
javascript: window.defaultStatus='DanGallagherForJudge.com: Vote on February 02, 2010' 

