var editBox;var openTags = new Array();function toggledivmain(url){		var img = document.getElementById('popupIMG');	var div = document.getElementById('popupDIV');	var bg = document.getElementById('bg');	var cont = document.getElementById('container');		var winHeight;	var winWidth;		if(window.innerHeight)	{		winHeight = window.innerHeight;		winWidth = window.innerWidth;	}	else	{		winHeight = document.body.clientHeight; 		winWidth = document.body.clientWidth; 	}	if(cont.style.display == "none")	{		cont.style.display = "block";		bg.style.display = "block";	}		img.src = url;		pauseScript(50);	//div.style.width = img.width + "px";	div.style.height = img.height + 16;		div.style.position = "absolute";	div.style.left = "50%";	div.style.top = "50%";	pauseScript(50);	div.style.marginLeft = (-1 * (img.width / 2)) + "px";	div.style.marginTop = (-1 * (img.height / 2)) + "px";		if(typeof(document.getElementById('theVideo')) != "undefined")	{		document.getElementById('theVideo').style.visibility = 'hidden';	}	}function toggledivmain2(url, left, top){		var img = document.getElementById('popupIMG');	var div = document.getElementById('popupDIV');	var bg = document.getElementById('bg');	var cont = document.getElementById('container');		var winHeight;	var winWidth;		if(window.innerHeight)	{		winHeight = window.innerHeight;		winWidth = window.innerWidth;	}	else	{		winHeight = document.body.clientHeight; 		winWidth = document.body.clientWidth; 	}	if(cont.style.display == "none")	{		cont.style.display = "block";		bg.style.display = "block";	}		img.src = url;	pauseScript(50);	div.style.height = img.height + 16;		div.style.position = "absolute";	div.style.left = "50%";	div.style.top = "50%";	div.style.marginLeft = (-1 * left) + "px";	div.style.marginTop = (-1 * top) + "px";		if(document.getElementById('theVideo'))	{		document.getElementById('theVideo').style.visibility = 'hidden';	}}function hidediv(url){	var img = document.getElementById('popupIMG');	var cont = document.getElementById('container');	var bg = document.getElementById('bg');		img.src = "";	cont.style.display = "none";	bg.style.display = "none";		if(typeof(document.getElementById('theVideo')) != "undefined")	{		document.getElementById('theVideo').style.visibility = 'visible';	}}function showlayer(layer){	var navLayer = document.getElementById(layer);		if(navLayer.style.display=="none" || navLayer.style.display=="")	{		navLayer.style.display="block";	} 	else 	{		navLayer.style.display="none";	}}function confirmSubmit(){var agree=confirm("Are you sure you wish to continue?");if (agree)	return true ;else	return false ;}function changeTitle(title) { 	document.title = title; }function redirect(url){	window.location = url;}function pauseScript(millis){	var date = new Date();	var curDate = null;	do 	{ 		curDate = new Date(); 	} while(curDate-date < millis);} function testYoutube(){	vidurl = 'testvideo.php?url=' + document.getElementById('videolink').value;	window.open(vidurl, 'dummyname', 'height=360,width=440,location=0,toolbar=0,menubar=0,directories=0,status=0,resizable=0,scrollbars=0', false);}function addtag(theform){	var tagindex = theform.taglist.selectedIndex;	var tagstring = theform.taglist.options[tagindex].value;		if(theform.tagtext.value.charAt(theform.tagtext.value.length - 1) == ' ')	{		theform.tagtext.value += tagstring;	}	else	{		theform.tagtext.value += ' ' + tagstring;	}}function limitText(element,maxlength){	if(element.value.length > maxlength)		element.value = element.value.substr(0,maxlength);}function createStyle(type, element, button){	if(inArray(openTags, type) == -1)	{		if(type == 'bold')		{			element.value += "[b]";			openTags.push(type);			button.className = 'bbbutton_hover';		}		else if(type == 'italic')		{			element.value += "[i]";			openTags.push(type);			button.className = 'bbbutton_hover';					}		else if(type == 'underline')		{			element.value += "[u]";			openTags.push(type);			button.className = 'bbbutton_hover';		}		else if(type == 'center')		{			element.value += "[center]";			openTags.push(type);			button.className = 'bbbutton_hover';		}		else if(type == 'link')		{			var string = prompt("Please enter the URL want to link to (i.e.: http://www.somewebsite.com)",'');						if(string != '' && string != null && string != 'null')			{				element.value += "[url=" + string + "]";				openTags.push(type);				button.className = 'bbbutton_hover';			}		}		else if(type == 'image')		{			var string = prompt("Please enter the image's URL want to show (i.e.: http://www.somewebsite.com/someimage.jpg)",'');			if(string != '' && string != null)				element.value += "[img]" + string + "[/img]";		}		else if(type == 'list')		{			var toPrint = "[list]\n";			var string = prompt("Please enter the item (nothing or cancel ends the tag)",'');						while(string != '' && string != null)			{				toPrint += '[*]' + string + '\n';				var string = prompt("Please enter the item (nothing or cancel ends the tag)",'');			}						toPrint += '[/list]';						if(toPrint != '[list]\n[/list]')				element.value += toPrint;		}			}	else	{		if(type == 'bold')			element.value += '[/b]';		else if(type == 'italic')			element.value += '[/i]';		else if(type == 'underline')			element.value += '[/u]';		else if(type == 'center')			element.value += '[/center]';		else if(type == 'link')			element.value += '[/url]';					openTags.splice(inArray(openTags, type), 1);		button.className = 'bbbutton';	}		element.focus();	element.setSelectionRange(element.value.length,element.value.length);	element.scrollTop = 9999;}function popupBox(boxtype, element, fromButton){	if(inArray(openTags, fromButton.name) == -1)	{		if(document.getElementById(boxtype).style.display != 'block')		{			closePopupBoxes();					var obj = fromButton;			var curleft = 0;			if(obj.offsetParent)				while(1) 				{				  curleft += obj.offsetLeft;				  if(!obj.offsetParent)					break;				  obj = obj.offsetParent;				}			else if(obj.x)				curleft += obj.x;							var obj = fromButton;			var curtop = 0;			if(obj.offsetParent)				while(1)				{				  curtop += obj.offsetTop;				  if(!obj.offsetParent)					break;				  obj = obj.offsetParent;				}			else if(obj.y)				curtop += obj.y;							document.getElementById(boxtype).style.top = (curtop + 25) + "px";			document.getElementById(boxtype).style.left = (curleft - 22) + "px";			document.getElementById(boxtype).style.display = "block";		}		else		{			document.getElementById(boxtype).style.display = "none";			element.focus();			element.setSelectionRange(element.value.length,element.value.length);			element.scrollTop = 9999;		}	}	else	{		element.value += "[/" + fromButton.name + "]";		openTags.splice(inArray(openTags, fromButton.name), 1);		fromButton.className = 'bbbutton';		element.focus();		element.setSelectionRange(element.value.length,element.value.length);		element.scrollTop = 9999;	}}function closePopupBoxes(){	document.getElementById('colorbox').style.display = "none";	document.getElementById('fontbox').style.display = "none";	document.getElementById('sizebox').style.display = "none";	document.getElementById('smiliebox').style.display = "none";}function addColor(colorVal){	editBox.value += "[color=" + colorVal + "]";	document.getElementById('colorbox').style.display = "none";	editBox.form.color.className = 'bbbutton_hover';	openTags.push('color');	editBox.focus();	editBox.setSelectionRange(editBox.value.length,editBox.value.length);	editBox.scrollTop = 9999;}function addResize(sizeVal){	editBox.value += "[size=" + sizeVal + "]";	document.getElementById('sizebox').style.display = "none";	editBox.form.size.className = 'bbbutton_hover';	openTags.push('size');	editBox.focus();	editBox.setSelectionRange(editBox.value.length,editBox.value.length);	editBox.scrollTop = 9999;}function addFont(fontVal){	editBox.value += "[font=" + fontVal + "]";	document.getElementById('fontbox').style.display = "none";	editBox.form.font.className = 'bbbutton_hover';	openTags.push('font');	editBox.focus();	editBox.setSelectionRange(editBox.value.length,editBox.value.length);	editBox.scrollTop = 9999;}function addSmilie(smilie){	editBox.value += smilie;			document.getElementById('smiliebox').style.display = "none";	editBox.focus();	editBox.setSelectionRange(editBox.value.length,editBox.value.length);	editBox.scrollTop = 9999;}function closeTags(element){	for(var i = openTags.length - 1; i >= 0; i--)	{		if(openTags[i] == 'bold')		{			element.value += '[/b]';			element.form.bold.className = "bbbutton";		}		else if(openTags[i] == 'italic')		{			element.value += '[/i]';			element.form.italic.className = "bbbutton";		}		else if(openTags[i] == 'underline')		{			element.value += '[/u]';			element.form.underline.className = "bbbutton";		}		else if(openTags[i] == 'center')		{			element.value += '[/center]';			element.form.center.className = "bbbutton";		}		else if(openTags[i] == 'font')		{			element.value += '[/font]';			element.form.font.className = "bbbutton";		}		else if(openTags[i] == 'color')		{			element.value += '[/color]';			element.form.color.className = "bbbutton";		}		else if(openTags[i] == 'size')		{			element.value += '[/size]';			element.form.size.className = "bbbutton";		}		else if(openTags[i] == 'link')		{			element.value += '[/url]';			element.form.link.className = "bbbutton";		}				openTags.splice(i,1);	}		element.focus();	element.setSelectionRange(element.value.length,element.value.length);	element.scrollTop = 9999;}function showLength(maxLength, limitingElement, displayElement){	displayElement.value = maxLength - limitingElement.value.length;}function checkForm(theForm){if(typeof(theForm.description) != "undefined")	if(theForm.description.value == '')	{		alert('Please enter a description!');		return false;	}	if(typeof(theForm.title) != "undefined")	if(theForm.title.value == '')	{		alert('Please enter a title!');		return false;	}	if(typeof(theForm.tagtext) != "undefined")	if(theForm.tagtext.value == '')	{		alert('Please enter tags!');		return false;	}if(typeof(theForm.caption) != "undefined")	if(theForm.caption.value == '')	{		alert('Please enter a caption!');		return false;	}	if(typeof(theForm.comment) != "undefined")	if(theForm.comment.value == '')	{		alert('Please enter a comment!');		return false;	}}function inArray(toSearch, element){	for(var i = 0; i < toSearch.length; i++)	{		if(toSearch[i] == element)			return i;	}	return -1;}function subForm(theform){	alert('test');	theform.form.Submit.disabled = true;	theform.form.Submit.className = "disButton";	this.form.submit();}function disableButton(itema){	itema.Submit.value = 'Posted';	itema.Submit.disabled = true;	itema.Submit.className = "disButton";}function submitForm(theForm){	alert('test');	theForm.Submit.disabled = true;	theForm.Submit.value = "Posted";	theForm.submit();}function finishDisable(itema){	itema.form.Submit.disabled = true;}document.onkeyup = checkkeys;var keys = new Array();function checkkeys(e){	//alert('test');   var KeyID = (window.event) ? event.keyCode : e.keyCode;      switch(KeyID)   {      case 37:		  //document.Form1.KeyName.value = "Arrow Left";		  keys.unshift('left');		  break;      case 38:		  //document.Form1.KeyName.value = "Arrow Up";		  keys.unshift('up');		  break;      case 39:		  //document.Form1.KeyName.value = "Arrow Right";		  keys.unshift('right');		  break;      case 40:		  //document.Form1.KeyName.value = "Arrow Down";		  keys.unshift('down');		  break;	}	if(keys.length == 4)	{		var str = keys.join(' ');		if(str == 'left down left up')		{			toggledivmain2('images/cheeseforce.jpg', 200, 60);		}				keys.pop();	}}