
function Ajax(url, metoda, funkcija, formData){
		
		http_request = false;
		
		if (window.ActiveXObject) { // IE
			try {
				http_request = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				errLog("Msxml2.XMLHTTP"+e.description);
				try {
					http_request = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {"Microsoft.XMLHTTP"+errLog(e.description);}
			}
		} else if (window.XMLHttpRequest) { // Mozilla, Safari,...
			http_request = new XMLHttpRequest();
			if (http_request.overrideMimeType) {
				http_request.overrideMimeType('text/xml');
			}
		} 
		
		if (!http_request) {
			alert('Giving up :( Cannot create an XMLHTTP instance');
			return false;
		}
		http_request.onreadystatechange = eval(funkcija);
		if(metoda!=""){
			http_request.open('POST', url, true);
			http_request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			http_request.send(formData);
		}else{
			http_request.open('GET', url, true);
			http_request.send(null);
		}
}

function getSession(){
	try{
		var url = "ajax.aspx";
		
		Ajax(url, "", "prenesiSession", "");
		
	}catch (e){alert(e.description)}
}


function prenesiSession(){
	
	try{
	if (http_request.readyState == 4) {
		if (http_request.status == 200) {
			var Details = document;
			var logiran=http_request.responseText;
			if (logiran=='1'){
				 $$("embed.reg").each(function(el){
			  		el.setStyle("display","block");
			 	  })
			}else{
				 $$("embed.reg").each(function(el){
			  		el.setStyle("display","none");
			 	  })
			}
	
		}
	}
	}catch(e){alert(e.description)}
}

var ucitan = false;
var per;var myheight = "";

function IframeResize(){
	if (myheight!="") {
		var fx = new Fx.Tween($("komentarframe"), {duration:3000, wait:false});
		fx.start('height',myheight);
	}
}  
function CreateBookmarkLink() {
	title = "She.hr"; 
	url = "http://www.she.hr";
	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title); 
	}
}

function setHeight(val){
 	myheight = val;
}

function cancelIt(evt) {
		var e = (typeof evt != 'undefined') ? evt : event;
		e.cancelBubble = true;
	}

window.addEvent("domready", function() {
	
      settings = {
          tl: { radius: 10 },
          tr: { radius: 10 },
          bl: { radius: 10 },
          br: { radius: 10 },
          antiAlias: true,
          autoPad: true,
          validTags: ["div"]
      }

      var myBoxObject = new curvyCorners(settings, "saljimail");
      myBoxObject.applyCornersToAll();

	  ucitan = true;

})

var fx;
var pozicija = 0;
var arrVijesti = [];

var clonePer, cloneMove;
var counter = 0;
var visina = (window.ie)? 169:171;

if (window.ie6) visina=174;




function moveGore(){
	if (!cloneMove) cloneMove = moveGore.periodical(7000);
	clone.delay(2000);
	 fx.start('top',$("scroller").getStyle("top").toInt(), $("scroller").getStyle("top").toInt()-visina);
	if (counter==100) document.location.href = "default.aspx";
}

function clone(){
	if (pozicija>1) pozicija = 0;
	//console.log(pozicija);

	var a = arrVijesti[pozicija].clone();
	a.injectInside($("scroller"));
	arrVijesti[pozicija].className = "efekt prosao";
	counter ++;
	pozicija ++;
	
}

 

