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 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 onFoldersLoadSuccess(xml) {
 	
	
      var ss = xml.split("+");
	
	var item_text = ss[0];
	var at_group_text = ss[1];
	
	$("div.attr").css("display", "none");
	$("#subfolders").html(ss[0]);

		
	
	if(at_group_text){
		$("#"+at_group_text).css("display", "");
		$("#type").find("option[@value='+at_group_text+']").attr("selected", "selected");
	}
}


function GetFolders(idparent) {
	
	if(parent==0){
		document.getElementById("subfolders").innerHTML = "";
		return;
	}
		
	document.getElementById("subfolders").innerHTML = "Загружаются подразделы, подождите...";
	
	$.get('/jslib/jfolders.php', {parent: idparent}, onFoldersLoadSuccess);
}


function DisplayAtGroup(value){
	$("div.attr").css("display", "none");
	var id = value.split("-");
	var group_id = "group-"+id[0];
	DisplayDiv(group_id);
}




function DisplayDiv(ID) {
	

	atts = document.getElementsByName('attributes');
	for (i = 0; i < atts.length; i++){
		item = atts[i];
		item.style.display = "none";
	}

	
	if(ID)
		document.getElementById(ID).style.display = (document.getElementById(ID).style.display == "none" ) ?  "" :   "none";
}



