function showHistoricImage(sImage)
{
	$('historicReaction' + sImage).onmouseover = function()
	{
		$('historicImage' + sImage).show();
	}
//	$('historicReaction' + sImage).onmousemove = function(e)
//	{
//		var IE = document.all?true:false;
//		if (!IE) 
//			document.captureEvents(Event.MOUSEMOVE)
//
//		if (IE) 
//		{ // grab the x-y pos.s if browser is IE
//			tempX = event.clientX + document.body.scrollLeft;
//			tempY = event.clientY + document.body.scrollTop;
//		}
//		else 
//		{  // grab the x-y pos.s if browser is NS
//			tempX = e.pageX;
//			tempY = e.pageY;
//		}
//		$('historicImage' + sImage).style.top = tempY + 'px';
//		$('historicImage' + sImage).style.left = tempX + 'px';
//
//	}
	$('historicReaction' + sImage).onmouseout = function()
	{
		$('historicImage' + sImage).hide();
	}
}

function number_format( number, decimals, dec_point, thousands_sep )
{
	//works as phps number_format
    var n = number, c = isNaN(decimals = Math.abs(decimals)) ? 2 : decimals;
    var d = dec_point == undefined ? "," : dec_point;
    var t = thousands_sep == undefined ? "." : thousands_sep, s = n < 0 ? "-" : "";
    var i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0;
 
    return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "");
}

function showImage(sImage)
{
	$('historicImage' + sImage).show();
}

function hideImage(sImage)
{
	$('historicImage' + sImage).hide();
}

function rejectAssignedDwelling(sUrl)
{
	var oRequest  = new Ajax.Request(sUrl,
	{
		method:'get',
		onSuccess: function(oTransport)
		{
			oAlertPopup = new ZigAlertPopup($('popup'));
			oAlertPopup.setTitle('');
			oAlertPopup.setContent(oTransport.responseText);
			oAlertPopup.oCloseButtonNode.style.display = 'none';
			oAlertPopup.show();
			
			handleAjaxLogin(oAlertPopup);
			/*initAjaxPopupForm();*/
		}
	});
}

//Global vars object
var oGlobal = {
	oModelStyles : {
		LOTINGMODEL: { 
			icon : 'modelLoting',
			alt : 'Lotingmodel',
			css : ''
		},
		DTH: { 
			icon : 'modelDirect',
			alt : 'Direct te huur',
			css : ''
		},
		OPTIEMODEL: { 
			icon : 'modelCluster',
			alt : 'Optiemodel',
			css : ''
		},
		AANBODMODEL: { 
			icon : 'modelAanbod',
			alt : 'Aanbodmodel',
			css : ''
		},
		KOOPMODEL: { 
			icon : 'modelKoop',
			alt : 'Koopmodel',
			css : ''
		}
	}
};

/**
 * Prevent double-click actions
 */
var allowedToRun = true;
function removeOption(iOptionID, sMessage)
{
	showConfirmCancelPopup({
		content				: sMessage,
    	showConfirmCancel	: true,
    	textConfirmSucces	: 'Ja',
    	textConfirmCancel	: 'Nee',
      	onConfirmSuccess	: function(){if(allowedToRun){allowedToRun=false; window.location = '?remove=' + iOptionID; }}
	});
}

function removeReaction(iOptionID, sMessage)
{
	showConfirmCancelPopup({
		content				: sMessage,
    	showConfirmCancel	: true,
    	textConfirmSucces	: 'Ja',
    	textConfirmCancel	: 'Nee',
      	onConfirmSuccess	: function(){if(allowedToRun){allowedToRun=false; window.location = '?remove=' + iOptionID;}}
	});
}

function setGoogleMap(sElID, oOptions, bHoldSetup)
{
	if(typeof(oOptions) != 'object')
	{
		oMapOptions = { width: 678, height: 414 };
	}
	else
	{
		oMapOptions = oOptions;
	}

	if(typeof(bHoldSetup) != 'boolean')
	{
		bHoldSetup = Boolean(bHoldSetup);
	}
	
	this.oMap = new GoogleMap(sElID, 'oMap', oMapOptions, bHoldSetup);
}
	

