function initadmin() {
	var menuItem = document.getElementById("menuitem_"+1);	
}


function gotoSect(sect){

	if(sect){
		this.location.href="default.asp?sect="+sect;
	}
}

function dogoto(url){

	if(url){
		this.location.href=url;
	}
}

function color(menuItem){
	menuItem.style.background = '#EEEEEE';
	menuItem.style.filter = "progid:DXImageTransform.Microsoft.Gradient(gradientType=1,startColorStr=#DDDDDD,endColorStr=#FFFFFF)";


}

function uncolor(menuItem){
	menuItem.style.background = '#FFFFFF';
	menuItem.style.filter = "progid:DXImageTransform.Microsoft.Gradient(gradientType=1,startColorStr=#FFFFFF,endColorStr=#FFFFFF)";
}

function xstandardSubmitHandler() {
	for(i=1;i<10;i++){
	if(document.getElementById('editor'+i)){
		document.getElementById('editor'+i).EscapeUnicode = true;
		document.getElementById('xhtml'+i).value = document.getElementById('editor'+i).value;
		}
	}
}

/* Client-side access to querystring name=value pairs
	Version 1.2.4
	30 March 2008
	Adam Vandenberg
*/
function Querystring(qstr) { // optionally pass a querystring to parse
	qs=qstr;
	this.params = {};
	this.get=Querystring_get;
	//alert('qstr:'+ qstr);
	if (qs == null);
		//alert('WTF? NULL?');
		//qs=location.search.substring(1,location.search.length);

	if (qs.length == 0) 
		return;

// Turn <plus> back to <space>
// See: http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.4.1
	qs = qs.replace(/\+/g, ' ');
	var args = qs.split('&'); // parse out name/value pairs separated via &

// split out each name=value pair
	for (var i=0;i<args.length;i++) {
		var pair = args[i].split('=');
		var name = unescape(pair[0]);
		
		var value = (pair.length==2)
			? unescape(pair[1])
			: name;
		
		this.params[name] = value;
	}
}

function Querystring_get(key, default_) {
	var value=this.params[key];
	return (value!=null) ? value : default_;
}





function showhideDiv(id) { 

	el = document.getElementById(id);
	var display = el.style.display ? 'block' : 'none';
	el.style.display = display;

	/*var divstate = 'hidden'; 
	
	if (divstate == 'visible') { 
	divstate = 'hidden';
	} 

	else { 
	divstate = 'visible'; 
	} 
	if (document.all) { //IS IE 4 or 5 (or 6 beta) 
	eval( "document.all." + layer_ref + ".style.visibility = divstate"); 
	eval( "document.all." + layer_ref + ".style.overflow = divstate"); 
	} 
	if (document.layers) { //IS NETSCAPE 4 or below 
	document.layers[layer_ref].visibility = divstate; 
	} 
	if (document.getElementById && !document.all) { 
	maxwell_smart = document.getElementById(layer_ref); 
	maxwell_smart.style.visibility = divstate; 
	} 
	*/
}

function parseForm(FormName){
	thisForm = document.forms["mailForm"];
	operation = thisForm.operation.value;
	
	switch(operation) {
	
		case "1"	: alert("1");break;
		case "sendmail"	:
				  mailing_id = thisForm.mailing_id[thisForm.mailing_id.selectedIndex].value;
				  sendto = radioValue(thisForm.sendto)
				  tomail = thisForm.tomail.value;
				  qstr = "mailer.asp?id=" +mailing_id + "&sendto=" + sendto + "&tomail=" + tomail;
				  document.intframe.location.href=qstr;
				  document.all.intframe.style.display = '';
				  //alert(qstr)
				  break;
		default		: break;
	}
	
}

function radioValue(radioButton)
{
    for (i = 0; i <= radioButton.length; i++)
    {
        if (radioButton[i].checked == true) return radioButton[i].value; 
    } 
         // if it didn't find anything, return the .value  (behaviour of single radio btn)
        return radioButton.value;
}

function validEmail(formvalue)
{
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(formvalue)){return true;}
	else { alert('S.v.p. een geldig emailadres opgeven.'); return false;}
}


