// Resize kod
//get page dimensions
function getPageDimensions(){

	var winObject = {height:0,width:0,x:0,y:0};
	if(navigator.userAgent.indexOf("Opera")!=-1){
		var versionindex=navigator.userAgent.indexOf("Opera")+6
		if (parseInt(navigator.userAgent.charAt(versionindex))>=8)
			return {width:1000,height:1000};
	}
	var  yScroll;
	var xScroll;
	if (window.innerHeight && window.scrollMaxY) {	
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		yScroll = document.body.offsetHeight;
	}
	
	if (window.innerWidth && window.scrollMaxX) {	
		xScroll = window.innerWidth + window.scrollMaxX;
	} else if (document.body.scrollWidth > document.body.offsetWidth){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
	}
		
	var windowHeight;
	var windowWidth;
	if (self.innerHeight) {	// all except Explorer
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowHeight = document.body.clientHeight;
	}	
	
	if (self.innerWidth) {	// all except Explorer
		windowWidth = self.innerWidth;
	} else if (document.documentElement && document.documentElement.clientWidth) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
	}	
		
	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		winObject.height = windowHeight;
	} else { 
		winObject.height = yScroll;
	}
	
	// for small pages with total height less then height of the viewport
	if(xScroll < windowWidth){
		winObject.width = windowWidth;
	} else { 
		winObject.width = xScroll;
	}
	
	//get win x and y cordnates
	if (document.all) {
		winObject.x = window.screenLeft;
   		winObject.y = window.screenTop;
	}
	else {
		winObject.x = window.screenX;
		winObject.y = window.screenY;
	}
	
	return winObject;
}

function getViewportSize() { 
			var size = {height:0,width:0};
			if (typeof window.innerWidth != "undefined") { 
				size.width = window.innerWidth;
				size.height = window.innerHeight;
			} 
			else if (typeof document.documentElement != "undefined" && typeof document.documentElement.clientWidth != "undefined" && document.documentElement.clientWidth != 0) {
				size.width = document.documentElement.clientWidth;
				size.height =document.documentElement.clientHeight;
			}
			else {
				size.width = document.getElementsByTagName("body")[0].clientWidth;
				size.height =document.getElementsByTagName("body")[0].clientHeight;
			}
			return size; 
		}

		
