	function getWindowHeight() {
			var windowHeight = 0;
			if (typeof(window.innerHeight) == 'number') {
				windowHeight = window.innerHeight;
			}
			else {
				if (document.documentElement && document.documentElement.clientHeight) {
					windowHeight = document.documentElement.clientHeight;
				}
				else {
					if (document.body && document.body.clientHeight) {
						windowHeight = document.body.clientHeight;
					}
				}
			}
			return windowHeight;
		}
		
	function getWindowWidth() {
			var windowWidth = 0;
			if (typeof(window.innerWidth) == 'number') {
				windowWidth = window.innerWidth;
			}
			else {
				if (document.documentElement && document.documentElement.clientWidth) {
					windowWidth = document.documentElement.clientWidth;
				}
				else {
					if (document.body && document.body.clientWidth) {
						windowWidth = document.body.clientWidth;
					}
				}
			}
			return windowWidth;
		}
    
  		
		function setFooter() {
      var flag=false;
			if (document.getElementById) {
        var windowHeight = getWindowHeight();
				var arabElement = document.getElementById('arabesque');
        var arabHeight  = arabElement.offsetHeight;
				if (windowHeight > 0) {
						  
					var contentHeight = document.getElementById('pageWrap').offsetHeight;
					
					var footerElement = document.getElementById('footerWrap');
					var footerHeight  = footerElement.offsetHeight;
					
					var arabTop = 0;
					
					if (windowHeight - (contentHeight + footerHeight) >= 0) {
						footerElement.style.position = 'relative';
            footerElement.style.top = (windowHeight - (contentHeight + footerHeight)) + 'px';
            arabTop = windowHeight - (footerHeight + arabHeight);
					}
					else {
					  arabTop = contentHeight - arabHeight;
						footerElement.style.position = 'static';
            flag=true;						
					}
					arabElement.style.top = (arabTop + 10) + 'px';
					 /*alert('windowheight : '+windowHeight+' footerheight : '+footerHeight+' contentHeight : '+contentHeight+' arabTop : '+arabTop);*/
				}
				
        var windowWidth = getWindowWidth(); /*getWindowWidth();*/
				var arabWidth  = arabElement.offsetWidth;

        if (windowWidth > 0) {
					var contentWidth = document.getElementById('pageWrap').offsetWidth;
					
					var arabLeft = 0;

					if (windowWidth - contentWidth >= 0) {
            arabLeft = windowWidth - arabWidth;
					}
					else {
					  arabLeft = contentWidth - arabWidth;	
					}
					if (flag)
          {
            arabLeft = arabLeft - 17;
          }
          if (arabLeft<800) arabLeft = 800;
					arabElement.style.left = arabLeft + 'px';
					/* alert('windowwidth : '+windowWidth+' contentW : '+contentWidth+' arabLeft : '+arabLeft);*/
				}
			/*	arabElement.style.zIndex=1;*/
			}
		}
		window.onload = function() {
			setFooter();
					/*document.body.style.backgroundColor = '#a9abaa';*/
		}
		window.onresize = function() {
			setFooter();
		}

