
function setActiveStyleSheet(title){var i,a,main;for(i=0;(a=document.getElementsByTagName("link")[i]);i++){if(a.getAttribute("rel").indexOf("style")!=-1&&a.getAttribute("title")){a.disabled=true;if(a.getAttribute("title")==title)a.disabled=false;}}}
function getActiveStyleSheet(){var i,a;for(i=0;(a=document.getElementsByTagName("link")[i]);i++){if(a.getAttribute("rel").indexOf("style")!=-1&&a.getAttribute("title")&&!a.disabled)return a.getAttribute("title");}
return null;}
function getPreferredStyleSheet(){var i,a;for(i=0;(a=document.getElementsByTagName("link")[i]);i++){if(a.getAttribute("rel").indexOf("style")!=-1&&a.getAttribute("rel").indexOf("alt")==-1&&a.getAttribute("title"))return a.getAttribute("title");}
return null;}
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 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;}
window.onunload=function(e){var title=getActiveStyleSheet();createCookie("style",title,365);}
var cookie=readCookie("style");var title=cookie?cookie:getPreferredStyleSheet();setActiveStyleSheet(title);var isDHTML=0;var isID=0;var isAll=0;var isLayers=0;if(document.getElementById){isID=1;isDHTML=1;}
else{if(document.all){isAll=1;isDHTML=1;}
else{browserVersion=parseInt(navigator.appVersion);if((navigator.appName.indexOf('Netscape')!=-1)&&(browserVersion==4)){isLayers=1;isDHTML=1;}}}
function findDOM(objectID,withStyle){if(withStyle==1){if(isID){tempDIV=document.getElementById(objectID);if(tempDIV==null){return null;}
else{return tempDIV.style;}}
else{if(isAll){return(document.all[objectID].style);}
else{if(isLayers){return(document.layers[objectID]);}};}}
else{if(isID){return(document.getElementById(objectID));}
else{if(isAll){return(document.all[objectID]);}
else{if(isLayers){return(document.layers[objectID]);}};}}}var menuTop=45;var menuLeft=400;var domSMenu=null;var oldDomSMenu=null;var t=0;var lDelay=3;var lCount=0;var pause=100;function popMenu(menuNum){if(isDHTML){t=2;if(oldDomSMenu){oldDomSMenu.visibility='hidden';oldDomSMenu.zIndex='0';t=2;lCount=0;}
var idMenu='menuHead';var domMenu=findDOM(idMenu,0);var idMenuOpt='menuHead'+menuNum;var domMenuOpt=findDOM(idMenuOpt,0);var idSMenu='menu'+menuNum;var domSMenu=findDOM(idSMenu,1);if(isID||isAll){var menuLeft=(domMenu.offsetLeft)+(domMenuOpt.offsetLeft)+5;var menuTop=(domMenu.offsetTop)+(domMenu.offsetHeight)+5;}
if(isLayers){var menuLeft=document.layers[idMenu].layers[idMenuOpt].pageX-5;var menuTop=domMenu.pageY+domMenu.clip.height-5;}
if(oldDomSMenu!=domSMenu){domSMenu.left=menuLeft;domSMenu.top=menuTop;domSMenu.visibility='visible';domSMenu.zIndex='100';oldDomSMenu=domSMenu;}
else{oldDomSMenu=null;}}
else{return null;}}
function delayHide(){if((oldDomSMenu)&&(t==0)){oldDomSMenu.visibility='hidden';oldDomSMenu.zIndex='0';oldDomSMenu=null;lCount=0;return false;}
if(t==2){lCount=0;return false;}
if(t==1){lCount=lCount+1;if(lDelay<=lCount){t=0;}
if(lDelay>=lCount){setTimeout('delayHide('+t+')',pause);}}}
if(document.layers){origWidth=innerWidth;origHeight=innerHeight;}
function reloadPage(){if(innerWidth!=origWidth||innerHeight!=origHeight)
location.reload();}
if(document.layers)onresize=reloadPage;function hideDropdowns(){for(counter=0;counter<=15;counter++){setVisibility('hide_me_'+counter,'hidden');}}
function showDropdowns(){for(counter=0;counter<=15;counter++){setVisibility('hide_me_'+counter,'visible');}
setVisibility('fontname_entryText','visible');setVisibility('fontsize_entryText','visible');}
function setVisibility(objectID,state){var dom=findDOM(objectID,1);if(dom!=null){dom.visibility=state;}}
function toggleVisibility(objectID){var dom=findDOM(objectID,1);state=dom.visibility;if(state=='hidden'||state=='hide')
dom.visibility='visible';else{if(state=='visible'||state=='show')
dom.visibility='hidden';else
dom.visibility='visible';}}
function loadIFrame(id,url){elem=document.getElementById(id);if(elem){elem.src=url;}}
function showIFrame(targetId,sourceFrame){document.getElementById(targetId).innerHTML=window.frames[sourceFrame].document.getElementById('theBody').innerHTML;}
function goToChatURL(url){if(window.name=='tagged_chat'){window.location.href=url;}
else{window.open(url,"tagged_chat","height=670,width=985,menubar=no,toolbar=no,status=no,scrollbars=yes,resizable=1");}}
function goToChatRoom(room_id){goToChatURL('/chat.html?room_id='+room_id);}
function acceptChatInvite(invite_id){goToChatURL('/chat.html?inv_id='+invite_id);setTimeout('location.reload()',7000);}
function debugObj(obj){var x='';for(var el in obj){x+=(el+'->'+obj[el]+"\n");}
alert(x);}
var arVersion=navigator.appVersion.split("MSIE")
var version=parseFloat(arVersion[1])
function fixPNG(myImage)
{if((version>=5.5)&&(version<7)&&(document.body.filters))
{var imgID=(myImage.id)?"id='"+myImage.id+"' ":""
var imgClass=(myImage.className)?"class='"+myImage.className+"' ":""
var imgTitle=(myImage.title)?"title='"+myImage.title+"' ":"title='"+myImage.alt+"' "
var imgStyle="display:inline-block;"+myImage.style.cssText
var strNewHTML="<span "+imgID+imgClass+imgTitle
+" style=\""+"width:"+myImage.width
+"px; height:"+myImage.height
+"px;"+imgStyle+";"
+"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
+"(src=\'"+myImage.src+"\', sizingMethod='scale');\"></span>"
myImage.outerHTML=strNewHTML}}
function getElt(parent,eltName){var temp=parent.getElementsByTagName(eltName)[0];if(temp){if(temp.childNodes.length>1){return temp.childNodes[1].nodeValue;}else{return temp.firstChild.nodeValue;}}}
function hasElt(parent,eltName){var temp=parent.getElementsByTagName(eltName)[0];return(temp)?true:false;}
function refreshIFrameDiv(iFrameDivId){var idiv=document.getElementById(iFrameDivId);if(idiv){idiv.innerHTML=idiv.innerHTML;return 1;}else{return 0;}}
var popUpWin=0;function popUpWindow(URLStr,left,top,width,height){return;if(popUpWin){if(!popUpWin.closed)popUpWin.close();}
popUpWin=open(URLStr,'popUpWin','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars,resizable=no,copyhistory=no,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');}
var popUnderWin=0;function popUnderWindow(URLStr,left,top,width,height){return;if(popUnderWin){if(!popUnderWin.closed)popUnderWin.close();}
popUnderWin=window.open(URLStr,'popUnderWin','scrollbars=1,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');popUnderWin.blur();window.focus();}
function toggle(theDiv){if(document.getElementById(theDiv).style.display=='none')
{document.getElementById(theDiv).style.display='block';document.getElementById(theDiv).style.display='';}
else
{document.getElementById(theDiv).style.display='none';}}
function showEl(elId){var el=document.getElementById(elId);if(el&&el.style)el.style.display='block';}
function hideEl(elId){var el=document.getElementById(elId);if(el&&el.style)el.style.display='none';}
function toggleVis(theDiv){if(document.getElementById(theDiv).style.visibility=='hidden')
{document.getElementById(theDiv).style.visibility='visible';document.getElementById(theDiv).style.visibility='';}
else
{document.getElementById(theDiv).style.visibility='hidden';}}
function tagCharCounter(textareaObj,countObj,maxCharsAllowed,showAlert){if(textareaObj.value.length>maxCharsAllowed){textareaObj.value=textareaObj.value.substring(0,maxCharsAllowed);if(countObj){countObj.value=maxCharsAllowed-textareaObj.value.length;}
if(showAlert){alert("The maximum number of characters for this field is "+maxCharsAllowed+" ! ");}
return false;}else if(countObj){countObj.value=maxCharsAllowed-textareaObj.value.length;}}
function trimString(str){str=str.replace(/^[ ]+(.*)$/,'$1');str=str.replace(/^(.*)[ ]+$/,'$1');return str;}
function showTooltip(inputEl){var inputID=inputEl.getAttribute("id");var allFields=document.forms[0].elements;var schoolSelected=(document.getElementById('ssta_school_id')&&document.getElementById('ssta_school_id').value!=0);for(var i=0;i<allFields.length;i++){var field=allFields[i];var fieldID=field.getAttribute("id");var toolID=String("tool_"+fieldID);var toolDiv=document.getElementById(toolID);var dontChangeColors=((fieldID=='ssta_textfld_id')&&schoolSelected);if(fieldID==inputID){if(field.type!="hidden"){if(toolDiv){toolDiv.style.display="block";}}
if((field.type!='select-one')&&(field.type!='checkbox')){if(!dontChangeColors){field.style.background="#CCEBFF";}
field.style.borderStyle="inset";}}else{if(field.type!="hidden"){if(toolDiv){toolDiv.style.display="none";}}
if((field.type!='select-one')&&(field.type!='checkbox')){if(!dontChangeColors){field.style.background="#FFF";}
field.style.border="1px solid #7F9DB9";}}}}
function hideTooltip(inputEl){return;}
function showTooltipWithLink(tooltipDiv){return;}
function hideTooltipWithLink(tooltipDiv){return;}
function showTooltipVis(inputEl){var thisEl=inputEl;var thisId=thisEl.getAttribute("id");var tooltip=document.getElementById("tool_"+thisId);tooltip.style.visibility="visible";thisEl.style.background="#CCEBFF";}
function hideTooltipVis(inputEl){var thisEl=inputEl;var thisId=thisEl.getAttribute("id");var tooltip=document.getElementById("tool_"+thisId);tooltip.style.visibility="hidden";thisEl.style.background="#FFF";}
function focusFirstField(){var bFound=false;for(f=0;f<document.forms.length;f++){for(i=0;i<document.forms[f].length;i++){if(document.forms[f][i].type!="hidden"){if(document.forms[f][i].type!="checkbox"){if(document.forms[f][i].disabled!=true){document.forms[f][i].focus();var bFound=true;}}}
if(bFound==true)
break;}
if(bFound==true)
break;}}
function checkAllBoxes(clickedBox,formName){numElements=document.forms[formName].elements.length;for(i=0;i<numElements;i++){if(document.forms[formName].elements[i].type=="checkbox"){document.forms[formName].elements[i].checked=clickedBox.checked;}}}
var debug=false;function GetXmlHttp(){var xmlhttp=false;if(window.XMLHttpRequest)
{xmlhttp=new XMLHttpRequest();}
else if(window.ActiveXObject)
{try
{xmlhttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch(e)
{try
{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(E){xmlhttp=false;}}}
return xmlhttp;}
function PassAjaxResponseToFunction(url,callbackFunction,params)
{var xmlhttp=new GetXmlHttp();if(xmlhttp)
{xmlhttp.onreadystatechange=function()
{if(xmlhttp&&xmlhttp.readyState==4)
{if(xmlhttp.status==200)
{var response=xmlhttp.responseText;var functionToCall=callbackFunction+'(response,'+params+')';if(debug){alert(response);alert(functionToCall);}
eval(functionToCall);}else if(debug){document.write(xmlhttp.responseText);}}}
xmlhttp.open("GET",url,true);xmlhttp.send(null);}}
function SetInnerHTMLFromAjaxResponse(url,obj_id)
{var xmlhttp=new GetXmlHttp();if(xmlhttp)
{xmlhttp.onreadystatechange=function()
{if(xmlhttp&&xmlhttp.readyState==4)
{if(xmlhttp.status==200)
{if(debug){alert(xmlhttp.responseText);}
if(typeof obj_id=='object'){obj_id.innerHTML=xmlhttp.responseText;}else{document.getElementById(obj_id).innerHTML=xmlhttp.responseText;}}else if(debug){document.Write(xmlhttp.responseText);}}}
xmlhttp.open("GET",url,true);xmlhttp.send(null);}}
var http_request=false;function makePOSTRequest(url,parameters,callbackFunction){http_request=false;if(window.XMLHttpRequest){http_request=new XMLHttpRequest();if(http_request.overrideMimeType){http_request.overrideMimeType('text/html');}}else if(window.ActiveXObject){try{http_request=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{http_request=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){}}}
if(!http_request){alert('Cannot create XMLHTTP instance');return false;}
http_request.onreadystatechange=function(){if(callbackFunction){try{if(http_request.readyState==4){if(http_request.status==200){var response=http_request.responseText;callbackFunction(response);return;}}}catch(e){}}}
http_request.open('POST',url,true);http_request.setRequestHeader("Content-type","application/x-www-form-urlencoded");http_request.setRequestHeader("Content-length",parameters.length);http_request.setRequestHeader("Connection","close");http_request.send(parameters);}
var dofade=true;var center=false;var centertext=false;var admin_tool=false;function ietruebody(){return(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body}
var NS4=(navigator.appName.indexOf("Netscape")>=0&&!document.getElementById)?true:false;var IE4=(document.all&&!document.getElementById)?true:false;var IE5=(document.getElementById&&document.all)?true:false;var NS6=(document.getElementById&&navigator.appName.indexOf("Netscape")>=0)?true:false;var W3C=(document.getElementById)?true:false;var w_y,w_x,navtxt,boxheight,boxwidth;var ishover=false;var isloaded=false;var ieop=0;var op_id=0;function getwindowdims(){w_y=(NS4||NS6||window.opera)?window.innerHeight:(IE5||IE4)?document.body.clientHeight:0;w_x=(NS4||NS6||window.opera)?window.innerWidth:(IE5||IE4)?document.body.clientWidth:0;}
function getboxwidth(){if(NS4)boxwidth=(navtxt.document.width)?navtxt.document.width:navtxt.clip.width;if(IE5||IE4)boxwidth=(navtxt.style.pixelWidth)?navtxt.style.pixelWidth:navtxt.offsetWidth;if(NS6)boxwidth=(navtxt.style.width)?parseInt(navtxt.style.width):parseInt(navtxt.offsetWidth);}
function getboxheight(){if(NS4)boxheight=(navtxt.document.height)?navtxt.document.height:navtxt.clip.height;if(IE4||IE5)boxheight=(navtxt.style.pixelHeight)?navtxt.style.pixelHeight:navtxt.offsetHeight;if(NS6)boxheight=parseInt(navtxt.offsetHeight);}
function movenavtxt(x,y){if(NS4)navtxt.moveTo(x,y);if(W3C||IE4){navtxt.style.left=x+'px';navtxt.style.top=y+'px';}}
function getpagescrolly(){if(NS4||NS6)return window.pageYOffset;if(IE5||IE4)return ietruebody().scrollTop;}
function getpagescrollx(){if(NS4||NS6)return window.pageXOffset;if(IE5||IE4)return ietruebody().scrollLeft;}
function writeindiv(text){if(NS4){navtxt.document.open();navtxt.document.write(text);navtxt.document.close();}
if(W3C||IE4)navtxt.innerHTML=text;}
function writetxt(text){if(navtxt!=null){if(text!=0){ishover=true;if(NS4)text='<div class="navtext">'+((centertext)?'<center>':'')+text+((centertext)?'</center>':'')+'</div>';writeindiv(text);getboxheight();getboxwidth();if((W3C||IE4)&&dofade){ieop=0;incropacity();}}
else{if(NS4)navtxt.visibility="hide";if(IE4||W3C){if(dofade)clearTimeout(op_id);navtxt.style.visibility="hidden";}
writeindiv('');ishover=false;}}}
function incropacity(){if(ieop<=100){ieop+=7;if(IE4||IE5)navtxt.style.filter="alpha(opacity="+ieop+")";if(NS6)navtxt.style.MozOpacity=ieop/100;op_id=setTimeout('incropacity()',50);}}
function moveobj(evt){if(isloaded&&ishover){margin=(IE4||IE5)?1:23;if(NS6)if(document.height+27-window.innerHeight<0)margin=15;if(NS4)if(document.height-window.innerHeight<0)margin=10;if(NS4){mx=evt.pageX
my=evt.pageY}
else if(NS6){mx=evt.clientX
my=evt.clientY}
else if(IE5){mx=event.clientX
my=event.clientY}
else if(IE4){mx=0
my=0}
if(NS4){mx-=getpagescrollx();my-=getpagescrolly();}
xoff=(center)?mx-boxwidth/2:mx+5;yoff=(my+boxheight+30-getpagescrolly()+margin>=w_y)?-15-boxheight:30;if(admin_tool){scroll_x=getpagescrollx();scroll_y=getpagescrolly();center_x=scroll_x+Math.floor(w_x/2)
center_y=scroll_y+Math.floor(w_y/2)
mx_prime=mx+scroll_x;my_prime=my+scroll_y;xoff=center_x-Math.floor(boxwidth/2);yoff=center_y-Math.floor(boxheight/2);if((((my_prime)>=yoff)&&((my_prime)<=yoff+boxheight+margin))&&(((mx_prime)>=xoff)&&((mx_prime)<=xoff+boxwidth+margin))){if(mx_prime<center_x)
xoff=center_x;else
xoff=center_x-boxwidth-margin-1;yoff=my_prime-Math.floor(boxheight/2);}
movenavtxt(xoff,yoff);}
else{movenavtxt(Math.min(w_x-boxwidth-margin,Math.max(2,xoff))+getpagescrollx(),my+yoff+getpagescrolly());}
if(NS4)navtxt.visibility="show";if(W3C||IE4)navtxt.style.visibility="visible";}}
if(NS4)document.captureEvents(Event.MOUSEMOVE);document.onmousemove=moveobj;function initAltText(){navtxt=(NS4)?document.layers['navtxt']:(IE4)?document.all['navtxt']:(W3C)?document.getElementById('navtxt'):null;if(navtxt!=null){getboxwidth();getboxheight();getwindowdims();isloaded=true;if((W3C||IE4)&&centertext)navtxt.style.textAlign="center";if(W3C)navtxt.style.padding='4px';if(IE4||IE5&&dofade)navtxt.style.filter="alpha(opacity=0)";}}
window.onresize=getwindowdims;var jActivating={IS_MSIE:(document.removeNode&&document.createAttribute)?true:false,TAGS:['object','embed','applet'],activateContent:function()
{var i=0;for(var _tagName;_tagName=jActivating.TAGS[i];i++)
{var j=0;for(var _node;_node=document.getElementsByTagName(_tagName)[j];j++)
{if(jActivating.IS_MSIE)
{jActivating.reinsertHtml(_node);}
else
{jActivating.reinsertNode(_node);}}}
jActivating=null;},reinsertHtml:function(_node)
{var _htmlCode=jActivating.getHtmlCode(_node);if(_htmlCode)
{_node.outerHTML=_htmlCode;}},reinsertNode:function(_node)
{var _clone=_node.cloneNode(true);var _parent=_node.parentNode;if(_clone&&_parent)
{_parent.replaceChild(_clone,_node);}},getHtmlCode:function(_node)
{var _htmlCode=_node.outerHTML;var _name=_node.nodeName.toLowerCase();if(_name=='embed')
{return _htmlCode;}
if(_name=='object'||_name=='applet')
{var _startTag=_htmlCode.substr(0,_htmlCode.indexOf('>')+1).toLowerCase();var _endTag=_htmlCode.substr(_htmlCode.length-9).toLowerCase();if(_endTag!='</object>'&&_endTag!='</applet>')
{return null;}
var _innerHtml=jActivating.getInnerHtml(_node);_htmlCode=_startTag+_innerHtml+_endTag;return _htmlCode;}},getInnerHtml:function(_node)
{var _innerHtml='';var i=0;for(var _childNode;_childNode=_node.childNodes[i];i++)
{_innerHtml+=_childNode.outerHTML;}
return _innerHtml;}}
if(jActivating.IS_MSIE)
{jActivating.activateContent();}
else if(window.opera)
{document.addEventListener('DOMContentLoaded',jActivating.activateContent,false);}
