function NewWindow(mypage,myname,w,h,scroll,pos){
	if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
	if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
	else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
	win=window.open(mypage,myname,settings);
}

function menu_goto( menuform, baseurl ){

    selecteditem = menuform.newurl.selectedIndex ;
    newurl = menuform.newurl.options[ selecteditem ].value ;
    
	if (newurl.length != 0) {
      location.href = baseurl + newurl ;
    }
}

function uniform_page(){
	
	var current_domain = document.domain;

	window.open('http://'+current_domain+'/parents/uniform.php', '_blank','width=760, height=800, toolbars=no, scrollbars=yes, resize=no,');

}


function calendar_window(url){

	window.open(url,'_blank','width=760, height=800, toolbars=no, scrollbars=yes, resize=no,');

}


function email_window(url){
	
	var current_domain = document.domain;

	window.open('http://'+current_domain+'/email/pop_up.php?url=' + url,'_blank','width=470, height=550, toolbars=no, scrollbars=yes, resize=no,');

}

function gallery_window(id){
	
	var current_domain = document.domain;

	window.open('http://'+current_domain+'/photo_gallery/display.php?album_id=' + id,'_blank','width=600, height=600, toolbars=no, scrollbars=yes, resize=no,');

}

function limitText(limitField, limitCount, limitNum) {
	
	if (limitField.value.length > limitNum) {
		limitField.value = limitField.value.substring(0, limitNum);
	} 
	else {
		limitCount.value = limitNum - limitField.value.length;
	}
}
	




