var ns6=document.getElementById&&!document.all

function restrictinput(maxlength,e,placeholder){

	if (window.event&&event.srcElement.value.length>=maxlength)

	return false

	else if (e.target&&e.target==eval(placeholder)&&e.target.value.length>=maxlength){

	var pressedkey=/[a-zA-Z0-9\.\,\/]/ //detect alphanumeric keys

	if (pressedkey.test(String.fromCharCode(e.which)))

	e.stopPropagation()

}

}

function lib_bwcheck(){ //Browsercheck (needed)

	this.ver=navigator.appVersion

	this.agent=navigator.userAgent

	this.dom=document.getElementById?1:0

	this.opera5=this.agent.indexOf("Opera 5")>-1

	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 

	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;

	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;

	this.ie=this.ie4||this.ie5||this.ie6

	this.mac=this.agent.indexOf("Mac")>-1

	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 

	this.ns4=(document.layers && !this.dom)?1:0;

	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)

	return this

}

var bw=new lib_bwcheck()

fromX = -185

fromX1 = -300

fromX2 = -400

fromX3 = -200

fromX5 = 0

fromX6= -470

fromY = 10

fromY1 = -20

fromY3 = -110

fromY4 = -140

function makeObj(obj){								

   	this.evnt=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?document.layers[obj]:0;

	if(!this.evnt) return false

	this.css=bw.dom||bw.ie4?this.evnt.style:bw.ns4?this.evnt:0;	

   	this.wref=bw.dom||bw.ie4?this.evnt:bw.ns4?this.css.document:0;		

	this.writeIt=b_writeIt;																

	return this

}

var px = bw.ns4||window.opera?"":"px";

function b_writeIt(text){

	if (bw.ns4){this.wref.write(text);this.wref.close()}

	else this.wref.innerHTML = text

}

var descx = 0

var descy = 0

function popmousemove(e){descx=bw.ns4||bw.ns6?e.pageX:event.x; descy=bw.ns4||bw.ns6?e.pageY:event.y

}

var oDesc;

function popup(num){

    if(oDesc){

	oDesc.writeIt('<div class="clDescription">'+messages[num]+'</div>')

	if(bw.ie5||bw.ie6) descy = descy+document.body.scrollTop

	oDesc.css.left = (descx+fromX)+px

	oDesc.css.top = (descy+fromY)+px

	oDesc.css.visibility = "visible"

    }

}

function popup1(num){

    if(oDesc){

	oDesc.writeIt('<div class="clDescription">'+messages[num]+'</div>')

	if(bw.ie5||bw.ie6) descy = descy+document.body.scrollTop

	oDesc.css.left = (descx+fromX1)+px

	oDesc.css.top = (descy+fromY1)+px

	oDesc.css.visibility = "visible"

    }

}

function popup2(num){

    if(oDesc){

	oDesc.writeIt('<div class="clDescription">'+messages[num]+'</div>')

	if(bw.ie5||bw.ie6) descy = descy+document.body.scrollTop

	oDesc.css.left = (descx+fromX2)+px

	oDesc.css.top = (descy+fromY)+px

	oDesc.css.visibility = "visible"

    }

}

function popup3(num){

    if(oDesc){

	oDesc.writeIt('<div class="clDescription">'+messages[num]+'</div>')

	if(bw.ie5||bw.ie6) descy = descy+document.body.scrollTop

	oDesc.css.left = (descx+fromX3)+px

	oDesc.css.top = (descy+fromY3)+px

	oDesc.css.visibility = "visible"

    }

}

function popup4(num){

    if(oDesc){

	oDesc.writeIt('<div class="clDescription">'+messages[num]+'</div>')

	if(bw.ie5||bw.ie6) descy = descy+document.body.scrollTop

	oDesc.css.left = (descx+fromX1)+px

	oDesc.css.top = (descy+fromY4)+px

	oDesc.css.visibility = "visible"

    }

}

function popup5(num){

    if(oDesc){

	oDesc.writeIt('<div class="clDescription">'+messages[num]+'</div>')

	if(bw.ie5||bw.ie6) descy = descy+document.body.scrollTop

	oDesc.css.left = (descx+fromX5)+px

	oDesc.css.top = (descy+fromY3)+px

	oDesc.css.visibility = "visible"

    }

}