/**
 * HOME CONTENT
 * 
 * Open Overlaying window
 * Give active button status
 * showHomeContent and hide old
 * closeHomeContent to close everything
 */
var activeHomeContent;
function showHomeContent(contentId)
{
	if(activeHomeContent)
	{
		$(activeHomeContent).addClassName('hidden');
		$('button' + activeHomeContent).removeClassName('active');

		$(contentId).removeClassName('hidden');
		$('button' + contentId).addClassName('active');
	}

	if(contentId != 'none')
	{
		activeHomeContent = contentId;

		$('etalageOverlay').removeClassName('hidden');
		$('windowHomeContent').removeClassName('hidden');
		$(contentId).removeClassName('hidden');
		$('button' + activeHomeContent).addClassName('active');
	}

	else

		activeHomeContent = null;
	
	return false;
}
function closeHomeContent()
{
	$(activeHomeContent).addClassName('hidden');
	$('button' + activeHomeContent).removeClassName('active');
	$('etalageOverlay').addClassName('hidden');
	$('windowHomeContent').addClassName('hidden');
}

/**
 *  FAQ
 *  Show hide questions and answers
 */
var activeQuestions;
function showQuestions(Questions)
{
	if(activeQuestions)
	{
		$(activeQuestions).addClassName('hidden');
		$('close' + activeQuestions).addClassName('hidden');
		$('item' + activeQuestions).removeClassName('active');
	}

	if(Questions != 'none')
	{
		activeQuestions = Questions;

		$(Questions).removeClassName('hidden');
		$('close' + activeQuestions).removeClassName('hidden');
		$('item' + activeQuestions).addClassName('active');
	}
	else

		activeQuestions = null;
	
	return false;
}
function closeQuestions(Questions)
{
	$(Questions).addClassName('hidden');
	$('close' + activeQuestions).addClassName('hidden');
	$('item' + activeQuestions).removeClassName('active');
}

var activeAnswer;
function showAnswer(Answer)
{
	if(activeAnswer)
	{
		$(activeAnswer).addClassName('hidden');
		$('close' + activeAnswer).addClassName('hidden');
		$('item' + activeAnswer).removeClassName('active');
	}

	if(Answer != 'none')
	{
		activeAnswer = Answer;

		$(Answer).removeClassName('hidden');
		$('close' + activeAnswer).removeClassName('hidden');
		$('item' + activeAnswer).addClassName('active');
	}
	else

		activeAnswer = null;
	
	return false;
}
function closeAnswer(Answer)
{
	$(Answer).addClassName('hidden');
	$('close' + activeAnswer).addClassName('hidden');
	$('item' + activeAnswer).removeClassName('active');
}

/**
 *  Show - Hide ID
 */
function showId(Id)
{
	$(Id).removeClassName('hidden');
}
function closeId(Id)
{
	$(Id).addClassName('hidden');
}

/**
 * Toggle Show - Hide ID
 */
var activeId;
function toggleId(Id)
{
	if(activeId)
	{
		$('toggleHidden_' + activeId).addClassName('hidden');
		$('toggleActive_' + activeId).removeClassName('active');
	}
	if(Id != 'none')
	{
		activeId = Id;
		
		$('toggleHidden_' + Id).removeClassName('hidden');
		$('toggleActive_' + Id).addClassName('active');
	}
	else
		activeId = null;
	return false;
}

/**
 * Function change input type fields for Password
 */
function onFocusPassword()
{
	if($('loginfield_text'))
	{
		closeId('loginfield_text');
		showId('loginfield_pass');
		$('loginfield_pass').focus();
	}
}

function onBlurPassword()
{
	if($('loginfield_pass') && $('loginfield_pass').value == '' )
	{
		showId('loginfield_text');
		closeId('loginfield_pass');
	}
}

