
/* Drop Downs */

function optional_drop_down_menu(_1,_2,_3,_4,_5,_6,_7,_8){
if(_3.style.display=="none"){
_3.style.display="block";
var _9=_6?_6:_1.className;
if(_2){
_2.className="active";
}
_1.className=_5?_5:"global_menu_arrow_active";
var _a=true;
var _b=ge(_3.id+"_iframe");
if(_b){
_b.style.top=_3.style.top;
_b.style.right=_3.style.right;
_b.style.display="block";
_b.style.width=(_3.offsetWidth+2)+"px";
_b.style.height=(_3.offsetHeight+2)+"px";
}
_3.offclick=function(e){
if(!_a){
hide(this);
if(_2){
_2.className="";
}
_1.className=_9;
var _d=ge(_3.id+"_iframe");
if(_d){
_d.style.display="none";
_d.style.width=_3.offsetWidth+"px";
_d.style.height=_3.offsetHeight+"px";
}
if(_8){
_8(e);
}
removeEventBase(document,"click",this.offclick,_3.id);
}else{
_a=false;
}
}.bind(_3);
if(_7){
_7();
}
addEventBase(document,"click",_3.offclick,_3.id);
}
return false;
};
function addEventBase(_e,_f,fn,_11){
if(_e.addEventListener){
_e.addEventListener(_f,fn,false);
}else{
if(_e.attachEvent){
var _12=_f+fn+_11;
_e["e"+_12]=fn;
_e[_12]=function(){
_e["e"+_12](window.event);
};
_e.attachEvent("on"+_f,_e[_12]);
}
}
return fn;
};
function hide(){
for(var i=0;i<arguments.length;i++){
var _14=ge(arguments[i]);
if(_14&&_14.style){
_14.style.display="none";
}
}
return false;
};
function removeEventBase(obj,_16,fn,_18){
if(obj.removeEventListener){
obj.removeEventListener(_16,fn,false);
}else{
if(obj.detachEvent){
var _19=_16+fn+_18;
if(obj[_19]){
obj.detachEvent("on"+_16,obj[_19]);
obj[_19]=null;
obj["e"+_19]=null;
}
}
}
};
function placeholderSetup(id){
var el=ge(id);
if(!el){
return;
}
if(el.type=="search"){
return;
}
var ph=el.getAttribute("placeholder");
if(!ph||ph==""){
return;
}
if(el.value==ph){
el.value="";
}
el.is_focused=(el.value!="");
if(!el.is_focused){
el.value=ph;
el.style.color="#777";
el.is_focused=0;
}
addEventBase(el,"focus",placeholderFocus);
addEventBase(el,"blur",placeholderBlur);
};
function ge(id){
if(typeof (id)=="undefined"){
Util.error("Tried to get an undefined element!");
return null;
}
var obj;
if(typeof (id)=="string"){
obj=document.getElementById(id);
if(!obj){
return null;
}else{
if(typeof (obj.id)=="string"&&obj.id==id){
return obj;
}else{
var _1f=document.getElementsByName(id);
if(!_1f||!_1f.length){
return null;
}
var _20=[];
for(var ii=0;ii<_1f.length;ii++){
var c=_1f[ii];
if(!c.id&&id){
continue;
}
if(typeof (c.id)=="string"&&c.id!=id){
continue;
}
_20.push(_1f[ii]);
}
if(_20.length!=1){
Util.error("ge() failed in a bizarre complicated edge case.");
return null;
}
return _20[0];
}
}
}else{
return id;
}
return null;
};
function bind(obj,_24){
var _25=[];
for(var ii=2;ii<arguments.length;ii++){
_25.push(arguments[ii]);
}
return function(){
var _27=obj||this;
var _28=_25.slice();
for(var jj=0;jj<arguments.length;jj++){
_28.push(arguments[jj]);
}
if(typeof (_24)=="string"){
if(_27[_24]){
return _27[_24].apply(_27,_28);
}
}else{
return _24.apply(_27,_28);
}
};
};
Function.prototype.bind=function(_2a){
var _2b=[arguments[0],this];
var _2c=arguments.length;
for(var ii=1;ii<_2c;ii++){
_2b.push(arguments[ii]);
}
return bind.apply(null,_2b);
};

/ * Forum Image Resize */

var rmw_max_width = 650;
var rmw_border_1 = '1px solid #006699';
var rmw_border_2 = '2px dotted #006699';
var rmw_image_title = 'Click to view full-size';

