function extra() {

	if ( document.upload.ext.value=='1' )
	{
		document.upload.ext.value='';
		document.getElementById('eac').style.display = 'none';
		document.getElementById('ekapa').style.display = '';

		for (var i = 1; i < 11; i++) {
			document.getElementById("extra_"+i).style.display = 'none';
		}
	}
	else
	{
		for (var i = 1; i < 11; i++) {
			document.getElementById("extra_"+i).style.display = '';
		}

		document.upload.ext.value='1';
		document.getElementById('eac').style.display = 'none';
		document.getElementById('ekapa').style.display = '';
	}

	if ( document.getElementById('yazi').style.display=='none' )
	document.getElementById('yazi').style.display = '';
	else
	document.getElementById('yazi').style.display = 'none';

}
function extraa() {

	if ( document.upload.ext.value=='1' )
	{
		for (var i = 1; i < 2; i++) {
			document.getElementById("extra_"+i).style.display = 'none';
		}
		document.upload.ext.value='';
		document.getElementById('eac').style.display = 'none';
		document.getElementById('ekapa').style.display = '';
	}
	else
	{
		for (var i = 1; i < 2; i++) {
			document.getElementById("extra_"+i).style.display = '';
		}
		document.upload.ext.value='1';
		document.getElementById('eac').style.display = 'none';
		document.getElementById('ekapa').style.display = '';
	}

	if ( document.getElementById('yazi').style.display=='none' )
	document.getElementById('yazi').style.display = '';
	else
	document.getElementById('yazi').style.display = 'none';

}
function tumunu_sec(deger)
{
	form = document.forms[deger];
	for (i=0; i < form.elements.length; i++)
	{
		if ((form.elements[i].type == "checkbox"))
		if ((form.elements[i].name != "tumu"))
		{
			if (form.elements["tumu"].checked == true)
			{
				form.elements[i].checked = true;
			} else {
				form.elements[i].checked = false;
			}
		}
	}
}
function aktifle(id) {
	document.getElementById(id).disabled=""
}
function pasif(id,fnamef) {
	xpasifx=document.getElementById(id,fname)
	xpasifx.disabled=true
	xpasifx.value="lütfen bekleyiniz..."
	document.fnamef.submit()
}
//hepsini seç
var copytoclip=1
function kopyala(theField) {
	var tempval=eval("document."+theField)
	tempval.focus()
	tempval.select()
	if (document.all&&copytoclip==1){
		therange=tempval.createTextRange()
		therange.execCommand("Copy")
		window.status="Metin Başarıyla Kopyalama Hafızasına Alındı İstediğiniz Yere Yapıştırabilirsiniz !"
		setTimeout("window.status=''",1800)
	}
}
function popup(mypage, myname, w, h, scroll) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+''
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

//copyright saho 2006
// ajax kutuphanesi
var saho = new myLibrary();
function myLibrary() { this.ajax = ajax }
function ajax(data, method, url, divid){
	document.getElementById(divid).innerHTML='<center><img src="imajlar/saho_coming.gif"><br>Sayfa Yükleniyor Lütfen Bekleyiniz...</center>'
	var page_request = false
	if (window.XMLHttpRequest)
	page_request = new XMLHttpRequest()
	else if (window.ActiveXObject){
		try {
			page_request = new ActiveXObject("Msxml2.XMLHTTP")
		}
		catch (e){
			try{
				page_request = new ActiveXObject("Microsoft.XMLHTTP")
			}
			catch (e){}
		}
	}
	else
	return false
	page_request.onreadystatechange=function(){
		loadpage(page_request, divid)
	}
	if (method == 'GET') {var url = url +'?'+ data}
	page_request.open(method, url, true)
	page_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
	page_request.send(data)
	return page_request
}

function loadpage(page_request, divid){
	if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
	document.getElementById(divid).innerHTML=page_request.responseText
}
function GetCookie(name) {
	var arg=name+"=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i  = 0;
	while (i < clen) {
		var j = i + alen;
		if (document.cookie.substring(i,j) == arg)
		return getCookieVal (j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0) break;
	}
	return null;
}
function getCookieVal (offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == 1)
	endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}
