function colorthis(thus, s) {
	if (s == 0) {
		thus.style.background='#FFFFFF';
	}
	else {
		thus.style.background='#FFFFDD';
	}
}

function hasClass(obj) {
	var result = false;
	if (obj.getAttributeNode("class") != null) {
		result = obj.getAttributeNode("class").value;
	}
	return result;
}   

function stripe(id) {
	var even = false;
	var evenColor = arguments[1] ? arguments[1] : "#d5eaff";
	var oddColor = arguments[2] ? arguments[2] : "#dfffdf";
	var table = document.getElementById(id);
	if (! table) { return; }
	var tbodies = table.getElementsByTagName("tbody");
	for (var h = 0; h < tbodies.length; h++) {
		var trs = tbodies[h].getElementsByTagName("tr");
		for (var i = 0; i < trs.length; i++) {
			if (!hasClass(trs[i]) && ! trs[i].style.backgroundColor) {
				var tds = trs[i].getElementsByTagName("td");
				for (var j = 0; j < tds.length; j++) {
					var mytd = tds[j];
					if (! hasClass(mytd) && ! mytd.style.backgroundColor) {
						mytd.style.backgroundColor = even ? evenColor : oddColor;
					}
					if (j != 0 && id == 'fiyatlist') {
						mytd.style.textAlign = 'right';
					}
					if (j != 0 && id == 'fiyatlist2') {
						mytd.style.textAlign = 'right';
					}
					if (j != 0 && id == 'fiyatlist3') {
						mytd.style.textAlign = 'right';
					}
					if (j != 0 && id == 'fiyatlist4') {
						mytd.style.textAlign = 'right';
					}
					if (j > 1 && id == 'icelist') {
						mytd.style.textAlign = 'right';
					}
					if (j > 1 && id == 'icelist2') {
						mytd.style.textAlign = 'right';
					}
					if (j > 1 && id == 'icelist3') {
						mytd.style.textAlign = 'right';
					}
					if (j > 1 && id == 'icelist4') {
						mytd.style.textAlign = 'right';
					}
					if (j > 1 && id == 'dosyalist') {
						mytd.style.textAlign = 'right';
					}
				}
			}
			even =  ! even;
		}
	}
}

function stripe2(id) {
	var even = false;
	var evenColor = arguments[1] ? arguments[1] : "#d5eaff";
	var oddColor = arguments[2] ? arguments[2] : "#ffd5d5";
	var table = document.getElementById(id);
	if (! table) { return; }
	var tbodies = table.getElementsByTagName("tbody");
	for (var h = 0; h < tbodies.length; h++) {
		var trs = tbodies[h].getElementsByTagName("tr");
		for (var i = 0; i < trs.length; i++) {
			if (!hasClass(trs[i]) && ! trs[i].style.backgroundColor) {
				var tds = trs[i].getElementsByTagName("td");
				for (var j = 0; j < tds.length; j++) {
					var mytd = tds[j];
					if (! hasClass(mytd) && ! mytd.style.backgroundColor) {
						mytd.style.backgroundColor = even ? evenColor : oddColor;
					}

				}
			}
			even =  ! even;
		}
	}
}

function spinC(cityx, typx) {
	var tempurl;
	if (cityx != '666') {
		tempurl = '?c=' + cityx //+ '&typ=' + typx;
	}
	location.href = tempurl;
}

function spinCD(cityx, districtx, typx) {
	var tempurl;
	if (cityx != '666') {
		tempurl = '?c=' + cityx;
		if (districtx != '666') {
			tempurl = tempurl + '&d=' + districtx;
		}
	}
	else {
		tempurl = '?c=';
	}
	location.href = tempurl + '&typ=' + typx;
}

function spinSRC(cityx, sectorx) {
	var tempurl;
	tempurl = '?c='+cityx+'&s='+sectorx;
	location.href = tempurl;
}

function PopIt(url, w, h, title){ 
	lm = (screen.width - w)/2;
	tm = (screen.height - h)/2;
	popup = window.open(url,title,"width="+w+",height="+h+",left="+lm+",top="+tm)
	popup.focus();
} 

function isEmail(strEmail) {
	var email;
	email = trim(strEmail);
	if (email.indexOf(' ') > 0) return false;
	var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
	var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
	if (!r1.test(email) && r2.test(email)) {
		return true;
	} else {
		window.alert('Yazdığınız e-posta adresi hatalı!');
		maillist.eposta.select();
		maillist.eposta.focus();
		return false;
	}
	//return (!r1.test(email) && r2.test(email));
}

function dumprefs() {
	var str = location.href;
	if (str.indexOf('?') > 0) {
		location.href=location.href+'&list=ok';
	}
	else {
		location.href=location.href+'?list=ok';
	}
}