var xmlhttp
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
  try {
  xmlhttp=new ActiveXObject("Msxml2.XMLHTTP")
 } catch (e) {
  try {
	xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
  } catch (E) {
   xmlhttp=false
  }
 }
@else
 xmlhttp=false
@end @*/

if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
{
  try {
	xmlhttp = new XMLHttpRequest ();
  }
  catch (e) {
  xmlhttp = false}
}

function myXMLHttpRequest ()
{
  var xmlhttplocal;
  try {
  	xmlhttplocal = new ActiveXObject ("Msxml2.XMLHTTP")}
  catch (e) {
	try {
	xmlhttplocal = new ActiveXObject ("Microsoft.XMLHTTP")}
	catch (E) {
	  xmlhttplocal = false;
	}
  }

  if (!xmlhttplocal && typeof XMLHttpRequest != 'undefined') {
	try {
	  var xmlhttplocal = new XMLHttpRequest ();
	}
	catch (e) {
	  var xmlhttplocal = false;
	}
  }
  return (xmlhttplocal);
}

var mnmxmlhttp = Array ();
var xvotesString = Array ();
var mnmPrevColor = Array ();
var responsestring = Array ();
var myxmlhttp = Array ();
var responseString = new String;


function vote (user, id, htmlid, md5, value)
{
  	if (xmlhttp) {
		url = "http://www.hitbol.com/vote.php";
		var mycontent = "id=" + id + "&user=" + user + "&md5=" + md5 + "&value=" + value;
		anonymous_vote = false;
        if (anonymous_vote == false && user == '0') {
            window.location="http://www.hitbol.com/login.php?return="+location.href;
        } else {
    		mnmxmlhttp[htmlid] = new myXMLHttpRequest ();
    		if (mnmxmlhttp) {
    			mnmxmlhttp[htmlid].open ("POST", url, true);
    			mnmxmlhttp[htmlid].setRequestHeader ('Content-Type',
    					   'application/x-www-form-urlencoded');
    
    			mnmxmlhttp[htmlid].send (mycontent);
    			errormatch = new RegExp ("^ERROR:");    
    			target1 = document.getElementById ('xvotes-' + htmlid);    
    			mnmPrevColor[htmlid] = target1.style.backgroundColor;
    			mnmxmlhttp[htmlid].onreadystatechange = function () {
    				if (mnmxmlhttp[htmlid].readyState == 4) {
    					xvotesString[htmlid] = mnmxmlhttp[htmlid].responseText;
    					if (xvotesString[htmlid].match (errormatch)) {
    						xvotesString[htmlid] = xvotesString[htmlid].substring (6, xvotesString[htmlid].length);
							changemnmvalues (htmlid, value, true);    					} else {
														if (xvotesString[htmlid].substring (1, 6) == "ERROR") { alert(xvotesString[htmlid]);  } else {changemnmvalues (htmlid, value, false); }     					}
    				}
    			}
    		}
    	}
	}
}


function unvote (user, id, htmlid, md5, value)
{
  	if (xmlhttp) {
		url = "http://www.hitbol.com/vote.php";
		var mycontent = "unvote=true&id=" + id + "&user=" + user + "&md5=" + md5 + "&value=" + value;
		anonymous_vote = false;
        if (anonymous_vote == false && user == '0') {
            window.location="http://www.hitbol.com/login.php?return="+location.href;
        } else {
    		mnmxmlhttp[htmlid] = new myXMLHttpRequest ();
    		if (mnmxmlhttp) {
    			mnmxmlhttp[htmlid].open ("POST", url, true);
    			mnmxmlhttp[htmlid].setRequestHeader ('Content-Type',
    					   'application/x-www-form-urlencoded');
    
    			mnmxmlhttp[htmlid].send (mycontent);
    			errormatch = new RegExp ("^ERROR:");    
				target1 = document.getElementById ('xvotes-' + htmlid);
  				target2 = document.getElementById ('xvote-' + htmlid);    
    			mnmPrevColor[htmlid] = target1.style.backgroundColor;
    			mnmxmlhttp[htmlid].onreadystatechange = function () {
    				if (mnmxmlhttp[htmlid].readyState == 4) {
    					xvotesString[htmlid] = mnmxmlhttp[htmlid].responseText;
    					if (xvotesString[htmlid].match (errormatch)) {
    						 xvotesString[htmlid] = xvotesString[htmlid].substring (6, xvotesString[htmlid].length);
							changemnmvalues (htmlid, value, true);target2.innerHTML = "<span>hitle</span>";						} else {
							if (xvotesString[htmlid].substring (1, 6) == "ERROR") { alert(xvotesString[htmlid]);  } else {target2.innerHTML = "<span>hitle</span>";changemnmvalues (htmlid, value, false); }							
    					}
    				}
    			}
    		}
    	}
	}
}


