/*this page crates an ajax request object. this page is included by other pages that need to perform XMLHttpRequest. */ var sbajax=false; if(window.XMLHttpRequest) sbajax=new XMLHttpRequest(); //IE 7,mozilla,safari,firefox.opera, mostbrowser else if(window.ActiveXObject) //older IE { try { sbajax = new ActiveXObejct("Msxml2.XMLHTTP"); } catch (e1) { try { sbajax = new ActiveXObejct("Microsoft.XMLHTTP"); } catch (e2) {} } } //if(!sbajax) //alert("Some page fuctionality is unavailable."); ///////////captcha functions function refresh_images(sbtemp_itemid,del)// 1 for add image 0 for remove { if(sbajax) { sbajax.open('get','getimages.php?sbtemp_itemid='+sbtemp_itemid+'&del='+del); if(del==1) sbajax.onreadystatechange=handle_refresh_images; else sbajax.onreadystatechange=handle_delete_images; sbajax.send(null); return false; } } function handle_refresh_images() { if((sbajax.readyState==4) && (sbajax.status==200)) window.opener.document.getElementById('imagethumb').innerHTML=sbajax.responseText; } function handle_delete_images() { if((sbajax.readyState==4) && (sbajax.status==200)) document.getElementById('imagethumb').innerHTML=sbajax.responseText; } /////=========== function refresh_videos(sbtemp_itemid,del)// 1 for add video 0 for remove { if(sbajax) { sbajax.open('get','getvideos.php?sbtemp_itemid='+sbtemp_itemid+'&del='+del); if(del==1) sbajax.onreadystatechange=handle_refresh_videos; else sbajax.onreadystatechange=handle_delete_videos; sbajax.send(null); return false; } } function handle_refresh_videos() { if((sbajax.readyState==4) && (sbajax.status==200)) window.opener.document.getElementById('videothumb').innerHTML=sbajax.responseText; } function handle_delete_videos() { if((sbajax.readyState==4) && (sbajax.status==200)) document.getElementById('videothumb').innerHTML=sbajax.responseText; } function sbshow_country(country,type) { country_str = ""; if(type=='con') { if(country.selectedIndex==0) country_str="-1"; else { for(i=0;i< country.options.length;i++)////getting allowed countries { if(country.options[i].selected==true) { if(country_str != "") country_str = country_str+","+country.options[i].value; else country_str = country_str+country.options[i].value; } } } if(country_str == "") country_str="-1"; }else country_str=country.value; if(sbajax) { sbajax.open('get','showlocation.php?clist='+country_str+'&listtype='+type); if(type=="con") sbajax.onreadystatechange=handle_country; else sbajax.onreadystatechange=handle_state; sbajax.send(null); return false; } } function handle_country() { if((sbajax.readyState==4) && (sbajax.status==200)) { document.getElementById('def_country').innerHTML=sbajax.responseText; sbshow_country(default_country,'st'); } } function handle_state() { if((sbajax.readyState==4) && (sbajax.status==200)) document.getElementById('def_state').innerHTML=sbajax.responseText; } //////////======== function sbshow_state(country,state) { if(sbajax) { sbajax.open('get','showstate.php?clist='+country.value+'&state='+state);//showstate.php is placed at both end so please make changes in both files in case of any update required sbajax.onreadystatechange=sbdisplay_state; sbajax.send(null); return false; } } function sbdisplay_state() { if((sbajax.readyState==4) && (sbajax.status==200)) document.getElementById('sbstateid').innerHTML=sbajax.responseText; }