_ZINDEX = 2000;
function ClearTextbox(obj)
{
    myTextBox=document.getElementById(obj);
    
    if (myTextBox.value==myTextBox.defaultValue)
        myTextBox.value='';
    else
        if (trim(myTextBox.value,' ')=='')
            myTextBox.value=myTextBox.defaultValue;
}

function AddToFavorites(title, url)
{
    if (document.all)
        window.external.AddFavorite(url, title);
    else if (window.sidebar)
        window.sidebar.addPanel(title, url, "")
        
    return false;
}

function MakeHomepage()
{
    this.style.behavior='url(#default#homepage)';
    this.setHomePage('http://www.ceyhanto.org.tr');
    
    return false;
}

function PrintContent(id)
{
    window.open('/yazdir.php?ID='+id,'Print','width=700, height=800, resizable=0, left=0, top=0, scrollbars=1');
    return false;
}


// Trim Function
function trim(str, chars) {
	return ltrim(rtrim(str, chars), chars);
}
 
function ltrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}
 
function rtrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}

var istek =false;
var istekm =false;

if (window.XMLHttpRequest)
{
	istek = new XMLHttpRequest();
	istekm = new XMLHttpRequest();
}
else if (window.ActiveXObject)
{
	istek = new ActiveXObject("Microsoft.XMLHTTP");
	istekm = new ActiveXObject("Microsoft.XMLHTTP");
}

function menugetirmanti()
{

	document.getElementById("footermanti").innerHTML = "Yükleniyor, lütfen bekleyiniz...";	
	istek.open("GET", "inc/mantifunction.php?islem=footermanti", true);
	istek.onreadystatechange = footeryuklemanti;
	istek.send(null);
}

function footeryuklemanti() {
	if (istek.readyState == 4 && istek.status == 200)
	{
		var cevap = istek.responseText;
		document.getElementById("footermanti").innerHTML = cevap;
	}
}

_ZINDEX = 2000;

function floatingBanner()
{
	// writed by CM Bilisim
	this.x_index = 820;
	this.min_client_width = this.x_index + 200;
	this.top_margin = 2;
	
	this.banner_CSS = "display: none; visibility: visible; width: 156px; position: absolute; top: 2px; z-index: " + _ZINDEX + ";";
	
	this.banner_Code = '';
	
	this._show = _show;
	this._hidden = _hidden;
	this._paint = _paint;
	this._draw = _draw;
	this.swapStatus = swapStatus;
	
	this.show_status = false;
	
	_ZINDEX += 1;
	
	function _show()
	{
		document.getElementById('CM_Float_banner_div').style.visibility = 'visible';
		document.getElementById('CM_Float_banner_div').style.display = 'block';
		this.show_status = true;
		this._paint();
	}

	function _hidden()
	{
		document.getElementById('CM_Float_banner_div').style.visibility = 'hidden';
		this.show_status = false;
	}
	
	function swapStatus()
	{
		if(this.show_status)
			this._hidden()
		else
			this._show();
	}
	function _paint()
	{
		with(document.body)
		{
			if(clientWidth > this.min_client_width)
			{
				if (this.show_status)
				{
					document.getElementById('CM_Float_banner_div').style.left = this.x_index + 'px';
					
					document.getElementById('CM_Float_banner_div').style.top = (scrollTop + this.top_margin) + 'px';
					
					document.getElementById('CM_Float_banner_div').style.display = "block";
				}
			}
			else
			{
				document.getElementById('CM_Float_banner_div').style.display = "none";
			}
		}
	}
	function _draw()
	{
		this.min_client_width = this.x_index + 200;
		document.write ('<div id="CM_Float_banner_div" style="' + this.banner_CSS + '">' + this.banner_Code + '</div>');
	}
	
}
function CM_Floating_changeStatus()
{
	elm.swapStatus()
}
function CM_Floating_Event()
{
	elm._paint();
}

function getNormalSWF(_WIDTH, _HEIGHT, _SRC, _WMODE, _VARS)
{
	if(!_WMODE)
	{
		_WMODE = 'opaque';
	}
	
	document.write('<div style="width: ' + _WIDTH + 'px; height: ' + _HEIGHT + 'px; z-index: ' + _ZINDEX + ';">');
	document.write('<object width="' + _WIDTH + '" height="' + _HEIGHT + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,45,0">');
	document.write('<param name="movie" value="' + _SRC + '">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="wmode" value="' + _WMODE + '">');
	document.write('<param name="scale" value="exactfit">');
	document.write('<param name="allowscriptaccess" value="always">');
	flashvars = '';
	if(_VARS)
	{
		document.write('<param name="flashvars" value="' + _VARS + '">');
		flashvars = ' flashvars="' + _VARS + '"';
	}
	document.write('<embed style="z-index: ' + _ZINDEX + ';" src="' + _SRC + '" width="' + _WIDTH + '" height="' + _HEIGHT + '" scale="exactfit" quality="high" wmode="' + _WMODE + '" ' + flashvars + ' pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash"></embed>');
	document.write('</object>');
	document.write('</div>');
	_ZINDEX += 1;
}

function getRolloverSWF(_WIDTH, _HEIGHT, _ROLL_WIDTH, _ROLL_HEIGHT, _SRC, _ROLL_DIR)
{
	_LEFT = '0px';
	_TOP = '0px';
	switch(_ROLL_DIR)
	{
		case '1':
			_TOP = '-' + (_ROLL_HEIGHT - _HEIGHT) + 'px';
			_LEFT = '0px';
			break;
		case '4':
			_TOP = '0px';
			_LEFT = '-' + (_ROLL_WIDTH - _WIDTH) + 'px';
			break;
	}
	
	document.write('<div style="width: ' + _WIDTH + 'px; height: ' + _HEIGHT + 'px; position: relative; z-index: ' + _ZINDEX + '; top: ' + _TOP + '; left: ' + _LEFT + '">');
	document.write('<object width="' + _ROLL_WIDTH + 'px" height="' + _ROLL_HEIGHT + 'px" style="position: absolute; left: 0px; top: 0px;" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,45,0">');
	document.write('<param name="movie" value="' + _SRC + '">');
	document.write('<param name="menu" value="false">');
	document.write('<param name="quality" value="high">');
	document.write('<param name="wmode" value="transparent">');
	document.write('<param name="scale" value="exactfit">');
	document.write('<param name="allowscriptaccess" value="always">');
	if(_VARS)
		document.write('<param name="flashvars" value="' + _VARS + '">');
	document.write('<embed style="z-index: ' + _ZINDEX + ';" src="' + _SRC + '" width="' + _ROLL_WIDTH + '" height="' + _ROLL_HEIGHT + '" scale="exactfit" quality="high" wmode="transparent" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash"></embed>');
	document.write('</object>');
	document.write('</div>');
	
	_ZINDEX += 1;
}

function hideFloatingBanner()
{
	var elm = document.getElementById('CM_floatingElm');
	if (typeof(elm) == 'undefined')
		return;
	elm.style.display = "none";
}
	
