if(top.location.href!=self.location.href && self.location.href.indexOf('load.php')!=self.location.href.length-'load.php'.length){top.location.href=self.location.href;};

if(top.location.href.indexOf("http:")<0){
top.location.href="http://www.fullposter.com/";
};


function FP_spansChildren(furtherIds){/*Some nodes (particularly those meant to host words: they are SPAN tags and their class name is in the pattern /_\d+/) are written writing within their first (and only) child node new contents drawn from DBV via Ajax: but if they haven't a child node, an error is triggered. This function makes sure all such nodes have at least one empty node. BTW the reason script generated data for language translations should be written into the same child nodes, is that if we would rather append new nodes at each translation we would go on appending contents and thus maybe burdening other scripts, rather than overwriting the old translation with the new translation. Script written contents must not coexist for this application, but overtake.*/
if(typeof(furtherIds)=="string"){furtherIds=furtherIds.split(" ");};
var spans=document.getElementsByTagName('SPAN');
for(var s=0; s<spans.length; s++){
var matches=spans[s].className.match(/^_\d+$/);/*identifies words by className, NOT id, because IDs are unique, BUT words in the document may be REPEATED*/
	if(matches && !spans[s].childNodes.length){
	spans[s].appendChild( document.createTextNode('') );
	};
	if(!matches && furtherIds){/*additional parameter passed: evidently, in the page not only classes name in the form /_\d+/ must be written but also either other class names or specific ids*/
		for(var f=0; f<furtherIds.length; f++){
		var matches2=spans[s].className.match( (new RegExp('^'+furtherIds[f]+'$')) );//class matches?
			if(!matches2){//id matches?
			matches2=spans[s].id.match( (new RegExp('^'+furtherIds[f]+'$')) );
			};
			if(matches2 && !spans[s].childNodes.length){
			spans[s].appendChild( document.createTextNode('') );
			};
		}//for f
	};
}//for s
}





function FP_getSpan(number, getLast){
var toReturn='';
var spans=document.getElementsByTagName('SPAN') || [];
for(var s=0; s<spans.length; s++){
	if(spans[s].className=='_'+number){
		if(spans[s].childNodes.length==0){spans[s].appendChild( document.createTextNode('') );};
	toReturn=spans[s];
		if(!getLast){return spans[s];};
	}
}
if(!toReturn){
var foonode=document.createElement("SPAN");
foonode.appendChild( document.createTextNode('System error. Please report') );
return foonode;
}
return toReturn;
}





function FP_addevent(element, event, func){
if(!element || !event || typeof(func)!="function"){return false;};
event=event.toLowerCase();
if( typeof(element['addEventListener'])!="undefined" ){
	if(event.indexOf('on')>-1){event=event.replace(/^on/, '');};
element.addEventListener(event, func, false);
}
else if(typeof(element['attachEvent'])!="undefined"){
	if(event.indexOf('on')!=0){event='on'+event;};
element.attachEvent(event, func);
};
}


function FP_options(select, valueToLookUp, addOrDelete/*add=1, delete=0*/, optionalText/*only if you ADD*/){
//Validate:
if(typeof(select)!="object" || (typeof(valueToLookUp)!="string" && typeof(valueToLookUp)!="number")){return false;};
addOrDelete=(addOrDelete)?1:0;
valueToLookUp=''+valueToLookUp;//forced String
optionalText=optionalText||valueToLookUp;//BEFORE valueToLookUp is forced to lowercase
valueToLookUp=valueToLookUp.toLowerCase();//forced to lowercase
//Initialize:
var output=[];
//RUN:
if(addOrDelete){//add option:
	output[++output.length-1]=[valueToLookUp, optionalText];/*adds on top*/
	for(var i=0; i<select.options.length; i++){
	output[++output.length-1]=[select.options[i].value, select.options[i].text];
	}
}
else{//delete option
	for(var i=0; i<select.options.length; i++){
		if(select.options[i].value.toLowerCase()==valueToLookUp){continue;};
	output[++output.length-1]=[select.options[i].value, select.options[i].text];
	}
};
select.options.length=0;
for(var i=0; i<output.length; i++){
	if(!output[i][1]){continue;};
var L=++select.options.length-1;
select.options[L].value=output[i][0];
select.options[L].text=output[i][1];
}
return output;
}




function FP_eventDisabler(which, object, readMessageFrom){
if(typeof(which)!="string"){return false;};
if(typeof(object)!="object"){object=document;};
which=which.toLowerCase();
switch(which){
case 'onkeydown':
	object.onkeydown=function(e){
		e=e||event;
		var key=(typeof(e.keyCode)!="undefined")?parseInt(e.keyCode):parseInt(e.which);
			if( (key>=33 && key<=40) ){
			var myspan=FP_getSpan(readMessageFrom);
			if(myspan){alert(myspan.childNodes[0].nodeValue);};
			return false;
			};
		}
break;
}//switch over
}



