var current_header_ic = false;

function shrinkHeaderIC(mode)
{
	document.cookie = "upshrinkIC=" + (mode ? 1 : 0);
	document.getElementById("upshrink_ic").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");
	document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";
	current_header_ic = mode;
}

var mysize = "small";

function setmysize(size)
{
	document.cookie = "size=" + size;
}

var mywidth = "85%";

function setmywidth(width)
{
	document.cookie = "width=" + width;
}

var mystyle = "none";

function setmystyle(style)
{
}



// Site genisligini degistirir, cereze yazdirir
function ws(wid) {
	// document.getElementById("outer").style.width = wid;
	document.getElementById("outer_wrapper").style.width = wid;
	setmywidth(wid);
	/* slider degerini degistirsin */
	
}

var tgs = new Array( 'div','td','tr');
var szs = new Array( 'xx-small','x-small','small','medium','large','x-large' );
			
var startSz = 2;

function ts( trgt,inc ) {
	if (!document.getElementById) return
	var d = document,cEl = null,sz = startSz,i,j,cTags;

	sz += inc;
	if ( sz < 0 ) sz = 0;
	if ( sz > 5 ) sz = 5;
	startSz = sz;

	if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];

	cEl.style.fontSize = szs[ sz ];

	for ( i = 0 ; i < tgs.length ; i++ ) {
		cTags = cEl.getElementsByTagName( tgs[ i ] );
		for ( j = 0 ; j < cTags.length ; j++ ) cTags[ j ].style.fontSize = szs[ sz ];
	}
    setmysize(szs[ sz ]);
}

function tsreset( trgt ) {
	if (!document.getElementById) return
	var d = document,cEl = null,sz = startSz,i,j,cTags;

	sz = 2;
	startSz = sz;

	if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];

	cEl.style.fontSize = szs[ sz ];

	for ( i = 0 ; i < tgs.length ; i++ ) {
		cTags = cEl.getElementsByTagName( tgs[ i ] );
		for ( j = 0 ; j < cTags.length ; j++ ) cTags[ j ].style.fontSize = szs[ sz ];
	}
	setmysize(szs[ sz ]);
}



/* http://www.quirksmode.org/js/cookies.html */

function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
	createCookie(name,"",-1);
}


/*
function changeWidth(newWidth) {
	
	var outer_wrapper = document.getElementById('outer_wrapper');

	if(newWidth == "thin") {
		outer_wrapper.style.width = "770px";
	}
	if(newWidth == "thick") {
		outer_wrapper.style.width = "93%";
	}
	if(newWidth == "max") {
		outer_wrapper.style.width = "100%";
	}

	// createCookie('width',newWidth,365);
	setmywidth(newWidth);

}
*/

function checkCookie() {
	// alert("window loaded");
	var width = readCookie('width');
	if (width != null && width != "") {
		// alert("There is a cookie read: "+width);
		// changeWidth(width);
		ws(width);
	} else {

	}
}

// window.onload = checkCookie();

