function onChangeCountry(sel)
{
    var id_country = sel.options[sel.selectedIndex].value;

    if( window.location.href.indexOf("page=category") == -1 )
    {
    	url	= 'index.php?country=' + id_country;
    }
    else
    {
    	url = setURLArgument(window.location,'country',id_country);
    }

    window.location = url;
}

function openPrintView()
{
    var url = window.location.href;

    if( url.indexOf("printview=yes") == -1 )
    {
        url = url + (( url.indexOf("?") == -1 ) ? "?printview=yes" : "&printview=yes");
        openPopupPage(url,"POP_PRINTVIEW",600,600,XB_POPUP_NORMAL,false);
    }
    else
    {
    	window.print();
    }
}

function submitSearch()
{
	var	text	= document.forms['frmSearch'].text.value.replace(/^\s*/, "").replace(/\s*$/, "");;

	if( text.length < 3 )
	{
		alert('Please type at least 3 characters!');

		return	false;
	}

	return	true;
}

function writeFlash(flash, w, h, className, bg)
{
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+w+'" height="'+h+'" align="center" class="'+className+'" >');
    document.write('<param name="allowScriptAccess" value="sameDomain" />');
    document.write('<param name="movie" value="'+flash+'" />');
    document.write('<param name="quality" value="high" />');
    document.write('<param name="bgcolor" value="'+bg+'" />');
    document.write('<param name="wmode" value="transparent" />');
    document.write('<embed src="'+flash+'" wmode="transparent" quality="high" bgcolor="'+bg+'" width="'+w+'" height="'+h+'" name="banner" align="center" allowScriptAccess="sameDomain" class="'+className+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
    document.write('</object>');
}

function openSubsInfBasic()
{
    openPopupPage('index.php?page=subsinf',"POP_SUBSINF",400,200,"center:yes;location:no;menubar:no;resizable:no;scrollbars:no;status:no;titlebar:no;toolbar:no",false);
}

function openSubsInfPremium()
{
    openPopupPage('index.php?page=subsinf',"POP_SUBSINF",400,200,"center:yes;location:no;menubar:no;resizable:no;scrollbars:no;status:no;titlebar:no;toolbar:no",false);
}

function closeBanner()
{
    var ifFullBannerCanvas = getEbyID('ifFullBannerCanvas');
    var divFullBanner = getEbyID('divFullBanner');
    
    ifFullBannerCanvas.style.display = 'none';
    divFullBanner.style.display = 'none';
}