/**
 * popup.js - Created by Jan Willem v. Diermen.
 * -----------
 * Allemaalkinderkleding.nl - By 2G B.V.
 * -----------
 * Code in the file may not be used without permission of its author.
 * Copyright(c) 2008, All rights reserved(c)
 */

/**
 * This method shows the popup DIV with a iframe.
 *
 */
function showSearchPopup()
{	
	// Get the search string.
	var oSearchText = document.getElementById('SearchText');	
	var sSearchText = oSearchText.value;
	
	var oSearchCategory = document.getElementById('SearchCategory');	
	var sSearchCategory = oSearchCategory.options[oSearchCategory.selectedIndex].value;
	
	// Create the HTML content of the popup.
	var sHTML = '<table cellspacing="0" cellpadding="0" width="100%" height="100%">';
		sHTML += '<tr>';
			sHTML += '<td align="center" class="cls_popupHeader" width="100%" onclick="hideSearchPopup();">Terug naar de website</td>';
			sHTML += '<td align="right" class="cls_popupHeader" onclick="hideSearchPopup();">X&nbsp;</td>';
		sHTML += '</tr>';
		sHTML += '<tr>';
			sHTML += '<td colspan="2" height="100%">';
				sHTML += '<iframe frameborder="0" width="100%" height="100%" scrolling="auto" src="search.php?query=' + encodeURIComponent(sSearchText) + '&category_id=' + sSearchCategory + '"></iframe>';
			sHTML += '</td>';
		sHTML += '</tr>';
	sHTML += '</table>';
	
	var oPopupContent = document.getElementById('SearchPopupContent');	
	oPopupContent.innerHTML = sHTML;
	oPopupContent.style.display = 'block';
}

/**
 * This method hides the popup DIV.
 */
function hideSearchPopup()
{
	var oPopupContent = document.getElementById('SearchPopupContent');
	oPopupContent.innerHTML = '';
	oPopupContent.style.display = 'none';
}