function onClickLogin()
{
	if($('loginfield_username') && $('loginfield_username').value == 'inschrijfnummer' )
	{
		$('loginfield_username').value = '';
	}
}


function clearDefaultSearch(mForm)
{
	var oForm = $(mForm);
	var oElements = oForm.getInputs('text', 'keyword');
	
	oElements.each(function(oEl)
	{
		if(oEl.defaultText && oEl.defaultText == oEl.value)
		{
			oEl.value = '';
		}
	});
}

/**
 * Show Howto enlarge text in popup
 */
function enlargeInfo()
{
	var oInfo ={title:'Vergroten',content: '<img src="/images/popupEnlargeInfo.gif" alt="Uitleg over lettervergroting" />'};
	showAlertPopup(oInfo);
}

/**
 * Show Howto enlarge text in popup
 */
function enlargeInfoEn()
{
	var oInfo ={title:'Enlarge',content: '<img src="/images/popupEnlargeInfoEn.gif" alt="Uitleg over lettervergroting" />'};
	showAlertPopup(oInfo);
}
 
function postWith(sAction, aPost)
{
	var oForm = document.createElement("form");
	oForm.method = 'post' ;
	oForm.action = sAction ;
	
	for (var sIndex in aPost)
	{
		var oInput = document.createElement("input");
		oInput.setAttribute("name", sIndex) ;
		oInput.setAttribute("value", aPost[sIndex]);
		oForm.appendChild(oInput) ;
	}
	
	document.body.appendChild(oForm) ;
	oForm.submit() ;
	document.body.removeChild(oForm) ;
}

/**
 * Make dButton fully clickable and hoverable for IE
 * by adding event to parent span
 * 
 * @author Sro
 * @version 0.2
 * @copyright Copyright (c) 2010, Zig Websoftware
 * @buildOn Prototype
 * @addon Dynamic Button CSS
 * 
 * Only works for IE sinds FF works with CSS
 */
function initDynamicButton() 
{
    var aButtons = $$('span.buttonContainer');
    aButtons.each(function(oButton, iKey)
    {
    	oButton.observe('click', dButtonSimulateClick);
    	oButton.observe('mouseover', dButtonDoMouseOver);
    	oButton.observe('mouseout', dButtonDoMouseOut);
    });
}

addOnloadFunction(initDynamicButton);

function dButtonSimulateClick(oEvent)
{
	var oEl = oEvent.element();
	var oElement = oEl.down();
	if(typeof(oElement) == 'object' && oElement != null)
	{
		if(oElement.tagName != "INPUT" && oElement.tagName != "A" )
		{
			oElement = oEl.down(1);
		}
		if(oElement.tagName == "INPUT" || oElement.tagName == "A")
		{
			if(oElement.click)
			{
				oElement.click();
			}
			else if(document.createEvent)
			{
				if(oElement.tagName == 'A' && oEvent.target !== oElement)
				{
					//execute the link (FF only executes the onclick)
					var oEvt = document.createEvent("MouseEvents");
					oEvt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
					var bAllowDefault = oElement.dispatchEvent(oEvt);
					// you can check allowDefault for false to see if
					// any handler called evt.preventDefault().
				}
			}
		}
	}
}

function dButtonDoMouseOver(oEvent)
{
	var oElement = oEvent.element();//get the span element
	if(oElement.tagName == "SPAN" && oElement.hasClassName('buttonContainer'))
	{
		oElement.addClassName('hover');
	}
	else if(oElement.tagName == "INPUT")
	{
		oElement.up('span', 1).addClassName('hover');
	}
	else if(oElement.tagName == "SPAN" && !oElement.hasClassName('buttonContainer'))
	{
		oElement.up(0).addClassName('hover');
	}
}

function dButtonDoMouseOut(oEvent)
{
	var oElement = oEvent.element();//get the span element
	if(oElement.tagName == "SPAN" && oElement.hasClassName('buttonContainer'))
	{
		oElement.removeClassName('hover');
	}
	else if(oElement.tagName == "INPUT")
	{
		oElement.up('span', 1).removeClassName('hover');
	}
	else if(oElement.tagName == "SPAN" && !oElement.hasClassName('buttonContainer'))
	{
		oElement.up(0).removeClassName('hover');
	}
}


