

function AddTemplatesToContentType( template_id, page, content_type ){
	
	var pagesSelect = document.getElementById("page_select_" + template_id);
	
	var optionsStr = ";";
	
	for( var r = pagesSelect.options.length-1; r >= 0; r-- ){
					
		var TheOption = pagesSelect.options[r];
		
		if( TheOption.selected == true ){
			
			optionsStr = optionsStr + TheOption.value + ";";
		}
	}
		
	xmlhttp.open('POST', "template_admin/page_to_template.php", false);
	
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	sendString = "content_type_id=" + page + "&template_id=" + template_id + "&pages=" + optionsStr;	
	
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
		OpenTemplateFolder(page, content_type);
	}
	
}

function UpdateOrder( tbl, id, form, tab, sub, step, fld, group, V, Prefix, ParentObj, StartNum, action ){	
	
	var xmlhttp_1 = new XMLHttpRequest();
	
	xmlhttp_1.onreadystatechange = 
		function () {
			
			if( xmlhttp_1.readyState == 4 ){
				
				var xmlResponse = xmlhttp_1.responseText;	
				document.getElementById("loading_div").style.display = "none";
				
			}
		};
	
	document.getElementById("loading_div").style.display = "block";
	
 	xmlhttp_1.open('POST', "order_move.php", true);
	xmlhttp_1.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	
	var sendString = "tbl=" + tbl + "&id=" + id + "&form=" + form + "&tab=" + tab + "&sub=" + sub + "&step=" + step + "&group=" + group + "&action=" + action;
	
	if( fld != "" ){
		
		sendString = sendString + "&fld=" + fld;
	}
	
	xmlhttp_1.send(sendString);
	
	/////////////////////////////////////////////
	
	ParentDiv = document.getElementById(ParentObj);		
		
	if( fld=="" ){
		
		HiddenPrefix = sub + "_ordering_div_" + id;
	}
	else{
		
		HiddenPrefix = sub + "_inner_group_" + group + "_" + id;	
	}		
	
	V_Object = document.getElementById("ord_" + HiddenPrefix);
	
	var V = V_Object.value;		
	
	if( action == "up" ){
		
		var point = parseInt(V) - 1;
	}
	else{
		
		var point = parseInt(V) + 1;
	}		
			
	prevPoint = parseInt(V);		
	
	childsArray = ParentDiv.childNodes;
	
	var DivsArray = new Array();
	
	var D=0;
	for( i=0; i<childsArray.length; i++ ){	
		
		if( childsArray[i].id !=undefined && childsArray[i].className == "ordering_div" ){
			
			DivsArray[D] = childsArray[i];				
			D++;
		}
	}
	
	for( i=0; i < DivsArray.length; i++ ){
		
		if( i!=prevPoint && i!=point ){
				
			var TheDiv = DivsArray[i];
		}
		
		if( i == point ){
				
			var TheDiv = DivsArray[prevPoint];				
			var TheHidden = document.getElementById("ord_" + TheDiv.id);	
			TheHidden.value = point;
		}
		
		if( i == prevPoint ){
			
			var TheDiv = DivsArray[point];				
			var TheHidden = document.getElementById("ord_" + TheDiv.id);
			TheHidden.value = prevPoint;
		}
		
		var TheDivId = TheDiv.id;
		
		var UpPointer = document.getElementById("up_pointer_" + TheDivId );
		var DownPointer = document.getElementById("down_pointer_" + TheDivId );
		
		DownPointer.style.display = "";
		UpPointer.style.display = "";
		
		if( i == 0 ){
			
			DownPointer.style.display = "";
			UpPointer.style.display = "none";
		}
		
		if( i == DivsArray.length-1 ){
			
			DownPointer.style.display = "none";
			UpPointer.style.display = "";
		}
		
		ParentDiv.appendChild( TheDiv );
	}
}

