Signin  Pricing  Examples  Support

Libraries > general.js

general.js - Search Live Website Code
It's like doing CTRL+F on millions of websites' source code



NerdyData is a search engine for source code. Search the source code of 200 million websites.


JAVASCRIPT FILE http://taalblad.be/templates/default/../js/general.js

Function Explorer




















Libraries on taalblad.be


ajax.js

audio-player.js

boxover.js

general.js

prototype.js

scriptaculous.js

slideshows.js

ypSlideOutMenusC.js



Explore More


jquery.nicescroll.js

jquery.smartwizard.js

jquery.ui.core.js

jquery.ui.mouse.js

general.js
				
var current_beeldverhaal_order = 0;
var current_beeldverhaal_artikel = '';

// functie om woordspel te openen.
function openWoordSpel()
{

	var width = 550; // width in px
	var height = 700; // height in px
	var url = '/woordspel-oud/taalblad_woordspel_maken.html'; // the url to open
		
	var chasm = screen.availWidth;
	var mount = screen.availHeight;
		
	var popup_window = window.open(url,"wiki_popup","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=yes, width="+width+", height="+height+",left="+((chasm - width - 10) * .5)+",top="+((mount - height - 30) * .5));
	if ( popup_window!=false )
		popup_window.focus();

	/*alert('Er wordt hard gewerkt om het eerste woordspel online te brengen.\nNog even geduld aub!');*/
}

function checkAantal(el)
{
	if ( aantal_antw!=0 )
	{
		var aantal = 0;;
		for(i=0; i<document.forms[0].elements.length; i++)
		{
			if(document.forms[0].elements[i].type=="checkbox" && 
				document.forms[0].elements[i].name==el.name &&
				document.forms[0].elements[i].checked==true)
			{
				aantal++;
			}
		}
		if ( aantal>aantal_antw )
		{
			el.checked = false;
			alert('Je mag maar ' + aantal_antw + ' keuzes maken!');
			return false;
		}
	}
	
	return true;
}

function popupWindow(url, width, height)
{
	if ( url==null )
		return;
	if ( width==null )
		width = 800; // width in px
	if ( height==null )
		height = 600; // height in px
		
	var chasm = screen.availWidth;
	var mount = screen.availHeight;
		
	var print_window = window.open(url,"print_window","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width="+width+", height="+height+",left="+((chasm - width - 10) * .5)+",top="+((mount - height - 30) * .5));
	if ( print_window!=false )
		print_window.focus();

}

function popupWindowNormal(url, width, height)
{
	if ( url==null )
		return;
	if ( width==null )
		width = 800; // width in px
	if ( height==null )
		height = 600; // height in px
		
	var chasm = screen.availWidth;
	var mount = screen.availHeight;
		
	var print_window = window.open(url,"print_window","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=yes, width="+width+", height="+height+",left="+((chasm - width - 10) * .5)+",top="+((mount - height - 30) * .5));
	if ( print_window!=false )
		print_window.focus();

}

function goTo(url)
{
	document.location.href=url;
}

function selectAll(el_id, to_checked_state)
{
	el = $(el_id);
	if ( el==null )
		return;
		
	for (i=0;i<el.length;i++)
		el.options[i].selected = to_checked_state;
}

function changeBackground(el)
{
	if ( el.old_bg!=null )
	{
		var old_bg = el.style.backgroundColor;
		el.style.backgroundColor = el.old_bg;
		el.old_bg = old_bg;
	}
	else
	{
		var old_bg = el.style.backgroundColor;
		el.style.backgroundColor = '#FFB93F';
		el.old_bg = old_bg;
	}
}


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

	document.cookie=string;
}


function getCookie(c_name)
{
	if (document.cookie.length>0)
	{
		c_start = document.cookie.indexOf(c_name + "=");
		if (c_start!=-1)
		{ 
			c_start = c_start + c_name.length+1 ;
			c_end = document.cookie.indexOf(";", c_start);
			if (c_end==-1) 
				c_end=document.cookie.length;
			return unescape(document.cookie.substring(c_start,c_end));
		} 
	}
	return null;
}
		
function tb_box_highlight(id)
{
	var e = document.getElementsByTagName('a');
	for(var x=0;x<e.length;x++)
	{
		if ( e[x].rel!=undefined && e[x].rel==id )
			e[x].style.backgroundColor = '#FFFF00';
	}
}
function tb_box_unhighlight(id)
{
	var e = document.getElementsByTagName('a');
	for(var x=0;x<e.length;x++)
	{
		if ( e[x].rel!=undefined && e[x].rel==id )
			e[x].style.backgroundColor = '#E5FBAB';
	}
}


