<!--//--><![CDATA[//><!--
// Disable Right Click
am = "Sorry, Right Click function has been disabled for security and copyright reasons.";
bV  = parseInt(navigator.appVersion)
bNS = navigator.appName=="Netscape"
bIE = navigator.appName=="Microsoft Internet Explorer"
function nrc(e) {
   if (bNS && e.which > 1){
      alert(am)
      return false
   } else if (bIE && (event.button >1)) {
     alert(am)
     return false;
   }
}
document.onmousedown = nrc;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (bNS && bV<5) window.onmousedown = nrc;
// Snapperfish Menu
sfHover = function() {
var sfEls = document.getElementById("hNav").getElementsByTagName("li");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className+=" sfhover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
}
}
}
if (window.attachEvent){
window.attachEvent("onload", sfHover);
} else {
// for IE mac
if (document.all && document.getElementById("hNav")) window.onload=sfHover;
}
// Popup Window
var win=null;
function popUp(url,name,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=0}
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(url,name,settings);
}
// Disable Enter Key in Forms
function dblEnt (field, event) {
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();
return false;
} 
else
return true;
} 
// Text Counter
function textCounter(field, countfield, maxlimit) 
{
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
// otherwise, update 'characters left' counter
else
countfield.value = maxlimit - field.value.length;
}
// Form Functions
function formrule(field) {
        if (field.defaultValue == field.value) field.value = "";
}
// clearField(fld)
function removeText(fld)
{
        if(fld.defaultValue == fld.value) fld.value = "";
}

function replaceText(fld)
{
        if(fld.value == ""){
                fld.value = fld.defaultValue;
        }
}

// Mail Script
function mailto(domain, user) { 
document.location.href = "mailto:" + user + "@" + domain; 
}
// Copy Script
function copyit(theField) {
var tempval=eval("document."+theField);
tempval.focus();
tempval.select();
therange=tempval.createTextRange();
therange.execCommand("Copy");
}
// 	DOMcollapse
if (document.images){
	status_open = new Image();status_close = new Image();
	status_open.src = "http://www.goldenTwine.com/btn/btnOpen.gif";status_close.src = "http://www.goldenTwine.com/btn/btnClose.gif";}
function togSB(item){
	if(document.images [item+"_img"])	document.images [item+"_img"].src = (document.images [item+"_img"].src == status_open.src) ? status_close.src:status_open.src;
	if(document.getElementById(item+'_div')) document.getElementById(item+'_div').style.display = (document.getElementById(item+'_div').style.display=="none") ? "":"none";
}
// 	DOMcollapse2
if (document.images){
	status_open = new Image();status_close = new Image();
	status_open.src = "http://www.goldenTwine.com/btn/btnOpen.gif";status_close.src = "http://www.goldenTwine.com/btn/btnClose.gif";}
function togOC(item){
	if(document.images [item+"_img"])	document.images [item+"_img"].src = (document.images [item+"_img"].src == status_open.src) ? status_close.src:status_open.src;
	if(document.getElementById(item+'_span')) document.getElementById(item+'_span').style.display = (document.getElementById(item+'_span').style.display=="none") ? "":"none";
}
// 	Display Twitter Followers in Text using Transients API
function get_twitter_count() {
// first check the transient
$count = get_transient('follower_count');
if ($count !== false) return $count;
// no count, so go get it
$count = 0;
$data = wp_remote_get('<a href="http://api.twitter.com/1/users/show.json?screen_name=goldenTwine" rel="nofollow">http://api.twitter.com/1/users/show.json?screen_name=goldenTwine</a>');
if (!is_wp_error($data)) {
$value = json_decode($data['body'],true);
$count = $value['followers_count'];
}
// set the cached value
set_transient('follower_count', $count, 60*60); // 1 hour cache
return $count;
}  

// FeedBurner Counter

//--><!]]>