function SetCookie (name, value, expires) {
	var exp = new Date();
	var expiro = (exp.getTime() + (24 * 60 * 60 * 1000 * expires));
	exp.setTime(expiro);
	var expstr = "; expires=" + exp.toGMTString();
	document.cookie = name + "=" + escape(value) + expstr;
}
function DeleteCookie(name){
	if (GetCookie(name)) {
		document.cookie = name + "=" + "; expires = Thu, 01-Jan-70 00:00:01 GMT";
	}
}
var imagepath = "images/";
////////////////////////////////////
blockarray = new Array();
var blockarrayint = -1;
function doblocks(imgpath) {
	if (imgpath != null) imagepath = imgpath;
	for (var q = 0; q < blockarray.length; q++) {
		xyzswitch(blockarray[q]);
	}
}
function xswitch(listID) {
	if(listID.style.display=="none") {
		listID.style.display="";
	} else {
		listID.style.display="none";
	}
}
function icoswitch(bid) {
	icoID = document.getElementById('pic'+bid);
	if(icoID.src.indexOf("minus") != -1) {
		icoID.src = imagepath+"plus.gif";
		SetCookie('block'+bid,'yes',365);
	} else {
		icoID.src = imagepath+"minus.gif";
		DeleteCookie('block'+bid);
	}
}
function xyzswitch(bid) {
	xswitch(document.getElementById('ph'+bid));
	xswitch(document.getElementById('pe'+bid));
	icoswitch(bid);
}
function addblock(bid) {
	var blockopen=GetCookie('block'+bid);
	if (blockopen != null) {
		blockarrayint += 1;
		blockarray[blockarrayint] = bid;
	}
}
////////////////////////////////////
var hiddenblocks = new Array();
var blocks = GetCookie('hiddenblocks');
if (blocks != null) {
	var hidden = blocks.split(":");
	for (var loop = 0; loop < hidden.length; loop++) {
		var hiddenblock = hidden[loop];
		hiddenblocks[hiddenblock] = hiddenblock;
	}
}
function blockswitch(bid) {
	var bph  = document.getElementById('ph'+bid);
	var bpe  = document.getElementById('pe'+bid);
	var bico = document.getElementById('pic'+bid);
	if (bph.style.display=="none") {
		bph.style.display="";
		bpe.style.display="none";
		hiddenblocks[bid] = bid;
		bico.src = imagepath+"plus.gif";
	} else {
		bph.style.display="none";
		bpe.style.display="";
		hiddenblocks[bid] = null;
		bico.src = imagepath+"minus.gif";
	}
	var cookie = null;
	for (var q = 1; q < hiddenblocks.length; q++) {
		if (hiddenblocks[q] != null) {
			if (cookie != null) {
				cookie = (cookie+":"+hiddenblocks[q]);
			} else {
				cookie = hiddenblocks[q];
			}
		}
	}
	if (cookie != null) {
		SetCookie('hiddenblocks', cookie, 365);
	} else {
		DeleteCookie('hiddenblocks');
	}
}
// aç kapalar

// Commonly-used functions, reduced.

function d(s) {return document.getElementById(s);}
function dE(o,s) {return o.getElementsByTagName(s);}

/**
* toggleDisplay()
*
* Will toggle the display property of the style object for any
* DOM element or object that supports style as a property.
*
* Warning: This'll wreak havoc if applied to <TR> elements. Those
* babies got different types "table-row" | "block" dependant on
* what browser's being used.
*
* Warning: Written in Texas.  Yeehaw.
*
* Typical usage:
* toggleDisplay(document.getElementById("foo"));
*/
function toggleDisplay(o)
{
	var display = getStyle(o, "display");

	if (o.style)
	o.style.display =
	(display != "none") ? "none" : getDisplayStyleByTagName(o);
}


function getDisplayStyleByTagName(o)
{
	n = o.nodeName.toLowerCase();
	return (
	n == "span"
	|| n == "img"
	|| n == "a"
	) ? "inline" : "block";
}


/**
* sahogizle()
*
* Hides an element from view.
*
* Typical usage:
* sahogizle(getElement("the-id-of-the-element"));
*/
function sahogizle(o)
{
	if (o && o.style) o.style.display = "none";
}



/**
* sahogoster()
*
* Shows an element that was hidden from view.
*
* Typical usage:
* sahogoster(getElement("the-id-of-the-element"));
*/
function sahogoster(o)
{

	if (o && o.style) o.style.display = getDisplayStyleByTagName(o);
}


/**
* getElement()
*
* Returns an element by its ID or shows an alert if it can't be found.
*
* Typical usage:
* getElement("the-id-of-the-element");
*/
function getElement(id) {
	var e = d(id);
	if (!e) {
		alert("Cannot get element: " + id);
	}
	return e;
}

/**
* setInnerHTML()
*
* Sets the innerHTML of an element or shows an alert if can't be set.
*
* Typical usage:
* setInnerHTML("the-id-of-the-element");
*/
function setInnerHTML(id, html) {
	try {
		getElement(id).innerHTML = html;
	} catch (ex) {
		alert("Cannot set inner HTML: " + id);
	}
}


