/* common */ function getXmlHttpObject() { var xmlHttp=null; try { xmlHttp=new XMLHttpRequest(); } catch( e ) { try { xmlHttp=new ActiveXObject( "Msxml2.XMLHTTP" ); } catch( e ) { xmlHttp=new ActiveXObject( "Microsoft.XMLHTTP" ); } } return xmlHttp; } /* save photo */ function savePhoto( id ) { xmlHttp=getXmlHttpObject(); if( xmlHttp==null ) { return; } var DHTML=( document.getElementById || document.all ); if( DHTML ) { xmlHttp.onreadystatechange=function() { savePhotoDone(); }; var url="/ajax/save-photo.php?id="+id+"&t="+Math.random(); xmlHttp.open( "GET",url,true ); xmlHttp.send( null ); } } function savePhotoDone() { if( xmlHttp.readyState==4 ) { var DHTML=( document.getElementById || document.all ); if( DHTML ) { var response=xmlHttp.responseText; var x1=new getObj( 'savecounter' ); x1.obj.innerHTML=response; showinfo( 1,"Photo saved","Use the links on the left menu to view your saved items and basket." ); } } } /* buy photo */ function buyPhoto( id ) { xmlHttp=getXmlHttpObject(); if( xmlHttp==null ) { return; } var DHTML=( document.getElementById || document.all ); if( DHTML ) { xmlHttp.onreadystatechange=function() { buyPhotoDone(); }; var url="/ajax/buy-photo.php?id="+id+"&t="+Math.random(); xmlHttp.open( "GET",url,true ); xmlHttp.send( null ); } } function buyPhotoDone() { if( xmlHttp.readyState==4 ) { var DHTML=( document.getElementById || document.all ); if( DHTML ) { var response=xmlHttp.responseText; var x1=new getObj( 'basketcounter' ); x1.obj.innerHTML=response; showinfo( 1,"Photo Added To Basket","Use the links on the left menu to view your saved items and basket." ); } } }