function printURL() {
	var header = '<html><head><title>Printable version</title><meta http-equiv="Content-Type" content="text/html; charset=windows-1250">';
	header += '<link rel="stylesheet" href="/css/template.css" type="text/css"><link rel="stylesheet" href="/css/nav.css" type="text/css"><link rel="stylesheet" href="/css/editor.css" type="text/css"><link rel="stylesheet" href="/css/general.css" type="text/css"><script src="/jscript/printing.js"></script></head>';
	header += '<body bgcolor="#FFFFFF" class="normal" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="window.print();">';
	header += "<table align='center'><tr><td width='100%'>"
	var footer = '</td></tr></table></body></html>';

	var strInner = document.body.innerHTML;
	var startPos = strInner.lastIndexOf("<!-- print_start -->");	
	var endPos = strInner.lastIndexOf("<!-- print_end -->");
	strInner = strInner.substring(startPos+20, endPos);
		
	if (strInner.lastIndexOf("<!-- print_pause_on -->") > -1){
		var str1 = "<!-- print_pause_on -->";
		var str2 = "<!-- print_pause_off -->";
		startPos = strInner.lastIndexOf(str1);	
		endPos = strInner.lastIndexOf(str2);
		if (endPos > startPos){
			leftStr = strInner.substring(0, startPos);
			rightStr = strInner.substring(endPos + str2.length, strInner.length);
			strInner =	 leftStr + rightStr;
		}
	}

	var xwin = window.open("/code/printable.asp", "PrintVersion", "menubar=yes, scrollbars=yes, resizable=yes, width=650, toolbar=yes, statubar=no");
	xwin.document.write(header+strInner+footer);
}

function isPPC() {
	if (navigator.appVersion.indexOf("PPC") != -1) return true;
	else return false;
}

function sendPage(value){
	value = escape(value);
//%u010D%u0107%u017E%u0161%u0111'
	while (value.lastIndexOf("%u010D")!=-1) value = value.replace("%u010D", "c");
	while (value.lastIndexOf("%u0107")!=-1) value = value.replace("%u0107", "c");
	while (value.lastIndexOf("%u017E")!=-1) value = value.replace("%u017E", "z");
	while (value.lastIndexOf("%u0161")!=-1) value = value.replace("%u0161", "s");
	while (value.lastIndexOf("%u0111")!=-1) value = value.replace("%u0111", "dj");
	
	value = unescape(value);

	if(!isPPC()) {
		window.location="mailto:\?subject\=" + value + "&body=" + value + ": " + window.location;
	}else { 
		window.location="mailto:\?body=" + value + ": " + window.location;
	}
}

var star_on = new Image();
star_on.src = "/images/basic/star_on.gif";

var star_off = new Image();
star_off.src = "/images/basic/star_off.gif";

function mark(mark){
	for (var i=1;i<mark+1;i++)
		document.getElementById('mark_img'+i).src=star_on.src;
	for (var i=mark+1;i<6;i++) 
		document.getElementById('mark_img'+i).src=star_off.src;
}

function deselect(mark){
	for (var i=1;i<mark+1;i++)
		document.getElementById('mark_img'+i).src=star_off.src;
}

function home_page(){
	if (window.external){
		document.body.style.behavior='url(#default#homepage)';
		document.body.setHomePage('http://www.danas.co.rs');
	}
}

function add_favorites(){
	var title = document.title; 
	var url = this.location;
	if (window.external) 
	{ 
		window.external.AddFavorite( url, title); 		
	} 
}

function getPageSize()
{
	var xScroll, yScroll;
	
	if (window.innerHeight && window.scrollMaxY){
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	}else{ // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}

	var windowWidth, windowHeight;

	if (self.innerHeight){ // all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight){ // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body){ // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}	

	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else{
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){
		pageWidth = windowWidth;
	} else{
		pageWidth = xScroll;
	}

	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
	return arrayPageSize;
}

function getPageScroll(){
	var yScroll;
	if (self.pageYOffset){
		yScroll = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop){ // Explorer 6 Strict
		yScroll = document.documentElement.scrollTop;
	} else if (document.body){ // all other Explorers
		yScroll = document.body.scrollTop;
	}
	arrayPageScroll = new Array('',yScroll) 
	return arrayPageScroll;
}

function uniform_heights(id1, id2){
	var div1 = $("news_"+id1);
	var div2 = $("news_"+id2);

	var height1 = div1.offsetHeight;
	var height2 = div2.offsetHeight;

//alert(height1 + " " + height2);
	div1.style.height = Math.max(height1, height2);
//	div2.style.height = Math.max(height1, height2);
}