function selectLang(idx) {
	   var locale = locales[idx];
	   collapseLandyerlilisteler();
	   changelang(idx)
	}

	function hiLight(langImg, idx, over) {
	   langImg.src = (over) ? langOverImgs[idx].src : langImgs[idx].src;
	}

	function createTooltip(id) {
	   var tt = document.createElement("DIV");
	   tt.id = id;
	   tt.style.border='none';
	   tt.style.position='absolute';
	   document.body.appendChild(tt);
	   return tt;
	}

	function findPos(obj) {
		var curleft = 0;
		var curtop = 0;
		if (obj.offsetParent) {
			curleft = obj.offsetLeft
			curtop = obj.offsetTop
			while (obj = obj.offsetParent) {
				curleft += obj.offsetLeft
				curtop += obj.offsetTop
			}
		}
		return [curleft,curtop];
	}

	function getyerlilistelerMenu(img) {
		var pdDiv = createTooltip('langselection');
		var top = img.clientY;
		var pos = findPos(img);
		pdDiv.style.left = (pos[0] + 3) + 'px';
		pdDiv.style.top = (pos[1]+ 21) + 'px';
		return pdDiv;
	}

	function runyerlilisteler(img) {
		var yerlilisteler = document.getElementById('langselection');
		if (yerlilisteler != null) {
			collapseLandyerlilisteler()
		}
		else {
			expandyerlilisteler(img);
		}
	}

	function collapseLandyerlilisteler() {
		var yerlilisteler = document.getElementById('langselection');
		if (yerlilisteler != null) {
			yerlilisteler.style.visibility='hidden';
			document.body.removeChild(yerlilisteler);
			yerlilisteler = null;
		}
	}

	function expandyerlilisteler(img) {
		var yerlilisteler = getyerlilistelerMenu(img);
		yerlilisteler.innerHTML=getPulldownHTML();
		yerlilisteler.style.visibility='visible';
	}

	function getPulldownHTML() 
	{
		var PulldownHTML = '<table cellpadding="0" cellspacing="0" border="0" id="langSelection" class="lang_Pulldown">';
				PulldownHTML = PulldownHTML.concat('<tr class="lang_Pulldown">');
		PulldownHTML = PulldownHTML.concat('<td class="lang_Pulldown" background="http://bedavaseyret.net/images/ust-bar.gif" height="25" width="129" onclick="window.location=\'/film-dizi-izle/09--yerli-diziler.html\'"><a href="/film-dizi-izle/09--yerli-diziler.html" style="margin-left:18px;text-decoration: none;float:left;color:#000000;font-size:11px; color:#000000; font-family:arial;line-height:25px;font-weight:bold;">Yerli Diziler</a></td>');
		PulldownHTML = PulldownHTML.concat('</tr>');
				PulldownHTML = PulldownHTML.concat('<tr class="lang_Pulldown">');
		PulldownHTML = PulldownHTML.concat('<td class="lang_Pulldown" background="http://bedavaseyret.net/images/orta-bar.gif" height="21" width="129" onclick="window.location=\'/film-dizi-izle/06--tv-showlari.html\'"><a href="/film-dizi-izle/06--tv-showlari.html" style="margin-left:18px;text-decoration: none;float:left;color:#000000;font-size:11px; color:#000000; font-family:arial;line-height:21px;font-weight:bold;" > Tv Showları</a></td>');
		PulldownHTML = PulldownHTML.concat('</tr>');
						PulldownHTML = PulldownHTML.concat('<tr class="lang_Pulldown">');
		PulldownHTML = PulldownHTML.concat('<td class="lang_Pulldown" background="http://bedavaseyret.net/images/orta-bar.gif" height="21" width="129" onclick="window.location=\'/film-dizi-izle/11--sona-ermis-diziler.html\'"><a href="/film-dizi-izle/11--sona-ermis-diziler.html" style="margin-left:18px;text-decoration: none;float:left;color:#000000;font-size:11px; color:#000000; font-family:arial;line-height:21px;font-weight:bold;" > Sona Ermiş Diziler</a></td>');
		PulldownHTML = PulldownHTML.concat('</tr>');
								PulldownHTML = PulldownHTML.concat('<tr class="lang_Pulldown">');
		PulldownHTML = PulldownHTML.concat('<td class="lang_Pulldown" background="http://bedavaseyret.net/images/orta-bar.gif" height="21" width="129" onclick="window.location=\'/film-dizi-izle/fragmanlar.html\'"><a href="/film-dizi-izle/fragmanlar.html" style="margin-left:18px;text-decoration: none;float:left;color:#000000;font-size:11px; color:#000000; font-family:arial;line-height:21px;font-weight:bold;" > Fragmanlar</a></td>');
		PulldownHTML = PulldownHTML.concat('</tr>');

				PulldownHTML = PulldownHTML.concat('<tr class="lang_Pulldown">');
		PulldownHTML = PulldownHTML.concat('<td class="lang_Pulldown"><a href="#" onclick="javascript:runyerlilisteler(this)"><img src="http://bedavaseyret.net/images/kapat-o.gif" border="0" width="129" height="21" /></a></td>');
		PulldownHTML = PulldownHTML.concat('</tr>');
						
		return PulldownHTML;
	}
