writeCookie();

function writeCookie()
{
var today = new Date();
var the_date = new Date("December 31, 2023");
var the_cookie_date = the_date.toGMTString();
var the_cookie = "users_resolution="+ screen.width +"x"+ screen.height;
var the_cookie = the_cookie + ";expires=" + the_cookie_date;
document.cookie=the_cookie

} 


function outBound(url)
       {
      /*  var w = screen.availWidth||screen.width;
	   var h = screen.availHeight||screen.height; */
	    
var w = 650;
var h = 450; 

        window.open('http://' + url,'newWIN','toolbar=yes,directories=yes,menubar=yes,scrollbars=yes,resizable=yes,location=yes,status=yes,width=' + w + ',height=' + h + ',screenX=0,screenY=0,left=0,top=0');
       }  

function cBox(chbox) {
    box = eval(chbox);
box.checked = !box.checked;
}

       function linkto(n) {
    top.window.location=document.forms[0][n].options[document.forms[0][n].selectedIndex].value;
  }

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];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function checkDaBox(mls) {
    box = eval(mls);
    box.checked = !box.checked;
} 

function setLyr(obj,lyr)
{
	var newX = findPosX(obj);
	var x = new getObj(lyr);
	x.style.left = newX + 'px';
}

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function getObj(name)
{
 if (document.getElementById)
 {
	   this.obj = document.getElementById(name);
	   this.style = document.getElementById(name).style;
 }
 else if (document.all)
 {
	   this.obj = document.all[name];
	   this.style = document.all[name].style;
 }
 else if (document.layers)
 {
	   if (document.layers[name])
	   {
	   	this.obj = document.layers[name];
	   	this.style = document.layers[name];
	   }
	   else
	   {
	    this.obj = document.layers.testP.layers[name];
	    this.style = document.layers.testP.layers[name];
	   }
 }
}

 function hide ( name ) {
	NS4 = (document.layers) ? 1 : 0;
	IE4 = (document.all) ? 1 : 0;
	W3C = (document.getElementById) ? 1 : 0;        
	if (W3C) {
		document.getElementById(name).style.visibility = "hidden";
	} else if (NS4) {
		document.layers[name].visibility = "hidden";
	} else {
		document.all[name].style.visibility = "hidden";
	}
}
function show (name ) {
	var ele;                //points to the popup element

	NS4 = (document.layers) ? 1 : 0;
	IE4 = (document.all) ? 1 : 0;
	W3C = (document.getElementById) ? 1 : 0;

	if ( W3C ) {
		ele = document.getElementById(name);
	} else if ( NS4 ) {
		ele = document.layers[name];
	} else {        // meant for IE4
		ele = window.opener.document.all[name];
	}

	if ( NS4 ) {
		ele.visibility = "show";
	} else {  // IE4 & W3C
		ele.style.visibility = "visible";
	}
}

function imageZoom(chosen){ 
 
 if (chosen == true)
 { 
 show('big');
 hide('small');
 }
 else
 { 
 hide('big');
 show('small');
 }
 
}

function scheduleSelect(){ 
 
 if (document.forms[0].alertperiod[0].selected == true)
 { 
 show('daily');
 hide('periodic');
 }
 if (document.forms[0].alertperiod[1].selected == true)
 { 
 hide('daily');
 show('periodic');
 }
 
}

function allPhoto(url)
       {
      /*  var w = screen.availWidth||screen.width;
	   var h = screen.availHeight||screen.height; */
	    
var w = 680;
var h = 400; 

        window.open(url,'newWIN','toolbar=no,directories=no,menubar=no,scrollbars=yes,resizable=yes,location=no,status=no,width=' + w + ',height=' + h + ',screenX=0,screenY=0,left=0,top=0');
}  

function delit(name,url) {
 ask=window.confirm("Are you sure you want to DELETE "+name+"? This action cannot be undone!");
 if(ask==true){
  window.location=url;
 }
}

function mySubmit() {
	selectAll();
	selectAll2();
	document.search.submit();
}

/* multiselect copying */
var multiSelection;
var multiSelected;

function createList(){
    multiSelection = document.getElementById("possibleItems");
    multiSelected = document.getElementById("selectedItems");
}

function delItem(){
    var sIndex = multiSelected.selectedIndex;
    if(sIndex < 0)
        return;

    multiSelection.appendChild(multiSelected.options.item(sIndex))
    selectNone(multiSelected,multiSelection);
}

function selectAll(){
  var optionList = document.getElementById("selectedItems").options;
  var len = optionList.length;

    for(i=0; i<len; i++){
        optionList[i].selected = true;
    }
}

function addItem(){
    var aIndex = multiSelection.selectedIndex;

    if(aIndex < 0)
       return;

    multiSelected.appendChild(multiSelection.options.item(aIndex));
    selectNone(multiSelected,multiSelection);
}

function selectNone(list1,list2){
    list1.selectedIndex = -1;
    list2.selectedIndex = -1;
    aIndex = -1;
    sIndex = -1;
}

var multiSelection2;
var multiSelected2;

function createList2(){
    multiSelection2 = document.getElementById("possibleItems2");
    multiSelected2 = document.getElementById("selectedItems2");
}

function delItem2(){
    var sIndex2 = multiSelected2.selectedIndex;
    if(sIndex2 < 0)
        return;

    multiSelection2.appendChild(multiSelected2.options.item(sIndex2))
    selectNone2(multiSelected2,multiSelection2);
}

function selectAll2(){
  var optionList2 = document.getElementById("selectedItems2").options;
  var len = optionList2.length;

    for(i=0; i<len; i++){
        optionList2[i].selected = true;
    }
}

function addItem2(){
    var aIndex2 = multiSelection2.selectedIndex;

    if(aIndex2 < 0)
       return;

    multiSelected2.appendChild(multiSelection2.options.item(aIndex2));
    selectNone2(multiSelected2,multiSelection2);
}

function selectNone2(list1a,list2b){
    list1a.selectedIndex = -1;
    list2b.selectedIndex = -1;
    aIndex2 = -1;
    sIndex2 = -1;
}

var phone_field_length=0;
function TabNext(obj,event,len,next_field) {
	if (event == "down") {
		phone_field_length=obj.value.length;
		}
	else if (event == "up") {
		if (obj.value.length != phone_field_length) {
			phone_field_length=obj.value.length;
			if (phone_field_length == len) {
				next_field.focus();
				}
			}
		}
	}