var arrayComments=new Array();
var arrayComments2=new Array();
var objectComments=null;
var objectComments2=null;
var CommentMenuOneTXT="";
var arrayCommentsCard=new Array();
var CommentsCardTXT="";
var CommentsTXT="";
function putMenuOne(type){
    if (type)
        formMenuOne();
    else
        formMenuOneAddress();
    showCommentsMenu1(objectComments);
}
function formMenuOne(){
    CommentMenuOneTXT='<table width="100%" cellpadding="0" cellspacing="0" class="submenu_4">';
    for(key in arrayComments){
        if (!isNaN(key)){
            CommentMenuOneTXT+='<tr class="first" onclick="loadCommentsGroup('+key+',this)" id="g'+key+'">';
            CommentMenuOneTXT+='<th><img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/2_1_1.gif" class="image_1"><img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/2_2_1.gif" class="image_2"></th>';
            CommentMenuOneTXT+='<td><div>'+arrayComments[key]["name"]+' <span>('+arrayComments[key]["count"]+')</span></div></td>';
            CommentMenuOneTXT+='<th><img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/2_1_2.gif" class="image_1"><img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/2_2_2.gif" class="image_2"></th>';
            CommentMenuOneTXT+='</tr>';
        }
    }
    CommentMenuOneTXT+='</table>';
}
function formMenuOneAddress(){
    CommentMenuOneTXT='<table width="100%" cellpadding="0" cellspacing="0" class="submenu_4">';
    for(key in arrayComments){
        if (!isNaN(key)){
            CommentMenuOneTXT+='<tr class="first" onclick="loadAddress('+key+',this)" id="g'+key+'">';
            CommentMenuOneTXT+='<th><img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/2_1_1.gif" class="image_1"><img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/2_2_1.gif" class="image_2"></th>';
            CommentMenuOneTXT+='<td><div>'+arrayComments[key]["name"]+', '+arrayComments[key]["street"]+' <span>('+arrayComments[key]["count"]+')</span></div></td>';
            CommentMenuOneTXT+='<th><img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/2_1_2.gif" class="image_1"><img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/2_2_2.gif" class="image_2"></th>';
            CommentMenuOneTXT+='</tr>';
        }
    }
    CommentMenuOneTXT+='</table>';
}
function putMenuTwo(){
    formMenuTwo();
    showCommentsMenu2(objectComments2);
}
function formMenuTwo(){
    CommentMenuTwoTXT='<table width="100%" cellpadding="0" cellspacing="0" class="submenu_4">';
    for(key in arrayComments2){
        if (!isNaN(key)){
            CommentMenuTwoTXT+='<tr class="first" onclick="loadFood('+key+')">';
            CommentMenuTwoTXT+='<th><img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/2_1_1.gif" class="image_1"><img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/2_2_1.gif" class="image_2"></th>';
            CommentMenuTwoTXT+='<td><div>'+arrayComments2[key]["name"]+' <span>('+arrayComments2[key]["count"]+')</span></div></td>';
            CommentMenuTwoTXT+='<th><img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/2_1_2.gif" class="image_1"><img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/2_2_2.gif" class="image_2"></th>';
            CommentMenuTwoTXT+='</tr>';
        }
    }
    CommentMenuTwoTXT+='</table>';
}
function hideCommentsMenu1() {
	if (lastCommentsObject1) {
		lastCommentsObject1.className = lastCommentsObject1.className.replace(' active', '');
		lastCommentsObject1.getElementsByTagName('div')[0].style.background = '';
	}
        lastCommentsObject2=null;
        hideComments();
}
function hideCommentsMenu2() {
	if (lastCommentsObject2) {
		lastCommentsObject2.className = lastCommentsObject2.className.replace(' active', '');
		lastCommentsObject2.getElementsByTagName('div')[0].style.background = '';
	}
        hideComments();
}
function showCommentsMenu1(obj){
	if (obj.className.indexOf('active') == -1){
		hideCommentsMenu1();
		obj.className += ' active';
		obj.getElementsByTagName('div')[0].style.background = '#E6EEE9';
		lastCommentsObject1 = obj;
		document.getElementById("menuOne").innerHTML=CommentMenuOneTXT;
	}
}
function showCommentsMenu2(obj, table_index){
	if (obj.className.indexOf('active') == -1){
		hideCommentsMenu2();
		obj.className += ' active';
		obj.getElementsByTagName('div')[0].style.background = '#E6EEE9';
		lastCommentsObject2 = obj;
		document.getElementById("menuTwo").innerHTML=CommentMenuTwoTXT;
	}
}
function showComments(){
    showCommentsCard();
    showCommentsList();
}
function showAddressComments(){
    showAddressCommentsCard();
    showAddressCommentsList();
}
function showCommentsCard(){
    FoodCard=arrayCommentsCard["information"];
    txt="";
    txt+='<img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/pixels/t_pixel.gif" class="separator_2"><br><br>';
    txt+='<table width="100%" cellpadding="0" cellspacing="0"><tr>';
    txt+='<td width="1%" class="testimonial_photo">';
    txt+='<table width="2%" cellpadding="0" cellspacing="0"><tr>';
    txt+='<td width="1%"><div class="photo_frame_1" style="width:120px;height:120px;background:url('+FoodCard["image"]+') no-repeat center center;">&nbsp;</div></td>';
    txt+='<td width="1%" style="vertical-align: bottom"><div class="price"><span>'+FoodCard["price"]+' руб.</span></div></td>';
    txt+='</tr></table>';
    txt+='</td>';
    txt+='<td width="39%" style="font-size: 11px; padding: 5 5 0 0"><b>'+FoodCard["name"]+'</b> '+FoodCard["weight"]+'<br>'+FoodCard["consist"]+'</td>';
    txt+='<td width="60%">';
    txt+='<form name="commentForm" method="post" action="">';
    txt+='<table width="100%" cellpadding="0" cellspacing="0"><tr>';
    txt+='<td width="50%" style="padding: 5 0 10 0"><b>Оставь свой отзыв</b></td>';
    txt+='<td width="50%" style="padding: 0 0 10 0">';
    txt+='<table width="100%" cellpadding="0" cellspacing="0"><tr>';
    txt+='<td width="1%" class="input_padding_1"><img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_1.gif" width="6" height="24"><br></td>';
    txt+='<td width="98%"><input type="text" name="" id="cName" value="Ваше имя" class="input2" onfocus="if (this.value == \'Ваше имя\') {this.value = \'\'}; this.style.backgroundColor=\'#ffffff\';" onblur="if (this.value == \'\') {this.value = \'Ваше имя\'}"><br></td>';
    txt+='<td width="1%" class="input_padding_1"><img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_2.gif" width="6" height="24"><br></td>';
    txt+='</tr></table>';
    txt+='</td>';
    txt+='</tr></table>';
    txt+='<table width="100%" cellpadding="0" cellspacing="0"><tr>';
    txt+='<td width="50%" style="padding: 0 5 10 0">';
    txt+='<table width="100%" cellpadding="0" cellspacing="0"><tr>';
    txt+='<td width="1%" class="input_padding_1"><div style="width:6px;height:24px;background:url(/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_1.gif) no-repeat center center;"></div><!--<img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_1.gif" width="6" height="24"><br>--></td>';
    txt+='<td width="98%"><input type="text" name="" id="cPhone" value="Ваш телефон" class="input2" onfocus="if (this.value == \'Ваш телефон\') {this.value = \'\'}; this.style.backgroundColor=\'#ffffff\';" onblur="if (this.value == \'\') {this.value = \'Ваш телефон\'}"><br></td>';
    txt+='<td width="1%" class="input_padding_1"><div style="width:6px;height:24px;background:url(/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_2.gif) no-repeat center center;"></div><!--<img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_2.gif" width="6" height="24"><br>--></td>';
    txt+='</tr></table>';
    txt+='</td>';
    txt+='<td width="50%" style="padding: 0 0 0 5">';
    txt+='<table width="100%" cellpadding="0" cellspacing="0"><tr>';
    txt+='<td width="1%" class="input_padding_1"><div style="width:6px;height:24px;background:url(/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_1.gif) no-repeat center center;"></div><!--<img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_1.gif" width="6" height="24"><br>--></td>';
    txt+='<td width="98%"><input type="text" name="" id="cMail" value="Ваш E-mail" class="input2" onfocus="if (this.value == \'Ваш E-mail\') {this.value = \'\'}; this.style.backgroundColor=\'#ffffff\';" onblur="if (this.value == \'\') {this.value = \'Ваш E-mail\'}"><br></td>';
    txt+='<td width="1%" class="input_padding_1"><div style="width:6px;height:24px;background:url(/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_2.gif) no-repeat center center;"></div><!--<img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_2.gif" width="6" height="24"><br>--></td>';
    txt+='</tr></table>';
    txt+='</td>';
    txt+='</tr></table>';
    txt+='<div class="comment_1">';
    txt+='<img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/4_1.gif" width="6" height="6" style="position: absolute; top: -1; left: -1"><img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/4_2.gif" width="6" height="6" style="position: absolute; top: -1; right: -2"><img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/4_3.gif" width="6" height="6" style="position: absolute; right: -2; bottom: -1"><img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/4_4.gif" width="6" height="6" style="position: absolute; left: -1; bottom: -1">';
    txt+='<textarea name="" id="cText" class="input3" onfocus="if (this.value == \'Оставьте ваш отзыв\') {this.value = \'\'}; this.style.backgroundColor=\'#ffffff\';" onblur="if (this.value == \'\') {this.value = \'Оставьте ваш отзыв\'}">Оставьте ваш отзыв</textarea><br>';
    txt+='<a href="javascript:putCommentObject('+arrayCommentsCard["information"]["id"]+',\'PDM\',true)" class="gray_3"><img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/icons/send_1.gif" width="20" height="20" alt="Отправить" title="Отправить" class="sinput1">Отправить</a><br>';
    txt+='</div></form><div style="text-align:center;line-height:26px;height:26px;;font-size:11px;">*поля "Ваше имя" и "Отзыв" обязательны, а так же "Телефон" или "E-mail"</div></td>';
    txt+='</tr></table>';
    txt+='<img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/pixels/t_pixel.gif" class="separator_3"><br>';
    CommentsCardTXT=txt;
    document.getElementById("info").innerHTML=CommentsCardTXT;
}
function showCommentsList(){
    FoodComments=arrayCommentsCard["comments"];
    txt="";
    for(key in FoodComments){
        if (!isNaN(key)){
            txt+='<div class="comment_2">';
            txt+='<div>'+FoodComments[key]["name"]+'</div>';
            txt+=FoodComments[key]["body"];
            txt+='</div>';
        }
    }
    CommentsTXT=txt;
    document.getElementById("comments").innerHTML=CommentsTXT;
}
function showAddressCommentsCard(){
    FoodCard=arrayCommentsCard["information"];
    txt="";
    txt+='<img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/pixels/t_pixel.gif" class="separator_2"><br><br>';
    txt+='<table width="100%" cellpadding="0" cellspacing="0"><tr>';
    txt+='<td width="1%" class="testimonial_photo">';
    txt+='<table width="2%" cellpadding="0" cellspacing="0"><tr>';
    txt+='<td width="1%"><div class="photo_frame_1" style="width:120px;height:120px;background:url('+FoodCard["image"]+') no-repeat center center;">&nbsp;</div></td>';
    txt+='<td width="1%" style="vertical-align: bottom"></td>';
    txt+='</tr></table>';
    txt+='</td>';
    txt+='<td width="39%" style="font-size: 11px; padding: 5 0 0 0"></td>';
    txt+='<td width="60%">';
    txt+='<form name="commentForm" method="post" action="">';
    txt+='<table width="100%" cellpadding="0" cellspacing="0"><tr>';
    txt+='<td width="50%" style="padding: 5 0 10 0"><b>Оставь свой отзыв</b></td>';
    txt+='<td width="50%" style="padding: 0 0 10 0">';
    txt+='<table width="100%" cellpadding="0" cellspacing="0"><tr>';
    txt+='<td width="1%" class="input_padding_1"><img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_1.gif" width="6" height="24"><br></td>';
    txt+='<td width="98%"><input type="text" name="" id="cName" value="Ваше имя" class="input2" onfocus="if (this.value == \'Ваше имя\') {this.value = \'\'}; this.style.backgroundColor=\'#ffffff\';" onblur="if (this.value == \'\') {this.value = \'Ваше имя\'}"><br></td>';
    txt+='<td width="1%" class="input_padding_1"><img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_2.gif" width="6" height="24"><br></td>';
    txt+='</tr></table>';
    txt+='</td>';
    txt+='</tr></table>';
    txt+='<table width="100%" cellpadding="0" cellspacing="0"><tr>';
    txt+='<td width="50%" style="padding: 0 5 10 0">';
    txt+='<table width="100%" cellpadding="0" cellspacing="0"><tr>';
    txt+='<td width="1%" class="input_padding_1"><div style="width:6px;height:24px;background:url(/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_1.gif) no-repeat center center;"></div><!--<img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_1.gif" width="6" height="24"><br>--></td>';
    txt+='<td width="98%"><input type="text" name="" id="cPhone" value="Ваш телефон" class="input2" onfocus="if (this.value == \'Ваш телефон\') {this.value = \'\'}; this.style.backgroundColor=\'#ffffff\';" onblur="if (this.value == \'\') {this.value = \'Ваш телефон\'}"><br></td>';
    txt+='<td width="1%" class="input_padding_1"><div style="width:6px;height:24px;background:url(/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_2.gif) no-repeat center center;"></div><!--<img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_2.gif" width="6" height="24"><br>--></td>';
    txt+='</tr></table>';
    txt+='</td>';
    txt+='<td width="50%" style="padding: 0 0 0 5">';
    txt+='<table width="100%" cellpadding="0" cellspacing="0"><tr>';
    txt+='<td width="1%" class="input_padding_1"><div style="width:6px;height:24px;background:url(/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_1.gif) no-repeat center center;"></div><!--<img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_1.gif" width="6" height="24"><br>--></td>';
    txt+='<td width="98%"><input type="text" name="" id="cMail" value="Ваш E-mail" class="input2" onfocus="if (this.value == \'Ваш E-mail\') {this.value = \'\'}; this.style.backgroundColor=\'#ffffff\';" onblur="if (this.value == \'\') {this.value = \'Ваш E-mail\'}"><br></td>';
    txt+='<td width="1%" class="input_padding_1"><div style="width:6px;height:24px;background:url(/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_2.gif) no-repeat center center;"></div><!--<img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_2.gif" width="6" height="24"><br>--></td>';
    txt+='</tr></table>';
    txt+='</td>';
    txt+='</tr></table>';
    txt+='<div class="comment_1">';
    txt+='<img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/4_1.gif" width="6" height="6" style="position: absolute; top: -1; left: -1"><img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/4_2.gif" width="6" height="6" style="position: absolute; top: -1; right: -2"><img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/4_3.gif" width="6" height="6" style="position: absolute; right: -2; bottom: -1"><img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/4_4.gif" width="6" height="6" style="position: absolute; left: -1; bottom: -1">';
    txt+='<textarea name="" id="cText" class="input3" onfocus="if (this.value == \'Оставьте ваш отзыв\') {this.value = \'\'}; this.style.backgroundColor=\'#ffffff\';" onblur="if (this.value == \'\') {this.value = \'Оставьте ваш отзыв\'}">Оставьте ваш отзыв</textarea><br>';
    txt+='<a href="javascript:putCommentObject('+arrayCommentsCard["information"]["id"]+',\'ADM\',true)" class="gray_3" onClick="CommentType=true"><img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/icons/send_1.gif" width="20" height="20" alt="Отправить" title="Отправить" class="sinput1">Отправить</a><br>';
    txt+='</div></form><div style="text-align:center;line-height:26px;height:26px;font-size:11px;">*поля "Ваше имя" и "Отзыв" обязательны, а так же "Телефон" или "E-mail"</div></td>';
    txt+='</tr></table>';
    txt+='<img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/pixels/t_pixel.gif" class="separator_3"><br>';
    CommentsCardTXT=txt;
    document.getElementById("info").innerHTML=CommentsCardTXT;
}
function showAddressCommentsList(){
    FoodComments=arrayCommentsCard["comments"];
    txt="";
    for(key in FoodComments){
        if (!isNaN(key)){
            txt+='<div class="comment_2">';
            txt+='<div>'+FoodComments[key]["name"]+'</div>';
            txt+=FoodComments[key]["body"];
            txt+='</div>';
        }
    }
    CommentsTXT=txt;
    document.getElementById("comments").innerHTML=CommentsTXT;
}
function hideComments(){
    document.getElementById("info").innerHTML="";
    document.getElementById("comments").innerHTML="";
    document.getElementById("menuTwo").innerHTML="";
}
function showCommentWindow(id,event){
    x=Number(event.clientX) + Number(document.body.scrollLeft);
    y=Number(event.clientY) + Number(document.body.scrollTop);
    document.getElementById("comment").style.top=y+"px";
    document.getElementById("comment").style.left=x+"px";
    txt="";
    txt+='<div style="width:300px;height:200px;position:absolute;z-index:150;filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/backgrounds/comment1.png\', sizingMethod=\'noscale\')"><img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/backgrounds/comment1.png" style="position:absolute" onLoad="loadPNG(this)"></div><div style="width:280px;height:180px;margin-top:10px;margin-left:10px;z-index:200;position:absolute;"><form name="commentForm" method="post" action="">';
    txt+='<table width="100%" cellpadding="0" cellspacing="0"><tr>';
    txt+='<td width="280" style="padding: 0 0 10 0">';
    txt+='<table width="100%" cellpadding="0" cellspacing="0"><tr>';
    txt+='<td width="1%" class="input_padding_1"><div style="width:6px;height:24px;background:url(/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_1.gif) no-repeat center center;"></div><!--<img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_1.gif" width="6" height="24"><br>--></td>';
    txt+='<td width="98%"><input type="text" name="" id="cName" value="Ваше имя" class="input2" onfocus="if (this.value == \'Ваше имя\') {this.value = \'\'}; this.style.backgroundColor=\'#ffffff\';" onblur="if (this.value == \'\') {this.value = \'Ваше имя\'}"><br></td>';
    txt+='<td width="1%" class="input_padding_1"><div style="width:6px;height:24px;background:url(/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_2.gif) no-repeat center center;"></div><!--<img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_2.gif" width="6" height="24"><br>--></td>';
    txt+='</tr></table>';
    txt+='</td>';
    txt+='<td width="20" valign="top" align="right">';
    txt+='<img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/backgrounds/savemenu_close.gif" style="width:9px;height:9px;position:relative;margin-left:10px;" onClick="closeWindow('+id+')">';
    txt+='</td>';
    txt+='</tr></table>';
    txt+='<table width="100%" cellpadding="0" cellspacing="0"><tr>';
    txt+='<td width="140" style="padding: 0 5 10 0">';
    txt+='<table width="100%" cellpadding="0" cellspacing="0"><tr>';
    txt+='<td width="1%" class="input_padding_1"><div style="width:6px;height:24px;background:url(/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_1.gif) no-repeat center center;"></div><!--<img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_1.gif" width="6" height="24"><br>--></td>';
    txt+='<td width="98%"><input type="text" name="" id="cPhone" value="Ваш телефон" class="input2" onfocus="if (this.value == \'Ваш телефон\') {this.value = \'\'}; this.style.backgroundColor=\'#ffffff\';" onblur="if (this.value == \'\') {this.value = \'Ваш телефон\'}"><br></td>';
    txt+='<td width="1%" class="input_padding_1"><div style="width:6px;height:24px;background:url(/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_2.gif) no-repeat center center;"></div><!--<img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_2.gif" width="6" height="24"><br>--></td>';
    txt+='</tr></table>';
    txt+='</td>';
    txt+='<td width="140" style="padding: 0 0 0 5">';
    txt+='<table width="100%" cellpadding="0" cellspacing="0"><tr>';
    txt+='<td width="1%" class="input_padding_1"><div style="width:6px;height:24px;background:url(/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_1.gif) no-repeat center center;"></div><!--<img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_1.gif" width="6" height="24"><br>--></td>';
    txt+='<td width="98%"><input type="text" name="" id="cMail" value="Ваш E-mail" class="input2" onfocus="if (this.value == \'Ваш E-mail\') {this.value = \'\'}; this.style.backgroundColor=\'#ffffff\';" onblur="if (this.value == \'\') {this.value = \'Ваш E-mail\'}"><br></td>';
    txt+='<td width="1%" class="input_padding_1"><div style="width:6px;height:24px;background:url(/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_2.gif) no-repeat center center;"></div><!--<img src="/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/corners/3_1_2.gif" width="6" height="24"><br>--></td>';
    txt+='</tr></table>';
    txt+='</td>';
    txt+='</tr></table>';
    txt+='<div class="comment_1">';
    txt+='<div class="corner_1"></div><div class="corner_2"></div><div class="corner_3"></div><div class="corner_4"></div>';
    txt+='<textarea name="" id="cText" class="input3" onfocus="if (this.value == \'Оставьте ваш отзыв\') {this.value = \'\'}; this.style.backgroundColor=\'#ffffff\';" onblur="if (this.value == \'\') {this.value = \'Оставьте ваш отзыв\'}">Оставьте ваш отзыв</textarea><br>';
    txt+='<a href="javascript:putCommentObject('+id+',\'PDM\',false)" class="gray_3"><div style="width:20px;height:20px;background:url(/CommonFiles/Yaposhka/WPG_Templates/Images/Yaposhka/icons/send_1.gif) no-repeat center center; float:left;"></div><div style="margin-top:3px;width:100px;">Отправить</div></a>';
    txt+='</div></form><div style="text-align:center;line-height:26px;height:26px;font-size:11px;">*поля "Ваше имя" и "Отзыв" обязательны, а так же "Телефон" или "E-mail"</div></div>';
    document.getElementById("comment").innerHTML=txt;
    document.getElementById("comment").style.display="block";
}
function closeWindow(id){
    document.getElementById("comment").style.display="none";
}
var errorArray=new Array();
function checkCommentForm(){
    flag=true;
    objName=document.getElementById("cName");
    objText=document.getElementById("cText");
    objPhone=document.getElementById("cPhone");
    objMail=document.getElementById("cMail");
    if (objName.value=="" || objName.value=="Ваше имя"){
	errorArray[errorArray.length]='cName';
	flag=false;
    }
    if (objText.value=="" || objText.value=="Оставьте ваш отзыв" || objText.value=="Ваш отзыв добавлен и ждет одобрения модератора. После одобрения, он будет добавлен на сайт"){
	errorArray[errorArray.length]='cText';
	flag=false;
    }
    if (objMail.value!="" && objMail.value!="Ваш E-mail" && !checkEMail(objMail.value)){
	errorArray[errorArray.length]='cMail';
	flag=false;
    }
    if (objPhone.value!="" && objPhone.value!="Ваш телефон" && !checkPhone(objPhone.value)){
	errorArray[errorArray.length]='cPhone';
	flag=false;
    }
    if ((objMail.value=="" || objMail.value=="Ваш E-mail") && (objPhone.value=="" || objPhone.value=="Ваш телефон")){
	errorArray[errorArray.length]='cPhone';
	errorArray[errorArray.length]='cMail';
	flag=false;
    }
    return flag;
}
function errorFields(){
    for(key in errorArray){
	if (!isNaN(key)){
	    obj=document.getElementById(errorArray[key]);
	    obj.style.backgroundColor = "#eeeeee";
	    obj.style.color = "#000000";
	    
	}
    }
    errorArray.splice(0,errorArray.length);
}