//var tstart = (new Date()).getTime()+1;

//function done_loading() {
 //var u = '' + self.location;
 //var t = (((new Date()).getTime() - tstart) / 1000);
 //u = u.replace('http://','');
 //u = u.replace('www.','');
 //u = u.replace('tourfinder.ru','');
 //if ( u != '/' AND u != '/index.html' ) return;
 //alert(u);
 //(new Image()).src = '/timer.html?u=' + u + '&t=' + t;
//}

//document.getElementsByTagName('BODY').onload = new function() {done_loading();};

function favadd(id) {
  var left = (screen.width - 500) / 2;
  var top = (screen.height - 350) / 2;
  window.open('/myfavorite/add.html?id='+id, 'favadd', 'scrollbars=0,resizable=no,width=500,height=350,left='+left+',top='+top+',status=1,menubar=0');
}

// confirm dialog
function cf(text) {
  var ret = false;
  ret = confirm(text);
  return ret;
}

function openpromo() {
  window.open("/static/publicite/promotion.html", "promo", 'scrollbars=0,resizable=no,width=700,height=500,status=1,menubar=0');
}

function showblock(name) {
	var obj = document.getElementById(name);
	var stl = obj.style.display;
	
	( stl == 'none' ) ? stl='block' : stl='none';
	
	obj.style.display = stl;
	
	return true;
	
}


function quote(id,name) {
	id = "comm-"+id;
	var obj = document.getElementById(id);
	var txt = document.getElementById('comment-field');
	var ins = "<blockquote><b>" +name+ "</b>\n" +obj.innerHTML+"</blockquote>\n\n";
	
	document.getElementById('addcomm').style.display='block';
	
	txt.value = txt.value + ins;
    txt.focus(); 
	

}

$(document).ready(function () {
	$("#line1 #menu #s2").corner("20px tl bl");
	$("#line2 #rightc #block_1").corner();
	$("#line2 #rightc #block_2").corner();
	$("#line2 #rightc #block_3").corner();
	$("#help").corner();
	$(".corner").corner();
	$("table#admin_list_albums").corner("10px");
	$(".vuses_paragraph").corner("10px");
	$("#photos_list .photo").corner("10px tr bl");
});

function setcookie (name, value, the_time) {
	var expDate = new Date();
	expDate.setTime (expDate.getTime() + (the_time * 60));
	document.cookie = name + "=" + escape (value) + "; expires=" + expDate.toGMTString ();
}


function add_rating (the_value, the_id){
		setcookie ("rating_" + the_id, "1", 36000);
		var ajax = new dle_ajax();
		ajax.onShow ("");
		var varsString = "";
		ajax.setVar("id", the_id);
		ajax.setVar("rating", the_value);
		ajax.requestFile = "/static/vuse_rating.php";
		ajax.method = "POST";
		ajax.element = "vuse_rating";
		ajax.sendAJAX(varsString);
}
	
