function disclaimer() {
	answer = confirm('With clicking OK you agree to the following: 1.This photo can be published on the internet to be seen and used by other people. 2.This photo does not contain copyright material and is licensed to be made public. 3.This photo does not contain any illegal content.');
	if (answer == true) {
		document.getElementById('uploadBox').style.display = 'none';
		document.getElementById('uploadWait').style.display = 'inline';
		return true;
	} else {
		return false;
	}
}

function showwhatpopup() { document.getElementById('whatpopup').style.display = 'block'; }
function hidewhatpopup() { document.getElementById('whatpopup').style.display = 'none'; }

function showcontactpopup() { document.getElementById('contactpopup').style.display = 'block'; }
function hidecontactpopup() { document.getElementById('contactpopup').style.display = 'none'; }

function showregisterpopup() { document.getElementById('registerpopup').style.display = 'block'; }
function hideregisterpopup() { document.getElementById('registerpopup').style.display = 'none'; }

function next() {
	ajax_return['previous'] = function(returned) { shownew(returned,1); };
	ajax_get('previous','index.php?ajact=next','');
}

function previous() {
	ajax_return['previous'] = function(returned) { shownew(returned,-1); };
	ajax_get('previous','index.php?ajact=previous','');
}

function shownew(info,direction) {
	if (info == 'none' && direction == -1) { return; }
	if (info == 'none' && direction ==  1) { return; }

	var pic = document.getElementById('pic');
	var lnk = document.getElementById('piclink');
	info = info.split(";"); // id,width,height
	pic.style.display = 'none';
	pic.width = info[1];
	pic.height = info[2];
	pic.src = 'pictures/'+info[0];
	lnk.href = pic.src;
}

function rememberCB(checked) {
	if (checked == true) {
		// Make member and set member cookie
		var post_vars = {'post':'remember'};
		ajax_return['rem_signin'] = function(returned) { }
		ajax_get('rem_signin','remember.php',post_vars);
	} else {
		// Remove member cookie and set dont_remember_me cookie
		var post_vars = {'post':'forget'};
		ajax_return['rem_signout'] = function(returned) { }
		ajax_get('rem_signout','remember.php',post_vars);
	}
}

function ggadget() {
	par = document.getElementById('googleGadget2');
	if (par.getElementsByTagName('DIV').length > 0) { return; }
	var newdiv = document.createElement('div');
	newdiv.setAttribute('id','gg2_popup');
	newdiv.setAttribute('style','background-color:#FF0000;color:#ffffff;width:100px;height:100px;z-index:100;position:absolute;right:0px;top:21px;border:solid 2px white;font-family:arial;font-size:8pt;padding-top: 3px;');
	newdiv.innerHTML = "<DIV STYLE='position:absolute;top:-3px;right:1px;font-family:Arial;font-size:8pt;'><A HREF='javascript:ggadget_close();' STYLE='color:white;'>x</A></DIV> <B>P4P Gadget</B><BR>Daily random photo on your iGoogle desktop<BR><BR><A HREF='http://www.google.com/ig/adde?source=atgs&moduleurl=www.photo4photo.com/gadget.xml' TARGET='_new'><IMG SRC='images/plus_google.gif' WIDTH='62' HEIGHT='17' BORDER='0'></A>";
	par.appendChild(newdiv);
}

function ggadget_close() {
	document.getElementById('gg2_popup').parentElement.removeChild(document.getElementById('gg2_popup'));
}
