if(typeof XMLHttpRequest=="undefined"){XMLHttpRequest=function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}
try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}
try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}
try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}
throw new Error("This browser does not support XMLHttpRequest or XMLHTTP.")};}
if(!xmlhttp&&typeof(XMLHttpRequest)!='undefined'){var xmlhttp=new XMLHttpRequest();}
if(!xmlhttp1&&typeof(XMLHttpRequest)!='undefined'){var xmlhttp1=new XMLHttpRequest();}
if(!xmlhttp2&&typeof(XMLHttpRequest)!='undefined'){var xmlhttp2=new XMLHttpRequest();}
if(!xmlhttp3&&typeof(XMLHttpRequest)!='undefined'){var xmlhttp3=new XMLHttpRequest();}
if(!xmlhttp4&&typeof(XMLHttpRequest)!='undefined'){var xmlhttp4=new XMLHttpRequest();}
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;}}
function UpdatePackages(lang,NewsId){xmlhttp.open('POST',"update_packages.php",false);var PackageParent=document.getElementById("parent_id_id").value;xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');sendString="parent_id="+PackageParent+"&lang="+lang+"&news="+NewsId;xmlhttp.send(sendString);if(xmlhttp.readyState==4){var xmlResponse=xmlhttp.responseText;}
document.getElementById('package_td_'+lang).innerHTML=xmlResponse;}
function UpdateFeatures(lang,NewsId){xmlhttp.open('POST',"update_features.php",false);var PackageParent=document.getElementById("parent_id_id").value;xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');sendString="feature_id="+PackageParent+"&lang="+lang+"&news="+NewsId;xmlhttp.send(sendString);if(xmlhttp.readyState==4){var xmlResponse=xmlhttp.responseText;}
document.getElementById('feature_td_'+lang).innerHTML=xmlResponse;}
function OpenPageEdit(id,parent,order){xmlhttp.open('POST',"page_admin/get_page_properties.php",false);xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');sendString="id="+id+"&parent="+parent+"&order="+order;xmlhttp.send(sendString);if(xmlhttp.readyState==4){var xmlResponse=xmlhttp.responseText;}
document.getElementById('OpenPageEdit').innerHTML=xmlResponse;document.getElementById('OpenPageEdit').className='show_div';}
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){xmlhttp.open('POST',"template_admin/content_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 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 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 OpenTemplateFolder(id,content_type){xmlhttp.open('POST',"template_admin/get_list.php",false);xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');sendString="id="+id+"&content_type="+content_type;xmlhttp.send(sendString);if(xmlhttp.readyState==4){var xmlResponse=xmlhttp.responseText;}
document.getElementById('OpenPageEdit').innerHTML=xmlResponse;document.getElementById('OpenPageEdit').className='show_div';}
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 SendMessage(){xmlhttp.open('POST',"client_refresh.php",false);xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');var message=document.getElementById('message').value;var support=document.getElementById('support_id').value;if(trim(message)==""){alert("Поле для сообщения пусто.");}
else{document.getElementById("loading_div").style.display="block";sendString="message="+message+"&support="+support+"&send=send&update=0";xmlhttp.send(sendString);if(xmlhttp.readyState==4){var xmlResponse=xmlhttp.responseText;document.getElementById("message_td").innerHTML=xmlResponse;document.getElementById('message').value="";}}
document.getElementById("loading_div").style.display="none";}
function SendSupportMessage(){xmlhttp.open('POST',"show_client_msg.php",false);xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');var message=document.getElementById('message').value;var client=document.getElementById('client_id').value;var session=document.getElementById('session_id').value;if(session==0){alert("Please choose the guest");}else{if(trim(message)==""){alert("Поле для сообщения пусто.");}else{document.getElementById("loading_div").style.display="block";sendString="message="+message+"&client_id="+client+"&session_id="+session+"&send=send";xmlhttp.send(sendString);if(xmlhttp.readyState==4){var xmlResponse=xmlhttp.responseText;document.getElementById("message_td").innerHTML=xmlResponse;document.getElementById('message').value="";}}}
document.getElementById("loading_div").style.display="none";}
function ShowClientMsg(clientId,sessionId){document.getElementById("loading_div").style.display="block";xmlhttp.open('POST',"show_client_msg.php",false);xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');sendString="client_id="+clientId+"&session_id="+sessionId;xmlhttp.send(sendString);if(xmlhttp.readyState==4){var xmlResponse=xmlhttp.responseText;document.getElementById("message_td").innerHTML=xmlResponse;document.getElementById("client_id").value=clientId;document.getElementById("session_id").value=sessionId;ShowOnline();NewMessage();}
document.getElementById("loading_div").style.display="none";}
function ClientRefresh(){document.getElementById("loading_div").style.display="block";xmlhttp.open('POST',"client_refresh.php",false);xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');sendString="update="+0;xmlhttp.send(sendString);if(xmlhttp.readyState==4){var xmlResponse=xmlhttp.responseText;document.getElementById("message_td").innerHTML=xmlResponse;}
document.getElementById("loading_div").style.display="none";}
function SupportRefresh(status,client,session,s_c){document.getElementById("loading_div").style.display="block";xmlhttp.open('POST',"support_refresh.php",false);xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');sendString="status="+status+"&client="+client+"&session="+session+"&s_c="+s_c;xmlhttp.send(sendString);if(xmlhttp.readyState==4){var xmlResponse=xmlhttp.responseText;document.getElementById("message_td").innerHTML=xmlResponse;ShowOnline();NewMessage();}
document.getElementById("loading_div").style.display="none";}
function UpdateMsg(){document.getElementById("loading_div").style.display="block";xmlhttp4.open('POST',"client_refresh.php",false);xmlhttp4.setRequestHeader('Content-Type','application/x-www-form-urlencoded');sendString="update="+1;xmlhttp4.send(sendString);if(xmlhttp4.readyState==4){var xmlResponse=xmlhttp4.responseText;if(xmlResponse!=""){document.getElementById("message_td").innerHTML=xmlResponse;}}
document.getElementById("loading_div").style.display="none";setTimeout("UpdateMsg();",30000);}
function ClientMsgPager(num){document.getElementById("loading_div").style.display="block";xmlhttp.open('POST',"client_refresh.php",false);xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');sendString="num="+num;xmlhttp.send(sendString);if(xmlhttp.readyState==4){var xmlResponse=xmlhttp.responseText;if(xmlResponse!=""){document.getElementById("message_td").innerHTML=xmlResponse;}}
document.getElementById("loading_div").style.display="none";}
function SupportMsgPager(num,client,session){document.getElementById("loading_div").style.display="block";xmlhttp.open('POST',"show_client_msg.php",false);xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');sendString="num="+num+"&client_id="+client+"&session_id="+session;xmlhttp.send(sendString);if(xmlhttp.readyState==4){var xmlResponse=xmlhttp.responseText;if(xmlResponse!=""){document.getElementById("message_td").innerHTML=xmlResponse;}}
document.getElementById("loading_div").style.display="none";}
function ShowOnline(){document.getElementById("loading_div").style.display="block";xmlhttp1.open('POST',"show_online.php",false);xmlhttp1.setRequestHeader('Content-Type','application/x-www-form-urlencoded');sendString="update="+1;xmlhttp1.send(sendString);if(xmlhttp1.readyState==4){var xmlResponse=xmlhttp1.responseText;document.getElementById("online_td").innerHTML=xmlResponse;}
document.getElementById("loading_div").style.display="none";setTimeout("ShowOnline();",30000);}
function OnlineSupport(){document.getElementById("loading_div").style.display="block";xmlhttp1.open('POST',"online_support.php",false);xmlhttp1.setRequestHeader('Content-Type','application/x-www-form-urlencoded');sendString="update="+1;xmlhttp1.send(sendString);if(xmlhttp1.readyState==4){var xmlResponse=xmlhttp1.responseText;var xmlpos1=xmlResponse.indexOf("||");var xmlpos2=xmlResponse.indexOf("||",xmlpos1+2);var xmlResponse1=xmlResponse.substr(0,xmlpos1);var xmlResponse2=xmlResponse.substr(xmlpos1+2,(xmlpos2-xmlpos1-2));var xmlResponse3=xmlResponse.substr(xmlpos2+2);document.getElementById("onlinesupporttd").innerHTML=xmlResponse1;document.getElementById("onlinesupportdrop").innerHTML=xmlResponse3;document.getElementById("support_id").value=xmlResponse2;}
document.getElementById("loading_div").style.display="none";setTimeout("OnlineSupport();",30000);}
new_message="false";set_title=0;function NewMessage(){document.getElementById("loading_div").style.display="block";xmlhttp2.open('POST',"support_new_message.php",false);xmlhttp2.setRequestHeader('Content-Type','application/x-www-form-urlencoded');sendString="update="+1;xmlhttp2.send(sendString);if(xmlhttp2.readyState==4){var xmlResponse=xmlhttp2.responseText;if(xmlResponse!=""){if(new_message!="true"){new_message="true";ChangeTitle();}}else{new_message="false";}}
document.getElementById("loading_div").style.display="none";setTimeout("NewMessage();",30000);}
function ChangeTitle(){if(set_title==0){document.title="New Message";set_title=1;}else{document.title="*************";set_title=0;}
if(new_message=="true"){setTimeout("ChangeTitle();",500);}else{document.title="Advanced Development Team";}}
function UpdateFrame(){xmlhttp3.open('POST',"frame.php",false);xmlhttp3.setRequestHeader('Content-Type','application/x-www-form-urlencoded');sendString="update="+1;xmlhttp3.send(sendString);if(xmlhttp3.readyState==4){var xmlResponse=xmlhttp3.responseText;}
setTimeout("UpdateFrame();",30000);}
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';}};function c_focus(type,c_id){if(type=="text"){for(i=1;i<=3;i++){if(c_id==i){document.getElementById('c_'+i).className='form_text_act';}else{document.getElementById('c_'+i).className='form_text';}}
document.getElementById('c_'+4).className='form_textarea';}else if(type=="textarea"){for(i=1;i<=3;i++){document.getElementById('c_'+i).className='form_text';}
document.getElementById('c_'+4).className='form_textarea_act';}else if(type=="blur"){for(i=1;i<=3;i++){document.getElementById('c_'+i).className='form_text';}
document.getElementById('c_'+4).className='form_textarea';}}
function trim(stringToTrim){return stringToTrim.replace(/^\s+|\s+$/g,"");}