function UpdateSelectOptions(TheSelect, OptionsString){	
	
	for( var r = TheSelect.options.length-1; r >= 0; r-- ){
					
		TheSelect.remove(TheSelect.options[r]);
	}
							
	var OptionSArr = OptionsString.split("[&];"); 
	
	for( op=0; op < OptionSArr.length; op++ ){
		
		if( OptionSArr[op] !=""){
			
			var OneOptionStr = OptionSArr[op].split("[^];"); 					
			var OptioniK = document.createElement('option');
			
			OptioniK.text = OneOptionStr[1];
			OptioniK.value = OneOptionStr[0];
			
			if( OptioniK.value != "undefined" && OptioniK.text != "undefined" ){
				
				try {
				
					TheSelect.add(OptioniK, null);
				}
				catch(ex) {
					
					TheSelect.add(OptioniK);
				}
			}
		}
	}
}

function TemplateModuleSelect(num){	
	
	if( document.getElementById('module_' + num).value == 0 ){
		
		var TheDisplay = "visible";
		document.getElementById('module_file_td_' + num ).style.visibility = "hidden";
	}
	else{
		
		var TheDisplay = "hidden";
		document.getElementById('module_file_td_' + num ).style.visibility = "visible";
	}
	
	for( i=1; document.getElementById('content_tr_' + i + '_' + num) != undefined; i++ ){
			
		document.getElementById('content_tr_' + i + '_' + num).style.visibility = TheDisplay;
	}
	
	var module = document.getElementById('module_' + num).value;
	
	xmlhttp.open('POST', "module_file.php", false);	
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	
	sendString = "module=" + module;	
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
		
		var xmlResponse = xmlhttp.responseText;
		
		var TheSelect = document.getElementById('module_file_' + num);	
		
		UpdateSelectOptions(TheSelect, xmlResponse);
		
	}
}






function GetCountry(ip){
	
	xmlhttp.open('POST', "http://www.formyip.com/ipcountry_popup.php", false);
	
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	sendString = "ipaddresses=" + ip ;	
		
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}	
	
	alert(xmlResponse);	
}


function OpenPageEdit(id, parent, order){	
	
	document.getElementById("loading_div").style.display = "block";
	
	xmlhttp.onreadystatechange = 
		function () {
			
			if ( xmlhttp.readyState == 4 ){	
		
				var xmlResponse = xmlhttp.responseText;
				
				document.getElementById('OpenPageEdit').innerHTML = xmlResponse;
				document.getElementById('OpenPageEdit').className='show_div';
				document.getElementById("loading_div").style.display="none";
			}	
		};	
	
	xmlhttp.open('POST', "page_admin/get_page_properties.php", true);
	
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	sendString = "id=" + id + "&parent=" + parent + "&order=" + order;	
	
	xmlhttp.send(sendString);	
}


function OpenContentGroupEdit(id){
	
	xmlhttp.open('POST', "edit_content_group.php", false);
	
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	sendString = "id=" + id;	
		
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}		
	
	document.getElementById('OpenPageEdit').innerHTML = xmlResponse;
	document.getElementById('OpenPageEdit').className='show_div';
}


function ChageDelivaryStatus(Order){
	
	xmlhttp.open('POST', "change_delivary_status.php", false);
	
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	
	sendString = "order=" + Order;
		
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}		
	
	if( xmlResponse != "false" ){
		
		if( xmlResponse ==0 ){
			
			document.getElementById('delivary_b_' + Order).innerHTML = "Not delivered";
			document.getElementById('delivary_b_' + Order).className = "not_del_b";
		}
		
		if( xmlResponse ==1 ){
			
			document.getElementById('delivary_b_' + Order).innerHTML = "Delivered";
			document.getElementById('delivary_b_' + Order).className = "del_b";
		}
	}	
}

function OpenContentAreaEdit(id){
	
	xmlhttp.open('POST', "edit_content_area.php", false);
	
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	sendString = "id=" + id;	
		
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}		
	
	document.getElementById('OpenPageEdit').innerHTML = xmlResponse;
	document.getElementById('OpenPageEdit').className='show_div';
}


function OpenContentEditor(page){
	
	document.getElementById("loading_div").style.display="block";
	
	xmlhttp.onreadystatechange = 
		function () {
			
			if ( xmlhttp.readyState == 4 ){	
		
				var xmlResponse = xmlhttp.responseText;
				
				document.getElementById('OpenContentEditor').innerHTML = xmlResponse;
				document.getElementById('OpenContentEditor').className='show_div';
				document.getElementById("loading_div").style.display="none";
			}	
		};
		
	
	xmlhttp.open('POST', "template_admin/content_editor.php", true);
	
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	sendString = "page=" + page;	
		
	xmlhttp.send(sendString);	
}