function popup6(num){

    if(oDesc){

	oDesc.writeIt('<div class="clDescription">'+messages[num]+'</div>')

	if(bw.ie5||bw.ie6) descy = descy+document.body.scrollTop

	oDesc.css.left = (descx+fromX6)+px

	oDesc.css.top = (descy+fromY3)+px

	oDesc.css.visibility = "visible"

    }

}

function popout(){

	if(oDesc) oDesc.css.visibility = "hidden"

}

function setPopup(){

   	if(bw.ns4)document.captureEvents(Event.MOUSEMOVE)

   	document.onmousemove = popmousemove;

	oDesc = new makeObj('divDescription')

}



function alp(cur,which){

	strength=(which==0)? 1 : 0.2

	if (cur.style.MozOpacity)

	cur.style.MozOpacity=strength

	else if (cur.filters)

	cur.filters.alpha.opacity=strength*100

}



function alp2(cur,which){

	strength=(which==0)? 1 : 0.2

	if (cur.style.MozOpacity)

	cur.style.MozOpacity=strength

	else if (cur.filters)

	cur.filters.alpha.opacity=strength*250

}



function f_alert(theForm)

{

if (theForm.title.value == "")

{

alert("Please enter a value for the \"Site Title\" field.");

	theForm.title.focus();

	return (false);

}

if (theForm.title.value.length < 4)

{

alert("Please enter at least 4 characters in the \"Site Title\" field.");

	theForm.title.focus();

	return (false);

}



if (theForm.urlss.value == "http://")

{

alert("Please enter a value for the \"Site Url\" field.");

	theForm.urlss.focus();

	return (false);

}

if (theForm.urlss.value.length < 12)

{

alert("Please enter at least 4 characters in the \"Site URL\" field.");

	theForm.urlss.focus();

	return (false);

}



if (theForm.reciprocalLink.value == "http://")

{

alert("Please enter a value for the \"Where can we find the link to our site?\" field.");

	theForm.reciprocalLink.focus();

	return (false);

}

if (theForm.reciprocalLink.value.length < 12)

{

alert("Please enter a value for the \"Where can we find the link to our site?\" field.");

	theForm.reciprocalLink.focus();

	return (false);

}



if (theForm.email.value == "")

{

alert("Please enter a value for the \"E-mail address\" field.");

	theForm.email.focus();

	return (false);

}

if (theForm.email.value.length < 7)

{

alert("Please enter a value for the \"Email\" field.");

	theForm.email.focus();

	return (false);

}



if (theForm.category.selectedIndex < 1)

{

alert("Please select one of the \"Category\" options.");

	theForm.category.focus();

	return (false);

}



if (theForm.description.value == "")

{

alert("Please enter a value for the \"Description\" field.");

	theForm.description.focus();

	return (false);

}

return (true);

}



function countlimit(maxlength,e,placeholder){

var theform=eval(placeholder)

var lengthleft=maxlength-theform.value.length

var placeholderobj=document.all? document.all[placeholder] : document.getElementById(placeholder)

if (window.event||e.target&&e.target==eval(placeholder)){

if (lengthleft<0)

theform.value=theform.value.substring(0,maxlength)

placeholderobj.innerHTML=lengthleft

}

}





function displaylimit(theform,thelimit){

var limit_text='<font color="#FF0000"><span id="'+theform.toString()+'">'+thelimit+'</span></font>'

if (document.all||ns6)

document.write(limit_text)

if (document.all){

eval(theform).onkeypress=function(){ return restrictinput(thelimit,event,theform)}

eval(theform).onkeyup=function(){ countlimit(thelimit,event,theform)}

}

else if (ns6){

document.body.addEventListener('keypress', function(event) { restrictinput(thelimit,event,theform) }, true); 

document.body.addEventListener('keyup', function(event) { countlimit(thelimit,event,theform) }, true); 

}

}



function links(url) { 

	link = window.open("http://"+url,"Link","toolbar=1,location=1,directories=0,status=1,menubar=1,scrollbars=yes,resizable=1"); 

	link.focus();

}