/**
 * TabWrapper
 * 
 * @author SRooij
 * @version 0.1
 * @copyright Copyright (c) 2010, Zig Websoftware
 * @buildOn Scriptaculous, Prototype
 */
var TabWrapper = Class.create();
TabWrapper.prototype = {
		
	/**
	 * Map object constructor
	 * @param array oOptions
	 */
	initialize: function(oOptions) 
	{
		this.oOptions = {
			sID					: '',						// id of tab container
			sTabSelector		: 'a',						// the css select selector, used to get the children
			sTabContentAttrib	: 'rel',					// the attribute to read the related content element from
			iActiveTabID		: 0,						// default the first tab is set to open
			oLinkParams			: {activeTabID:0},			// the url parameters that need to be set for the related links
			bHideWithClassname	: true,						// set the class 'hidden' to hide a container 
			bSetLocationHash	: true						// set the locationhash on click
		}

	    Object.extend(this.oOptions, oOptions || {});
		
		if(this.oOptions.sID && $(this.oOptions.sID))
		{
			if('onhashchange' in window)
			{
				Event.observe(window,'hashchange', function(event)
				{
					this.loadURIHashTab();
				}.bind(this));
			}
			else
			{
				this.sLastHash = null;
				new PeriodicalExecuter(
				function(oPE)
				{
					if(location.hash && typeof(location.hash == 'string') && location.hash.search('tab') > -1)
					{
						var sHash = location.hash.replace('#', '');
						this.sLastHash = sHash;
						if(this.sLastHash)
						{
							this.loadURIHashTab();
						}
					}
				}.bind(this), 0.5);
			}
			
			//get the first active tab
			aActiveChildren = $(this.oOptions.sID).select(this.oOptions.sTabSelector+'[class*=active]');
			this.oActiveChild = aActiveChildren[0];
	
			this.aChildren = this.getAllChildren(this.oOptions.sID, this.oOptions.sTabSelector);
			
			//setup the tab actions
			this.setupActions();
		}
	},

	/**
	 * Get all the children
	 */
	getAllChildren: function(sID, sCssSelector)
	{	
		var aChildren = new Array();
		aChildren[0] = null;
		var oChild = null;
		var iI = 0;
		
		//get all children and number them in the order of appearance
		for(iI = 0; iI <= 99; iI++)
		{
			oChild = $(sID).down(sCssSelector, iI);
			if(oChild == undefined)
			{
				break;
			}
			oChild.tabID = iI+1;
			aChildren[oChild.tabID] = oChild;
		}
		
		return aChildren;
	},

	/**
	 * Setup the tab actions
	 */
	setupActions: function()
	{
		this.aChildren.each(function(oChild, iIndex) {
			
			if(oChild)
			{
				oChild.observe('click', function(oEvent){
					
					this.activateTab(oChild, oEvent);
					
					Event.stop(oEvent);
				}.bind(this));
			}
			
		}.bind(this));
	},

	/**
	 * Load the fist tab by hash
	 */
	loadURIHashTab: function()
	{
		if(location.hash && typeof(location.hash == 'string') && location.hash.search('tab') > -1)
		{
			var sHash = location.hash.replace('#', '');
			var iActivateID = sHash.replace('tab', '');
			if(this.aChildren[iActivateID])
			{
				this.activateTab(this.aChildren[iActivateID]);
			}
		}
	},

	/**
	 * Activate a tab
	 */
	activateTab: function(oChild, oEvent)
	{	
		if(oChild && this.oActiveChild.tabID != oChild.tabID)
		{
			/**
			 * set the action of an empty form action in the loaded tab to the href of the loaded tab, 
			 * so submit will return to the correct tab
			 */
			var oForm = $$('#'+oChild.readAttribute('rel')+' form').first();

			if(oForm && oForm.action == '')
			{
				oForm.action = oChild.readAttribute('href');
			}
			
			this.toggleContent(oChild.readAttribute('rel'), this.oActiveChild.readAttribute('rel'));

			this.oActiveChild.removeClassName('active');
			oChild.addClassName('active');
			this.oActiveChild = oChild;
			
			this.oOptions.iActiveTabID = oChild.tabID;
			this.oOptions.oLinkParams.activeTabID = oChild.tabID;
			
			if(this.oOptions.bSetLocationHash)
			{
				location.hash = 'tab'+oChild.tabID;
			}
			
			if(oEvent)
			{
				Event.stop(oEvent);
			}
			
			if(oChild.aFunctions)
			{
				oChild.aFunctions.each(function(aCaller, iIndex){
					this.executeFunction(aCaller);
				}.bind(this));
			}
		}
	},

	/**
	 * Toggle the visibility of the content panes
	 */
	toggleContent: function(sContentSelector, sActiveContentSelector)
	{	
		if(sContentSelector.indexOf('::'))
		{
			aCS = sContentSelector.split('::');
		}
		else
		{
			aCS[0] = sContentSelector;
		}
		
		if(sActiveContentSelector.indexOf('::'))
		{
			aActiveCS = sActiveContentSelector.split('::');
		}
		else
		{
			aActiveCS[0] = sActiveContentSelector;
		}

		aActiveCS.each(function(sContentSelector, iIndex){
			if($(sContentSelector))
			{
				if(this.oOptions.bHideWithClassname)
				{
					$(sContentSelector).addClassName('hidden');
				}
				else
				{
					$(sContentSelector).hide();
				}
			}
		}.bind(this));
		aCS.each(function(sContentSelector, iIndex){
			if($(sContentSelector))
			{
				if(this.oOptions.bHideWithClassname)
				{
					$(sContentSelector).removeClassName('hidden');
				}
				else
				{
					$(sContentSelector).show();
				}
			}
		}.bind(this));
	},

	/**
	 * Execute a function from a Caller hash
	 */
	executeFunction: function(aCaller)
	{
		oFunction = aCaller.get('oFunction');
		oFunctionContext = aCaller.get('oFunctionContext');
		sTabRel = aCaller.get('sTabRel');
		bExecuteOnce = aCaller.get('bExecuteOnce');
		bExecuted = aCaller.get('bExecuted');
		if(oFunction && (!bExecuteOnce || !bExecuted))
		{
			aCaller.set('bExecuted', true);
			mResult = oFunction.call(oFunctionContext, sTabRel);
		}
	},

	/**
	 * Add a function to run @ tab execution
	 */
	addFunction: function(sTabRel, oFunction, oFunctionContext, bExecuteOnce)
	{
		if(typeof(bExecuteOnce) != 'boolean')
		{
			bExecuteOnce = true;
		}
		
		var aChild = this.aChildren.findAll(function(oEl){ if(oEl){return oEl.readAttribute('rel') == sTabRel;} });
		oChild = aChild[0];
		
		var aCaller = new Hash();
		aCaller.set('oFunction', oFunction);
		aCaller.set('oFunctionContext', oFunctionContext);
		aCaller.set('sTabRel', sTabRel);
		aCaller.set('bExecuteOnce', bExecuteOnce);
		aCaller.set('bExecuted', false);
		
		if(!oChild.aFunctions)
		{
			oChild.aFunctions = new Array();
		}

		oChild.aFunctions.push(aCaller);
	},

	/**
	 * Add this function to the <a> onclick to add an activeTab param to the <a>'s href
	 */
	addParamToURI: function(oElement, bNavigate, oExtraParams)
	{
		var sLinkURI = oElement.href;
		var sParamString = '?';
		if(typeof(bNavigate) != 'boolean')
		{
			bNavigate = true;
		}
		if(typeof(oExtraParams) != 'object')
		{
			oExtraParams = {};
		}
		
		oParams = this.oOptions.oLinkParams;
	    Object.extend(oParams, oExtraParams);
		
		if(sLinkURI.indexOf('?') >= 0)
		{
			/*get current link params and overwrite them with given params*/
			oElParams = sLinkURI.toQueryParams();
			Object.extend(oElParams, oParams || {});
			oParams = oElParams;
			
			sLinkURI = sLinkURI.substring(0, sLinkURI.indexOf('?'));
		}
		
		aParams = new Hash(oParams);
		aParams.each(function(oParam) {
			if(sParamString == '?')
			{
				sParamString = sParamString+oParam.key+'='+oParam.value;
			}
			else
			{
				sParamString = sParamString+'&'+oParam.key+'='+oParam.value;
			}
		});

		oElement.href = sLinkURI+sParamString;
		if(bNavigate)
		{
			location.href = sLinkURI+sParamString;
			return false;
		}
	}
}


