/*! Author: QiQiBoY Update: 2009/12/15 Author URI: http://www.qiqiboy.com/ */ var allurl=document.getElementsByTagName('a'); var nowurl=location.href; nowurl=nowurl.split('?'); nowurl=nowurl[1]; if (nowurl != undefined){ for (i=0;i<=allurl.length;i++) allurl[i].href = allurl[i].href+'?'+nowurl; } function grin(tag) { var myField; tag = ' ' + tag + ' '; if (document.getElementById('comment') && document.getElementById('comment').type == 'textarea') { myField = document.getElementById('comment') } else { return false } if (document.selection) { myField.focus(); sel = document.selection.createRange(); sel.text = tag; myField.focus() } else if (myField.selectionStart || myField.selectionStart == '0') { var startPos = myField.selectionStart; var endPos = myField.selectionEnd; var cursorPos = endPos; myField.value = myField.value.substring(0, startPos) + tag + myField.value.substring(endPos, myField.value.length); cursorPos += tag.length; myField.focus(); myField.selectionStart = cursorPos; myField.selectionEnd = cursorPos } else { myField.value += tag; myField.focus() } } var searchbox = document.getElementById("s"); var searchtxt = document.getElementById("s"); var tiptext = "Type text to search here..."; if(searchtxt.value == "" || searchtxt.value == tiptext) { searchtxt.className += " searchtip"; searchtxt.value = tiptext; } searchtxt.onfocus = function(e) { if(searchtxt.value == tiptext) { searchtxt.value = ""; searchtxt.className = searchtxt.className.replace(" searchtip", ""); } } searchtxt.onblur = function(e) { if(searchtxt.value == "") { searchtxt.className += " searchtip"; searchtxt.value = tiptext; } }