var timeout_remove="";$(document).ready(function(){$(".popup_shadow").dropShadow({left:2,top:0,blur:4,opacity:0.5,color:"black",swap:false});var popup_shadow_parent=$(".popup_shadow_parent");popup_shadow_parent.mouseover(function(){$("ul",this).removeShadow();$("ul",this).dropShadow({left:2,top:0,blur:4,opacity:0.5,color:"black",swap:false});});popup_shadow_parent.mouseout(function(){$("ul",this).removeShadow();});var popup_shadow_hover=$(".popup_shadow_hover");popup_shadow_hover.mouseover(function(){var this_shadow=$(this);this_shadow.removeShadow();this_shadow.dropShadow({left:2,top:0,blur:4,opacity:0.5,color:"black",swap:false});});popup_shadow_hover.mouseout(function(){$(this).removeShadow();});});$(function(){var fancyboxes=$("a.fancybox"),aantal_fancybox=fancyboxes.length,fancybox_width=600,fancybox_height=400;function event_fancybox(this_element){if(this_element.attr("rel")){var fancybox_rel=this_element.attr("rel");if(fancybox_rel!=""&&fancybox_rel.indexOf("width")!=-1&&fancybox_rel.indexOf("height")!=-1){var get_vars=fancybox_rel.split(",");var gv_length=get_vars.length;for(var x=0;x<gv_length;x++){get_var=get_vars[x].split("=");if(get_var[0]=="width")fancybox_width=get_var[1];if(get_var[0]=="height")fancybox_height=get_var[1];}}}
if(this_element.attr("fancybox")){var fancybox_rel=this_element.attr("fancybox");if(fancybox_rel!=""&&fancybox_rel.indexOf("width")!=-1&&fancybox_rel.indexOf("height")!=-1){var get_vars=fancybox_rel.split(",");var gv_length=get_vars.length;for(var x=0;x<gv_length;x++){get_var=get_vars[x].split("=");if(get_var[0]=="width")fancybox_width=get_var[1];if(get_var[0]=="height")fancybox_height=get_var[1];}}}
this_element.fancybox({'overlayShow':true,'zoomSpeedIn':0,'zoomSpeedOut':0,'frameWidth':fancybox_width,'frameHeight':fancybox_height});this_element.unbind("mouseover");}
fancyboxes.each(function(){$(this).mouseover(function(){event_fancybox($(this));});});});$(document).ready(function(){$(".media_rectangle").each(function(){$.fn.media.defaults.flvPlayer='/flash/flvplayer.swf';$.fn.media.defaults.flashvars={backcolor:"0xCCCCCC",screencolor:"0xFFFFFF",frontcolor:"0x000000",lightcolor:"0x3E3A37",logo:"http://images.smulweb.nl/v2_1/sw_logo_flv.png"}
$.fn.media.defaults.params={allowfullscreen:"true"}
$(this).media({width:615,height:346,attrs:{wmode:"transparent"},params:{wmode:"transparent"},flashvars:{image:$(this).attr("rel")}});});});$(document).ready(function(){$(".first_focus").focus();});function select_tab_by_name(tab_naam,tabs_id){if(tabs_content&&tabs_content[tabs_id]&&tabs_content[tabs_id][tab_naam]){selected_tab=tabs_content[tabs_id][tab_naam];tabs[tabs_id].tabs('select',selected_tab);}}
rollover_image=function(imageId){$(imageId).mouseover(function(){$(this).attr("src",$(this).attr("src").split('_out').join('_over'))});$(imageId).mouseout(function(){$(this).attr("src",$(this).attr("src").split('_over').join('_out'))});}
$(document).ready(function(){rollover_image("img.rollover");});$(document).ready(function(){set_scroll_height(true);});function land_bijwerken(land){$(".jq_postcode_cijfer").val("");$(".jq_postcode_letters").val("");if(land!="Nederland"){$(".jq_postcode_cijfer").attr("maxlength","10");$(".jq_postcode_cijfer").unbind("keyup");$(".jq_postcode_letters").attr("maxlength","10");$(".jq_postcode_letters").unbind("keyup");$(".jq_postcode_letters").unbind("keydown");$(".form_postcode_plaats").removeAttr("disabled");$(".form_adres_straat").removeAttr("disabled");}else{postcode_restrictie();}}
function postcode_restrictie(){$(".jq_postcode_cijfer").keyup(function(e){autotab(this,document.user.pc_letter,e);checkPostcode(document.user,0);});$(".jq_postcode_cijfer").attr("maxlength","4");$(".jq_postcode_cijfer").attr("autocomplete","off");$(".jq_postcode_letters").keyup(function(e){returntab(this,document.user.pc_cijfer,e);checkPostcode(document.user,0);});$(".jq_postcode_letters").keydown(function(e){checkKey(e);});$(".jq_postcode_letters").attr("maxlength","2");$(".jq_postcode_letters").attr("autocomplete","off");}
$(document).ready(function(){postcode_restrictie();});$(function(){if($.browser.msie){$(".dropdown").mousedown(function(){var deze=$(this);var orgineel=deze.width();deze.css("width","auto");if(deze.width()<orgineel){deze.css("width","95%");}});$(".dropdown").blur(function(){$(this).css("width","95%");});$(".dropdown").change(function(){$(this).css("width","95%");});}});$(document).ready(function(){$("textarea.jq_autogrow").each(function(){$(this).autoResize({extraSpace:0});});});
	
		function event_popupblok(this_element){
			var this_element = this_element;
			var this_element_rel = this_element.attr("rel");
			//console.log(window.location.href);
			//if($('#container_popupblokken #'+this_element_rel).length < 1 && this_element_rel.indexOf('webgroep') == -1 && this_element_rel.indexOf('zoeken') == -1 && this_element_rel.indexOf('volgende_vorige_') == -1){
			if($('#container_popupblokken #'+this_element_rel).length < 1 && this_element_rel.indexOf('volgende_vorige_') == -1 && window.location.href.indexOf('shop_product') == -1 && this_element_rel.indexOf('toolbar_menu') == -1 && this_element_rel.indexOf('webgroepen_') == -1 && this_element_rel.indexOf('intellitext_')==-1){
				
				var element_type = this_element_rel.split("_"),
					element_id = element_type[element_type.length-1];
				var js_array_key = this_element_rel;
				/*if(popup_blokken_array[element_id] == "" || popup_blokken_array[element_id] == undefined){
					element_type = this_element_rel;
				} else {
					if(popup_blokken_array[element_id] != undefined){
						element_type = popup_blokken_array[element_id]+'_'+element_id;
					} else {
						element_type = "";
					}
				}*/
				if(popup_blokken_array[js_array_key] == "" || popup_blokken_array[js_array_key] == undefined){
					element_type = this_element_rel;
				} else {
					if(popup_blokken_array[js_array_key] != undefined){
						element_type = popup_blokken_array[js_array_key]+'_'+element_id;
					} else {
						element_type = "";
					}
				}
				/*console.log(this_element_rel);
				console.log(popup_blokken_array[js_array_key]);*/
				
				if(element_type.indexOf('undefined') == -1 && this_element.html().indexOf('0 ') != 0 ){
					base_url = 'http://www.smulweb.nl/';
					page_url = 'http://'+window.location.hostname+'/';
					new_url = page_url.match(/^http\:\/\/([a-zA-Z0-9_-].*)\.|^(\w*)\./)[1];
					url = base_url.replace(/www.smulweb/, new_url);					
					$.ajax({
						type: "GET",
					   	url: url+'ajax/make_popupblok.php',
					   	data: "type_id="+element_type+"&orgineel="+this_element_rel,
					   	success: function(msg){
					   		$(".loading_ajax").remove();
					   		if(msg != ""){
								$('#container_popupblokken').append(msg);
								if(this_element_rel.indexOf('zoek') != -1 || this_element_rel.indexOf('gebruiker') != -1){
									$('#'+this_element_rel+' a.fancybox').each(function(){
										var fancybox_rel = jQuery(this).attr("rel");
										if(fancybox_rel!="" && fancybox_rel.indexOf("width")!=-1 && fancybox_rel.indexOf("height")!=-1){
											var get_vars = fancybox_rel.split(",");
											var gv_length = get_vars.length;
											for(var x=0; x < gv_length; x++){
												get_var = get_vars[x].split("=");
												if(get_var[0]=="width") fancybox_width = get_var[1];
												if(get_var[0]=="height") fancybox_height = get_var[1];
											}
										}
										jQuery(this).fancybox({
											'overlayShow': true,
											'zoomSpeedIn': 0, 
											'zoomSpeedOut': 0,
											'frameWidth': fancybox_width,
											'frameHeight': fancybox_height
										});
									});
								}
							}
							this_element.unbind("mouseover");
					   	}
					});
				}
			}
			
			if(this_element.hasClass("jq_popup_hover")){
				this_element.mouseover(function(){
					popup_blok(this_element, this_element.attr("rel"), "link");
				});
				this_element.mouseout(function(){						
					popup_blok(this_element, this_element.attr("rel"), "uitlink");
				});
				popup_blok(this_element, this_element.attr("rel"), "link");
			} else {
				this_element.click(function(event){
					event.stopPropagation();
					if($(".loading_ajax").length < 1 && this_element.html().indexOf('0 ') != 0 ){
						this_element.after("<img src='http://images.smulweb.nl/v2_1/loading.gif' alt='loading' width='14' style='margin-left:2px;' class='loading_ajax'/>");
					}
					if(this_element.attr("href")!="javascript:;"){
						this_element.attr("rev", this_element.attr("href"));
						this_element.attr("href", "javascript:;");
						if(this_element.attr("target")!=''){
							this_element.attr("bk_target", this_element.attr("target"));
							this_element.attr("target", "");
						}
						
					}
					popup_blok(this_element, this_element.attr("rel"), "link");
				});
				this_element.dblclick(function(){					
					if(this_element.attr("rev")!="" && this_element.attr("href")=="javascript:;"){
						location.href=this_element.attr("rev");
					}else{
						location.href=this_element.attr("href");
					}
				});
				this_element.mouseout(function(){
					if(this_element.attr("rev")!=""){
						this_element.attr("href", this_element.attr("rev"));
						this_element.attr("rev", "");
						if(this_element.attr("bk_target")!=''){
							this_element.attr("target", this_element.attr("bk_target"));
							this_element.attr("bk_target", "");
						}
					}
					popup_blok(this_element, this_element.attr("rel"), "uitlink");
				});
				this_element.unbind("mouseover");
			}
		}		
		
		$(document).ready(function() {
			$("a.jq_popup_blok,span.jq_popup_blok").each(function(){
				$(this).mouseover(function(){
					event_popupblok($(this));
				});
			});
		});		
	

