function showhide(GroupName) {
		if (document.getElementById(GroupName + "Group").style.display == 'none') {
			document.getElementById(GroupName + "Group").style.display = '';
		} else {
			document.getElementById(GroupName + "Group").style.display = 'none';
		}//
	}
function confirmRaidRequest(theForm){
		if (theForm.toon.value == ""){
			alert("Please enter a character name.");
			return false;
		}

		if (theForm.class_id.value == -1){
			alert("Please specify a character class.");
			return false;
		}

		if (theForm.note.value.length >= 100){
			alert("Your note contains " + theForm.note.value.length + " characters. Please shorten to 100 character or less.");
			return false;
		}

		return true;
}

function confirmRaidClass(theForm){

	if (theForm.class_name.value == ""){
		alert("Please enter a name for this raid class.");
		return false;
	}

	return true;
}

function confirmRaidCreate(theForm){
	if (theForm.title.value == ""){
		alert("Please enter a title for this raid.");
		return false;
	}

	if (theForm.description.value.length < 1){
		alert("Please provide a description for this raid.");
		return false;
	}

	if (theForm.description.value.length > 2000){
		alert("Your description contains " + theForm.raid_description.value.toString.length + " characters. Please shorten to 200 character or less.");
		return false;
	}

	var theDay = theForm.raid_day.selectedIndex + 1;
	var theMonth = theForm.raid_month.selectedIndex + 1;
	var theYear = theForm.raid_year.selectedIndex + 2002;
	var daysInMonth = DaysArray(12)

	if (theMonth == 2 && daysInFebruary(theYear) == 28 && theDay > 28){
		alert("February doesn't have more than 28 days for the year given. Please select another day.");
		return false;
	}

	if (theDay > daysInMonth[theMonth]) {
		alert("The month you've selected does not have that many days. Try again.");
		return false;
	}

	if (theForm.forum_link.value.length > 200){
		alert("The link provided is too long. Sorry.");
		return false;
	}

	return true;
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
	// EXCEPT for centurial years which are not also divisible by 400.
	return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}

function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
	}
	return this
}

/*
function checkVersion4() {
	var x = navigator.appVersion;
	y = x.substring(0,4);
	if (y>=4) setVariables();moveOB();
}

function setVariables() {
	if (navigator.appName == "Netscape") {
		h=".left=";v=".top=";dS="document.";sD="";
	}
	else{
		h=".pixelLeft=";v=".pixelTop=";dS="";sD=".style";
	}
	objectX="object11"
	XX=-70;
	YY=-70;
	OB=11;
}

function setObject(a) {
	objectX="object"+a;
	OB=a;
	XX=eval("xpos"+a);
	YY=eval("ypos"+a);
}

function getObject() {
	if (isNav) document.captureEvents(Event.MOUSEMOVE);
}

function releaseObject() {
	if (isNav) document.releaseEvents(Event.MOUSEMOVE);
		check="no";
		objectX="object11";
		document.close();
}

function moveOB() {
	eval(dS + objectX + sD + h + Xpos);
	eval(dS + objectX + sD + v + Ypos);
}

var isNav = (navigator.appName.indexOf("Netscape") !=-1);
var isIE = (navigator.appName.indexOf("Microsoft") !=-1);
nsValue=(document.layers);
check="no";
function MoveHandler(e) {
	Xpos = (isIE) ? event.clientX : e.pageX;
	Ypos = (nsValue) ? e.pageY : event.clientY;
	if (check=="no") {
		diffX=XX-Xpos;
		diffY=YY-Ypos;
		check="yes";
		if (objectX=="object11") check="no";
	}
	Xpos+=diffX;
	Ypos+=diffY;
	if (OB=="1") xpos1=Xpos,ypos1=Ypos;
		moveOB();
}

if (isNav) {
	document.captureEvents(Event.CLICK);
	document.captureEvents(Event.DBLCLICK);
	}
xpos1=50; // make this the left pixel value for object1 below
ypos1=50; // make this the top pixel value for object1 below
xpos11 = -50;
ypos11 = -50;
Xpos=5;
Ypos=5;
document.onmousemove = MoveHandler;
document.onclick = getObject;
document.ondblclick = releaseObject;

*/


