function info(url){ newwindow=window.open(url,'info','height=320,width=400,scrollbars=yes');
    if (window.focus) {
        newwindow.focus()
    }
    return false;
}

function send(url){ newwindow=window.open(url,'send','height=320,width=400,scrollbars=yes');
    if (window.focus) {
        newwindow.focus()
    }
    return false;
}

function print(url){ newwindow=window.open(url,'print','height=500,width=640,scrollbars=yes');
    if (window.focus) {
        newwindow.focus()
    }
    return false;
}

function bookmarkit(title, url){
    if (document.all)
        window.external.AddFavorite(url, title);
    else if (window.sidebar)
    window.sidebar.addPanel(title, url, "")
}

var auto_tab=0;
function TabNext(obj,event,len,next_field) {
	if (event == "down") {
		auto_tab=obj.value.length;
		}
	else if (event == "up") {
		if (obj.value.length != auto_tab) {
			auto_tab=obj.value.length;
			if (auto_tab == len) {
				next_field.focus();
			}
	    }
	}
}

site="";
function combineMenus(frm, menu1, menu2) {
with (frm) {
for (var i = 0; i < document.menufrm.menu1.length; i++) {
if (document.menufrm.menu1[i].checked) {
str = document.menufrm.menu1[i].value;
break;
   }
}
url = site + "/" + str + "/";
window.location.href = url;
   }
}

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}

function gup( name )
{
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
    return "";
  else
    return results[1];
}

if ((gup('ph')).length==10) {
	createCookie('phone',gup('ph'),365);
}
else if (readCookie('phone')) {
	createCookie('phone',readCookie('phone'),365);
}
