//// NEW WINDOWS


function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'titlebar=no,toolbar=no,scrollbars=no,directories=no,location=no,statusbar=no,menubar=no,resizable=no,width=400,height=350,left = 440,top = 200');");
}

function quickView(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'titlebar=no,toolbar=no,scrollbars=yes,directories=no,location=no,statusbar=no,menubar=no,resizable=yes,width=750,height=500,left = 290,top = 134');");
}

var newwindow;
function pop(url)
{
	
	newwindow=window.open(url,'name','height=800,width=700');
	if (window.focus) {newwindow.focus()}
}



function autoTab(element, nextElement) {
    if (element.value.length == element.maxLength && nextElement != null) {
        element.form.elements[nextElement].focus();
    }
}

// DISABLE TEXT FIELDS

function SetState(obj_checkbox, obj_textarea)
{ if(obj_checkbox.checked)
{ obj_textarea.disabled = true;
}
else
{ obj_textarea.disabled = false;
}
}


var win = null;
function NewWindow(mypage,myname,w,h,scroll){
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings =
'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)

if (window.focus) {NewWindow.focus()}


}



function showHide(inID) {
     if (document.getElementById(inID).style.display == 'none') {
          document.getElementById(inID).style.display = 'block';
     } else {
          document.getElementById(inID).style.display = 'none';
     }
}

function Show(inID) {
     if (document.getElementById(inID).style.display == 'none') {
          document.getElementById(inID).style.display = 'block';
     } else {
          document.getElementById(inID).style.display = 'block';
     }
}

function Hide(inID) {
     if (document.getElementById(inID).style.display == 'block') {
          document.getElementById(inID).style.display = 'none';
     } else {
          document.getElementById(inID).style.display = 'none';
     }
}



var checkobj

function agreesubmit(el){
checkobj=el
if (document.all||document.getElementById){
for (i=0;i<checkobj.form.length;i++){  //hunt down submit button
var tempobj=checkobj.form.elements[i]
if(tempobj.type.toLowerCase()=="submit")
tempobj.disabled=!checkobj.checked
}
}
}

function defaultagree(el){
if (!document.all&&!document.getElementById){
if (window.checkobj&&checkobj.checked)
return true
else{
alert("Please read/accept terms to submit form")
return false
}
}
}