/**
 * ZigPopup observer
 * looks if a with rel is clicked
 */
document.observe("dom:loaded", function()
{
	$$('a[rel^=popup]').each(function(oAnchor)
	{	
		$(oAnchor).observe('click', function(oEvent)
		{
			var oTargetAnchor = oEvent.target;
			oEvent.stop();
			
			if (typeof(oTargetAnchor.rel) == 'undefined')
			{
				// target has no "rel" attribute
				// maybe we clicked on the image and we have to select its parent anchor
				oTargetAnchor = oTargetAnchor.parentNode;
			}
			
			var sAlbumName = oTargetAnchor.rel;
			// determine index
			var iIndex = 0;
			
			var aAlbumAnchors = $$('a[rel^='+sAlbumName+']');
			
			for (var i = 0 ; i < aAlbumAnchors.length ; i++)
			{	
				if (aAlbumAnchors[i] == oTargetAnchor)
				{
					break;
				}			

				iIndex++;	
			}
			
			var oImagePopup = new ZigImagePopup($('popup'), {minWidth: 400, verticalScroll: false});
			oImagePopup.setImagesFromSelector(sAlbumName);
			oImagePopup.show(iIndex);
		});
	});		
});

/**
 * ZigPopup
 */
function showSingleImagePopup(sImage, sTitle, iImageWidth, iImagePadding)
{	
	if(typeof(sImage) == 'string')
	{
		var oSingleImagePopup = new ZigImagePopup($('popup'));
		oSingleImagePopup.aTitles.push(sTitle);
		oSingleImagePopup.setImages([sImage]);
		oSingleImagePopup.show();
		if(iImageWidth && oSingleImagePopup.oActiveImage)
		{
			oSingleImagePopup.oActiveImage.style.width= iImageWidth+'px';
		}
		if(iImagePadding && oSingleImagePopup.oActiveImage)
		{
			oSingleImagePopup.oActiveImage.style.padding= iImagePadding+'px';
		}
	}
}

