
function checkUncheckAll(theElement) 
{
    arrElmts = theElement.form.elements;
    for(e = 0; e < arrElmts.length; ++e)
        {
            if(arrElmts[e].type == 'checkbox' && arrElmts[e] != theElement)
                {
                    arrElmts[e].checked = theElement.checked
                }
        }
}



function popUp1(wintype)
{
  var nwl = (screen.width-500)/2;
  var nwh = (screen.height-600)/2;
  popUp=window.open(wintype, 'detail', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=500,height=600,left='+nwl+',top='+nwh+''); 
}
function popUp2(w,h,url){
  MeinFenster = window.open(url, "Hilfsfenster", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=" + w + ",height=" + h + ",scrollbars=yes");
  MeinFenster.focus();
}





function pushimage(bildid,type,uid){
	var ajaxRequest;  
	try{
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				alert("Your browser broke!");
				return false;
			}
		}
	}
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			document.getElementById('imageboxresponse').innerHTML = ajaxRequest.responseText;
		}
	}
	ajaxRequest.open("GET", "imagevote.php?id=" + bildid + "&type="+ type +"&uid=" + uid, true);
	ajaxRequest.send(null); 
}




tinyMCE.init({
	mode : "textareas",
	document_base_url : "http://www.y-treff.de/", 
	theme : "advanced",
	language : "de", 
	//extended_valid_elements : "iframe[src|width|height],object[width|height],param[movie|allowFullScreen|allowscriptaccess],embed[src|type|width|height|allowScriptAccess|allowFullScreen]",
	plugins : "imgmap,tinyautosave,save,safari,advimage,advlink,emotions,media,contextmenu,paste,fullscreen",
	theme_advanced_buttons1 : "imgmap,tinyautosave,bold,italic,underline,strikethrough,pasteword,bullist,numlist,outdent,indent,link,unlink,image,cleanup,hr,emotions,media,code,fullscreen",
	theme_advanced_buttons2 : "",
	theme_advanced_buttons3 : "",
	theme_advanced_buttons4 : "",
        theme_advanced_toolbar_location : "top",
        theme_advanced_toolbar_align : "left",
        theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing : true,
		content_css : "/default.css",
	editor_selector : "tiny"
}); 



  function FlashInstalled()
   {
     result = false;
 
    if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"])
       {
         result = navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin;
       }
     else
       if (document.all && (navigator.appVersion.indexOf("Mac")==-1))
         {
           eval ('try {var xObj = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if (xObj)result = true; xObj = null; } catch (e){}');
         }
       return result;
   }
 




$(document).ready(function(){ 

	$("#reminderbox").slideDown(1000);
	$("#postitbox").slideDown(1000);
	$("a[rel*=facebox]").facebox();
	
	$(function(){
		 $(".obenlinks").tipsy({gravity: 'nw', fade:true});
		 $(".oben").tipsy({gravity: 'n', fade:true});
		 $(".obenrechts").tipsy({gravity: 'ne', fade:true});
		 $(".rechts").tipsy({gravity: 'w', fade:true});
		 $(".links").tipsy({gravity: 'e', fade:true});
		 $(".untenlinks").tipsy({gravity: 'sw', fade:true});
		 $(".unten").tipsy({gravity: 's', fade:true});
		 $(".untenrechts").tipsy({gravity: 'se', fade:true});
		 $(".auto").tipsy({gravity: $.fn.tipsy.autoNS, fade:true});
		 $("input:checkbox, input:radio, input:file").uniform();
      });
     

	$("body").append("<div id='opaque' style='display: none;'></div>");

	$(document).bind('loading.facebox', function() {
		$("#opaque").show();
	});
	$(document).bind('close.facebox', function() {
		$("#opaque").hide();
	});
	$(document).bind('afterReveal.facebox', function() {
		// this is a fix for IE6 which resets the height to 100% of the window height
		$("#opaque").height($(document).height());
	}); 
	 

	 
});


var IE6UPDATE_OPTIONS = {icons_path: "images/"	}