function OpenContentTypeEditor(page){
	
	xmlhttp.open('POST', "template_admin/content_type_editor.php", false);
	
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	sendString = "page=" + page;	
		
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}		
	
	document.getElementById('OpenContentEditor').innerHTML = xmlResponse;
	document.getElementById('OpenContentEditor').className='show_div';
}

function ResetTemplate(page, content_type){
	
	xmlhttp.open('POST', "template_admin/page_to_template.php", false);
	
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	sendString = "page=" + page + "&reset=1" + "&content_type=" + content_type;	
	//alert(sendString);	
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
		//alert(xmlResponse);
		OpenTemplateFolder(page, content_type);
	}
}

function AddTemplateToPage(page, template, content_type){	
	
	xmlhttp.open('POST', "template_admin/page_to_template.php", false);
	
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	sendString = "page=" + page + "&template=" + template + "&content_type=" + content_type;	
		
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		OpenTemplateFolder(page, content_type);
	}	
}

function checkingPageName( pageId, submit ){
	
	var xmlhttp_name = new XMLHttpRequest();
	
	document.getElementById("page_name_gif").style.display="";
	document.getElementById("up_page_name_gif").style.display="";
	
	var nameSpan = document.getElementById("page_title_span");
	
	var messageTd = document.getElementById("message_td");
	messageTd.innerHTML = "&nbsp;";
	
	var up_messageTd = document.getElementById("up_message_td");
	up_messageTd.innerHTML = "&nbsp;";
	
	var pageName = document.getElementById("page_title").value;	
	
	nameSpan.innerHTML = pageName;
	
	pageName = encodeBase64(pageName);
	
	
	xmlhttp_name.onreadystatechange = 
		function () {
			
			if ( xmlhttp_name.readyState == 4 ){	
		
				var xmlResponse = xmlhttp_name.responseText;		
				
				if( parseInt(xmlResponse)==1 ){
					
					up_messageTd.innerHTML = messageTd.innerHTML = "&nbsp;";
					if( submit==1 && parseInt(xmlResponse)==1 ){
						
						document.getElementById("page_edit_form").submit();
					}
				}
				else{
					
					if( parseInt(xmlResponse)==0 ){
						
						up_messageTd.innerHTML = messageTd.innerHTML = "Page with this name already exists";
					}
					
					if( parseInt(xmlResponse)==2 ){
						
						up_messageTd.innerHTML = messageTd.innerHTML = "Empty page name";
					}
					
					if( parseInt(xmlResponse)==3 ){
						
						up_messageTd.innerHTML = messageTd.innerHTML = "Not allowed simbols";
					}
				}
							
				document.getElementById("page_name_gif").style.display="none";
				document.getElementById("up_page_name_gif").style.display="none";
			}	
		};
	
	xmlhttp_name.open('POST', "page_admin/check_page_name.php", true);
	
	xmlhttp_name.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	
	sendString = "id=" + pageId + "&name=" + pageName;		
	
	xmlhttp_name.send(sendString);
}


function OpenTemplateFolder(id, content_type){
	
	document.getElementById("loading_div").style.display="block";
	
	xmlhttp.onreadystatechange = 
		function () {
			
			if ( xmlhttp.readyState == 4 ){	
		
				var xmlResponse = xmlhttp.responseText;
				
				document.getElementById('OpenPageEdit').innerHTML = xmlResponse;
				document.getElementById('OpenPageEdit').className='show_div';
				document.getElementById("loading_div").style.display="none";
			}	
		};
	
	xmlhttp.open('POST', "template_admin/get_list.php", true);
	
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	sendString = "id=" + id + "&content_type=" + content_type;	
		
	xmlhttp.send(sendString);	
}

function AddToContentTypeGroup(GroupId){
	
	xmlhttp.open('POST', "add_content_type_group.php", false);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	
	id = document.getElementById('add_content_type_group').value;
	
	sendString = "id=" + id + "&group_id=" + GroupId;	
	
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}
	
	document.getElementById('put_content_group_list').innerHTML = xmlResponse;	
}