/**
 * ZigPopup
 */
function showPopup(oConfig)
{	
	if(typeof(oConfig) == 'object')
	{
		if(typeof(oConfig.title) == 'undefined')
		{
			oConfig.title = '';
		}
		oPopup = new ZigPopup($('popup'));
		oPopup.setTitle(oConfig.title);
		oPopup.oTitleNode.style.display = 'block';
		oPopup.setContent(oConfig.content);
		
		if(typeof(oConfig.width) != 'undefined' && oConfig.width > 0)
		{
			oPopup.setWidth(oConfig.width);
		}
		
		if(oConfig.noContentPadding && oConfig.noContentPadding == true)
		{
			oPopup.oContentNode.style.padding = '0px';
		}
		
		if (oPopup.oHeaderCloseNode)
		{
			oPopup.oHeaderCloseNode.observe('click', function() 
			{
				oPopup.hide();
			}.bind(oPopup));
		}
		
		oPopup.show();
	}
}

/**
 * ZigPopup Alert function
 * oConfig looks like: {title:'text',content:'text'}
 */
function showAlertPopup(oConfig, bClearClose)
{	
	if(typeof(oConfig) == 'object')
	{
		if(typeof(oConfig.title) == 'undefined')
		{
			oConfig.title = '';
		}
		oAlertPopup = new ZigAlertPopup($('popup'));
		oAlertPopup.setTitle(oConfig.title)
		oAlertPopup.setContent(oConfig.content);
		oAlertPopup.show();
		
		if(bClearClose)
		{
			oAlertPopup.oCloseButtonNode.stopObserving('click');
			oAlertPopup.oCloseButtonNode.observe('click', function() 
			{
				this.hide();
				oAlertPopup.setContent('');
			}.bind(oAlertPopup));
		}
	}
}

