function processPhotos() {	
      $("canvas.photo").each(function(i){
      //for (var canvas in YAHOO.util.Selector.query('canvas.photo')){
      //var nodes = YAHOO.util.Selector.query('canvas.photo');
      //for (var i=0;i<nodes.length;i++)
      //{
      //var canvas=nodes[i];
      
      //alert (canvas);
      var canvas=this;

      if (canvas.getContext) {
    	  
        var ctx = canvas.getContext("2d");

            var img = new Image();
                img.onload = function(){

					cw = canvas.width;
					ch = canvas.height;
					
					w=cw-50;
					h=cw-50;			
					
					bw = 12;		

                    ctx.translate(w/2+20,h/2+20);
                    ctx.rotate(-.1+Math.random()*.2);
                    //ctx.rotate(3.14/2);
                    ctx.translate(-w/2,-h/2);
                    
                     //ctx.drawImage(img,0,0);

                    //ctx.translate(20,20);


					// shadow
                    ctx.translate(bw-5,bw-5);
                    for (i=5;i>=0;i--)
                    {
                        c=215+i*5;
                     ctx.fillStyle='rgb('+c+','+c+','+c+')';
                     ctx.fillRect(0,0,w+bw+i,h+bw+i);
                  	}
                    ctx.translate(-bw+5,-bw+5);

				  
				  // image and border
				  
				  ctx.translate(bw/2,bw/2);
                  ctx.drawImage(img,0,0);
				  ctx.translate(-bw/2,-bw/2);
				  
                  ctx.strokeStyle="rgba(0,0,0,1)";
                  ctx.lineWidth=bw;
                  ctx.strokeRect(0,0,w+bw,h+bw);
                  ctx.strokeStyle="rgba(255,255,255,1)";
                  ctx.lineWidth=bw-2;
                  ctx.strokeRect(0,0,w+bw,h+bw);

			 	  
                }
            // get src of the img within the canvas, that is otherwise used
            // as fallback for older browser w/o canvas support
            
            //alert(canvas.getElements());
            
			//img.src = canvas.getElement('img').src;
			
			img.src=canvas.id;
      	}
    });
	}

function removeExampleText(field)
{
	if (field.value.charAt(0)=='«' && field.value.charAt(field.value.length-1)=='»')
	{
		field.value="";
		field.className=field.className.replace(/example/, "");
	}
}

function processDynamicTextAreas() {	
      $('textarea.dynamicHeight').each(function(ta){
      //for (var ta in YAHOO.util.Selector.query('textarea.dynamicHeight')){

		var origRows=ta.rows;
		ta.onfocus=function(){removeExampleText(ta);ta.rows=15;}; 
		//ta.onblur=function(){ta.rows=origRows;};
       });
}

function showNotificationTab(text)
{
	document.getElementById("notificationTabText").innerText=text;
	document.getElementById("notificationTab").style.display = '';
}

function hideFeedbackMessage()
{
	document.getElementById("feedbackMessage").style.display = 'none';
}

function createXMLHttpReqObj() {
	var xmlHttp = null;
	// Mozilla, Opera, Safari sowie Internet Explorer 7
	if (typeof XMLHttpRequest != 'undefined') {
	    xmlHttp = new XMLHttpRequest();
	}
	if (!xmlHttp) {
	    // Internet Explorer 6 und älter
	    try {
	        xmlHttp  = new ActiveXObject("Msxml2.XMLHTTP");
	    } catch(e) {
	        try {
	            xmlHttp  = new ActiveXObject("Microsoft.XMLHTTP");
	        } catch(e) {
	            xmlHttp  = null;
	        }
	    }
	}	
	return xmlHttp;
}

function showHelp_internal(url,topic)
{
	jQuery.modal('<div id="helpPopUp">', {
		closeHTML:"",
		containerCss:{
			backgroundColor:"#900",
			borderColor:"#000",
			height:430,
			padding:0,
			width:850,
			XXoverflow:"auto"
		},
		overlayClose:true
	});

	jQuery.ajax({
		url: url,
 	 	data: "popUp=true&topic="+topic,
 	 	async: true,
 	 	success: function (data,status) {$("#helpPopUp").html(data);}
 	 	 	});
}