function pageDynamicContent(iNewPage, iFormCount)
{
	var iPage = iNewPage;
	if (iNewPage > 0)
	{
		iPage--;
	}
	var oForm = document.forms["dynamicFilterForm" + iFormCount];
	if (oForm)
	{
		oForm.elements["requestedPage" + iFormCount].value = iPage;
		oForm.submit();
	}
}

function updateCountryDropdown()
{
	var oSelect = document.getElementById("cSel");
	if (oSelect) {
		for (var i = 0; i < oSelect.options.length; i++) {
			if (bIsCorporate) {
				var reg = new RegExp(".*?/corporate/.*?", "i");
			} else {
				var reg = new RegExp(".*?" + sAlias + "$", "i");
			}
			if (oSelect.options[i].value.match(reg)) {
				oSelect.selectedIndex = i;
				oSelect.options[i].selected = true;
				return;
			}
		}
	}
}

addEvent(window, "load", updateCountryDropdown, false);

search = {
	txtBoxes : ['qt','txtContentSearch'],
	init: function() {
		for (i=0;i<search.txtBoxes.length;i++) {
			var oCurrentTxtBox = document.getElementById(search.txtBoxes[i]);
			if (!oCurrentTxtBox) continue;
			oCurrentTxtBox.defaultVal = oCurrentTxtBox.defaultValue;
			search.clearBox(oCurrentTxtBox);
		}
	},
	clearBox : function(txtBox) {
		txtBox.onfocus = function() {
			if (txtBox.value == txtBox.defaultVal) txtBox.value = ''; 
		}
		txtBox.onblur = function() {
			if (txtBox.value == '') txtBox.value = txtBox.defaultVal;
		}
	}
}
addEvent(window,'load',search.init, false);

function searchSubmit()
{
	var oSearchC = document.getElementById("searchGo");
	if (oSearchC)
	{
		oSearchC.href = "javascript:document.search2.submit();";
	}
	var oSearchCidz = document.getElementById("searchidz");
	if (oSearchCidz)
	{
		oSearchCidz.href = "javascript:document.search2.submit();";
	}
	
	var oSearchC2 = document.getElementById("searchGoMiddle");
	if (oSearchC2)
	{
		oSearchC2.href = "javascript:document.search.submit();";
	}
	var oSearchC2idz = document.getElementById("searchidzMiddle");
	if (oSearchC2idz)
	{
		oSearchC2idz.href = "javascript:document.search.submit();";
	}
	
	var oSearchC2a = document.getElementById("searchOk");
	if (oSearchC2a)
	{
		oSearchC2a.href = "javascript:document.search2.submit();";		
	}
	
	var oSearchC2b = document.getElementById("searchSOk");
	if (oSearchC2b)
	{
		oSearchC2b.href = "javascript:document.search2.submit();";
	}
	
	var oSearchC2c = document.getElementById("searchHae");
	if (oSearchC2c)
	{
		oSearchC2c.href = "javascript:document.search2.submit();";
	}
	var oSearchC2d = document.getElementById("searchArrows");
	if (oSearchC2d)
	{
		oSearchC2d.href = "javascript:document.search2.submit();";
	}
	var oSearchC2e = document.getElementById("searchOkMiddle");
	if (oSearchC2e)
	{
		oSearchC2e.href = "javascript:document.search.submit();";		
	}
	
	var oSearchC2f = document.getElementById("searchSOkMiddle");
	if (oSearchC2f)
	{
		oSearchC2f.href = "javascript:document.search.submit();";
	}
	
	var oSearchC2g = document.getElementById("searchHaeMiddle");
	if (oSearchC2g)
	{
		oSearchC2g.href = "javascript:document.search.submit();";
	}
	var oSearchC2h = document.getElementById("searchArrowsMiddle");
	if (oSearchC2h)
	{
		oSearchC2h.href = "javascript:document.search.submit();";
	}	
}
addEvent(window, "load", searchSubmit, false);