/**
 * ZigPopup Confirm function
 * 
 */
function showConfirmPopup()
{			
	oConfirmPopup = new ZigConfirmPopup($('popup'));

	oConfirmPopup.setTitle('een vraagje');
	oConfirmPopup.setContent('weet u zeker dat u wilt reageren op deze woning?');


	oConfirmPopup.setOkHandler(function() {

		new Ajax.Request('example.html?dosomething=yes', {
			method: 'get',
			onSuccess: function(transport) {
				$('result').innerHTML = 'uw reactie is opgeslagen';
				this.hide();
			}.bind(this)
		});

	}.bind(oConfirmPopup));

	oConfirmPopup.show();
}

 /**
  * ZigPopup Confirm function
  * 
  */
function showConfirmCancelPopup(oOptions)
{
	var oConfirmCancelPopup = new ZigConfirmPopup($('popup'));
	
	if(oOptions.title)
	{
		oConfirmCancelPopup.setTitle(oOptions.title);
	}
	else
	{
		oConfirmCancelPopup.setTitle('');
	}
	
	if(oOptions.content)
	{
		oConfirmCancelPopup.setContent(oOptions.content);
	}
	else
	{
		oConfirmCancelPopup.setContent('');
	}
	
	if(oOptions.textConfirmCancel)//&& oOptions.showConfirmCancel
	{
		oConfirmCancelPopup.setLabelCloseButton(oOptions.textConfirmCancel);
	}
	
	if(oOptions.textConfirmSucces)
	{
		oConfirmCancelPopup.setLabelOkButton(oOptions.textConfirmSucces);
	}
	
	if(oOptions.onConfirmSuccess)
	{
		oConfirmCancelPopup.setOkHandler(oOptions.onConfirmSuccess.bind(oConfirmCancelPopup));
	}
	
	if(oOptions.onConfirmCancel)
	{
		oConfirmCancelPopup.setCloseHandler(oOptions.onConfirmCancel.bind(oConfirmCancelPopup));
	}
	else
	{
		oConfirmCancelPopup.setCloseHandler(function(){this.hide()}.bind(oConfirmCancelPopup));
	}

	oConfirmCancelPopup.show();
}

/**
 * WebTV Popup
 */
function showWebTVlotingmodel()
{
	var oMovie = 
	{
		title: 'Uitleg over het model Loting',
		content: '<embed width=\"460\" height=\"295\" align=\"middle\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" allowscriptaccess=\"always\" flashvars=\"client_id=229&media_id=87229&start=191.1\" name=\"QuadiaPlayer\" bgcolor=\"#000000\" salign=\"b\" wmode=\"transparent\" quality=\"high\" src=\"http://static.quadiatv.com/player/2009312-Zig/player.swf\"></embed>'
	};
	showAlertPopup(oMovie, true);
}

function showWebTVaanbodmodel()
{
	var oMovie = 
	{
		title: 'Uitleg over het model Aanbod',
		content: '<embed width=\"460\" height=\"295\" align=\"middle\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" allowscriptaccess=\"always\" flashvars=\"client_id=229&media_id=87229&start=113\" name=\"QuadiaPlayer\" bgcolor=\"#000000\" salign=\"b\" wmode=\"transparent\" quality=\"high\" src=\"http://static.quadiatv.com/player/2009312-Zig/player.swf\"></embed>'
	};
	showAlertPopup(oMovie, true);
}

