//v1.0
//Copyright 2006 Adobe Systems, Inc. All rights reserved.
function showpic (args) {
	var argsarray = args.split ("_SPLIT_");
	var imgurl = argsarray[0];
	var caption = argsarray[1];
	var date = argsarray[2];
	var location = argsarray[3];
	window.open ("http://home.101eventos.com.br/components/com_exposeprive/showpic.html?" +
	"img=expose/" + imgurl +
	"&amp;caption=" + escape (caption) +
	"&amp;date=" + escape (date) +
	"&amp;location=" + escape (location)
	, 'pic',
	"width=" + screen.width +
	",height=" + screen.height +
	",toolbar=no,resizable=yes,scrollbars=yes,location=no,top=0,left=0,fullscreen=1,status=no");
}

function openurl (args) {
	var url = args;
	window.open (url);
}

var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;

function expose_DoFSCommand(command, args) {
	var exposeObj = InternetExplorer ? expose : document.expose;
	if (command == "showpic") {
		showpic (args);
	}
	if (command == "openurl") {
		openurl (args);
	}
}

if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 &&
		navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('Sub expose_FSCommand(ByVal command, ByVal args)\n');
	document.write('  call expose_DoFSCommand(command, args)\n');
	document.write('end sub\n');
	document.write('</SCRIPT\> \n');
}

// SEO fix thanks to Hambon
function getQueryVariable(variable) {
	var query = window.location.search.substring(1);
	var pairDelimiter = "&";
	var pairSeparator = "=";
	var joomlaComName = "option,com_exposeprive";

	if (query == "") {
		query = window.location.pathname.substring(1);
		var joomlaIsSEO = query.indexOf(joomlaComName);
		if (joomlaIsSEO != -1) {
			pairDelimiter = "/";
			pairSeparator = ",";
		}
	}

	var vars = query.split(pairDelimiter);
	for (var i=0;i<vars.length;i++) {
		var pair = vars[i].split(pairSeparator);
		if (pair[0] == variable) {
			return pair[1];
		}
	}
	return '';
}
