function CheckFormRates() {

	if(document.form_edit_rates.xp.options[0].selected){
		alert("You did not select an Exp Rate.");
		return false;
	}
	if(document.form_edit_rates.sp.options[0].selected){
		alert("You did not select a Skill Point Rate.");
		return false;
	}
	if(document.form_edit_rates.drop.options[0].selected){
		alert("You did not select a Drop Rate.");
		return false;
	}
	if(document.form_edit_rates.adena.options[0].selected){
		alert("You did not select an Adena Rate.");
		return false;
	}
	if(document.form_edit_rates.safe_ench.options[0].selected){
		alert("You did not select a Safe Enchant Level.");
		return false;
	}
	if(document.form_edit_rates.max_ench.options[0].selected){
		alert("You did not select a Max Enchant Level.");
		return false;
	}
		
	return true;

}


function limitText(limitField, limitCount, limitNum) {



	if (limitField.value.length > limitNum) {

		limitField.value = limitField.value.substring(0, limitNum);



	} else {

		limitCount.value = limitNum - limitField.value.length;

	}

}


function CheckForm() {

	if(document.form_comment.s_stability.options[0].selected){
		alert("You did not select a rating for Server Stability.");
		return false;
	}
	if(document.form_comment.s_availability.options[0].selected){
		alert("You did not select a rating for Server Availability.");
		return false;
	}
	if(document.form_comment.c_friend.options[0].selected){
		alert("You did not select a rating for Community Friendliness.");
		return false;
	}
	if(document.form_comment.c_event.options[0].selected){
		alert("You did not select a rating for Community Eventfulness.");
		return false;
	}
	if(document.form_comment.gm_rating.options[0].selected){
		alert("You did not select a rating for Game Master Friendliness.");
		return false;
	}
	if(document.form_comment.gm_avail.options[0].selected){
		alert("You did not select a rating for Game Master Availability.");
		return false;
	}
	if(document.form_comment.gm_help.options[0].selected){
		alert("You did not select a rating for Game Master Helpfulness.");
		return false;
	}
	if(document.form_comment.g_eco.options[0].selected){
		alert("You did not select a rating for Game Play Economy.");
		return false;
	}
	if(document.form_comment.g_sieges.options[0].selected){
		alert("You did not select a rating for Game Play Sieges.");
		return false;
	}
	if(document.form_comment.g_class.options[0].selected){
		alert("You did not select a rating for Game Play Class Balance.");
		return false;
	}
	if(document.form_comment.comments.value.length > 350){
		alert("Comments must be less than or equal to 350 characters.");
		return false;
	}
	if(document.form_comment.comments.value.length < 60){
		alert("Comments is blank or too short.");
		return false;
	}
	if(document.form_comment.playing.options[0].selected){
		alert("You did not select the time interval you played on this server.");
		return false;
	}
	
	return true;

}



var enablepersist="on" //Enable saving state of content structure using session cookies? (on/off)
var collapseprevious="no" //Collapse previously open content when opening present? (yes/no)

if (document.getElementById){
document.write('<style type="text/css">')
document.write('.switchcontent{display:none;}')
document.write('</style>')
}

function getElementbyClass(classname){
ccollect=new Array()
var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
ccollect[inc++]=alltags[i]
}
}

function contractcontent(omit){
var inc=0
while (ccollect[inc]){
if (ccollect[inc].id!=omit)
ccollect[inc].style.display="none"
inc++
}
}

function expandcontent(cid){
if (typeof ccollect!="undefined"){
if (collapseprevious=="yes")
contractcontent(cid)
document.getElementById(cid).style.display=(document.getElementById(cid).style.display!="block")? "block" : "none"
}
}

function revivecontent(){
contractcontent("omitnothing")
selectedItem=getselectedItem()
selectedComponents=selectedItem.split("|")
for (i=0; i<selectedComponents.length-1; i++)
document.getElementById(selectedComponents[i]).style.display="block"
}

function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function getselectedItem(){
if (get_cookie(window.location.pathname) != ""){
selectedItem=get_cookie(window.location.pathname)
return selectedItem
}
else
return ""
}

function saveswitchstate(){
var inc=0, selectedItem=""
while (ccollect[inc]){
if (ccollect[inc].style.display=="block")
selectedItem+=ccollect[inc].id+"|"
inc++
}

document.cookie=window.location.pathname+"="+selectedItem
}

function do_onload(){
uniqueidn=window.location.pathname+"firsttimeload"
getElementbyClass("switchcontent")
if (enablepersist=="on" && typeof ccollect!="undefined"){
document.cookie=(get_cookie(uniqueidn)=="")? uniqueidn+"=1" : uniqueidn+"=0" 
firsttimeload=(get_cookie(uniqueidn)==1)? 1 : 0 //check if this is 1st page load
if (!firsttimeload)
revivecontent()
}
}


if (window.addEventListener)
window.addEventListener("load", do_onload, false)
else if (window.attachEvent)
window.attachEvent("onload", do_onload)
else if (document.getElementById)
window.onload=do_onload

if (enablepersist=="on" && document.getElementById)
window.onunload=saveswitchstate

//sdfsdfsd
function QuickJump(Formular)
{
	var Element = Formular.Ziel.selectedIndex;
	if (Formular.Ziel.options[Element].value != 0) 
	{
		location = Formular.Ziel.options[Element].value;
	}	
}

function bookmarksite(title, url){
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, "")
}


function confirmSubmit()
{
var agree=confirm("Are you sure you want this ?");
if (agree)
        return true ;
else
        return false ;
}



//Specify highlight behavior. "TD" to highlight table cells, "TR" to highlight the entire row:
var highlightbehavior="TR"

var ns6=document.getElementById&&!document.all
var ie=document.all

function changeto(e,highlightcolor){
source=ie? event.srcElement : e.target
if (source.tagName=="TABLE")
return
while(source.tagName!=highlightbehavior && source.tagName!="HTML")
source=ns6? source.parentNode : source.parentElement
if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
source.style.backgroundColor=highlightcolor
}

function contains_ns6(master, slave) { //check if slave is contained by master
while (slave.parentNode)
if ((slave = slave.parentNode) == master)
return true;
return false;
}

function changeback(e,originalcolor){
if (ie&&(event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")||source.tagName=="TABLE")
return
else if (ns6&&(contains_ns6(source, e.relatedTarget)||source.id=="ignore"))
return
if (ie&&event.toElement!=source||ns6&&e.relatedTarget!=source)
source.style.backgroundColor=originalcolor
}