function cvote (user, id, htmlid, md5, value)
{
	if (xmlhttp) {
		url = "http://www.hitbol.com/cvote.php";
		mycontent = "id=" + id + "&user=" + user + "&md5=" + md5 + "&value=" + value;
		anonymous_vote = false;

        if (anonymous_vote == false && user == '0') {
            window.location="http://www.hitbol.com/login.php?return="+location.href;
        } else {
    		mnmxmlhttp[htmlid] = new myXMLHttpRequest ();
    		if (mnmxmlhttp) {
    			mnmxmlhttp[htmlid].open ("POST", url, true);
    			mnmxmlhttp[htmlid].setRequestHeader ('Content-Type', 'application/x-www-form-urlencoded');    
    			mnmxmlhttp[htmlid].send (mycontent);
    			errormatch = new RegExp ("^ERROR:");
    			target1 = document.getElementById ('cvote-' + htmlid);        
    			mnmPrevColor[htmlid] = target1.style.backgroundColor;
    			target1.style.backgroundColor = '#FFFFFF';
    			mnmxmlhttp[htmlid].onreadystatechange = function () {
    				if (mnmxmlhttp[htmlid].readyState == 4) {
    					xvotesString[htmlid] = mnmxmlhttp[htmlid].responseText;
    					if (xvotesString[htmlid].match (errormatch)) {
    						xvotesString[htmlid] = xvotesString[htmlid].substring (6, xvotesString[htmlid].length);						
    						changecvotevalues (htmlid, true);							
    					} else {
							target1 = document.getElementById ('ratebuttons-' + id);
							target1.style.display = "none";
							target2 = document.getElementById ('ratetext-' + id);
							target2.innerHTML = "Thank you for rating this comment.";
							changecvotevalues (htmlid, false);
    					}
    				}
    			}
    		}
    	}
	}
}

function changemnmvalues (id, value, error)
{
	split = new RegExp ("~--~");
	b = xvotesString[id].split (split);
	//alert(id);
	target1 = document.getElementById ('xvotes-' + id);
	target2 = document.getElementById ('xvote-' + id);
	target3 = document.getElementById ('xreport-' + id);
	target4 = document.getElementById ('xnews-' + id);
	if (error) {
		if (value > 0) { target2.innerHTML = "<span>hitlediniz</span> "; }
		else if (value < 0) { target2.innerHTML = "<span>raporlanmÄ±ÅŸ</span> "; }
		return false;
	}
	if (b.length <= 3) {
		target1.innerHTML = b[0];
		target1.style.backgroundColor = mnmPrevColor[id];
		new Effect.Fade(target3);
		if (value > 0) { target2.innerHTML = "<span>hitlediniz</span> "; }
		else if (value < 0 ) { target2.innerHTML = "<span>raporlanmÄ±ÅŸ</span> ";
													new Effect.Opacity(target4, {duration:0.8, from:1.0, to:0.3}); }
	}
	return false;
}

function changecvotevalues (id, error)
{
	split = new RegExp ("~--~");
	b = xvotesString[id].split (split);
	target1 = document.getElementById ('cvote-' + id);
	if (error) {
		return false;
	}
	if (b.length <= 3) {
		target1.innerHTML = b[0];
		target1.style.backgroundColor = mnmPrevColor[id];
	}
	return false;
}


function enablebutton (button, button2, target)
{
	var string = target.value;
	button2.disabled = false;
	if (string.length > 0) {
		button.disabled = false;
	} else {
		button.disabled = true;
	}
}

function checkfield (type, form, field)
{
	url = 'http://www.hitbol.com/checkfield.php?type='+type+'&name=' + field.value;
	checkitxmlhttp = new myXMLHttpRequest ();
	checkitxmlhttp.open ("GET", url, true);
	checkitxmlhttp.onreadystatechange = function () {
		if (checkitxmlhttp.readyState == 4) {
		responsestring = checkitxmlhttp.responseText;
			if (responsestring == 'OK') {
				document.getElementById (type+'checkitvalue').innerHTML = '<span style="color:black">"' + field.value + 
						'": ' + responsestring + '</span>';
				form.submit.disabled = '';
			} else {
				document.getElementById (type+'checkitvalue').innerHTML = '<span style="color:red">"' + field.value + '": ' +
				responsestring + '</span>';
				form.submit.disabled = '';
			}
		}
	}
  checkitxmlhttp.send (null);
  return false;
}

