function do_ajax_hd( lv_image ) {
 $(document).ready(function () {
  var img = new Image();
  img.src = lv_image;
  document.getElementById('HDImage').src = lv_image;
  img = "";
  $('#Personalia_HD').fadeTo(1000,1.0,function() { 
   document.getElementById('Personalia_HD').style['display'] = 'block' 
  });
 });  
}

function do_ajax_hd_close( ) {
 $(document).ready(function () {
  $('#Personalia_HD').fadeTo(1000,0.0,function() { 
   document.getElementById('HDImage').src = '';
   document.getElementById('Personalia_HD').style['display'] = 'none';
  });     
 });  
}

function do_ajax_layout( ) {
 $(document).ready(function () {
  $.ajaxSetup ({ cache: false }); 
  var post;
  var myUrl = "PersonaliaFunct_RSS.asp?type=layout";
  $("#Pers_Layout").load(myUrl,function(response, status, xhr){   	
   if (status == "success") { 
     myUrl = "";
     do_ajax_code(myUrl,post);
   }   
  });
 });
}

function do_ajax(pers_scherm) { 
 $(document).ready(function () {
  $.ajaxSetup ({ cache: false }); 
  $("a").live('click', function() {
   lv_href = $(this).attr("href");		   
   lv_target = $(this).attr("target");
   if ( (lv_href.charAt(0) != "#") && (lv_target == "") ) {		  
    var myUrl = $(this).attr("href");
    var post;
    do_ajax_code(myUrl,post);
    return false;
   }
  }); 
  $('form').live('submit', function() {
   var post =  $(this).serializeArray();  
   var myUrl = $(this).attr("action");	
   do_ajax_code(myUrl,post);
   return false;   
  }); 
 });
}

function do_ajax_code(myUrl,post) {
$(document).ready(function () {
 $.ajaxSetup ({ cache: false }); 
 if (myUrl=="") { 
  myUrl = "PersonaliaFunct_RSS.asp?type=home";
  var set_waiter = 1;
 }
 $("#Pers_Temp").load(myUrl,post,function(response, status, xhr){
  if (status == "success") {
   var data_dom = $("<div>" + response + "</div>");
   var images = data_dom.find('img');
   if( images.length > 0 ) {
	images.each(function(i){
	 var imgbuff = new Image();
	 $(imgbuff).bind('load',function(){
	 if( i == images.length-1  )
	 { }
	 delete imgbuff;
	 }).attr('src',this.src);
	});
   }  
   var pwidth = document.getElementById("Pers_Data").clientWidth;
   var pheight = document.getElementById("Pers_Data").clientHeight;
   var pheight_b = document.getElementById("Pers_Data_Bottom").clientHeight;   
   var teller = 0;
   if (set_waiter==1) {
    $("#Pers_Layout").fadeTo(1000,1.0);
   }
   $('.RSS').fadeTo(1000,0.0);   
   $("#Personalia_data_bottom").animate({'height':pheight_b},{ queue:false, duration:1000 });	    
   var pheight_p = document.getElementById("Pers_Layout").clientHeight;
   var pheight_1 = 82;	 	 
   var pheight_2 = document.getElementById("Personalia_title_holder").clientHeight;	 	 
   var pheight_3 = document.getElementById("Pers_Data").clientHeight;	 	 
   var pheight_4 = document.getElementById("Pers_Data_Bottom").clientHeight;	 	
   var pheight_5 = document.getElementById("Pers_Data_Navigation").clientHeight;	 	
   var pheight_d = pheight_1 +  pheight_2 + pheight_3 + pheight_4 + pheight_5;
   var pheight_r = pheight_p - pheight_d;
   var pheight_o = document.getElementById("Pers_Screen").offsetHeight;   
   if (pheight_d > pheight_o) {
	pheight_r = pheight_r * (-1);
	pheight_r = pheight_p + pheight_r;
	$("#Personalia").animate({'height':pheight_r},{ queue:false, duration:2000 }); 
   }else{
    $("#Personalia").animate({'height':pheight_o},{ queue:false, duration:2000 }); 	  
   }
   $('html, body').animate({scrollTop:0},{ queue:false, duration:1000 });    	    
   $("#Personalia_data").animate({'height':pheight,'width':pwidth},1000,function(){  
     if (teller==0) {;
      teller++;

	  var content = $("#Pers_Menu").html();
	  $("#Pers_Menu").remove();
	  $("#Personalia_menu").html(content);
	  
	  var content = $("#Pers_Babe").html();
      $("#Pers_Babe").remove();	  	  
	  $("#Personalia_babe").html(content);	  
	  
	  var content = $("#Pers_Data").html();
	  var lv_special_ajax = $("#Pers_Data").attr("class");	  
      $("#Pers_Data").remove();	  	  
	  $("#Personalia_data").html(content);	

	  var content = $("#Pers_Movie").html();
      $("#Pers_Movie").remove();	  	  
	  $("#Personalia_movie").html(content);		  

	  var content = $("#Pers_Data_Title").html();
      $("#Pers_Data_Title").remove();	  	  
	  $("#Personalia_data_title").html(content);
	  
	  var content = $("#Pers_Data_Bottom").html();
      $("#Pers_Data_Bottom").remove();	  	  	  
	  $("#Personalia_data_bottom").html(content);
	  
	  var content = $("#Pers_Data_Navigation").html();
      $("#Pers_Data_Navigation").remove();	  	  	  
	  $("#Personalia_data_navigation").html(content);
	  
	  var content = $("#Pers_Photo").html();
      $("#Pers_Photo").remove();	  	  	  
	  $("#Personalia_photo").html(content);		   
	  
	  var content = $("#Pers_Image").html();
      $("#Pers_Image").remove();	  	  	  
	  $("#Personalia_image").html(content);	
	  
	  var content = $("#Pers_Menu_Side").html();
      $("#Pers_Menu_Side").remove();	  	  	  
	  $("#Personalia_menuside").html(content);	
	  
	 }
	 if (lv_special_ajax=="TinyMCE") {
	  tinyMCE.init({
		mode : "textareas",
		plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",	
		theme : "advanced",
		theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
		theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
		theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
		theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
		theme_advanced_toolbar_location : "external",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "none",
		extended_valid_elements : "iframe[src|width|height|name|frameborder],script[src|language|type],div[*],tbody[*],a[*]"
	  }); 
	 }
     $('.RSS').fadeTo(1000,1.0);	 	 
     var content;
	 $("#Pers_Temp").html(content);
   });		 		        
  };
 }); 
});
} 