var zend=0;
function CheckFrmSMSearch() {
	var error = 0;
	var validlenght = "^.{2,}$";
	if ((FrmSmSearch.ss.value=="" && error==0) || FrmSmSearch.ss.value=="Что вы хотите найти?") { alert ('Введите строку поиска.'); error = 1; }
	if (FrmSmSearch.ss.value.match(validlenght)==null && error==0) { alert ('Строка поиска слишком мала.'); error = 1; }
	if (error==0) {
		FrmSmSearch.submit();
	} 
}

$(document).ready(function(){

 $.getScript('http://www.creditdeposit.com.ua/informersrc/?type=currency', function(){
	$('#rub_po').text(cRUBb);
    $('#rub_pr').text(cRUBa);
    $('#eur_po').text(cEURb);
    $('#eur_pr').text(cEURa);
    $('#usd_po').text(cUSDb);
    $('#usd_pr').text(cUSDa);																			
});

$('.menu a img').hide();
     $(".menu a").not(".select").hover(
		function() { $(this).find('img').fadeIn(200);  $('.mentext #'+$(this).attr('class')).fadeIn(200); }, 
		function() { $(this).find('img').fadeOut(600); $('.mentext #'+$(this).attr('class')).fadeOut(600); });
	 
 $('.delete').click(function(){
        temp = window.confirm('Вы действительно хотите произвести операцию удаления?');
        if (!temp) return false;						 
   });
})

function del(url)
{
	temp = window.confirm('Вы действительно хотите произвести операцию удаления?');
    if (temp) window.location=url;	
}

function country(data,start,selects)
{	
 $.ajax({ 
   type: "POST", 
   url: "ajax/city.php", 
   data:data,
   success: function(msg){
	 msg=msg.split('-$$-');
	 for(q=0; q<msg.length-1; q++)
	 {
	   qwe=q+(4-msg.length);
       $('select[name="'+selects[qwe]+'"]').html('');
	   msg[q]=msg[q].split('-!-');
	   for(i=0; i<msg[q].length-1; i++)
	   {
	     msg[q][i]=msg[q][i].split('-@-');
	     $('select[name="'+selects[qwe]+'"]').append('<option '+(start[qwe]==msg[q][i][0]?'selected':'')+' value="'+msg[q][i][0]+'">'+msg[q][i][1]+'</option>');
	   }
	 }
   } 
 });	 
}

function timyin(elemen, lang, them) 
 {
	tinyMCE.init({
		// General options
		language : lang,
		mode : "exact",
		elements : elemen,
		theme : them,
		skin : "o2k7",
		plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,images,mediamenager",

		// Theme options
		theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull",
		theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,|,insertdate,inserttime,preview,|,forecolor,backcolor",
		theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,advhr,|,print,|,ltr,rtl,|,fullscreen",
		theme_advanced_buttons4 : "",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true,

		content_css : "css/content.css",
		force_br_newlines : true,
		
		relative_urls : false,
		remove_script_host : true
	});
 }
