/*****************************************************************************
 *
 *  Copyright              : Copyright (C) House4Media
 *	Versie				   : V2.0
 *	
 *  
 *  Disclaimer:
 *	Deze scripting is tot stand gekomen door een samenwerking van
 *	verschillende scripters. De HIMH site en het H4M CMS is GEEN vrije 
 *	software en mag niet worden gewijzigd of doorverkocht aan derden tenzij 
 *	de eigenaar hiertoe toestemming tot verleend.
 *
 *****************************************************************************/

function get_content_ajax(div,id,type){
		var value = encodeURIComponent(document.getElementById(id).value); 
		$("#"+div+"").fadeIn("slow");
		$("#"+div+"").load("/includes/inc_check_data.php?id="+id+"&value="+value+"&sort="+type+"");	
}
function get_content_reel(){	
		var $data = $('#home_reel_kopen_inside');
		$data.fadeOut('slow', function() { $data.load('/includes/inc_getdata_reel.php?sort=2&reel_id=reel_1', function() { $data.fadeIn('slow'); }); });
		
		var $data2 = $('#home_reel_huren_inside');
		$data2.fadeOut('slow', function() { $data2.load('/includes/inc_getdata_reel.php?sort=2&reel_id=reel_2', function() { $data2.fadeIn('slow'); }); });
		var $data3 = $('#home_reel_extra_inside');
		$data3.fadeOut('slow', function() { $data3.load('/includes/inc_getdata_reel.php?sort=2&reel_id=reel_3', function() { $data3.fadeIn('slow'); }); });
}
function get_pass_ajax(div,id,id2){
		var value = encodeURIComponent(document.getElementById(id).value); 
		var value2 = encodeURIComponent(document.getElementById(id2).value); 
		$("#"+div+"").fadeIn("slow");
		$("#"+div+"").load("/includes/inc_check_data.php?id="+id+"&value="+value+"&value2="+value2+"");	
}

function gotonewpage(what) {
  value = what.options[what.selectedIndex].value;
  if (value == "") return;
  window.location.href = value;  
}

function show_box(element){	
	if (element == 'comment'){		
		this.document.getElementById("toevoegen").style.display = 'none'; 
		this.document.getElementById("comment").style.display = 'block';
	}
	else{			
		if(this.document.getElementById(element).style.display == 'block'){
			this.document.getElementById(element).style.display = 'none';
		}
		else{
			this.document.getElementById(element).style.display = 'block';	
		}			
	}
}

var phone = "-0123456789";
var numb = "0123456789";
var price = "0123456789,";
var alpha = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
function res(t,v){	
	var w = "";
	for (i=0; i < t.value.length; i++) {
		x = t.value.charAt(i);
		if (v.indexOf(x,0) != -1){
			w += x;
		}	
	}
	t.value = w;
}

function Popup(url,width,height,name){
	var winleft = screen.width/2 - width/2 ;
	var wintop =  0;
	winprops = 'height='+height+', width='+width+',top='+wintop+',left='+winleft+',scrollbars=yes,location=no,menubar=no,titlebar=no,status=no,toolbar=no,resizable=no,directories=no'
	window.open(url, name, winprops); 	
}

function get_safe(first,second,third,fourth){
	if(fourth!=""){		
		this.document.write('<a class=\"'+fourth+'\" href=\"mailto:' + first + '@' + second + '\">');
		if(third!=""){
			this.document.write(third + '</a>');		
		}
		else{
			this.document.write(first + '@' + second + '</a>');		
		}
	}
	else{
		this.document.write('<a href=\"mailto:' + first + '@' + second + '\">');
		if(third!=""){
			this.document.write(third + '</a>');		
		}
		else{
			this.document.write(first + '@' + second + '</a>');		
		}
	}		
}

function setCookie(c_name,value,expiredays)
{
	
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : "; expires="+exdate.toGMTString());
document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : "; expires="+exdate.toGMTString());
}
