function DisplayFlash(path, width, height, wmode){

    text = "<object type=\"application/x-shockwave-flash\" data=\""+path+"\" width=\""+width+"\" height=\""+height+"\" wmode=\""+wmode+"\" quality=\"high\" allowScriptAccess=\"always\">\r\n";
    text += "<param name=\"movie\"	value=\""+path+"\" />\r\n";
    text += "<param name=\"wmode\" value=\""+wmode+"\" />\r\n";
    text += "<param name=\"quality\" value=\"high\" />\r\n";
    text += "<param name=\"allowScriptAccess\" value=\"always\" />\r\n";    
    text += "<param name=\"width\" value=\""+width+"\" />\r\n";
    text += "<param name=\"height\" value=\""+height+"\" />\r\n";
    text += "</object>";
    document.write(text);
}


function getPoints(pointsData) {
  pointsData = pointsData.substr(1);

var accAr = new Array(41,46,28,29,32,45,37,47,36,44,52,51,39,49,31,40,35,43,30,24,33,42,38,48,34,50);

ShowRegion(accAr[parseInt(pointsData-1)]);
 
  
}

function openWind(url,width,height) {
        number = Math.round(Math.random() * 100000000);
        auxWnd = window.open(url, 'newWindow_' + number,'width=' + width + ',height=' + height + ',resizable=yes,scrollprint=yes,toolbar=no,menubar=no,location=no,status=no,directories=no,copyhistory=no,left=0,top=0');
}

function ShowRegion(item) {

	
	if(!item)
		return false;	
	openWind("/structure.php?id="+item, 600, 400);
	return false;
}

function DisplayAnimatedDiv(ID){
        var vis = document.getElementById(ID).style.display;
	  var div_id = "#"+ID;

	  if(vis=="none")
        	$(div_id).animate({height: "show"}, 500);
        else
        	document.getElementById(ID).style.display = "none";
}

function getcaptchareload(th){
	var i = parseInt($(th).attr('rel')) + 1;
	$(th).attr('rel', i);
	$('#getcaptchaimg').attr('src', '/images/getcaptcha.php?'+i);

	return false;
}

function onAAddResponseSuccess(data) {

	$("#message").attr("value", "");
	$("#fio").attr("value", "");
	$("#title").attr("value", "");
	alert("Ваш отзыв успешно добавлен!\nПосле проверки редактором сайта он появится на сайте!");
}


function AddResponse(){
	
	var fio = $("#fio").attr("value");
	var message = $("#message").attr("value");

	if(!fio){
		alert('Заполните поля формы!');
		return false;
	}

	if(!message){
		alert('Заполните поля формы!');
		return false;
	}

	$.get('/includes/js/response.php', {action: "add", fio: fio, message: message}, onAAddResponseSuccess);

}