/**
* setCssStyle()
*
* Sets the style of an element by its id or shows an alert if can't be set.
*
* Typical usage:
* setCssStyle("the-id-of-the-element", "display", "block");
*/
function setCssStyle(id, name, value) {
	try {
		getElement(id).style[name] = value;
	} catch (ex) {
		alert("Cannot set style: " + id);
	}
}


/**
* getStyle()
*
* Gets the computed style of any object.
*
* WARNING: Produces unexpected results in Safari.  To achieve best
* results, explicitly set the style property for that browser when the
* element is rendered.
*
* Typical usage:
* getStyle(object, "display");
*/
function getStyle(el, style) {
	if (!document.getElementById || !el) return;

	if (document.defaultView
	&& document.defaultView.getComputedStyle) {
		return document.defaultView.
		getComputedStyle(el, "").getPropertyValue(style);
	}
	else if (el.currentStyle) {
		return el.currentStyle[style];
	}
	else {
		return el.style.display;
	}
}

/**
* getStyleAttribute()
*
* Returns the style attribute of the specified node.
*/
function getStyleAttribute(node) {
	if (Detect.IE()) {
		return node.getAttribute('style').value;
	}else {
		return node.getAttribute('style');
	}
}


/*
* showProps()
*
* Displays all the properties for a given element
*/
function showProps(o) {
	s=""; for (p in o) {
		s+=p+": "+o[p]+"\n<br />";
	}
	document.write(s);
}



function setIFrameEvent(iframe, eventName, func)
{
	if (document.all) {
		eval('getIFrameDocument(iframe).on' + eventName + ' = func;');
	} else {
		iframe.contentWindow.addEventListener(eventName, func, true);
	}
}

function setIFrameBody(iframe, strStyle, innerHtml)
{
	if (!innerHtml) innerHtml = '';
	if (innerHtml == '' && Detect.IE()) {
		innerHtml = '<div></div>';
	}
	var doc = getIFrameDocument(iframe);
	doc.open();
	doc.write('<body style="' + strStyle + '">'
	+ innerHtml + '</body>');
	doc.close();
}


function getIFrameDocument(iframe)
{
	if (Detect.IE()) {
		return iframe.document;
	} else {
		return iframe.contentDocument;
	}
}

function getIFrame(strId)
{
	if (Detect.IE()) {
		return document.frames[strId];
	} else {
		return document.getElementById(strId);
	}
}


function createElementandAppend(nodeName, strId, appendTo) {
	var el = document.createElement(nodeName);
	el.setAttribute("id", strId);
	if (appendTo) {
		appendTo.appendChild(el);
	} else {
		document.body.appendChild(el);
	}
	return el;
}

function createElementandInsertBefore(nodeName, strId, appendTo, sibling) {
	var el = document.createElement(nodeName);
	el.setAttribute("id", strId);
	if (appendTo) {
		appendTo.insertBefore(el, sibling);
	} else {
		document.body.insertBefore(el, sibling);
	}
	return el;
}


/**
* getXY()
*
* Returns the position of any element as an object.
*
* Typical usage:
* var pos = getXY(object);
* alert(pos.x + " " +pos.y);
*/
function getXY(el) {
	var x = el.offsetLeft;
	var y = el.offsetTop;
	if (el.offsetParent != null) {
		var pos = getXY(el.offsetParent);
		x += pos.x;
		y += pos.y;
	}
	return {x: x, y: y}
}

// The following 3 functions are taken from common.js
function hasClass(el, cl) {
	if (el == null || el.className == null) return false;
	var classes = el.className.split(" ");
	for (var i = 0; i < classes.length; i++) {
		if (classes[i] == cl) {
			return true;
		}
	}
	return false;
}

// Add a class to element
function addClass(el, cl) {
	if (hasClass(el, cl)) return;
	el.className += " " + cl;
}
//saho aç kapa
function ackapa(ac,ac2,kapa,kapa2) {
	sahogoster(d(ac));
	sahogoster(d(ac2));
	sahogizle(d(kapa));
	sahogizle(d(kapa2));
}

// Remove a class from an element
function removeClass(el, cl) {
	if (el.className == null) return;
	var classes = el.className.split(" ");
	var result = [];
	var changed = false;
	for (var i = 0; i < classes.length; i++) {
		if (classes[i] != cl) {
			if (classes[i]) { result.push(classes[i]); }
		} else {
			changed = true;
		}
	}
	if (changed) { el.className = result.join(" "); }
}

/* Constants for node types, since IE doesn't support Node.TEXT_NODE */
var TEXT_NODE = 3;
var ELEMENT_NODE = 1;