function FP_keydown(e, num){
e=e||event;
if(typeof(num)=="undefined"){/*only one arg, read*/
return (typeof(e.keyCode)!="undefined")?parseInt(e.keyCode):parseInt(e.which);
}
else{/*two args, read and verify if matches*/
num=parseFloat(num);
	if(isNaN(num)){return false;};
var key=(typeof(e.keyCode)!="undefined")?parseInt(e.keyCode):parseInt(e.which);
return (num==key);
};
}





function FP_normalize(incomingData){
incomingData=incomingData.replace(/\s{2,}/g, ' ');
incomingData=incomingData.replace(/^\s+|\s+$/, '');
return incomingData.toLowerCase();
}

function FP_trimmer(incomingData){/*for now it's an alias, but maybe in the future a trimmer should do something slightly different from format normalization*/
	return FP_normalize(incomingData);
}



function FP_empty(obj){return /^\s*$/.test(obj);}
function FP_replacewhite(obj){return obj.replace(/\s+/g,'');}
function FP_replacewhite2(obj){return obj.replace(/\s{2,}/g,' ');}
function FP_trim(obj){return obj.replace(/^\s+|\s+$/g,"");}/*depleted FP_trimmer, does NOT lowercase*/
function FP_remove_letters(obj){obj.value=obj.value.replace(/[a-zA-Z]/g,'');}



function FP_notnum(obj, defaults){
obj.value=FP_trim(obj.value);
if( !/^[0-9]?\.?[0-9]+$/g.test(obj.value) ){obj.value=(defaults)?defaults:"";};
}



function FP_algebraicnotnum(obj, defaults){
obj.value=FP_trim(obj.value);
if( !/^[\-\+]?[0-9]?\.?[0-9]+$/g.test(obj.value) ){obj.value=(defaults)?defaults:"";};
}

function FP_limitchars(object, limit, print){
limit=parseInt(limit); limit=limit||0;
if(object.value && object.value.length>limit){ object.value=object.value.substring(0, limit); };
var remains=limit - object.value.length;
if(print){
	var id=object.id||object.name;
	id+='_limit';
	if(document.getElementById(id)){
		if(!document.getElementById(id).childNodes.length){
		document.getElementById(id).appendChild( document.createTextNode('') );
		};
	document.getElementById(id).childNodes[0].nodeValue=remains;
	};
}
return remains;
}


function FP_resizeByHeight(h, w, newH){
h=parseFloat(h)||0; w=parseFloat(w)||0; newH=parseFloat(newH)||0;
if(!h){h=1;};
if(h>newH){ w=parseInt(((newH*w)/h)); }else{ newH=h; };
return [newH, w];
}

function FP_confirm(num){
return confirm(FP_getSpan(num).childNodes[0].nodeValue);
}





function imatch(string, regexp, flags, doubleReturn){
if(typeof(string)!="string" || !regexp){return null;};
flags=(flags && typeof(flags)=="string")?flags:"g";
var re=(typeof(regexp)=="string")?new RegExp(regexp, flags):regexp;
var matches=string.match(re);
	if(!matches){return null;};
var found=0;
var indexes=new Array(matches.length);
	for(var m=0; m < matches.length; m++){
	found=string.substring(0, found).length;
	indexes[m]=found+string.substring(found).search(re);
	found=indexes[m]+matches[m].length;
	};
return (!doubleReturn)? indexes: [indexes, matches];
/* http://www.unitedscripters.com */}

