function doAJAX(){
                var ajaxRequest;				
                try {
                    // Opera 8.0+, Firefox, Safari
                    ajaxRequest = new XMLHttpRequest();
                } 
                catch (e) {
                    // Internet Explorer Browsers
                    try {
                        ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
                    } 
                    catch (e) {
                        try {
                            ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
                        } 
                        catch (e) {
                            // Something went wrong
                            alert("The version of your browser is obsolete...");
                            return false;
                        }
                    }
                }
                
                return ajaxRequest;
            }
          
            function showContent(){
                    if (ajaxRequest = doAJAX()) {
						
                        ajaxRequest.onreadystatechange = function(){
                            if (ajaxRequest.readyState == 4) {
								var arr=eval('(' + ajaxRequest.responseText + ')');
								if (arr.show_page==1){								
								/*
								document.write("<head><meta http-equiv=\"refresh\" content=\"10\"></head>");								
								//document.write("<body><a href=\"javascript:location.href='"+arr.reff+"';\">Click here to skip</a><br/><div id=\"divContent\" onclick=\"javascript:location.href='redirector.php?p="+arr.link+"'\">"+arr.content+"</div></body>");								
								document.write("<body><a href=\"javascript:location.href='"+arr.reff+"';\">Click here to skip</a><br/><div id=\"divContent\" onclick=\"javascript:location.href='advert/redirector.php?p="+arr.link+"'\">"+arr.content+"</div></body>");
								document.close();
								*/
									//document.location = 'ad.php?arr_ref='+ arr.reff + '&arr_link='+ arr.link;
									document.location = 'ad.php?arr_ref='+ arr.reff + '&arr_link='+ arr.link+'&width='+ arr.width+'&height='+ arr.height;
								}
                            }
                        }
                        
						var newDate = new Date;
                        
                        //ajaxRequest.open("GET", "getData.php", true);
                        ajaxRequest.open("GET", "advert/getData.php?uid=" + newDate.getTime(), true);
                        ajaxRequest.send(null);
                        
                    }
                
            }
     showContent();       