/***  
 *
 * Copyright: moreganize.ch 2008-2010, develed: S.Zuercher 
 *
 ***/


/*overlib including*/
var mge_overlib_content=null;
overlib

function overlibComment(text){
	overlib(text,true);
}
function overlib(text,comment){
	if(!text || text.length==0 || (document.readyState && document.readyState!="complete"))
		return true;
	if(mge_overlib_content)
		mge_overlib_content.parentNode.removeChild(mge_overlib_content);
	mge_overlib_content=document.createElement('div');
	mge_overlib_content.id='overDiv';
	mge_overlib_content.className='overDiv';

	mge_overlib_content['style']['zIndex']='9999';
	document['body'].appendChild(mge_overlib_content);
	mge_initBrowserType();

	mge_overlib_content['style']['left']="-40000px";
	mge_overlib_content['style']['width']="";
	if(text.length<=0)
		return nd();
	text=text.replace(/\n+$/g, '');
	text=text.replace(/\n/g,'<br />');
	text=text.replace(/\\"/g,'"');
	if(comment && comment==true){
		//mge_overlib_content.innerHTML=text+'<p style="height:1px;"></p>';
		mge_overlib_content.commentImg=new Image(23,13);
		mge_overlib_content.commentImg.className='comment-v';
		mge_overlib_content.commentImg.src='/template/default/img/todoCommentPoint.gif';
		mge_overlib_content.appendChild(mge_overlib_content.commentImg);
		mge_overlib_content.innerHTML=text+'<br />';
		mge_overlib_content.comment=true;
		mge_overlib_content.appendChild(mge_overlib_content.commentImg);
		mge_overlib_content.className='overDiv overDivComment';

	}
	else{
		mge_overlib_content.innerHTML=text;
		mge_overlib_content.comment=false;
		mge_overlib_content.className='overDiv';
	}
	if(document.addEventListener) 
		document.addEventListener("mousemove",mge_overlib_caputreEventFN,false);
	else
		document.attachEvent("onmousemove",mge_overlib_caputreEventFN);
	return true;
}
function nd(){
	if(mge_overlib_content)
		mge_overlib_content['style']['left']="-40000px";
	try{
		if(document.removeEventListener)
			document.removeEventListener("mousemove",mge_overlib_caputreEventFN,false);
		else
			document.detachEvent("onmousemove",mge_overlib_caputreEventFN);
	}
	catch(e){ x=1; }
	return true;
}
var mge_overlib_caputreEventFN=function overlib_caputreEvent(e){
	var maxWidth=280;
	var left = 0; 
	var top = 0;
	if(mge_overlib_content.offsetWidth>maxWidth)
		mge_overlib_content['style']['width']=maxWidth+"px";

	if (!e) 
		e = window.event;
	if (e.target) 
		el = e.target;
	else
		el = e.srcElement;
	if (el.nodeType == 3) 
		el = el.parentNode;
	var target = el;
	
	if(!mge_overlib_content.comment){
		if (e.pageX || e.pageY) {
			left = e.pageX;
			top = e.pageY;
		} 
		else {
			var de = document.documentElement;
			var b = document.body;
			left = e.clientX +(de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0);
			top = e.clientY + (de.scrollTop || b.scrollTop) - (de.clientTop || 0);
		}

		if(window.ie6){
			left+=15;
			top+=20;
		}
		else if(window.ie7){
			left+=13;
			top+=20;
		}
		else if(window.webkit){
			left+=13;
			top+=12;
		}
		else{
			left+=18;
			top+=10;
		}
		if(target.overAligneLeft==true){
			left-=mge_overlib_content.offsetWidth+15;
			top+=5;
		}
	}
	else{
		if(document.removeEventListener)
			document.removeEventListener("mousemove",mge_overlib_caputreEventFN,false);
		else
			document.detachEvent("onmousemove",mge_overlib_caputreEventFN);

		if(target.className.indexOf('todo')!=-1)
			var todo=true;
		else
			var todo=false;
		do {
			left += el.offsetLeft || 0;
			top += el.offsetTop || 0;
			el = el.offsetParent;
		} while (el);

		top-=mge_overlib_content.offsetHeight;

		if(window.ie6){
			top-=13;
			left-=2;
			if(todo)
				left-=48;
		}
		else if(window.ie7){
			left-=2;
			top-=12;
			if(todo)
				left+=3;
		}
		else if(window.webkit){
			left-=2;
			top-=13;
			if(todo)
				left+=3;
		}
		else{
			left-=4;
			top-=12;
			if(todo)
				left+=4;
		}
			
	}
	posx=left;
	posy=top;

	mge_overlib_content['style']['top']=posy+"px";
	mge_overlib_content['style']['left']=posx+"px";
	mge_overlib_content['style']['display']='block';
}
function mge_initBrowserType(){
	if (window.ActiveXObject) window.ie = window[window.XMLHttpRequest ? 'ie7' : 'ie6'] = true;
	else if (document.childNodes && !document.all && !navigator.taintEnabled) window.webkit = window[window.xpath ? 'webkit420' : 'webkit419'] = true;
	else if (document.getBoxObjectFor != null) window.gecko = true;
}



/* end overlib including*/



function mge_sfbn_onkeyDown(e,formName){
	if(e && e.which){
		e = e;
		characterCode = e.which;
	}
	else{
		e = event;
		characterCode = e.keyCode;
	}

	if(characterCode == 13){
		if(formName=='login')
			mge_doLogin();
		else
			mge_sfbn(formName);
	}
	else{
		return true
	}

}
function mge_langChooserToggle(){
	box = document.getElementById('mge_languageSelectBox');
	if(!box)
		return;
	if(box.isVisisble){
		box.isVisisble=false;
		box.style.display='none';
		if(document.body.removeEventListener)
			document.body.removeEventListener("mouseup",mge_langChooserToggle,false);
		else
			document.body.detachEvent("onmouseup",mge_langChooserToggle);
	}
	else{
		box.isVisisble=true;
		box.style.display='block';
		if(document.body.addEventListener)
			document.body.addEventListener("mouseup",mge_langChooserToggle,false);
		else
			document.body.attachEvent("onmouseup",mge_langChooserToggle);
	}

}
function mge_addBookmark(url,title){
	url=decodeURIComponent(url);
	title=decodeURIComponent(title);
	if (document.all)
		window.external.AddFavorite(url,title);
	else
		window.sidebar.addPanel(title,url,'');
}


function mge_check_date_selected(formname){
	var e = document.getElementById('seldate_1');

	if(e.value == 0){
		alert(mge_msg_select_date);
		return false;
	}
	if(formname.length > 0){
		form=document.forms[formname];
		form.action=form.action+"&date="+e.value;

		mge_sfbn(formname);
	}
	return true;
}

function mge_set_date(val){
	for(var i=1;i<=3;i++){
		var e = document.getElementById('seldate_'+i);
		if(e){
			e.value = val;
		}
	}

}

function showWerbungField(status){
	if(status){
		toggleById('activeeinst_picker',true);

	}else{
		document.getElementById('fromfield').innerHTML='';
		document.getElementById('tofield').innerHTML='';
		toggleById('activeeinst_picker',false);

		document.getElementById('from').value='';
		document.getElementById('to').value='';
	}


}

function toggleById(id,state){
	el = document.getElementById(id);
	if(el){
		if(state){
			el.style.display='block';
		}else{
			el.style.display='none';
		}


	}
}

function togglefiles(id,id2,stateon,stateoff){
	el = document.getElementById(id);
	el2 = document.getElementById(id2);
	if(el.style.display == 'block'){
		el.style.display='none';
		el2.innerHTML = stateon;
	}else{
		el.style.display='block';
		el2.innerHTML = stateoff;
	}
}


function toggleAdverts(id,state){

	toggleById(id,state);

	if(state){
		toggleById('events2',true);
		toggleById('events1',false);

	}else{
		toggleById('events2',false);
		toggleById('events1',true);
	}

}

function clk(b,c){
	    if (document.images) {
	    	a=(new Image).src='/werbung/ping.php?a='+b+'&c='+c;
	    }
	    return true;
}


function mge_set_hidden_value(mname,mvalue){
	e = document.getElementById(mname);
	if(e){
		e.value = mvalue;
	}
}



function mge_submit_form_by_name(formname,fieldname,value){

	mge_set_hidden_value(formname+'_'+fieldname,value);
	mge_sfbn(formname);
}
function mge_sfbn(name){

	document.forms[name].submit();
	
	//eval('document.'+name+'.submit();');
}


/**
 * Go back one step by adding a hidden field. Requires the
 * form to have a name and an id.
 * @author Kristoffer
 * @since 29.5.2007
 */
function mge_sfbbn(name, id) {
	var e = document.getElementById(id);
	var f;

	f = document.createElement('input');
	f.type = "hidden";
	f.name = "p_back";
	f.value = "1";

	e.appendChild(f);

	eval('document.'+name+'.submit();');
}


function mge_empty_value(id_name, def_val) {
		var el = document.getElementById(id_name);

		if(trim(el.value) == trim(def_val)) {
			document.getElementById(id_name).value = '';
			return true;
		}
		else {
			return false;
		}
}



function mge_verify_email(email) {
	var ret = false;
	var dot = false
	var i;

	if(email.length == 0) {
		return false;
	}
	for(i=0; i < email.length; i++) {
		if(email.charAt(i) == "@") {
			ret = true;
		}
	}
	return ret;
}


function mge_verify_email_strong(email) {
	var regexpp;

	// t@e.tl  -> at least 6 characters long.
	if(email.length <= 5) {
		return false;
	}
	var regexpp  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (regexpp.test(email)) {
		return true;
	}
	else {
		return false;
	}
}

function mge_verify_comment_form(){
	if(document.getElementById('comment_name').value == '' || document.getElementById('comment_box').value ==''){
		alert(mge_comment_error);
		return false;
	}else{
		return true;
	}
}

function mge_set_radio(id,name){
	var rf = document.getElementById(name+'_value');
	var imgs;
	var i;
	var co;

	if(!rf){return;}

	if(rf.value == id) {
		rf.value = '';
	}
	else {
		rf.value = id;
	}

	imgs = document.getElementsByTagName("img");
	// loop over the length of the forms in the document
	for(i=0;i<imgs.length;i++) {
		if(imgs[i].getAttribute("id").substr(0,name.length) == name){
			imgs[i].src = "/template/default/img/radio_off.gif";
		}
	}

	try {
		co = document.getElementById(name+'_'+rf.value);
	}
	catch (e) {
		co = false;
	}
	if(co){
		co.src="/template/default/img/radio_on.gif";
	}
}




function init_checkboxes() {
	so_checkCanCreate();
}

function so_checkCanCreate() {

	// make sure the browser has images turned on. If they are, so_createCustomCheckBoxes will
	// fire when this small test image loads. otherwise, the user will get the hard-coded checkboxes
	testImage = document.body.appendChild(document.createElement("img"));

	// MSIE will cache the test image, causing it to not fire the onload event the next time the
	// page is hit. The parameter on the end will prevent this.
	testImage.src = "/template/default/img/blank.gif?" + new Date().valueOf();
	testImage.id = "so_testImage";
	try {
		testImage.onload = so_createCustomCheckBoxes();
	}
	catch (e) {
		testImage.onload = so_createCustomCheckBoxes;
	}
}

function so_createCustomCheckBoxes() {


	// bail out is this is an older browser
	if(!document.getElementById)return;
	// remove our test image from the DOM
	//document.body.removeChild(document.getElementById("so_testImage"));
	// an array of applicable events that we'll need to carry over to our custom checkbox
	events = new Array("onfocus", "onblur", "onselect", "onchange", "onclick", "ondblclick", "onmousedown", "onmouseup", "onmouseover", "onmousemove", "onmouseout", "onkeypress", "onkeydown", "onkeyup");
	// a reference var to all the forms in the document

	frm = document.getElementsByTagName("form");
	// loop over the length of the forms in the document
	for(i=0;i<frm.length;i++) {
		// reference to the elements of the form
		c = frm[i].elements;
		// loop over the length of those elements
		for(j=0;j<c.length;j++) {
			// if this element is a checkbox, do our thing

			if(c[j].getAttribute("type") == "checkbox" && c[j].style.left != "-9000px" &&
				c[j].name.substr(0,5)!="nobox"
				) {
				// hide the original checkbox
				c[j].style.position = "absolute";
				c[j].style.left = "-9000px";
				// create the replacement image
				n = document.createElement("img");
				n.setAttribute("class","chk");
				n.style.cursor='pointer';
				n.setAttribute('id', c[j].getAttribute('id'));
				// check if the corresponding checkbox is checked or not. set the
				// status of the image accordingly
				if(c[j].checked == false) {
					n.setAttribute("src","/template/default/img/checkbox_off.gif");
					n.setAttribute("title",image_title_on);
					n.setAttribute("alt",image_title_on);
				} else {
					var el=document.getElementById("radio_"+n.id.substring(6));

					if(el){
						if(el.checked == true){
							n.setAttribute("src","/template/default/img/checkbox_pref.gif");
							pref = 	n.id.substring(6);
						}else{
							n.setAttribute("src","/template/default/img/checkbox_on.gif");
						}
					}
					n.setAttribute("title",image_title_off);
					n.setAttribute("alt",image_title_off);
				}
				// there are several pieces of data we'll need to know later.
				// assign them as attributes of the image we've created
				// first - the name of the corresponding checkbox
				n.xid = c[j].getAttribute("name");
				// next, the index of the FORM element so we'll know which form object to access later

				n.frmIndex = i;
				// assign the onclick event to the image

				if(c[j].id.substr(0,5)=='check'){
					n.setAttribute('id',c[j].id.substr(6));
					n.onclick = function() {  so_toggleCheckBox(this,0); mge_toggle( this.id ); return false; }
				}else{
					n.onclick = function() { so_toggleCheckBox(this,0);return false; }
				}
				// insert the image into the DOM
				c[j].parentNode.insertBefore(n,c[j].nextSibling)
				// this attribute is a bit of a hack - we need to know in the event of a label click (for browsers that support it)
				// which image we need turn on or off. So, we set the image as an attribute!
				c[j].objRef = n;
				// assign the checkbox objects event handlers to its replacement image
				for(e=0;e<events.length;e++) if(eval('c[j].' +events[e])) eval('n.' + events[e] + '= c[j].' + events[e]);
				// append our onchange event handler to any existing ones.
				fn = c[j].onchange;
				if(typeof(fn) == "function") {
					c[j].onchange = function() { fn(); so_toggleCheckBox(this.objRef,1); return false; }
				} else {
					c[j].onchange = function () { so_toggleCheckBox(this.objRef,1); return false; }
				}
			}
		}
	}
}
var pref = false;
var remove_radio = false;
function mge_unset_radio(rid){

	var el=document.getElementById("radio_"+rid);

	if(el){
		if(el.checked == true){
			remove_radio = true;

		}else{
			remove_radio = false
		}
	}
}

function mge_set_check(rid){
	// new function that allows multiple checked preferences
	var el=document.getElementById("radio_"+rid);
	var a = el.id;
	var el2 = document.getElementById(a.substring(6));
	if(el2){
		if(el.checked == true ){
			el2.setAttribute("src","/template/default/img/checkbox_pref.gif");
		}else{
			el2.setAttribute("src","/template/default/img/checkbox_on.gif");
		}
	}
}


function mge_unset_radio2(rid){
	var el=document.getElementById("radio_"+rid);
	//debugger;
	if(el){
			if(remove_radio==true){
				el.checked = false;
				if(el.id.substring(6) == pref){
					var el3 =  document.getElementById(pref);
					el3.setAttribute("src","/template/default/img/checkbox_on.gif");
					pref = false;
				}
			}
	}
	if(el.checked == true ){
		var a = el.id;
		var el2 = document.getElementById(a.substring(6));
		if(el2){
			el2.setAttribute("src","/template/default/img/checkbox_pref.gif");
			if(pref){
				var el3 =  document.getElementById(pref);
				el3.setAttribute("src","/template/default/img/checkbox_on.gif");
			}
			pref = a.substring(6);
		}

	}
}

function so_toggleCheckBox(imgObj,caller) {





	// if caller is 1, this method has been called from the onchange event of the checkbox, which means
	// the user has clicked the label element. Dont change the checked status of the checkbox in this instance
	// or we'll set it to the opposite of what the user wants. caller is 0 if coming from the onclick event of the image

	// reference to the form object
	formObj = document.forms[imgObj.frmIndex];
	// the name of the checkbox we're changing
	objName = imgObj.xid;
	// change the checked status of the checkbox if coming from the onclick of the image
	if(!caller)formObj.elements[objName].checked = !formObj.elements[objName].checked?true:false;
	// finally, update the image to reflect the current state of the checkbox.
	if(imgObj.src.indexOf("/template/default/img/checkbox_on.gif")>-1 ||
		imgObj.src.indexOf("/template/default/img/checkbox_pref.gif")>-1
	) {
		imgObj.setAttribute("src","/template/default/img/checkbox_off.gif");
		imgObj.setAttribute("title",image_title_on);
		imgObj.setAttribute("alt",image_title_on);
	} else {
		imgObj.setAttribute("src","/template/default/img/checkbox_on.gif");
		imgObj.setAttribute("title",image_title_off);
		imgObj.setAttribute("alt",image_title_off);
		if(imgObj.id == pref){
			pref = false;
		}
	}
}


	/**
	 * add the onclick to an object
	 * just because we've got IE7 (and IE6)
	 * there's some special fun
	 */
	function mge_add_onclick(mObject,mString){
		try {
			mObject.onclick = new Function(mString);
		}
		catch (e) {
			mObject.removeAttribute('onclick');
			mObject.setAttribute('onclick', mString);
		}
	}

	/**
	 * add the onclick to an object
	 * just because we've got IE7 (and IE6)
	 * there's some special fun
	 */
	function mge_add_onchange(mObject,mString){
		try {
			mObject.onchange = new Function(mString);
		}
		catch (e) {
			mObject.removeAttribute('onchange');
			mObject.setAttribute('onchange', mString);
		}
	}

	/**
	 * add the onclick to an object
	 * just because we've got IE7 (and IE6)
	 * there's some special fun
	 */
	function mge_add_onkeyup(mObject,mString){
		try {
			mObject.onkeyup = new Function(mString);
		}
		catch (e) {
			mObject.removeAttribute('onkeyup');
			mObject.setAttribute('onkeyup', mString);
		}
	}

	/**
	 * Returns the max value of an array
	 * @author Kristoffer
	 */
	function mge_array_max(ia) {
		var i;
		var j = 0;

		for(i = 0; i < ia.length; i++) {
			j = ia[i] > j ? ia[i] : j;
		}

		return j;
	}



	function trim(s)
	{
		return s.replace(/^\s+|\s+$/g,'');
	}

	function ltrim(s)
	{
		var l=0;
		while(l < s.length && s[l] == ' ')
		{	l++; }
		return s.substring(l, s.length);
	}

	function rtrim(s)
	{
		var r=s.length -1;
		while(r > 0 && s[r] == ' ')
		{	r-=1;	}
		return s.substring(0, r+1);
	}

function mge_validate_feedback() {

		var name = document.getElementById('gen_sender');
		var email = document.getElementById('gen_email');
		var text = document.getElementById('genInv_text');
		var err_field = new Array();
		var i = 0;
		var returnv = true;


		if(text.value == '') {
			err_field[i] =  feedback_error;
			text.style.backgroundColor = 'orange';
			i++;
			returnv = false;
		}
		else {
			text.style.backgroundColor = 'white';
		}

		if(i>0){
			var alert_msg = '';
			for( var j = 0; j<i; j++){

				alert_msg = alert_msg + err_field[j]+"\n";
			}
			alert(alert_msg);
		}

		if(returnv){
			mge_sfbn('sendmail');
		}
	}

var my_popup = null;
function showPopup(url){

		my_popup = window.open(url,'','menubar=no,location=no,width=900,height=600,left=120,top=10,scrollbars=yes,resizable=yes');
}

function showPopup2(url){
		my_popup = window.open(url,'','menubar=no,location=no,width=300,height=600,left=120,top=10,scrollbars=yes,resizable=yes');
}
function mge_setElHeight(id,height){
	var el=document.getElementById(id);
	if(el)
		el.style.height=height+'px';
}
function mge_logginToggle(e){
	box = document.getElementById('loginBox');
	if(!box)
		return;
	if(box.isVisisble || box.style.display!='none'){
		t=e.target || e.srcElement;
		if(t && t.id!='clossingX' && ( t.id=='loginBox' || t.parentNode.id=='loginBox' || t.parentNode.parentNode.id=='loginBox'
		|| t.className=='ButtonBoxTextGrey' || t.id=='loginBoxIE7' || t.parentNode.id=='loginBoxIE7' || t.parentNode.parentNode.id=='loginBoxIE7'))
			return;
		box.isVisisble=false;
		box.style.display='none';
		if(document.body.removeEventListener)
			document.body.removeEventListener("mouseup",mge_logginToggle,false);
		else
			document.body.detachEvent("onmouseup",mge_logginToggle);
	}
	else{
		box.isVisisble=true;
		box.style.display='block';
		document.getElementById('loginBoxUsername').focus();
		document.getElementById('loginBoxUsername').select();
		if(document.body.addEventListener)
			document.body.addEventListener("mouseup",mge_logginToggle,false);
		else
			document.body.attachEvent("onmouseup",mge_logginToggle);
	}

}
function mge_doLogin(){
	var langForm=document.forms['lang_form'];
	var logginForm=document.forms['loggin_form'];
	if(!langForm || !logginForm)
		return;
	if(document.getElementById('loginBoxUsername').value==''){
		document.getElementById('loginBoxUsername').focus();
		return;
	}
	if(document.getElementById('loginBoxPasswd').value==''){
		document.getElementById('loginBoxPasswd').focus();
		return;
	}
	for(i=langForm.childNodes.length;i>=0;i--){
		el=langForm.childNodes[i];
		if(!el || el.nodeName!='INPUT' || el.type!=='hidden')
			continue;
		logginForm.appendChild(el.cloneNode(false));
	}
	logginForm.action=langForm.action;
	logginForm.submit();
}
function noteDate(){
	form=document.forms.sendNote;
	for(x=0;x<form.elements.length;x++){
		if(form.elements[x].type && form.elements[x].type=='checkbox')
			if(form.elements[x].checked)
				return mge_sfbn('sendNote');
	}
	alert(selectErrorMSG);
	
}
// Social bookmarking
var social_is_over = 0;
var social_over_delay = 300;
var social_out_delay = 100;
var social_el=null;

function showContent(){
	if(!social_el)
		social_el=document.getElementById('socialBookmarkContent');

	if(social_is_over==0)
		social_el.style.display='none';
	else{
		social_el.style.display='block';
		//window.scrollBy(0,1000);
	}
}

function link_over(){
	social_is_over|=1;
	self.setTimeout('showContent()',social_over_delay);
}
function link_out(){
	social_is_over^=1;
	self.setTimeout('showContent()',social_out_delay);
}
function content_over(){
	social_is_over|=2;
}
function content_out(){
	social_is_over^=2;
	self.setTimeout('showContent()',social_out_delay);
}
function mge_sendFinalMail(formname,elName,adminId,alertMsg){
		var form=document.forms[formname]
		var els=form[elName];
		if(!els.length && els.checked){
			form.action='/page/mail/final.html?'+adminId;
			return form.submit();
		}
		for(i=els.length-1;i>=0;i--){
			if(els[i].type=="checkbox" && els[i].checked==true){
				form.action='/page/mail/final.html?'+adminId;
				return form.submit();
			}
		}
		alert(alertMsg);
}

function mge_sfbn_addField(form,elName,elVal){
	var el=form[elName];
	if(typeof el == 'undefined'){
		el = document.createElement('input');el.name=elName;
		form.appendChild(el);
	}
	el.value=elVal;
	form.submit();
}
function mge_sfb2page(formname,page){
		var form=document.forms[formname];
		form.action='/page/'+page;
		if(form.id)
			form.action+='?'+form.id.value;
		form.submit();
}
function mge_printSelection(){
	form = document.forms['print'];
	url='/page/print.html?'+form.id.value;
	els=form['seldate[]'];
	for(i=0;i<els.length;i++){
		if(els[i].checked)
			url+='&seldate[]='+els[i].value;
	}
	window.open(url,'printWindow_'+form.id.value,'width=900,height=800,left=100,top=200').focus();
}
function removeFromLogin(id){
	if(document.mge_removeFromLoginDialog && !confirm(document.mge_removeFromLoginDialog))
		return;
	document.location.href='/page/removeFromLogin.html?'+id;
}
function mge_adminMenueActionCheckSelection(form,alertMsg){
	els=form['selection[]'];
	if(!els.length && els.checked)
		return form.submit();
	for(i=0;i<els.length;i++){
		if(els[i].checked)
			return form.submit();
	}
	alert(alertMsg);
}
function addUrl2Fb(url){
	window.open(url,'fb_url_add','width=650,height=350,left=100,top=200').focus();
}

