function popitup(url, width, height) {
	h = screen.height;
	if (h<900) {
		newwindow=window.open(url,'name','scrollbars=1,resizable=1,height=' +  h + ',width=' + width);
	} else {
		newwindow=window.open(url,'name','scrollbars=1,resizable=1,height=' +  height + ',width=' + width);
	}
	if (window.focus) {newwindow.focus()}
	return false;
}
function maximize(maxDiv){
	if(document.getElementById && document.createTextNode){
	  if(document.getElementById(maxDiv)){
		document.getElementById(maxDiv).className='maximized';
	  }
	}
}
function minimize(minDiv){
	if(document.getElementById && document.createTextNode){
	  if(document.getElementById(minDiv)){
		document.getElementById(minDiv).className='minimized';
	  }
	}
}

function addClass(id, theclass){
	if(document.getElementById && document.createTextNode){
	  if(document.getElementById(id)){
		document.getElementById(id).className=theclass;
	  }
	}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function showactionextras(selObj){
	if (selObj.options[selObj.selectedIndex].value == 'addhours') {
		maximize('showHours');
		minimize('showRatings');		
	} else if (selObj.options[selObj.selectedIndex].value == 'rate') {
		maximize('showRatings');
		minimize('showHours');
	} else {
		minimize('showHours');
		minimize('showRatings');
	}
}

function showAddHoursForm(oid){
		document.getElementById('oid').value=oid;
		maximize('hoursFormDiv');
		minimize('ratingFormDiv');
}

function showRatingForm(oid){
		document.getElementById('oid2').value=oid;
		maximize('ratingFormDiv');
		minimize('hoursFormDiv');
}

function ConfirmDelete(msg, loc) {
	var answer = confirm(msg)
	if (answer){
		window.location = loc;
	}
}

//total=4;
loop_count=1;
function slideshow() {
	var total = countSlideshowDivs();
	minimize("slide"+(loop_count-1));
	if(loop_count==total+1){loop_count=1;}
	maximize("slide"+loop_count);
	loop_count++;
	t=setTimeout("slideshow()",5000);
}
function countSlideshowDivs(){
	var total=0;
	for(i=1; i<100; i++){
		if(document.getElementById && document.createTextNode){
			if(document.getElementById("slide"+i)){
				total=i;
			}else{
				return total;
				break;
			}
		}
	}
}

