

function getPageSize(){

	var xScroll, yScroll;

	if (window.innerHeight && window.scrollMaxY) {
		xScroll = document.body.scrollWidth;
		yScroll = window.innerHeight + window.scrollMaxY;
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		xScroll = document.body.scrollWidth;
		yScroll = document.body.scrollHeight;
	} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
		xScroll = document.body.offsetWidth;
		yScroll = document.body.offsetHeight;
	}

	var windowWidth, windowHeight;
	if (self.innerHeight) {	// all except Explorer
		windowWidth = self.innerWidth;
		windowHeight = self.innerHeight;
	} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
		windowWidth = document.documentElement.clientWidth;
		windowHeight = document.documentElement.clientHeight;
	} else if (document.body) { // other Explorers
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}

	// for small pages with total height less then height of the viewport
	if(yScroll < windowHeight){
		pageHeight = windowHeight;
	} else {
		pageHeight = yScroll;
	}

	// for small pages with total width less then width of the viewport
	if(xScroll < windowWidth){
		pageWidth = windowWidth;
	} else {
		pageWidth = xScroll;
	}


	arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
	return arrayPageSize;
}

function getpos(el_id) {
	var el = $(el_id);
	var t_left = el.offsetLeft;
	var t_top = el.offsetTop;
    var parent_el = el.offsetParent;
    while (parent_el!= null) {
    	t_left += parent_el.offsetLeft;
    	t_top += parent_el.offsetTop;
        parent_el = parent_el.offsetParent;
    }
    return [t_left,t_top];
}
var siteurl = "http://www.simdisat.com/";
function load_toolbar(){
	/*
	var tbar = new Element("div", {id:"simdisat_toolbar"});
	tbar.setStyle({
	  backgroundColor: 'transparent',
	  fontSize: '11px',
	  width:"600px",
	  backgroundImage:"url(/themes/default/images/shop_up_bg.gif)",
	  height:"27px",
	  opacity:0.5,
	  position:"absolute",
	  top:"0px",
	  left:"200px"
	});
	
	var tbar_left = new Element("div");
	tbar_left.setStyle({
		"float":"left",
		"width":"120px"
	});
	
	var tbar_right = new Element("div");
	tbar_right.setStyle({
		"float":"right",
		"width":"400px",
		marginTop:"8px",
		marginRight:"5px",
		textAlign:"right"
	});
	
	tbar_right.update("<a href='"+siteurl+"'>Anasayfa</a> | <a href='"+siteurl+"kategoriler'>Kategoriler</a> | <a href='"+siteurl+"arama'>İlan Arama</a> | <a href='"+siteurl+"ad/new/first'>İlan Ver</a> | <a href='"+siteurl+"dukkanlar.html'>Dükkanlar</a> | <a href='"+siteurl+"start'>Hesabım</a>");
	
	var logo = new Element("img",{src:"/themes/default/images/logo_shop_min.gif"});
	tbar_left.insert(logo);
	tbar.insert(tbar_left);
	tbar.insert(tbar_right);
	
	tbar.onmouseover = function(){
		new Effect.Opacity("simdisat_toolbar",{
			to:1.0,
			duration:0.5
		});
	}
	
	tbar.onmouseout = function(){
		new Effect.Opacity("simdisat_toolbar",{
			to:0.5,
			duration:0.5
		});
	}
	
	document.body.appendChild(tbar);
	*/
}

function ShowTooltip(event, source, offset, wd){
	if(offset == null) offset = 15;
	if(wd == null) wd = "200px";
	
	ttSource = $(source);
		
	if($("IdeaToolTip") != null && $("IdeaToolTip").visible){
		tt = $("IdeaToolTip");
		css = tt.classNames();
		for(i=0;i<css.length;i++)
			tt.removeClassName(css[i]);
	}else{
		tt = document.createElement("div");
		Element.extend(tt);
		tt.id = "IdeaToolTip";
		tt.hide();
		document.body.appendChild(tt);
		Position.absolutize(tt);
	}
		
	tt.addClassName(ttSource.className);
	tt.update(ttSource.innerHTML);
	
	tt.setStyle({
		'width':wd,
		'height':ttSource.style.height,
		'display':'block',
		'z-index':1050
	});
	
	tt.style.left = (Event.pointerX(event) + (offset))  + "px";
	tt.style.top = (Event.pointerY(event))  + "px";
	tt.makePositioned();
	tt.show();
}

function HideTooltip(){
	$('IdeaToolTip').hide();
}