function showWebTVdthmodel()
{
	var oMovie = 
	{
		title: 'Uitleg over het model Direct te huur',
		content: '<embed width=\"460\" height=\"295\" align=\"middle\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" allowscriptaccess=\"always\" flashvars=\"client_id=229&media_id=87229&start=213.7\" name=\"QuadiaPlayer\" bgcolor=\"#000000\" salign=\"b\" wmode=\"transparent\" quality=\"high\" src=\"http://static.quadiatv.com/player/2009312-Zig/player.swf\"></embed>'
	};
	showAlertPopup(oMovie, true);
}

function showWebTVoptiemodel()
{
	var oMovie = 
	{
		title: 'Uitleg over het model Optie',
		content: '<embed width=\"460\" height=\"295\" align=\"middle\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" allowscriptaccess=\"always\" flashvars=\"client_id=229&media_id=87229&start=29\" name=\"QuadiaPlayer\" bgcolor=\"#000000\" salign=\"b\" wmode=\"transparent\" quality=\"high\" src=\"http://static.quadiatv.com/player/2009312-Zig/player.swf\"></embed>'
	};
	showAlertPopup(oMovie, true);
}

function showWebTVkoopmodel()
{
	var oMovie = 
	{
		title: 'Uitleg over het model Koop',
		content: '<embed width=\"460\" height=\"295\" align=\"middle\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" allowscriptaccess=\"always\" flashvars=\"client_id=229&media_id=87229&start=0\" name=\"QuadiaPlayer\" bgcolor=\"#000000\" salign=\"b\" wmode=\"transparent\" quality=\"high\" src=\"http://static.quadiatv.com/player/2009312-Zig/player.swf\"></embed>'
	};
	showAlertPopup(oMovie, true);
}


/**
 * WebTV Popup English
 */
function showWebTVlotingmodel_en()
{
	var oMovie = 
	{
		title: 'Explanation about Lottery model',
		content: '<embed width=\"460\" height=\"295\" align=\"middle\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" allowscriptaccess=\"always\" flashvars=\"client_id=229&media_id=87229&start=191.1\" name=\"QuadiaPlayer\" bgcolor=\"#000000\" salign=\"b\" wmode=\"transparent\" quality=\"high\" src=\"http://static.quadiatv.com/player/2009312-Zig/player.swf\"></embed>'
	};
	showAlertPopup(oMovie, true);
}

function showWebTVaanbodmodel_en()
{
	var oMovie = 
	{
		title: 'Explanation about Offer model',
		content: '<embed width=\"460\" height=\"295\" align=\"middle\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" allowscriptaccess=\"always\" flashvars=\"client_id=229&media_id=87229&start=113\" name=\"QuadiaPlayer\" bgcolor=\"#000000\" salign=\"b\" wmode=\"transparent\" quality=\"high\" src=\"http://static.quadiatv.com/player/2009312-Zig/player.swf\"></embed>'
	};
	showAlertPopup(oMovie, true);
}

function showWebTVdthmodel_en()
{
	var oMovie = 
	{
		title: 'Explanation about To Let Immediately model',
		content: '<embed width=\"460\" height=\"295\" align=\"middle\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" allowscriptaccess=\"always\" flashvars=\"client_id=229&media_id=87229&start=213.7\" name=\"QuadiaPlayer\" bgcolor=\"#000000\" salign=\"b\" wmode=\"transparent\" quality=\"high\" src=\"http://static.quadiatv.com/player/2009312-Zig/player.swf\"></embed>'
	};
	showAlertPopup(oMovie, true);
}



/**
 *  Active ClickPreventer
 */
function activateClickPreventer()
{
	$('clickPreventer').removeClassName('hidden');
	setTimeout("deactivateClickPreventer()", 9000);
}

/**
 *  Deactive ClickPreventer
 */
function deactivateClickPreventer()
{
	$('clickPreventer').addClassName('hidden');
}
