function smShow(id) {
	document.getElementById(id).style.display = '';
}
function smHide(id) {
	document.getElementById(id).style.display = 'none';
}

function smOver(id,p) {
	document.getElementById(id).style.background = "url(images_hu/sm_bg-over.gif)";
	document.getElementById(id).style.color = "#ffffff";
	document.getElementById(p).style.display = '';
}
function smOut(id,p) {
	document.getElementById(id).style.background = "url(images_hu/sm_bg.gif)";
	document.getElementById(id).style.color = "#333333";
	document.getElementById(p).style.display = 'none';
}

function getURL(url) {
	window.location.href=url;
}

function yPos (pos) {
	pos = pos +"px";
	document.getElementById('subcont').style.paddingTop = pos
}


var oldId;
function showText (id) {
	if (oldId) {
	document.getElementById(oldId).style.display = 'none';
	}
	document.getElementById(id).style.display = ''
	oldId = id;
}
var ertek;
function showPrice() {
	ertek = document.getElementById('jumpMenu').value
	document.getElementById('priceText').innerHTML=ertek;
}
function showUploadForm() {

	document.getElementById('ulForm').style.display = ''
}
function showBorders() {
	document.getElementById('borders').style.display = ''
}
function showDetails() {
	document.getElementById('details').style.display = ''
}

function addfav() {
	title = "Fotószobor - Fotóflip"; 
	url = "http://www.fotoszobor.hu.hu";
	if (window.sidebar) {
		window.sidebar.addPanel(title, url,"");
	}
	else if( window.external ) {
		window.external.AddFavorite( url, title);
	}
	else if(window.opera && window.print) {
		return true;
	}
}






function shopOver(id) {
	document.getElementById(id).style.backgroundColor = "#eaeaea";
	oldId = id
}
function shopOut() {
	document.getElementById(oldId).style.backgroundColor = "";
}
function alertShop1() {
	alert ("Ide kell majd hogy folytatja-e vagy visszadobja a shop elejére");
	getURL('webshop.php')
}
function valaszt () {
	if (confirm('Szeretnéd folytatni a vásárlást ugyanezekkel a képekkel?')) {
		document.location.href = 'vasarlas.php';
	}
	else {
		document.location.href = 'webshop.php';
	}
}






function validEmail(email){      
	var emailReg = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
	return emailReg.test(email); 
}

function checkStaticFieldsInForm(lang) {
	
	var hiba = false;
	
	if (lang == "hu")
	{
		var strElolvastam = "A szabályzat elfogadása kötelező!";
		var strRosszEmail = "Érvénytelen e-mail formátum!";
	}
	else
	{
		var strElolvastam = "You have to accept the rules!";
		var strRosszEmail = "Invalid e-mail address!";
	}
	
	if (document.getElementById("txtEmail"))
	{
		var email = document.getElementById("txtEmail").value;
		if (!validEmail(email)) {
			alert(strRosszEmail);
			hiba = true;
			return false;
		}	
	}
	
	if (document.getElementById("chkAccept"))
	{
		var accept = document.getElementById("chkAccept");
		if (!accept.checked) {
			alert(strElolvastam);
			hiba = true;
			return false;
		}	
	}
	
	if (!hiba)	
		document.getElementById("dynamicForm").submit();
	
}