/***********************************************
* Image Thumbnail viewer- © Dynamic Drive (www.dynamicdrive.com)
* Last updated Sept 26th, 03'. This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var ie=document.all;
var ns6=document.getElementById&&!document.all;

function ietruebody(){
	return (document.compatMode && document.compatMode!="BackCompat" && !window.opera)? document.documentElement : document.body;
}

function enlarge(which, e, layer_name, position, imgwidth, imgheight){
	if (ie||ns6){
		crossobj=document.getElementById? document.getElementById(layer_name + "") : document.all.layer_name+"";

		if (position=="center"){
			pgyoffset=ns6? parseInt(pageYOffset) : parseInt(ietruebody().scrollTop);
			horzpos=ns6? pageXOffset+window.innerWidth/2-imgwidth/2 : ietruebody().scrollLeft+ietruebody().clientWidth/2-imgwidth/2;
			vertpos=ns6? pgyoffset+window.innerHeight/2-imgheight/2 : pgyoffset+ietruebody().clientHeight/2-imgheight/2;
			if (window.opera && window.innerHeight) //compensate for Opera toolbar
				vertpos=pgyoffset+window.innerHeight/2-imgheight/2;
			vertpos=Math.max(pgyoffset, vertpos);
		}
		else{
			var horzpos=ns6? pageXOffset+e.clientX : ietruebody().scrollLeft+event.clientX;
			var vertpos=ns6? pageYOffset+e.clientY : ietruebody().scrollTop+event.clientY;
		}

		crossobj.style.left=horzpos+"px";
		crossobj.style.top=vertpos+"px";

		crossobj.innerHTML='<div align="left" class="dragbar" id="dragbar_'+layer_name+'" onmousedown="getNewCrossobj(this.id)"><span class="closetext" id="closetext" onClick="closepreview()">&nbsp;X Close </span> </div><img src="'+which+'">';
		crossobj.style.visibility="visible";
		return false;
	}
	else //if NOT IE 4+ or NS 6+, simply display image in full browser window
		return true;

}

function getTitleFlag(){
	var title_flag = crossobj.title;
	return title_flag;
}

function itemStayOn(){
	crossobj.title = "rightclickonoff";
	return false;
}

function itemShutOff(){
	crossobj.title = "mouseonoff";
	closepreview();
}
var z = 5000;

function showItem(which, e){
	if (ie||ns6){
		crossobj=document.getElementById? document.getElementById(which + "") : document.all.which+"";
		getTitleFlag()
		if (crossobj.style.visibility != "visible"){

			var horzpos=ns6? pageXOffset+e.clientX : ietruebody().scrollLeft+event.clientX;
			var vertpos=ns6? pageYOffset+e.clientY : ietruebody().scrollTop+event.clientY;

			crossobj.style.left=horzpos+15+"px";
			crossobj.style.top=vertpos+15+"px";

			//crossobj.innerHTML ='<div align="left" class="dragbar" id="dragbar_'+which+'" onmousedown="getNewCrossobj(this.id)"><span class="closetext" id="closetext" onClick="closepreview()">&nbsp;X Close </span> </div>'+crossobj.innerHTML+'';
			crossobj.style.zIndex = z;
			z++;
			crossobj.style.visibility="visible";
		}
		return false;
	}
	else //if NOT IE 4+ or NS 6+, simply display image in full browser window
		return true;

}

function getNewCrossobj(layer_name){
	var this_string = layer_name;
	this_substring = this_string.substring(8);
	//alert(this_substring);
	crossobj=document.getElementById? document.getElementById(this_substring + "") : document.all.this_substring+"";
	getTitleFlag();
	crossobj.style.zIndex = z;
	z++;
}

function closepreview(){
	this_flag = getTitleFlag()
	if (this_flag == "mouseonoff" || this_flag == "")
		crossobj.style.visibility="hidden";
}

function drag_drop(e){
	if (ie&&dragapproved){
		crossobj.style.left=tempx+event.clientX-offsetx+"px";
		crossobj.style.top=tempy+event.clientY-offsety+"px";
	}
	else if (ns6&&dragapproved){
		crossobj.style.left=tempx+e.clientX-offsetx+"px";
		crossobj.style.top=tempy+e.clientY-offsety+"px";
	}
	return false;
}

function initializedrag(e){
	/*if (ns6 && (e.which == 3 || e.which == 2)) {
			alert("No right clicking, please.")
			return false;
	}
	else {
		if (ie && (event.button == 2 || event.button == 3)){
			alert("No right clicking, please.")
			return false;
		}
	}
	return true;
	*/

	if (ie&&event.srcElement.id.toString().indexOf("dragbar_")==0||ns6&&e.target.id.toString().indexOf("dragbar_")==0){
		offsetx=ie? event.clientX : e.clientX
		offsety=ie? event.clientY : e.clientY

		tempx=parseInt(crossobj.style.left)
		tempy=parseInt(crossobj.style.top)

		dragapproved=true
		document.onmousemove=drag_drop
		//alert(event.srcElement.id.toString().indexOf("dragbar_"));
	}
}