function emailto (original_id, htmlid, instpath, address_count)
{
	email_message = document.getElementById('email_message' + htmlid).value;
	email_address = document.getElementById('email_address_1_' + htmlid).value;
	if (address_count > 1){ 
		for ($i = 2; $i <= address_count; $i++) {
			if(document.getElementById('email_address_' + $i + '_' + htmlid).value != "") {
				email_address = email_address + ', ' + document.getElementById('email_address_' + $i + '_' + htmlid).value;
			}
		}
	}
	
	if (xmlhttp) {
		url = "http://www.hitbol.com/recommend.php";
		mycontent = "email_address=" + escape(email_address) + "&email_to_submit=submit&email_message=" + escape(email_message) + "&original_id=" + original_id + "&backup=0";
		target2 = document.getElementById ('emailto-' + htmlid);
		target2.innerHTML = "<br>Sending, please wait....";
		
		mnmxmlhttp[htmlid] = new myXMLHttpRequest ();
		if (mnmxmlhttp) {
			mnmxmlhttp[htmlid].open ("POST", url, true);
			mnmxmlhttp[htmlid].setRequestHeader ('Content-Type',
					   'application/x-www-form-urlencoded');

			mnmxmlhttp[htmlid].send (mycontent);
			errormatch = new RegExp ("^ERROR:");
			target1 = document.getElementById ('emailto-' + htmlid);
			mnmxmlhttp[htmlid].onreadystatechange = function () {
				if (mnmxmlhttp[htmlid].readyState == 4) {
					xvotesString[htmlid] = mnmxmlhttp[htmlid].responseText;
			
					if (xvotesString[htmlid].match (errormatch)) {
						xvotesString[htmlid] = xvotesString[htmlid].substring (6, xvotesString[htmlid].length);						
						target2 = document.getElementById ('emailto-' + htmlid);
						target2.innerHTML = xvotesString[htmlid];						
					} else {
						target2 = document.getElementById ('emailto-' + htmlid);
						target2.innerHTML = xvotesString[htmlid];
					}
				}
			}
		}
	}
}

function show_recommend(htmlid, linkid, instpath)
{
	var emailtodisplay=document.getElementById('emailto-' + htmlid).style.display ? '' : 'none';
	document.getElementById('emailto-' + htmlid).style.display = emailtodisplay;

	if (xmlhttp) {
		url = "http://www.hitbol.com/recommend.php";
		mycontent = "draw=small&htmlid=" + htmlid + "&linkid=" + linkid;
		target2 = document.getElementById ('emailto-' + htmlid);
		target2.innerHTML = "<br>Loading, please wait....";		
		mnmxmlhttp[htmlid] = new myXMLHttpRequest ();
		
		if (mnmxmlhttp) {
			mnmxmlhttp[htmlid].open ("POST", url, true);
			mnmxmlhttp[htmlid].setRequestHeader ('Content-Type',
					   'application/x-www-form-urlencoded');

			mnmxmlhttp[htmlid].send (mycontent);
			errormatch = new RegExp ("^ERROR:");
			target1 = document.getElementById ('emailto-' + htmlid);
			mnmxmlhttp[htmlid].onreadystatechange = function () {
				if (mnmxmlhttp[htmlid].readyState == 4) {
					xvotesString[htmlid] = mnmxmlhttp[htmlid].responseText;			
					if (xvotesString[htmlid].match (errormatch)) {
						xvotesString[htmlid] = xvotesString[htmlid].substring (6, xvotesString[htmlid].length);						
						target2 = document.getElementById ('emailto-' + htmlid);
						target2.innerHTML = xvotesString[htmlid];						
					} else {
						target2 = document.getElementById ('emailto-' + htmlid);
						target2.innerHTML = xvotesString[htmlid];
					}
				}
			}
		}
	}
}


function gizle() {for (i = 0; i < arguments.length; i++) {var e = document.getElementById(arguments[i]); if (e) e.style.display = "none";}}
function goster() {for (i = 0; i < arguments.length; i++) {var e = document.getElementById(arguments[i]); if (e) e.style.display = "";}}
function tepebosluk() {for (i = 0; i < arguments.length; i++) {var e = document.getElementById(arguments[i]); if (e) e.style.marginTop = "200px";}}
function tepebosluksil() {for (i = 0; i < arguments.length; i++) {var e = document.getElementById(arguments[i]); if (e) e.style.marginTop = "0px";}}