function swapImage(el, url)
{
    if ( el!=null )
      el.src = url;
}

function getPageSize() {
    var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY) {	
		xScroll = window.innerWidth + window.scrollMaxX;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}
	
	var windowWidth, windowHeight;
	
	if (self.innerHeight) {	// all except Explorer
		if(document.documentElement.clientWidth){
			windowWidth = document.documentElement.clientWidth; 
		} else {
			windowWidth = self.innerWidth;
		}
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	
	
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else { 
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){	
		pageWidth = xScroll;		
	} else {
		pageWidth = windowWidth;
	}

	return [pageWidth,pageHeight];
}

function switchBeeldVerhaalContent(url)
{
	new Effect.Fade('beeld_content', { duration: 1, from: 1, to: 0.0, queue: {position:'end', scope: 'beeldverhaal'} });
	
	var url = url + '/' + current_beeldverhaal_order;	
	setTimeout("changeBeeldVerhaalContent('"+url+"');", 1000);
}

function updateBeeldVerhaal(artikel, fotoOrder) {
	if ( artikel!='' )
		current_beeldverhaal_artikel = artikel;
	if ( fotoOrder!='' )
		current_beeldverhaal_order = fotoOrder;
		
	
	new Effect.Fade('beeld_content', { duration: 1, from: 1, to: 0.0, queue: {position:'end', scope: 'beeldverhaal'} });
	
	var url = '/foto/'+current_beeldverhaal_artikel+'/'+current_beeldverhaal_order;
	setTimeout("changeBeeldVerhaalContent('"+url+"');", 1000);
}

function changeBeeldVerhaalContent(url)
{
	new Ajax.Updater('beeld_content', url, {
                      evalScripts: true,
                      asynchronous: false
                    });
	
	setBeeldVerhaalContentDimensions();
	
	new Effect.Appear('beeld_content', { duration: 1, from: 0.0, to: 1, queue: {position:'end', scope: 'beeldverhaal'} });
}

function startBeeldVerhaalLinks() {

	if ( img_artikel_id_links=='' )
		return;
	

	tempHolder = document.createElement('DIV');
	tempHolder.style.width= '0px';
	tempHolder.style.height= '0px';
	tempHolder.style.overflow= 'hidden';
	tempHolder.innerHTML = js_imgs;
	
	document.body.appendChild(tempHolder); 

	img_artikel_id = img_artikel_id_links;


	var t=setTimeout("startBeeldVerhaal()",500);
}

function startBeeldVerhaal(fotoOrder) {

	if ( img_artikel_id=='' )
		return;
		
	current_beeldverhaal_artikel = img_artikel_id;
	if ( fotoOrder==null )
		current_beeldverhaal_order = 0;
	else
		current_beeldverhaal_order = fotoOrder;
		
	new Ajax.Updater('beeld_content', '/foto/'+img_artikel_id+'/'+current_beeldverhaal_order, {
                      evalScripts: true,
                      asynchronous: false
                    });
	showBeeldVerhaal();

}

function showBeeldVerhaal()
{
	var pagesize = getPageSize();
	$('beeld_bg').setStyle({
		width: pagesize[0] + 'px',
		height: pagesize[1] + 'px'
	});
	
	setBeeldVerhaalContentDimensions();
	
	new Effect.Appear('beeld_bg', { duration: 0.5, from: 0.0, to: 0.8, queue: {position:'end', scope: 'beeldverhaal'} });
	new Effect.Appear('beeld_content', { duration: 1, from: 0.0, to: 1, queue: {position:'end', scope: 'beeldverhaal'} });
}

function setBeeldVerhaalContentDimensions()
{
	var viewsize = document.viewport.getDimensions();

	$('beeld_content').setStyle({
		width: 'auto',
		height: 'auto'
	});
	
	var con_left = ((viewsize['width'] - $('beeld_content').getWidth())/2);
	var con_top = ((viewsize['height'] - $('beeld_content').getHeight())/2);
	
	if ( con_left<0 ) { con_left = 0; }
	if ( con_top<0 ) { con_top = 0; }
	
	$('beeld_content').setStyle({
		left: con_left + 'px',
		top: con_top + 'px'
	});
}

function stopBeeldVerhaal()
{
	new Effect.Fade('beeld_content', { duration: 1, from: 1, to: 0.0, queue: {position:'end', scope: 'beeldverhaal'} });
	new Effect.Fade('beeld_bg', { duration: 0.5, from: 0.8, to: 0.0, queue: {position:'end', scope: 'beeldverhaal'} });
}


A B C D E F G H I J K L M N O P Q R S T U V W X Y Z