function DeleteContentTypeGroup(Id, GroupId){
	
	xmlhttp.open('POST', "delete_content_type_group.php", false);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	
	sendString = "id=" + Id + "&group_id=" + GroupId;	
	
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}
	
	document.getElementById('put_content_group_list').innerHTML = xmlResponse;	
}

function DeleteContentTypeArea(Id, AreaId){
	
	xmlhttp.open('POST', "delete_content_type_area.php", false);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	
	sendString = "id=" + Id + "&area_id=" + AreaId;		
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}
	
	document.getElementById('put_content_area_list').innerHTML = xmlResponse;	
}


function DeleteBannerArea(Banner, AreaId){
	
	xmlhttp.open('POST', "delete_banner_area.php", false);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	
	sendString = "banner=" + Banner + "&area_id=" + AreaId;	
	
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}
	
	document.getElementById('put_banner_area_list').innerHTML = xmlResponse;	
}



function AddInArea(ContentType){
	
	xmlhttp.open('POST', "add_content_in_area.php", false);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	
	var AreaId = document.getElementById('add_in_area_' + ContentType).value;
	
	sendString = "content=" + ContentType + "&area=" + AreaId;	
	
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
		document.getElementById('option_area_' + xmlResponse + ContentType).selected = true;	
	}
}


function AddBannerInArea(banner){
	
	xmlhttp.open('POST', "add_banner_in_area.php", false);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');		
	
	sendString = "banner=" + banner;	
	
	var selObj = document.getElementById('add_in_area_' + banner);
	
	var count = 0;
	for( var i=0; i<selObj.options.length; i++ ){
		
		if( selObj.options[i].selected ){
			
			sendString = sendString + "&option_" + count + "=" + selObj.options[i].value;
			count++;
		}
	}
	
	xmlhttp.send(sendString);	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}	
}

function SaveContentTypeInArea(AreaId){
	
	xmlhttp.open('POST', "add_type_in_area.php", false);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	
	var ContType = document.getElementById('content_types').value;
	var ContOrder = document.getElementById('type_order').value;
	var ContLimit = document.getElementById('type_limit').value;
	
	sendString = "content=" + ContType + "&order=" + ContOrder + "&limit=" + ContLimit + "&area=" + AreaId;	
	
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
		
		document.getElementById('cont_type_' + xmlResponse).selected = true;	
		document.getElementById('type_order_' + ContOrder).selected = true;	
		document.getElementById('type_limit').value = ContLimit;	
	}
}




/*
function getImage(img){  
  
	xmlhttp.open('POST', "get_image.php", false);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	sendString = "img=" + img ;	
		
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}
	
	pop = document.getElementById('PopupImg');
	pop.innerHTML = xmlResponse;
	pop_offset (pop, 0, 0 );
	pop.className='show';
}


function open_div(id, player){  
  
	xmlhttp.open('POST', "get_video.php", false);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	
	sendString = "id=" + id + "&player=" + player;	
		
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}
	
	pop = document.getElementById('PopupVideo');
	pop.innerHTML = xmlResponse;
	pop_offset (pop, 300, 150 );
	pop.className = 'show';
}
*/



/*function UpdateSelectOptions(TheSelect, OptionsString){
	
	for( var r = TheSelect.options.length-1; r >= 0; r-- ){
					
		TheSelect.remove(TheSelect.options[r]);
	}
							
	var OptionSArr = OptionsString.split("[&];"); 
	
	for( op=0; op < OptionSArr.length; op++ ){
		
		if( OptionSArr[op] !=""){
			
			var OneOptionStr = OptionSArr[op].split("[^];"); 					
			var OptioniK = document.createElement('option');
			
			OptioniK.text = OneOptionStr[1];
			OptioniK.value = OneOptionStr[0];
			
			if( OptioniK.value>=0 && OptioniK.text != "undefined" ){
				
				try {
				
					TheSelect.add(OptioniK, null);
				}
				catch(ex) {
					
					TheSelect.add(OptioniK);
				}
			}
		}
	}
}*/

