jQuery.noConflict();

	
	/* small functions */
	function get_home_url() { return 'http://localhost/medbankas/med_skaiciuokle_frame/'; }
	function redirect( url ) { if (url.length < 5) return ''; window.location = url; }
	function get_num_val( s ) { return s.replace(/\D/g, ''); }
	function is_ie() { return navigator.appName == 'Microsoft Internet Explorer'; }
	function is_ie7() { return navigator.appVersion.indexOf('MSIE 7.') != -1; }
	function is_ie8() { return navigator.appVersion.indexOf('MSIE 8.') != -1; }
	/* onkeypress="return isNumberKey(event)" */
	function isNumberKey(evt) { var charCode = (evt.which) ? evt.which : event.keyCode; if (charCode > 31 && (charCode < 48 || charCode > 57)) return false; return true; }
	function dbg(variable){
		var str = 'Type: ' + typeof(variable) + '\n';str += 'Properties:\n';
		if(typeof variable == 'string') str += variable;
		else { for(i in variable) { if(typeof variable[i] == 'function') { continue; } try{ str += i + ': (' + typeof(variable[i]) +') '+  variable[i] + "\n"; } catch(e){} } }
		alert(str);
	}


	var pptitle = 'Siųsti bankui';
	function createSingleWindow() {
		var single = document.getElementById('popup_single');
		if ( single == null ) {
			single = jQuery('<div id="popup_single" style="display:none;width:500px;"></div>');
			jQuery('body').append( single );
		}
		return single;
	}
	

	function submitToBank(o){
		// o.style.visibility = 'hidden';
		var n = document.getElementById('yourname').value;
		var e = document.getElementById('youremail').value;
		var tel = document.getElementById('yourtel').value;
		var single = createSingleWindow();
		
		jQuery.post(get_home_url()+'ajax.php?cmd=submit_form',{e:e,n:n,tel:tel},function(d){
			jQuery(single).html( '<p class="nqspopup-ttl">'+pptitle+'</p>'+d ).slideDown();
			// o.style.visibility = 'visible';
		});
	}


jQuery(document).ready(function(){
	jQuery('.twoj_li_top').find('a').click(function(e){
		calcHeight('frame_skaiciuokle');
	});
});
	
function calcHeight(frame_id){
	var the_height = jQuery(document.getElementById(frame_id).contentWindow.document.body).height();
	if(!f_timeout) { f_timeout = true; setTimeout(function(){ calcHeight(frame_id); },200); }
	else {
		f_timeout = false;
		document.getElementById(frame_id).style.height=the_height+'px';
		}
}
var f_timeout = false;
