var img_vote_1, img_vote_2;
function popup_window(url, title) {
	window.open(url, title, 'width=600,height=400,status=no,location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,screenX=0,screenY=0');
}
function popup_spec_window(url, title, w, h) {
	window.open(url, title, 'width='+w+',height='+h+',status=no,location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,screenX=0,screenY=0');
}
function popup_print(url) {
	window.open(url, '_blank', 'width=700,height=400,status=no,location=no,toolbar=no,menubar=yes,scrollbars=yes,resizable=yes,screenX=0,screenY=0');
}
function dsp_photo(url, w, h) {
	w2 = w
	h2 = h
	if (w > 600) { w2 = 600 }
	if (w < 220) { w2 = 220 }
	if (h < 100) { h2 = 100 }
	if (h > 500) { h2 = 500 }
	if (h > h2 || w > w2) {
		window.open(url, '_blank', 'width='+w2+',height='+h2+',status=no,location=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes');
	} else {
		window.open(url, '_blank', 'width='+w2+',height='+h2+',status=no,location=no,toolbar=no,menubar=no,scrollbars=no,resizable=yes');
	}
}


// Koks elemento srifto dydis
var default_text_size;
function get_class_text_size(el) {
	var x = document.getElementById(el);
	if (x.currentStyle) {
		var styleProp = 'fontSize';
		var y = x.currentStyle[styleProp];
	} else if (window.getComputedStyle) {
		var styleProp = 'font-size';
		var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);
	}
	var text_size = y.substring(0,2) * 1;
	if (!text_size) {
		text_size = y.substring(0,1) * 1;
	}
	
	return text_size;
}
function set_text_size(el, act) {
	
	if (!default_text_size) {
		default_text_size = get_class_text_size(el);
	}
	
	cookie_name = 'js_main_text';
	text_size = getCookie(cookie_name);
	text_size = text_size * 1;
	
	if (!text_size) {
		text_size = default_text_size;
	} else {
		text_size = parseInt(text_size);
	}
	if (act == '+' && text_size < 15) {
		text_size = text_size + 1;
		setCookie(cookie_name,text_size,30,'/');
	} else if (act == '-' && text_size > 9) {
		text_size = text_size - 1;
		setCookie(cookie_name,text_size,30,'/');
	} else if (act == 'r') {
		text_size = default_text_size;
		setCookie(cookie_name,text_size,30,'/');
	}
	
	text_size  = text_size + 'px';
	document.getElementById(el).style.fontSize = text_size;
}


function voting_preload() {
	img_vote_1 = new Image();
	img_vote_1.src = server_path_info + 'themes/' + themes + '/vote_1.gif';
	img_vote_2 = new Image();
	img_vote_2.src = server_path_info + 'themes/' + themes + '/vote_2.gif';
}
function voting(id, act) {
	if (act == 1) {
		for (i=1; i<=id; i++) {
			name2 = 'vote[' + i + ']';
			document.getElementById(name2).src = img_vote_2.src;
		}
	} else {
		for (i=1; i<=5; i++) {
			name2 = 'vote[' + i + ']';
			document.getElementById(name2).src = img_vote_1.src;
		}
	}
}
function voting2(id, act) {
	if (act == 1) {
		for (i=1; i<=id; i++) {
			name2 = 'vote2[' + i + ']';
			document.getElementById(name2).className = 'active';
		}
	} else {
		for (i=1; i<=5; i++) {
			name2 = 'vote2[' + i + ']';
			document.getElementById(name2).className = 'inactive';
		}
	}
}

