var snPath = '/sn/'

function include(filename) {
	
	var head = document.getElementsByTagName('head')[0];
	
	script = document.createElement('script');
	script.src = filename;
	script.type = 'text/javascript';
	
	head.appendChild(script)
	
}

function includeCss(filename) {
	
	var head = document.getElementsByTagName('head')[0];
	
	styleS = document.createElement('link');
	styleS.href = filename;
	styleS.rel = 'stylesheet';
	styleS.type = 'text/css';
	
	head.appendChild(styleS)
}

function hideEl(_el) {
	document.getElementById(_el).style.display = "none";
}

function checkVoucher() {
	field = document.getElementById('voucherEmail').value;
	checkAt = field.indexOf("@");
	checkDot = field.indexOf(".");
	if(field != "") {
		if(checkAt > 0 && checkDot > 0) return true;
		else {
			alert("Please fill in correct email address");
			return false;
		}
			
	}
	else return true;
}

function showSearchText(text) {
	el = document.getElementById('searchq');
	if(el.value == "") {
		el.value = text;
		el.style.color = "#c0c0c0";
	}
}

function hideSearchText(text) {
	el = document.getElementById('searchq');
	if(el.value == text) {
		el.value = "";
		el.style.color = "#000000";
	}
}

function panelFriends() {
	var friends = document.getElementById('friendsTableI');
	if(friends.style.display == 'none')
		$("#friendsTableI").slideDown();
	else 
		$("#friendsTableI").slideUp();
	return false;
}

include('../sn/js/jquery.js');
include('../sn/js/jquery.form.js');
include('../sn/js/facebox/facebox.js');

include('../sn/js/scripts.js');
includeCss('../sn/js/facebox/facebox.css');

