﻿function load_header() {
	var header_count = 8;
	var rand_header = 1 + Math.floor(Math.random() * header_count);
	if(document.getElementById && (x = document.getElementById('header_image')) && x.style) {
		x.style.background = "url(website_uploads/layout_images/header_" + rand_header + ".jpg) no-repeat scroll 0 0";
	}
}

function fix_slideshow_container() {
	var x = document.getElementById('slideshow');
	var elem = x.childNodes;
	alert(elem.length);
	elem.style.border = '1px solid red';
}

function validate(clang) {
	var the_form = document.comments_form;
	
	if(the_form.name.value == '') {
		switch(clang) {
			case 'bg' : msg = 'Моля, въведете име!'; break;
			case 'en' : msg = 'Please, type your name!'; break;
			case 'ru' : msg = 'Моля, въведете име!'; break;
		}
		alert(msg);
		the_form.name.focus();
		return false;
	}
	
	if(the_form.message.value == '') {
		switch(clang) {
			case 'bg' : msg = 'Моля, въведете коментар!'; break;
			case 'en' : msg = 'Please, type comment!'; break;
			case 'ru' : msg = 'Моля, въведете коментар!'; break;
		}
		alert(msg);
		the_form.message.focus();
		return false;
	}
	
	if(the_form.code.value == '') {
		switch(clang) {
			case 'bg' : msg = 'Моля, въведете кода от изображението вдясно!'; break;
			case 'en' : msg = 'Please, type code from the image!'; break;
			case 'ru' : msg = 'Моля, въведете кода от изображението вдясно!'; break;
		}
		alert(msg);
		the_form.code.focus();
		return false;
	}
}






