function videoizle(hangisite,videoid,sayfaid){
var izlediv=document.getElementById ('oyyla-video-'+sayfaid);


if (hangisite=='youtube'){
var neyazayim = '<embed src="http://www.youtube.com/v/'+videoid+'&autoplay=1" type="application/x-shockwave-flash" wmode="transparent" width="480" height="395"></embed>';}

else if(hangisite=='google'){
var neyazayim = '<embed style="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId='+videoid+'" flashvars="&subtitle=on"></embed>';
}

else if(hangisite=='izlesene'){
var neyazayim = '<embed src="http://beta.izlesene.com/player_normal.swf?video='+videoid+'" wmode="transparent" width="416" height="344" type="application/x-shockwave-flash"></embed>';
}

else if(hangisite=='pikniktube'){
var neyazayim = '<object width="340" height="320" allowFullScreen="true"><param name="flashvars" value="linktarget=_blank&embedded=1&xmlsrc=http://www.pikniktube.com/getxmle.asp?q='+videoid+'&a=1&c=0"></param><param name="movie" value="http://www.pikniktube.com/player/videoplayer2.swf"></param><param name="xmlsrc" value="http://www.pikniktube.com/getxmle.asp?q='+videoid+'&a=1&c=0"></param><embed src="http://www.pikniktube.com/player/videoplayer2.swf" type="application/x-shockwave-flash" allowFullScreen="true" width="340" height="320" flashvars ="linktarget=_blank&embedded=1&xmlsrc=http://www.pikniktube.com/getxmle.asp?q='+videoid+'&a=1&c=0"></embed></object>';
}

else if(hangisite=='metacafe'){
var neyazayim = '<embed src="http://www.metacafe.com/fplayer/'+videoid+'/.swf&playerVars=autoPlay=yes" width="400" height="345" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"> </embed>';
}

else if(hangisite=='clipfish'){
var neyazayim = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="464" height="380" id="player" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="http://www.clipfish.de/videoplayer.swf?as=0&videoid='+videoid+'&r=1" /><param name="wmode" value="transparent"><param name="quality" value="high" /> <param name="bgcolor" value="#999999" /> <embed src="http://www.clipfish.de/videoplayer.swf?as=0&videoid='+videoid+'&r=1" quality="high" bgcolor="#999999" width="464" height="380" name="player" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>';
}
else if(hangisite=='myvideo'){
var neyazayim = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="476" height="411"><param name="movie" value="http://www.myvideo.de/movie/'+videoid+'"></param><embed src="http://www.myvideo.de/movie/'+videoid+'" width="476" height="411" type="application/x-shockwave-flash"></embed></object>';
}
else if(hangisite=='videotube'){
var neyazayim = '<object type="application/x-shockwave-flash" data="http://www.videotube.de/ci/flash/videotube_player_4.swf?videoId='+videoid+'&svsf=0&lang=german&host=www.videotube.de" width="480" height="400" wmode="transparent"><param name="movie" value="http://www.videotube.de/ci/flash/videotube_player_4.swf?videoId='+videoid+'&svsf=0&lang=german&host=www.videotube.de" /></object>';
}
else if(hangisite=='myspacetv'){
var neyazayim = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="480" height="386" id="player" align="middle"><embed src="http://lads.myspace.com/videos/myspacetv_vplayer0005.swf?fuseaction=vids.individual&videoid='+videoid+'" width="480" height="386" flashvars="m='+videoid+'&type="application/x-shockwave-flash"></embed></object>';
}
else if(hangisite=='hurriyet'){
var neyazayim = '<embed id="Hürriyet_Video" width="420" height="350" flashvars="FlashVars=&videoid='+videoid+'&vimage=http://videogaleri.hurriyet.com.tr/images/logo_hurriyet_video.gif" wmode="transparent" quality="high" name="Hürriyet_Video" src="http://videogaleri.hurriyet.com.tr/hurriyetmediaplayer.swf" type="application/x-shockwave-flash"/>';
}
else if(hangisite=='abcnews'){
var neyazayim = '<embed width="400" height="350" wmode="transparent" flashvars="file=http://ugv.abcnews.go.com/ChannelRssHandler.ashx%3fcontentItemID%3d'+videoid+'%26mi%3d1&autostart=false&overstretch=false&LinkOnScreenClick=0&InitialVolume=40" quality="high" name="mpl" id="mpl" src="http://ugv.abcnews.go.com/dbox/3/flvplayer_abc_small.swf" type="application/x-shockwave-flash"/>';
}


izlediv.innerHTML = neyazayim+'<br /><a style="color:#0099FF; font-weight: bold;" href="#" onclick="videokapa(\''+sayfaid+'\');return false;">videoyu kapat</a>';
var gizlenecek='oyyla-video-onizleme-'+sayfaid;
gizle(gizlenecek);
var bosluklanacak='oyyla-dugmesi-'+sayfaid;
tepebosluk(bosluklanacak);
}