function UpdateSelectByParent(GroupId, FormPrefix, ParentType, Lang, AjaxNum, ParentString){		
	
	var SelectsArray = document.getElementsByTagName("select");	
	var ParentValue = document.getElementById(FormPrefix).value;
	
	for( i=0; i<SelectsArray.length; i++ ){				
		
		TheSelect = SelectsArray[i];		
		var TheSelectId = TheSelect.id;		
		var TheSelectType = document.getElementById(TheSelectId + "_Type").value;
		
		if( TheSelectId.search("_ChangeMe" + GroupId + AjaxNum + ParentType) != -1 ){
			
			xmlhttp.open('POST', "ajax.php?action=update_select", false);
			xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
			sendString = "parent_id=" + ParentValue + "&type=" + TheSelectType + "&lang=" + Lang + "&parent_type=" + ParentType;	
			
			if( ParentString!="" ){
				
				sendString = sendString + "&parent_string=" + ParentString;
			}
			
			xmlhttp.send(sendString);
			
			if ( xmlhttp.readyState == 4 ){		
				
				var xmlResponse = xmlhttp.responseText;	
				
				UpdateSelectOptions(TheSelect, xmlResponse);		
				
				var ParentString = ";";
				
				var OptionsArr = TheSelect.options;
				
				var detect = 0;
				
				for( var o=0; o<OptionsArr.length; o++ ){
					
					ParentString = ParentString + OptionsArr[o].value + ";";
					if( parseInt(OptionsArr[o].value)>0 ){
						
						detect = 1;
					}
				}
					
				UpdateSelectByParent(GroupId, TheSelect.id, TheSelectType, Lang, AjaxNum, ParentString);							
			}
		}
	}
}


function BannerClick(banner, user, session_id){
	
	xmlhttp.open('POST', "baner_click.php", false);
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	
	sendString = "banner=" + banner + "&user=" + user + "&session_id=" + session_id;
	
	xmlhttp.send(sendString);
}


function AddToFavorite(Id, CloneTd, customer){
	
	xmlhttp.open('POST', "add_to_favorite.php", false);
	
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	
	sendString = "id=" + Id + "&clone=" + CloneTd + "&customer=" + customer;		
	
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}	
	
	document.getElementById("add_to_favorite_" + Id).innerHTML = '<span style="color:#666666; font-size:10px;"><u>В "портфель"</u></span> |';
}


function UpdatePic(pic_id, img_r){
	
	xmlhttp.open('POST', "update_picture.php", false);
	
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	
	sendString = "Id=" + pic_id + "&img_r=" + img_r;	
	
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}	
	
	document.getElementById("popup_pic").innerHTML = xmlResponse;	
}


function AddAddonDates(Id){	
	
	xmlhttp.open('POST', "addon_in_shop.php", false);
	
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	
	var address = document.getElementById('addon_address').value;
	var phone = document.getElementById('addon_phone').value;
	var postal_code = document.getElementById('addon_postal_code').value;
	
	sendString = "id=" + Id + "&address=" + address + "&phone=" + phone + "&postal_code=" + postal_code;
	
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 ){	
	
		var xmlResponse = xmlhttp.responseText;
	}	
}

function UpdateSelect(id)
{
	xmlhttp.open('POST', "update_child.php?id="+id, false);
	
	xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');	
	
	parent_id = document.getElementById("id_izdanie").value;
	
	sendString = "parent_id=" + parent_id;	
	
	xmlhttp.send(sendString);
	
	if ( xmlhttp.readyState == 4 )
	{
		var xmlResponse = xmlhttp.responseText;
	}	
	
	document.getElementById("razdel").innerHTML = xmlResponse;	
}


function pop_offset (pop, ox,oy){

	mouse_x = cursorObj.getX();
	mouse_y = cursorObj.getY();
	

	var is_ie    = /MSIE/.test(navigator.userAgent);
		
	if (is_ie)
	{
    	pop.style.top  = (document.body.scrollTop + (oy > 0 ? oy : mouse_y)) + 'px';
    	pop.style.left = (document.body.scrollLeft + (ox > 0 ? ox : mouse_x)) + 'px';
	}
	else
	{
    	pop.style.top  = (window.scrollY + (oy > 0 ? oy : mouse_y)) + 'px';
    	pop.style.left = (window.scrollX + (ox > 0 ? ox : mouse_x)) + 'px';
	}
	
}

