var submitCount; submitCount = 0; function openwindow(windowurl, windowname, windowwidth, windowheight) { var winl = (screen.width - windowwidth) / 2; var wint = (screen.height - windowheight) / 2; winprops = 'height='+ windowheight +',width='+ windowwidth +',top='+ wint +',left=' + winl + ',resizable=1,scrollbars=1'; window.open(windowurl, windowname, winprops); } function closewindow() { window.close(); } function submitFormOnce(eleForm) { if (submitCount == 0) { //eleForm.submit(); submitCount += 1; } } function deleterecord(deleteUrl, deleteMessage) { if (confirm(deleteMessage)) { window.location = deleteUrl; } } function limittextarea (formTextAreaElement, formTextBoxElement, ElementMaxLenght) { if (formTextAreaElement.value.length > ElementMaxLenght) { formTextAreaElement.value = formTextAreaElement.value.substring(0, ElementMaxLenght); } formTextBoxElement.value = ElementMaxLenght - formTextAreaElement.value.length; } function limittextareawithCounter (formTextAreaElement, ElementMaxLenght) { if (formTextAreaElement.value.length > ElementMaxLenght) { formTextAreaElement.value = formTextAreaElement.value.substring(0, ElementMaxLenght); } } function redirectpage(redirecttUrl) { window.location = redirecttUrl; } function redirectparent(parentUrl) { opener.location = parentUrl; } function breakfromframe(urlPage) { if (top.frames.length != 0) { parent.location = urlPage; } } function submitActive(formName, ElementName, ElementValue) { ElementName.value = ElementValue; formName.submit(); } function fillparentformelement(formname, formelementname, formelementvalue) { opener[formname][formelementname].value = formelementvalue; } 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' window.open(mypage,myname,settings); } function breakfromframe(urlPage) { if (top.frames.length != 0) { parent.location = urlPage; } else { parent.location = urlPage; } } function addformatting(formElement, htmlTag) { var formatContent = "[" + htmlTag + "][/" + htmlTag + "]"; formElement.value += formatContent; } function addimage(formElement) { var imagelocation; imagelocation = prompt("Enter the location of the image : ", "http://"); if (imagelocation != "" && imagelocation != null) { var formatContent = "[IMG]" + imagelocation + "[/IMG]"; formElement.value += formatContent; } } function addurl(formElement) { var imagelocation; imagelocation = prompt("", "http://"); if (imagelocation != "" && imagelocation != null) { var formatContent = "[URL]" + imagelocation + "[/URL]"; formElement.value += formatContent; } } function addsmilie(formelement, smilie) { formelement.value += smilie; } function CheckAllDelete(formElement, fieldElement, deleteFieldElement) { var val = document[formElement][fieldElement].checked; for (var i=0; i < document[formElement].elements.length; i++){ var e = document[formElement].elements[i]; if (e.name == deleteFieldElement){ e.checked = val; } } } function emailArtistPicture() { alert("The picture has been sent to your friend(s). Thank You!"); document.photo.submit(); } function addToBookmarks(url,title){ if (document.all){ window.external.AddFavorite(url,title); } } function isEmpty(str){ return (str == null) || (str.length == 0); } function isEmail(str){ if(isEmpty(str)) return false; var re = /^[^\s()<>@,;:\/]+@\w[\w\.-]+\.[a-z]{2,}$/i return re.test(str); } function isAlpha(str){ var re = /[^a-zA-Z]/g if (re.test(str)) return false; return true; } function isNumeric(str){ var re = /[\D]/g if (re.test(str)) return false; return true; } function isAlphaNumeric(str){ var re = /[^a-zA-Z0-9]/g if (re.test(str)) return false; return true; } function isLength(str, len){ return str.length == len; } function isLengthBetween(str, min, max){ return (str.length >= min)&&(str.length <= max); } function isDate(str){ var re = /^(\d{1,2})[\s\.\/-](\d{1,2})[\s\.\/-](\d{4})$/ if (!re.test(str)) return false; var result = str.match(re); var m = parseInt(result[1]); var d = parseInt(result[2]); var y = parseInt(result[3]); if(m < 1 || m > 12 || y < 1900 || y > 2100) return false; if(m == 2){ var days = ((y % 4) == 0) ? 29 : 28; }else if(m == 4 || m == 6 || m == 9 || m == 11){ var days = 30; }else{ var days = 31; } return (d >= 1 && d <= days); } function trim(str) { return str.replace(/^\s+|\s+$/g,""); } function toggleDiv(id) { if (document.getElementById) { // DOM3 = IE5, NS6 if (document.getElementById(id).style.display == 'none') { document.getElementById(id).style.display = 'block'; } else { document.getElementById(id).style.display = 'none'; } } else { if (document.layers) { // Netscape 4 if (document.id.display == 'none') { document.id.display = 'block'; } else { document.id.display = 'none'; } } else { // IE 4 if (document.all.id.style.display == 'none') { document.all.id.style.display = 'block'; } else { document.all.id.style.display = 'none'; } } } } function hideDiv(id) { //safe function to hide an element with a specified id if (document.getElementById) { // DOM3 = IE5, NS6 document.getElementById(id).style.display = 'none'; } else { if (document.layers) { // Netscape 4 document.id.display = 'none'; } else { // IE 4 document.all.id.style.display = 'none'; } } } function showDiv(id) { //safe function to show an element with a specified id if (document.getElementById) { // DOM3 = IE5, NS6 document.getElementById(id).style.display = 'block'; } else { if (document.layers) { // Netscape 4 document.id.display = 'block'; } else { // IE 4 document.all.id.style.display = 'block'; } } } function submitArticleComment(eleForm, eleField) { if (trim(eleField.value) != "" && trim(eleField.value) != null) { eleForm.Action.value = "Add Comment"; eleForm.submit(); } else { alert("You need to enter a comment"); } } function submitForumTopic(eleForm, eleField, eleField2) { if (trim(eleField.value) != "" && trim(eleField.value) != null) { if (trim(eleField2.value) != "" && trim(eleField2.value) != null) { eleForm.Action.value = "Add Topic"; eleForm.submit(); } else { alert("You need to enter a 'Message'"); } } else { alert("You need to enter a 'Title'"); } } function submitForumThread(eleForm, eleField, eleField2) { if (trim(eleField.value) != "" && trim(eleField.value) != null) { if (trim(eleField2.value) != "" && trim(eleField2.value) != null) { eleForm.Action.value = "Add Thread"; eleForm.submit(); } else { alert("You need to enter a 'Message'"); } } else { alert("You need to enter a 'Title'"); } } function submitPhotoComment(eleForm, eleField) { if (trim(eleField.value) != "" && trim(eleField.value) != null) { eleForm.Action.value = "Add Comment"; eleForm.submit(); } else { alert("You need to enter a comment"); } } function submitVideoComment(eleForm, eleField) { if (trim(eleField.value) != "" && trim(eleField.value) != null) { eleForm.Action.value = "Add Comment"; eleForm.submit(); } else { alert("You need to enter a comment"); } } function uploadPhoto(eleForm, eleField) { if (eleField.value != "" && eleField.value != null) { eleForm.Action.value = "UPLOAD"; eleForm.submit(); } else { alert("You need to select a file"); } } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i