



//////////////////////////////////// Fix IE6 Flickering



function fixIE6flicker(fix) {

	try {

		document.execCommand("BackgroundImageCache", false, fix);

	} catch(err) { }

}

fixIE6flicker(true);









////////////////////////////////////////////////////// FORM VALIDATION



function chcont(){

	if(isEmpty(document.getElementById('name'), "Lūdzu ievadiet vārdu!")){

		if(isEmail(document.getElementById('email'), "Lūdzu ievadiet pareizu e-pasta adresi!")){

			if(isEmpty(document.getElementById('text'), "Lūdzu ievadiet tekstu!")){

				return true;

			}

		}

	}

	return false;

}



function chapp(){

	if(isEmpty(document.getElementById('name'), "Lūdzu ievadiet vārdu!")){

		if(isEmail(document.getElementById('email'), "Lūdzu ievadiet pareizu e-pasta adresi!")){

			if(isEmpty(document.getElementById('phone'), "Lūdzu ievadiet tālruni!")){

				if(isEmpty(document.getElementById('time'), "Lūdzu ievadiet datumu, laiku!")){

					return true;

				}

			}

		}

	}

	return false;

}









////////////////////////////////////////////////////// FORM VALIDATION GLOBAL



function isEmpty(elem, helperMsg){

	if(elem.value.length == 0){

		alert(helperMsg);

		elem.focus();

		return false;

	}else{

		return true;

	}

}



function isEmail(elem, helperMsg){

	var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;

	if(elem.value.match(emailExp)){

		return true;

	}else{

		alert(helperMsg);

		elem.focus();

		return false;

	}

}