function rmw_go()
{
	var rmw_img_array = document.getElementsByTagName("IMG");
	for (var i = 0; i < rmw_img_array.length; i++)
	{
		var rmw_img = rmw_img_array[i];
		if (String(rmw_img.getAttribute('resizemod')) == 'on')
		{
			if (rmw_wait_for_width && rmw_img.width && !isNaN(rmw_img.width))
			{
				if (rmw_img.width > Number(rmw_max_width))
				{
					rmw_img.setAttribute('resizemod','off');
					rmw_img.onload = null;
					rmw_img.removeAttribute('onload');
					var rmw_clone = rmw_img.cloneNode(false);
					var rmw_parent = rmw_img.parentNode;
					rmw_clone.setAttribute('width',String(rmw_max_width));
					rmw_parent.replaceChild(rmw_clone,rmw_img);
					rmw_make_pop(rmw_clone);
				}
			}
			else if (!rmw_wait_for_width)
			{
				rmw_img.setAttribute('resizemod','off');
				var rmw_clone = rmw_img.cloneNode(false);
				rmw_img.onload = null;
				rmw_img.removeAttribute('onload');
				var rmw_parent = rmw_img.parentNode;
				var rmw_ind = rmw_count++;
				rmw_clone.setAttribute('resizemod',String(rmw_ind));
				rmw_preload[rmw_ind] = new Image();
				rmw_preload[rmw_ind].src = rmw_img.src;
				if (window.showModelessDialog)
				{
					rmw_clone.style.margin = '2px';
				}
				rmw_clone.style.border = rmw_border_1;
				rmw_clone.style.width = '28px';
				rmw_parent.replaceChild(rmw_clone,rmw_img);
			}
		}
	}
	if (!rmw_over && document.getElementById('resizemod'))
	{
		rmw_over = true;
		rmw_go();
	}
	else if (!rmw_over)
	{
		window.setTimeout('rmw_go()',2000);
	}
}
function rmw_img_loaded(rmw_obj)
{
	if (!document.getElementsByTagName || !document.createElement) {return;}
	var rmw_att = String(rmw_obj.getAttribute('resizemod'));
	var rmw_real_width = false;
	if ((rmw_att != 'on') && (rmw_att != 'off'))
	{
		var rmw_index = Number(rmw_att);
		if (rmw_preload[rmw_index].width)
		{
			rmw_real_width = rmw_preload[rmw_index].width;
		}
	}
	else
	{
		rmw_obj.setAttribute('resizemod','off');
		if (rmw_obj.width)
		{
			rmw_real_width = rmw_obj.width;
		}
	}
	if (!rmw_real_width || isNaN(rmw_real_width) || (rmw_real_width <= 0))
	{
		var rmw_rand1 = String(rmw_count++);
		eval("rmw_retry" + rmw_rand1 + " = rmw_obj;");
		eval("window.setTimeout('rmw_img_loaded(rmw_retry" + rmw_rand1 + ")',2000);");
		return;
	}
	if (rmw_real_width > Number(rmw_max_width))
	{
		if (window.showModelessDialog)
		{
			rmw_obj.style.margin = '2px';
		}
		rmw_make_pop(rmw_obj);
	}
	else if (!rmw_wait_for_width)
	{
		rmw_obj.style.width = String(rmw_real_width) + 'px';
		rmw_obj.style.border = '0';
		if (window.showModelessDialog)
		{
			rmw_obj.style.margin = '0px';
		}
	}
	if (window.ActiveXObject) // IE on Mac and Windows
	{
		window.clearTimeout(rmw_timer1);
		rmw_timer1 = window.setTimeout('rmw_refresh_tables()',10000);
	}
}
function rmw_refresh_tables()
{
	var rmw_tables = document.getElementsByTagName("TABLE");
	for (var j = 0; j < rmw_tables.length; j++)
	{
		rmw_tables[j].refresh();
	}
}
function rmw_make_pop(rmw_ref)
{
	rmw_ref.style.border = rmw_border_2;
	rmw_ref.style.width = String(rmw_max_width) + 'px';
	if (!window.opera)
	{
		rmw_ref.onclick = function()
		{
			if (!rmw_pop.closed)
			{
				rmw_pop.close();
			}
			rmw_pop = window.open('about:blank','christianfecteaudotcom',rmw_pop_features);
			rmw_pop.resizeTo(window.screen.availWidth,window.screen.availHeight);
			rmw_pop.moveTo(0,0);
			rmw_pop.focus();
			rmw_pop.location.href = this.src;
		}
	}
	else
	{
		var rmw_rand2 = String(rmw_count++);
		eval("rmw_pop" + rmw_rand2 + " = new Function(\"rmw_pop = window.open('" + rmw_ref.src + "','christianfecteaudotcom','" + rmw_pop_features + "'); if (rmw_pop) {rmw_pop.focus();}\")");
		eval("rmw_ref.onclick = rmw_pop" + rmw_rand2 + ";");
	}
	document.all ? rmw_ref.style.cursor = 'hand' : rmw_ref.style.cursor = 'pointer';
	rmw_ref.title = rmw_image_title;
	if (window.showModelessDialog)
	{
		rmw_ref.style.margin = '0px';
	}
}
if (document.getElementsByTagName && document.createElement) // W3C DOM browsers
{
	rmw_preload = new Array();
	if (window.GeckoActiveXObject || window.showModelessDialog) // Firefox, NN7.1+, and IE5+ for Win
	{
		rmw_wait_for_width = false;
	}
	else
	{
		rmw_wait_for_width = true;
	}
	rmw_pop_features = 'top=0,left=0,width=' + String(window.screen.width-80) + ',height=' + String(window.screen.height-190) + ',scrollbars=1,resizable=1';
	rmw_over = false;
	rmw_count = 1;
	rmw_timer1 = null;
	if (!window.opera)
	{
		rmw_pop = new Object();
		rmw_pop.closed = true;
		rmw_old_onunload = window.onunload;
		window.onunload = function()
		{
			if (rmw_old_onunload)
			{
				rmw_old_onunload();
				rmw_old_onunload = null;
			}
			if (!rmw_pop.closed)
			{
				rmw_pop.close();
			}
		}
	}
	window.setTimeout('rmw_go()',2000);
}

