﻿<!--
	    /* Script taken from leemessenger.co.uk - Please do not remove this line */
        function ClearAttribute1(elem)
        {
           var  element = document.getElementById(elem);
           element.removeAttribute("step")
           element.removeAttribute("event-id");
        }

        function ClearAttribute2(sender)
        {
            sender.removeAttribute("step");
            sender.removeAttribute("event-id");
        }

	    function GoToGoogle(sender){
           
            var step = sender.getAttribute("step");
            var elemid =  sender.getAttribute("event-id");

            if(step == null && elemid == null)
            {

	            var textbuttonValue = document.getElementById('search_textbox')
                //window.open('http://www.google.co.uk/search?q=' + textbuttonValue.value, '_blank');
                window.open("http://www.google.co.uk/search?q=" + textbuttonValue.value, "googleWindow", "width=800, height=600, location=1,status=1,scrollbars=1,toolbar=1,menubar=1,resizable=1");
                //window.location = 'http://www.payzoolamobiles.com/mobiles/RewardSelector.aspx?step=2';
                return true;
            }
            else
            {
                var submit = document.getElementById(elemid);
                submit.click();
            }
            return false;
	    }

	    function ChangeCSSBgImg() {

	        
	        if (!document.getElementById) return false;

	        var MyElement = "search_container" //The ID of the element you want to change
	        var ImgPath = "http://www.payzoolamobiles.com/google_search_images/" //The file path to your images

	        if (!document.getElementById(MyElement)) return false;
	      
	        var random_images = new Array();
	        random_images[0] = "search_spend_bg_laptop.png";
	        random_images[1] = "search_spend_bg_tv.png";
	        random_images[2] = "search_spend_bg_holiday.png";
	        random_images[3] = "search_spend_bg_motor.png";

	   
	        var $header = document.getElementById(MyElement);
	        var $backgroundurl = $header.style.backgroundImage;

	        var $currentIndex = document.getElementById('hidCurrentIndex').value;
	   
	        if ($currentIndex == 3) {
	            $currentIndex = 0;
	        }
	        else {
	            $currentIndex++;

	        }
            
	        var ImgURL = "url(" + '"' + ImgPath + random_images[$currentIndex] + '"' + ")";
	        $header.style.backgroundImage = ImgURL;
	        document.getElementById('hidCurrentIndex').value = $currentIndex;

	        movement = setTimeout("ChangeCSSBgImg()", 5000);


	    }

	   


	    /* random number generator */
	    function rand(n) {
	        return (Math.floor(Math.random() * n));
	    }

	    /* Custom onload function */

	    function addLoadEvent(func) {
	        var oldonload = window.onload;
	        if (typeof window.onload != 'function') {
	            window.onload = func;
	        } else {
	            window.onload = function() {
	                oldonload();
	                func();
	            }
	        }
	    }

	    /* trigger onload */

	    addLoadEvent(ChangeCSSBgImg); 
// -->