var fixedWidth = 500;
var resizeType = 1;

function resizeImage(thisimage) {
    if (resizeType == 0) fixedWidth = parseInt(screen.width/dynamicDivisor);
    if (thisimage.width > fixedWidth) {
		thisimage.width = fixedWidth;
		thisimage.style.cursor='pointer';
		thisimage.title='Click to enlarge';
	}
}

document.onmousedown=initializedrag;
document.onmouseup=new Function("dragapproved=false");


/*
// IMAGE RESIZE SCRIPT FROM WWW.TRAINS.COM
// =============================================================================
// Begin user defined variables
// =============================================================================
var resizeType = 1;      // 0 = Dynamically resize to a fraction of the users desktop
                         //     width divided by the dynamicDivisor variable below.
                         //     (i.e. 1024/4 = 256 or 1280/4 = 320)
                         // 1 = Resize the image if it is wider than the fixedWidth
                         //     variable below
var enlargeType = 0;     // 0 = Opens in the same window
                         // 1 = Opens in a new window
var fixedWidth = 350;    // Resize the image if it is wider than this many
                         // pixels. Only used when resizeType = 1.
var dynamicDivisor = 2;  // Resize images to users screen width divided by
                         // this number. Only used when resizeType = 0.
var alignClose = "left"; // Values are 'left' or 'right'. Default is right.
var topSpacing = 10;     // Spaces the pop-up window this number of pixels
                         // from the top of the window
var leftSpacing = 10;    // Spaces the pop-up window this number of pixels
                         // from the left of the window
// =============================================================================
// End of user defined variables
// =============================================================================

// =============================================================================
// Do not modify below this line
// =============================================================================
var ie=document.all
var ns=document.layers
var ns6=document.getElementById&&!document.all
var nsx,nsy,nstemp

function walkImages(){
    re = /^img/;
    if (document.images){
        for (a=0;a<document.images.length;a++){
          if (re.test(document.images[a].name)) resizeImage(document.images[a]);
        }
    }
}

function doimage(imgObj,event){
    if (document.images) enlargeimg(imgObj,event);
}

//Thumbnail image viewer-
//© Dynamic Drive (www.dynamicdrive.com)

function resizeImage(thisimage) {
    if (resizeType == 0) fixedWidth = parseInt(screen.width/dynamicDivisor);
    if (thisimage.width > fixedWidth) {
		thisimage.width = fixedWidth;
		thisimage.style.cursor='pointer';
		thisimage.title='Click to enlarge';
	}
}

function enlargeimg(which,e){
    if (resizeType == 0) fixedWidth = parseInt(screen.width/dynamicDivisor);
	if (which.width < fixedWidth) {return false;}
	if (enlargeType == 0) {
		if (ie||ns6){
			crossobj=document.getElementById? document.getElementById("showimage") : document.all.showimage
			if (crossobj.style.visibility=="hidden"){
				crossobj.style.left = (ns6? pageXOffset : document.body.scrollLeft) + leftSpacing
				crossobj.style.top  = (ns6? pageYOffset : document.body.scrollTop) + topSpacing
			    alignRE = /^left$/i
				crossobj.innerHTML= (alignRE.test(alignClose))? '<div class=tvborder><div class=tvhead align=left id=drag>&nbsp;<span class=tvclosex onClick=closepreview() style=cursor:pointer> X </span>&nbsp;<span class=tvclose onClick=closepreview()>Close</span> </div><img src="'+which.src+'"></div>' : '<div class=tvborder><div class=tvhead align=right id=drag> <span class=tvclose onClick=closepreview()>Close</span>&nbsp;<span class=tvclosex onClick=closepreview() style=cursor:pointer> X </span>&nbsp;</div><img src="'+which.src+'"></div>';
				crossobj.style.visibility="visible"
			}
			else
				crossobj.style.visibility="hidden"
				return false
		}
		else if (document.layers){
			if (document.showimage.visibility=="hide"){
				document.showimage.document.write('<a href="#" onMouseover="drag_dropns(showimage)"><img src="'+which.src+'" border=0></a>')
				document.showimage.document.close()
				document.showimage.left=e.x
				document.showimage.top=e.y
				document.showimage.visibility="show"
			}
			else
				document.showimage.visibility="hide"
				return false
		}
		else
		return true
	}
	else if (enlargeType == 1) {
		popupPic(which.src);
		// eval('window.open("showpic.asp?pic=' + which.src + '","","width='+which.width+'px,height='+which.height+'px,resizable=1,scrollbars=0")')
	}
}

function popupPic(imagepath) {
	var tmpImg = new Image();
	tmpImg.src = imagepath;
	var width = tmpImg.width;
	var height = tmpImg.height;
	if (document.all&&window.print) //if ie5
		//
		eval('window.showModalDialog(tmpImg.src,"","help:0;resizable:0;scroll:0;dialogWidth:'+width+'px;dialogHeight:'+height+'px")')
	else
		eval('window.open(tmpImg.src,"","width='+width+'px,height='+height+'px,resizable=0,scrollbars=0,left=10,top=10")')
}

function closepreview(){
	crossobj.style.visibility="hidden"
}

function drag_dropns(name){
	temp=eval(name)
	temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
	temp.onmousedown=gons
	temp.onmousemove=dragns
	temp.onmouseup=stopns
}

function gons(e){
	temp.captureEvents(Event.MOUSEMOVE)
	nsx=e.x
	nsy=e.y
}
function dragns(e){
	temp.moveBy(e.x-nsx,e.y-nsy)
	return false
}

function stopns(){
	temp.releaseEvents(Event.MOUSEMOVE)
}

function drag_drop(e){
	if (ie&&dragapproved){
	crossobj.style.left=tempx+event.clientX-offsetx
	crossobj.style.top=tempy+event.clientY-offsety
	}
	else if (ns6&&dragapproved){
	crossobj.style.left=tempx+e.clientX-offsetx
	crossobj.style.top=tempy+e.clientY-offsety
	}
	return false
}

function initializedrag(e){
	if (ie&&event.srcElement.id=="drag"||ns6&&e.target.id=="drag"){
	offsetx=ie? event.clientX : e.clientX
	offsety=ie? event.clientY : e.clientY

	tempx=parseInt(crossobj.style.left)
	tempy=parseInt(crossobj.style.top)

	dragapproved=true
	document.onmousemove=drag_drop
	}
}
*/