function videokapa(sayfaid){
var izlediv=document.getElementById ('oyyla-video-'+sayfaid);
izlediv.innerHTML = '';
var gosterilecek='oyyla-video-onizleme-'+sayfaid;
goster(gosterilecek);
var bosluksilinecek='oyyla-dugmesi-'+sayfaid;
tepebosluksil(bosluksilinecek);
}


function ao() {nerdeyiz = window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop;
document.getElementById('kapla').style.top = nerdeyiz + 'px';
document.getElementById('girisci').style.top = 60 + nerdeyiz + 'px';
goster("kapla", "girisci");
return;
}
function menu1ac(id){
		if(id != ((id*1+ 1)-1)) return false;
		var m1_act = document.getElementById('m1_act').innerHTML;
		if(m1_act == id) return false;
		var m2_act = document.getElementById('m2_act').innerHTML;
		
		document.getElementById('m1_act').innerHTML = id;
		document.getElementById('m2_act').innerHTML = '';
		
		if(m1_act != '' && document.getElementById('m1_' + m1_act)) document.getElementById('m1_' + m1_act).className = '';
		if(m1_act != '' && document.getElementById('m2_' + m1_act)) document.getElementById('m2_' + m1_act).style.display = 'none';
		if(m2_act != '' && document.getElementById('m3_' + m2_act)) document.getElementById('m3_' + m2_act).style.display = 'none';
		
		if(m1_act != '' && m2_act != '' && document.getElementById('m2_' + m1_act + '_' + m2_act))
			document.getElementById('m2_' + m1_act + '_' + m2_act).className = '';
		
		if(m2_act != '' && document.getElementById('m3_' + m2_act)) document.getElementById('m3_' + m2_act).style.display = 'none';
		
		if(document.getElementById('m1_' + id)){ var soldan = document.getElementById('m1_' + id).offsetLeft*1 - 30; document.getElementById('m1_' + id).className = 'active'; }
        else  var soldan = 0;
        
        if(document.getElementById('m2_' + id)){
			document.getElementById('m2_' + id).style.display = 'block';
			
			soldan = soldan - document.getElementById('m2_' + id).scrollWidth/2;
			soldan = soldan + document.getElementById('m1_' + id).scrollWidth/3;
			if(soldan < 0) soldan = 0;
        	//if(navigator.userAgent.toLowerCase().indexOf("gecko") != -1) soldan = soldan - 15;

			 
		 	document.getElementById('m2_' + id).style.marginLeft = soldan  +'px'; 
		 
		 }
	}
	function menu2ac(id){
		if(id != ((id*1+ 1)-1) ) return false;
			
		var m2_act = document.getElementById('m2_act').innerHTML;
		if(m2_act == id) return false;
		var m1_act = document.getElementById('m1_act').innerHTML;
		
		document.getElementById('m2_act').innerHTML = id;
		
		if(m1_act != '' && m2_act != '' && document.getElementById('m2_' + m1_act + '_' + m2_act))
			document.getElementById('m2_' + m1_act + '_' + m2_act).className = '';
		
		if(m2_act != '' && document.getElementById('m3_' + m2_act)) document.getElementById('m3_' + m2_act).style.display = 'none';
		
		if(document.getElementById('m2_' + m1_act + '_' + id)){ var soldan = document.getElementById('m2_' + m1_act + '_' + id).offsetLeft*1 - 30; document.getElementById('m2_' + m1_act + '_' + id).className = 'active'; }
		else{  var soldan = 0; }
		if(document.getElementById('m3_' + id)){ document.getElementById('m3_' + id).style.display = 'block'; document.getElementById('m3_' + id).style.marginLeft = soldan + 'px'; }
	}
girisform = function(){ 
		if(document.getElementById('logindiv').style.display == 'none'){
			document.getElementById('logindiv').style.display = 'block';
			document.getElementById('searchdiv').style.display = 'none';
			document.getElementById('loginlink').className = 'active';
			document.getElementById('user').focus();
		}
		else{
			document.getElementById('logindiv').style.display = 'none';
			document.getElementById('searchdiv').style.display = 'block';
			document.getElementById('loginlink').className = '';
			document.getElementById('searchbox').focus();
		}
		
	}