
function maxPopUp(name, URL){
	var hite = eval(screen.availHeight-70);
	var wid = eval(screen.availWidth-50);
	w=window.open(URL, name, "scrollbars=1, menubar=0, top=0, left=0, width=" + wid + ", status=1, height=" + hite + ", resizable=1");
	centerWin(w,wid,hite);
}


function popUp(name, URL){
	var hite = 430;
	var wid = 400;
	w=window.open(URL, name, "scrollbars=1, menubar=0, top=20, left=50, width=" + wid + ", height=" + hite + ", , status=1, resizable=1");
	centerWin(w,wid,hite);
}


function mediumPopUp(name, URL){
	var hite = 500;
	var wid = 500;
	w=window.open(URL, name, "scrollbars=1, menubar=0, width=" + wid + ", status=1, height=" + hite + ", resizable=0");
	centerWin(w,wid,hite);
}


function tallPopUp(name, URL){
	w=window.open(URL, name, "scrollbars=1, menubar=0, top=20, left=50, width=500, status=1, height=550, resizable=1");
}

function timecardPopUp(name, URL){
	w=window.open(URL, name, "scrollbars=1, menubar=0, top=20, left=50, width=650, status=1, height=600, resizable=0");
}

function customPopUp(winName, URL, wid, hite){
	var winl = (screen.width - wid) / 2;
	var wint = (screen.height - hite) / 2;
	//alert(winl + " and " + wint);
	w=window.open(URL, winName, "scrollbars=1, menubar=0, width=" + wid + ", status=0, height=" + hite + ", resizable=0");
	//w.moveTo(winl,wint);
	//if(parseInt(navigator.appVersion) >= 4){w.window.focus();}
	centerWin(w,wid,hite);

}

function contactCPPopUp(winName, URL){
	w=window.open(URL, name, "scrollbars=1, menubar=0, width=600, height=650, resizable=1");
}

function contactInfoPopUp(winName, URL){
	w=window.open(URL, name, "scrollbars=1, menubar=0, width=400, height=450, resizable=1");
}

function maxHeightPopUp(name, URL){
	w=window.open(URL, name, "scrollbars=1, menubar=0, top=0, left=0, width=700, status=0, height=" + eval(screen.availHeight-40) + ", resizable=1");
	centerWin(w, 700, eval(screen.availHeight-40));
}

function largePopUp(name, URL){
	var hite = 550;
	var wid = 700;
	w=window.open(URL, name, "scrollbars=1, menubar=0, width=" + wid + ", status=1, height=" + hite + ", resizable=1");
	centerWin(w,wid,hite);
}

function couponPopUp(winName, URL){
	//if(window.w){
	//	w.close();
	//}
	w=window.open(URL, winName, "scrollbars=1, menubar=0, width=550, status=0, height=300, resizable=0");
}

function upperCaseFirstChar(txt_el){
	var temp;
	var first_char;

	temp = Trim(txt_el.value);

	first_char = temp.substring(0, 1).toUpperCase();
	temp = temp.substring(1, txt_el.value.length.trim);
	txt_el.value = first_char + temp;
}


function centerWin(win, wid, hite){
	var winl = (screen.width - wid) / 2;
	var wint = (screen.height - hite) / 2;

	win.moveTo(winl,wint);
	if(parseInt(navigator.appVersion) >= 4){w.window.focus();}
}


function RTrim(str){
	var whitespace = new String(" \t\n\r");

	var s = new String(str);

	if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {
	    var i = s.length - 1;
	    while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
		i--;
	    s = s.substring(0, i+1);
	}

	return s;
}



function LTrim(str){
	var whitespace = new String(" \t\n\r");

	var s = new String(str);

	if (whitespace.indexOf(s.charAt(0)) != -1) {
	    var j=0, i = s.length;
	    while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
		j++;
	    s = s.substring(j, i);
	}

	return s;
}



function Trim(str){
	return RTrim(LTrim(str));
}




