
function GetThis(T, C, U, L){
	var targetUrl = 'http://www.myspace.com/index.cfm?fuseaction=postto&' + 't=' + encodeURIComponent(T)
   + '&c=' + encodeURIComponent(C) + '&u=' + encodeURIComponent(U) + '&l=' + L;
   window.open(targetUrl);
   
}


Digg = {
  remoteSubmit:function(a,b,c,d){
    var s='99d1febfbc0f579a6c3bb3559bbe7ace';if(!a)return;b=b||'';c=c||'';d=d||'';
    window.open('http://digg.com/remote-submit?phase=2&url='+a+'&title='+b+'&bodytext='+c+'&topic='+d+'&s='+s, new Date().getTime(),'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=650,height=600');
  }
}

Delicious = {
  remoteSubmit: function(url, title) {
    if(!url) return; title = title || '';
    window.open('http://del.icio.us/post?v=4&noui&jump=close&url='+url+'&title='+title, new Date().getTime(),'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=700,height=400');
  }
}


function IsDef(variable) {
  return (!(!( variable||false )))
}


function farkItButton(h, u, s, b) {  if (!IsDef(h)) {
    if (IsDef(window.fark_headline)) {
      h = window.fark_headline;
    } else {
      h = '';
    }
  }
  u = unescape(location.href);
  var img = 'FarkItButton2_16x16.gif'; imgw = 16; imgh = 16;
  if(b){
    document.write('<a style="background-image:url(\'http://img.fark.net/pub/' + img + '\');" href="http://cgi.fark.com/cgi/fark/farkit.pl?h=' + h + '&u=' + u + '" title="Fark It!" target="_blank">Fark It!</a>');
  } else {
    document.write('<a href="http://cgi.fark.com/cgi/fark/farkit.pl?h=' + h + '&u=' + u + '" title="Fark It!" target="_blank"><img id="farkitButton" src="http://img.fark.net/pub/' + img + '" width="' + imgw + '" height="' + imgh + '" border="0"></a>');
  }
}

function email_share(id, url, title,position) {
	var form = $('#akst_form');
	var post_id = $('#akst_post_id');
	if (form.css('display') == 'block' && post_id.val() == id) {
		form.css('display')= 'none';
		alert('in box')
		return;
	}
	
	var link = $('#akst_link_' + id+'_'+position);
	var offset = link.offset();
	
	//add value into the input#hidden field
	post_id.val(id);

	form.css('left',offset.left +'px');
	form.css('top',(offset.top + link.height() + 3) +'px');
	form.css('display','block');
}

function OnLoadUtils() {
	jQuery('#comment-personaldetails').hide();
	jQuery('#showinfo').show();
	jQuery('#hideinfo').hide();
};

function ShowUtils() {
	jQuery('#comment-personaldetails').slideDown();
	jQuery('#showinfo').hide();
	jQuery('#hideinfo').show();
};

function HideUtils() {
	jQuery('#comment-personaldetails').slideUp();
	jQuery('#showinfo').show();
	jQuery('#hideinfo').hide();
};


// Manipulation of cookies (credit: http://www.webreference.com/js/column8/functions.html)
function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
};

function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
};

function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
};


/*
	Base, version 1.0.2
	Copyright 2006, Dean Edwards
	License: http://creativecommons.org/licenses/LGPL/2.1/
*/

var Base = function() {
	if (arguments.length) {
		if (this == window) { // cast an object to this class
			Base.prototype.extend.call(arguments[0], arguments.callee.prototype);
		} else {
			this.extend(arguments[0]);
		}
	}
};

Base.version = "1.0.2";

Base.prototype = {
	extend: function(source, value) {
		var extend = Base.prototype.extend;
		if (arguments.length == 2) {
			var ancestor = this[source];
			// overriding?
			if ((ancestor instanceof Function) && (value instanceof Function) &&
				ancestor.valueOf() != value.valueOf() && /\bbase\b/.test(value)) {
				var method = value;
			//	var _prototype = this.constructor.prototype;
			//	var fromPrototype = !Base._prototyping && _prototype[source] == ancestor;
				value = function() {
					var previous = this.base;
				//	this.base = fromPrototype ? _prototype[source] : ancestor;
					this.base = ancestor;
					var returnValue = method.apply(this, arguments);
					this.base = previous;
					return returnValue;
				};
				// point to the underlying method
				value.valueOf = function() {
					return method;
				};
				value.toString = function() {
					return String(method);
				};
			}
			return this[source] = value;
		} else if (source) {
			var _prototype = {toSource: null};
			// do the "toString" and other methods manually
			var _protected = ["toString", "valueOf"];
			// if we are prototyping then include the constructor
			if (Base._prototyping) _protected[2] = "constructor";
			for (var i = 0; (name = _protected[i]); i++) {
				if (source[name] != _prototype[name]) {
					extend.call(this, name, source[name]);
				}
			}
			// copy each of the source object's properties to this object
			for (var name in source) {
				if (!_prototype[name]) {
					extend.call(this, name, source[name]);
				}
			}
		}
		return this;
	},

	base: function() {
		// call this method from any other method to invoke that method's ancestor
	}
};

Base.extend = function(_instance, _static) {
	var extend = Base.prototype.extend;
	if (!_instance) _instance = {};
	// build the prototype
	Base._prototyping = true;
	var _prototype = new this;
	extend.call(_prototype, _instance);
	var constructor = _prototype.constructor;
	_prototype.constructor = this;
	delete Base._prototyping;
	// create the wrapper for the constructor function
	var klass = function() {
		if (!Base._prototyping) constructor.apply(this, arguments);
		this.constructor = klass;
	};
	klass.prototype = _prototype;
	// build the class interface
	klass.extend = this.extend;
	klass.implement = this.implement;
	klass.toString = function() {
		return String(constructor);
	};
	extend.call(klass, _static);
	// single instance
	var object = constructor ? klass : _prototype;
	// class initialisation
	if (object.init instanceof Function) object.init();
	return object;
};

Base.implement = function(_interface) {
	if (_interface instanceof Function) _interface = _interface.prototype;
	this.prototype.extend(_interface);
};

function jumpToArchive() {
	var box =  document.getElementById("archJump"); // $('#archJump');
	destination = box.options[box.selectedIndex].value;
	if (destination) location.href = destination;
}