function formatcheck(field){
var v=field.value;
if(v.indexOf('<pre>')>-1){return true;};
var squareOpen=imatch(v, /\[/g);
var squareClose=imatch(v, /\]/g);
var curlyOpen=imatch(v, /{/g);
var curlyClose=imatch(v, /}/g);
var pipe=v.match(/\|/g);
/*first check just wrong numbers in special chars couples, later we'll check nesting errors (no need to check nesting if we are ALREADY wrong at this stage):*/
var mismatches='';
if(squareOpen && squareClose && squareOpen.length!=squareClose.length){
mismatches+=(squareOpen.length>squareClose.length)?'[':']';
};
if(squareOpen && !squareClose){
mismatches+='[';
};
if(squareClose && !squareOpen){
mismatches+=']';
};
if(curlyOpen && curlyClose && curlyOpen.length!=curlyClose.length){
mismatches+=(curlyOpen.length>curlyClose.length)?'{':'}';
};
if(curlyOpen && !curlyClose){
mismatches+='{';
};
if(curlyClose && !curlyOpen){
mismatches+='}';
};
if( pipe && (pipe.length%2) ){
mismatches+='|';
};
if(mismatches){
alert(FP_getSpan(386).childNodes[0].nodeValue+": \n"+mismatches);
return false;
};
/*now check nesting errors in special chars (ie: right amount, but wrong placement):*/
mismatches='';
if(squareOpen && squareClose){
	for(var i=0; i<squareOpen.length; i++){
		if(squareOpen[i]>squareClose[i]){
		mismatches+="]";
		alert(FP_getSpan(438).childNodes[0].nodeValue+": \n"+mismatches);
		return false;
		};
	}
};
if(curlyOpen && curlyClose){
	for(var i=0; i<curlyOpen.length; i++){
		if(curlyOpen[i]>curlyClose[i]){
		mismatches+="}";
		alert(FP_getSpan(438).childNodes[0].nodeValue+": \n"+mismatches);
		return false;
		};
	}
};
return true;
}

function FP_rander(limit, alphabet){
limit=parseFloat(limit)||5;
var alphabet=alphabet||'0123456789';
var output='';
for(var i=0; i<limit; i++){
output+=alphabet.charAt( Math.round(Math.random()*(alphabet.length-1)) );
}
return output;
}

function setTtimezone(onlyString){
if(typeof window['ajaxTimezone']){window['ajaxTimezone']=new Ajax();}
var d=new Date();
var m=d.getMonth()+1; m=(m<10)?'0'+m:m;
var day=d.getDate(); day=(day<10)?'0'+day:day;
var h=d.getHours(); h=(h<10)?'0'+h:h;
var mm=d.getMinutes(); mm=(mm<10)?'0'+mm:mm;
var s=d.getSeconds(); s=(s<10)?'0'+s:s;
var outcome=d.getFullYear()+'-'+m+'-'+day+' '+
h+':'+mm+':'+s;
if(onlyString){return outcome;};
ajaxTimezone.post('_php_/ajax_timezone.php',
'timezone='+outcome+
'&token='+document.getElementById('token').value
);
}




function orderautoindexfunction(){
var element=document.getElementById('autoindexfieldset');
if(element){
var a1=element.getElementsByTagName('A');
var a2=[];
for(var i=0; i<a1.length; i++){
a2[++a2.length-1]=[(a1[i].childNodes.length)?a1[i].childNodes[0].nodeValue:'', a1[i].href];
}
	if(a2.length){
		a2.sort(function(a,b){
			if(a[0].toLowerCase()==b[0].toLowerCase()){return 0;};
			if(a[0].toLowerCase()<b[0].toLowerCase()){return -1;};
			if(a[0].toLowerCase()>b[0].toLowerCase()){return 1;};
		});
	for(var i=0; i<a1.length; i++){//not in place device
		if(a1[i].childNodes.length){
		a1[i].href=a2[i][1];
		a1[i].childNodes[0].nodeValue=a2[i][0];
		};
	}
		if(document.getElementById('autoindexcommands')){document.getElementById('autoindexcommands').style.display='none';};
	};
};
}










function pageContentTextFix(id, how){
if(document.getElementById(id)){    id=document.getElementById(id);
var Mw=parseFloat(id.offsetWidth);
var mw=650;
var w=parseFloat(id.offsetWidth);
var current=parseInt(id.style.paddingLeft)||0; 
    if(how){//shrink:
    current+=50;
        //if(current>=300){return false;};
    }
    else{//enlarge:
    current-=50;
        if(current<0){current=0;};
    };
id.style.paddingLeft=id.style.paddingRight=current+'px';
};
}


function ajaxwait(layer, hide, path){
if(document.getElementById(layer)){
var l=document.getElementById(layer);
l.style.display='none';
	if(!l.childNodes.length || !l.getElementsByTagName('IMG').length){ l.appendChild(document.createElement('IMG')); };
l.getElementsByTagName('IMG')[0].src=(path||'_images_/ajaxwait.gif'); l.getElementsByTagName('IMG')[0].width=128; l.getElementsByTagName('IMG')[0].height=15;
l.getElementsByTagName('IMG')[0].style.cssText="margin-left:auto; margin-right:auto;float:none;";
if(hide){
	if(typeof hide=='string' && document.getElementById(hide)){
	document.getElementById(hide).style.display='none';
	}
	else if(typeof hide=='object'){
		for(var i=0; i<hide.length; i++){
			if(document.getElementById(hide[i])){document.getElementById(hide[i]).style.display='none';};
		}
	};
};
l.style.display='block';
};
}






























