function loadMessage(mess_id) { window.location.href='message.php?id='+mess_id; } function loadEvent(event_id) { window.location.href='event.php?id='+event_id; } function trHoverClass(obj,nc){ obj.nc=obj.className; obj.className=obj.className + ' ' + nc; obj.onmouseout=function(){ this.className=this.nc; } } function imageHover(obj,obj2){ obj.oldsrc=obj2.src; obj.mainid=obj2.id; obj2.src=obj.src; obj.onmouseout=function(){ document.getElementById(this.mainid).src=this.oldsrc; } } function toggleDisplay(obj) { var el = document.getElementById(obj); if ( el.style.display != 'none' ) { el.style.display = 'none'; } else { el.style.display = ''; } } function buttonHover(objHover, img, nsrc, link){ objHover.style.cursor = "pointer"; objImage = document.getElementById(img); objHover.i_img=img; objHover.i_link=link; objHover.i_src=objImage.src; objImage.src=nsrc; objHover.onclick = function(){window.location.href=this.i_link;} objHover.onmouseout=function(){ document.getElementById(this.i_img).src=this.i_src; } } function actionExchange(cmd, id) { obj = document.getElementById("actionExForm_" + id); obj.exchangeaction_action.value = cmd; obj.submit(); } function actionFavorites(cmd, id) { obj = document.getElementById("actionFavForm_" + id); obj.favoritesaction_action.value = cmd; obj.submit(); } function count(msgObj, countId, max) { var msgString = msgObj.value; var msgLength= msgString.length; var countObj = document.getElementById(countId); if (msgLength > max) { msgObj.value = msgObj.value.substr(0,max); msgLength=max; alert("Sorry, you have reached the limit.\n"); } countObj.value = msgLength; countObj.style.width = (countObj.value.length * 9) -(countObj.value.length+1) + 'px'; } function sendMessage(formObj) { if(formObj.subject.disabled) { return; } if(formObj.subject.value.length<1) { alert('Please enter a subject'); return; } if(formObj.message.value.length<1) { alert('Please enter a message'); return; } formObj.submit(); } function openWriteMail(id,nick,subject,reply) { if(subject=="undefined") {subject="";} if(reply=="undefined") {repy="0";} window.open('writemail.php?i='+id+'&n='+nick+'&s='+subject+'&r='+reply, id , 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=620,height=420'); } function openEditPic(slot,uid) { window.open('picedit.php?s='+slot+'&u='+uid, 'a', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=650'); } function openPopup(url) { window.open(url, 'gpopup', 'toolbar=1,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=520,height=520'); } COUNTRIES = new Array(); function populate(select_trig, select_pop, select_trig_value, select_pop_value) { var trigi=1; var objSelect_pop = document.getElementById(select_pop); var objSelect_trig = document.getElementById(select_trig); if (objSelect_trig.options.length < 2) { for (var key in COUNTRIES ) { objSelect_trig.options[trigi] = new Option(COUNTRIES[key][0],key); trigi++; } } if (select_trig_value) { formSetValue(objSelect_trig,select_trig_value); } if (objSelect_trig.selectedIndex == 0 || COUNTRIES[objSelect_trig.options[objSelect_trig.selectedIndex].value].length == 1) { var i=1; if (objSelect_pop) { objSelect_pop.disabled=true; clearSelect(objSelect_pop); objSelect_pop.options[1] = new Option("Not Applicable",""); objSelect_pop.selectedIndex=1; } } if (objSelect_trig.selectedIndex > 0 && COUNTRIES[objSelect_trig.options[objSelect_trig.selectedIndex].value].length > 1) { if (objSelect_pop) { objSelect_pop.disabled=false; clearSelect(objSelect_pop); for (i=1; i < COUNTRIES[objSelect_trig.options[objSelect_trig.selectedIndex].value].length; i++) { objSelect_pop.options[i] = new Option(COUNTRIES[objSelect_trig.options[objSelect_trig.selectedIndex].value][i]); } } } if (select_pop_value) { formSetValue(objSelect_pop,select_pop_value); } } function clearSelect(select_box){ for(i = select_box.options.length -1; i > 0; i--){ select_box.options[i] = null; } } function formSetValue(fieldElement,fieldValue) { if (fieldElement.type=="select-one") { for (i=0; i < fieldElement.length; i++) { if (fieldElement.options[i].value==fieldValue) { fieldElement.selectedIndex=i } } fieldElement.disabled=false; } if (fieldElement.type=="text") { fieldElement.value = fieldValue; } if (fieldElement.type=="checkbox") { fieldElement.checked = fieldValue; } } function handleEnter(field, event, frm) { var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode; if (keyCode == 13) { var i; for (i = 0; i < field.form.elements.length; i++) if (field == field.form.elements[i]) break; i = (i + 1) % field.form.elements.length; field.form.elements[i].focus(); document.forms[frm].submit(); } } function editorCommand(editor, command, option) { // first we assign the content of the textarea to the variable mainField var mainField; mainField = document.getElementById(editor).contentWindow; alert(mainField); // then we will use execCommand to execute the option on the textarea making sure the textarea stays in focus try { mainField.focus(); mainField.document.execCommand(command, false, option); mainField.focus(); } catch (e) { } } function designer(editor, html) { var mainContent= "" + html + "" ; //assign the frame(textarea) to the edit variable using that frames id var edit = document.getElementById(editor).contentWindow.document; //write the content to the textarea edit.write(mainContent); //enable the designMode edit.designMode = "On" ; //enable the designMode for Mozilla document.getElementById(content).contentDocument.designMode = "on" ; }