﻿// Show/Hide text in search input

function switchText(object, baseText, eventName)
	{
		if (eventName == "blur")
		{
		if (object.value == "")
		{
		object.value = baseText;
		}
		}
		else
		{
		if (object.value == baseText)
		{
		object.value = "";
		}
	}
}




// Show/Hide div on mouseclick
function ShowDiv(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
		if(el.style.display != "block"){
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}



// Saati
var dt = new Date();
var curSecond = dt.getSeconds();
var curMinute = dt.getMinutes();
var curHour = dt.getHours();
var curDay = dt.getDay();

function tiktik() {

    curSecond += 1;
    if (curSecond == 60) {
        curSecond = 0;
        curMinute += 1;
    }
    if (curMinute == 60) {
        curMinute = 0;
        curHour += 1;
    }
    if (curHour == 24) curHour = 00;
    sec = (curSecond < 10 ? '0' : '') + curSecond;
    minute = (curMinute < 10 ? '0' : '') + curMinute;
    hour = (curHour < 10 ? '0' : '') + curHour;
    day = (curDay < 10 ? '0' : '') + curDay;
    document.getElementById('clock').innerHTML = hour + ':' + minute + ':' + sec;
}




// Popup Windows
function popitup(url) {
  newwindow = window.open(url, 'name', 'height=100,width=350,left=450,top=200');
  if (window.focus) { newwindow.focus() }
  return false;
}

<!--
function fb_popitup(url) {
  newwindow = window.open(url, 'Facebook', 'width=600,height=400,left=250,top=130,status=0,toolbar=0,scrollbars=0');
  if (window.focus) { newwindow.focus() }
  return false;
}
// -->

function popitup_tow(url) {
  newwindow = window.open(url, 'name', 'height=600,width=800,left=250,top=130,status=0,toolbar=0,scrollbars=1');
  if (window.focus) { newwindow.focus() }
  return false;
}

function popitup(url) {
  newwindow = window.open(url, 'name', 'height=140,width=500');
  if (window.focus) { newwindow.focus() }
  return false;
}

function popitup2(url) {
  newwindow = window.open(url, 'name', 'height=400,width=600');
  if (window.focus) { newwindow.focus() }
  return false;
}


// რუბრიკების დამალვა გამოჩენა შოუს გვერდზე
function show_hide_rubric(id, title) {
  var but_id = "show_hide_button" + id;
  var rub_id = "rubrika" + id;
  var button = document.getElementById(but_id);
  var rubrika_text = document.getElementById(rub_id);

  if (rubrika_text.style.display == "block") {
    button.innerHTML = title;
    rubrika_text.style.display = "none";
  }
  else {
    button.innerHTML = title;
    rubrika_text.style.display = "block";
  }
  return false;
}
