var theme = 'vista_glass';

var win;
function openEvaluation() {
	if(win) { win.close(); }
	win = new Window({className: theme, title: "Evaluate PeekStr",
		top:10, left:10, width:400, height:300, destroyOnClose: true, resizable: false,
		closable: true, minimizable: true, maximizable: false, minWidth: 260, minHeight: 210});
	win.setURL("http://polls.zoho.com/external/stojadinovicp/peekstr-evaluation");
	win.show();
	win.setConstraint(true, {left:10, right:20, top: 1, bottom:10});
	win.toFront();
}

function peekStrSearch(theForm) {
	var q = theForm.peekStrSearchQuery.value;
	window.location = 'results.html?'+q;
	return false;
}

function indexLoad() {
	$("peekStrSearchQuery").focus();
	ajaxLoader('part/top.html', 'top', showTop);
	ajaxLoader('part/info.html', 'info', showInfo);
	ajaxLoader('part/footer.html', 'footer', showFooter);
	setTimeout(showFull, 5000);
}
window.onload = indexLoad; 

function showTop() { setTimeout("showElement('topTable', 2.0)", 500); }
function showInfo() { setTimeout("showElement('info', 2.0)", 1500); }
function showFooter() { setTimeout("showElement('footer', 2.0)", 2500); }
function showElement(elID, dur) { $(elID).appear({ duration: dur }); }

function showFull() {
	$("topTable").style.opacity = '1';
	$("info").style.opacity = '1';
	$("footer").style.opacity = '1';
}

