var applycook=document.getElementsByTagName('*');
for(var cook=0; cook < applycook.length; cook++){
	var newclass=getCookie(applycook[cook].id+'_style');
	var display=getCookie(applycook[cook].id+'_display');
	if(newclass.length > 0 && applycook[cook].id+'_style'!=='_style')applycook[cook].className=newclass;
	if(display.length > 0 && (applycook[cook].id=='menformular' || applycook[cook].id=='menarhiva')){}
	if(display.length > 0 && (applycook[cook].id.match('mainsubcontent') || applycook[cook].id.match('mainsubcontent'))){}
	else if(display.length > 0 && applycook[cook].id!==''){applycook[cook].style.display=display;}
	}
if(existtag('a','alink')){
	var removehref=entireTag('a','alink');
	for(ahr=0; ahr < removehref.length; ahr++ ){
		if(element(removehref[ahr]).getAttribute('type')=='folder')element(removehref[ahr]).href='javascript:void(0)';
		else eventRemove(element(removehref[ahr]),"onclick",'');
	}
}
if(existtag('div','folder'))outputType('folder');
if(existtag('div','file'))outputType('file');
if(existtag('div','folder') && document.location.href.match('imagini'))outputType('image');
document.onmousemove = getMouseXY;
if(existtag('div','accordion')){
// Functie armonica
	$(function() {
			$("#accordion").accordion({ autoHeight: false});
		});
}

$(document).ready(function () {
	var men=$('div.folder');
	var den=false;
	for(xi=0; xi < men.length; xi++){
		if(men[xi].style.display=='block')den=true;
		}
	if(!den)$('div#menoff').css("display","block");
	$('.ascPrice, a.button').button();
	$('.backbtn').button({icons: {primary: "ui-icon-arrowreturnthick-1-w"},text: "inapoi"});
	$('#openfilter').button();
	$('#homebtn').button();
//	$("[title]").tooltip();
	$('.login .form input.button').button();
	$('button.button').button();
	$formularA="Completati formularul pentru a primi informatii pe mail<hr><table style='margin-top:30px;'><tr><td>Nume/Preunue</td><td><input type='text' class='forA'></td></tr><tr><td>Email</td><td><input type='text'  class='forA'></td></tr><tr><td>Telefon</td><td><input type='text' class='forA'></td></tr></table>";
	$('.ascPrice').click(function(){
		$.confirm({
			height:300,
			title:"Cerere cotatie de pret",
			text:$formularA,
			text_true:"Send",
			ontrue:function(){
			  //$('input').each(function(i){alert($(this).val());})
			}
		});
	});
	if(document.location.href.match('/admin')){
		$('input[name="radioDom"]').each(function(){
			if($(this).val().match($.cookie('radioDom'))){//alert($(this).val());
				$(this).attr('checked',true);
				$(this).click();
			}
		});
	}
});