/* Ajax Suggest */

function lookup(inputString){if(inputString.length == 0){$('#suggestions').hide();}else{$.post("http://www.fakku.net/includes/suggest.php", {queryString: ""+inputString+""}, function(data){if(data.length > 0){$('#suggestions').show();$('#autoSuggestionsList').html(data);}});}}function fill(thisValue){$('#inputString').val(thisValue);setTimeout("$('#suggestions').hide();", 200);}

/* Show Hide */

function showhide(a, b) {
	if(document.getElementById(a).style.display == "none") { 
		document.getElementById(a).style.display = "block";
		document.getElementById(b).style.background = "transparent url(/images/more_info_arrow.png) no-repeat scroll 0 7px";
	} else if(document.getElementById(a).style.display == "block") { 
		document.getElementById(a).style.display = "none";
		document.getElementById(b).style.background = "transparent url(/images/more_info_arrow.png) no-repeat scroll 0 -9px";
	}
}

function showhidemore(a, b, c) {
		document.getElementById(a).style.display = "block";
		document.getElementById(b).style.display = "none";
		document.getElementById(c).style.display = "none";
}

/* Sort by.. Drop Down */

function showSortdrop () {
	if(document.getElementById('sort1').style.display == "none") { 
		document.getElementById('sort1').style.display = "block";
		document.getElementById('sort2').style.display = "block";
		document.getElementById('sort3').style.display = "block";
		document.getElementById('sort4').style.display = "block";
		document.getElementById('sort5').style.display = "block";
		document.getElementById('sort6').style.display = "block";
	} else if(document.getElementById('sort1').style.display == "block") { 
		document.getElementById('sort1').style.display = "none";
		document.getElementById('sort2').style.display = "none";
		document.getElementById('sort3').style.display = "none";
		document.getElementById('sort4').style.display = "none";
		document.getElementById('sort5').style.display = "none";
		document.getElementById('sort6').style.display = "none";
	}
}

function changeBox(cbox) {
	box = eval(cbox);
	box.checked = !box.checked;
}
function windowOpener(url, name, args) {
	popupWin = window.open(url, "", "width=800,height=600,resizable")
	popupWin.focus()
}
function popup(url) {
	popupWin = window.open(url, "", "width=640,height=480,resizable")
	popupWin.focus()
}
function a(a) {
	if(document.images){
		(new Image()).src="http://www.fakku.net/includes/a.php?a="+a;
	}
	return true;
}