
function PopupImage($id) {
$urll='popup_image.php' + "?id=" + $id;
w=window.open($urll,'image','toolbar=0,resizable=1,location=0,directories=0,status=0,menubar=0');

}

function setValue()
{
    window.myValue = document.getElementById("imgp").src;
    //alert(window.myValue);
}

function getValue()
{
    alert(window.myValue); // "test" (assuming setValue has run)
}

function ImageOver($id) {
//alert($id);
document.getElementById("imgp").src = $id;

}


function ImageOver2() {
//alert($orig_link);
imgp=document.getElementById("imgp").src=window.myValue;
}
function OpenWindow(url){
//url="prikazi_sliku2.php?id_slike=" + id;
//alert(url);
window.open(url,"Anketa","toolbar=0, status=1, width=300, height=400, resizable=1,scrollbars=1");

}

function Glasaj() {
var id_odgovora;
for (i=0;i<document.anketa_form.odgovor.length;i++){
if (document.anketa_form.odgovor[i].checked==true){
id_odgovora=document.anketa_form.odgovor[i].value;
break;
}
}
url="include/anketa/anketa_glasaj.php?id_odgovora=" + id_odgovora;
//alert(url);
window.open(url,"Glasanje","toolbar=0, status=1, width=300, height=400, resizable=1,scrollbars=1");
}

function Resize_rs() {
//alert('fsdfds');
var left=document.getElementById('left');
 var right=document.getElementById('right');

if(right.offsetHeight>left.offsetHeight) {
  left.style.height=right.offsetHeight+"px";
    right.style.height=left.offsetHeight+"px";

}
else {
  right.style.height=left.offsetHeight+"px";
    left.style.height=right.offsetHeight+"px";

 }

//var htmlheight = document.body.parentNode.scrollHeight;
//var windowheight = window.innerHeight;
//if ( htmlheight < windowheight ) { document.body.style.height = windowheight + "px"; frame.style.height = windowheight + "px"; }
//else { document.body.style.height = htmlheight + "px"; frame.style.height = htmlheight + "px"; }



}

function SetTheme($id) {
//var $id = that.options[that.selectedIndex].value;
//alert($id);
switch ($id) {
    case 1:
        switch_style('style');
        break;
    case 2:
        switch_style('style2');
        break;
    case 3:
        switch_style('style3');
        break;
     case 4:
        switch_style('style4');
        break;
    case 5:
        switch_style('style5');
        break;
    case 6:
        switch_style('style6');
        break;
}
}

function hhh(){
alert('gfdgdsf');
}



var style_cookie_name = "style" ;
var style_cookie_duration = 30 ;

// *** END OF CUSTOMISABLE SECTION ***

function switch_style ( css_title )
{
//alert(css_title);
// You may use this script on your site free of charge provided
// you do not remote this notice or the URL below. Script from
// http://www.thesitewizard.com/javascripts/change-style-sheets.shtml
  var i, link_tag ;
  for (i = 0, link_tag = document.getElementsByTagName("link") ;
    i < link_tag.length ; i++ ) {
    if ((link_tag[i].rel.indexOf( "stylesheet" ) != -1) &&
      link_tag[i].title) {
      link_tag[i].disabled = true ;
      if (link_tag[i].title == css_title) {
        link_tag[i].disabled = false ;
      }
    }
    set_cookie( style_cookie_name, css_title,
      style_cookie_duration );
  }
}
function set_style_from_cookie()
{
  var css_title = get_cookie( style_cookie_name );
  if (css_title.length) {
    switch_style( css_title );
  }
}
function set_cookie ( cookie_name, cookie_value,
    lifespan_in_days, valid_domain )
{
    // http://www.thesitewizard.com/javascripts/cookies.shtml
    var domain_string = valid_domain ?
                       ("; domain=" + valid_domain) : '' ;
    document.cookie = cookie_name +
                       "=" + encodeURIComponent( cookie_value ) +
                       "; max-age=" + 60 * 60 *
                       24 * lifespan_in_days +
                       "; path=/" + domain_string ;
}
function get_cookie ( cookie_name )
{
    // http://www.thesitewizard.com/javascripts/cookies.shtml
    var cookie_string = document.cookie ;
    if (cookie_string.length != 0) {
        var cookie_value = cookie_string.match (
                        '(^|;)[\s]*' +
                        cookie_name +
                        '=([^;]*)' );
        return decodeURIComponent ( cookie_value[2] ) ;
    }
    return '' ;
}
