function swf(src, width, height) {
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="800" height="600"  id="currentGame">');
	document.write('<param name="movie" value="' + src + '">');
	document.write('<param name="quality" value="high">');
	document.write('<embed src="' + src + '" id="currentEmbedGame" quality="high" bgColor="#ffffff" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="800" height="600" menu="0"></embed>');
	document.write('</object>');
}
function dcr(src, width, height) {
	document.write('<object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=7,0,2,0" width="' + width + '" height="' + height + '">');
	document.write('<param name="swRemote" value="swSaveEnabled=\'true\' swVolume=\'true\' swRestart=\'true\' swPausePlay=\'true\' swFastForward=\'true\' swContextMenu=\'true\'">');
	document.write('<param name="swStretchStyle" value="meet">');
	document.write('<param name="bgColor" value="#000000">');
	document.write('<param name="src" value="' + src + '">');
	document.write('<embed src="' + src + '" width="' + width + '" height="' + height + '" bgColor="#ffffff" swRemote="swSaveEnabled=\'true\' swVolume=\'true\' swRestart=\'true\' swPausePlay=\'true\' swFastForward=\'true\' swContextMenu=\'true\'" swStretchStyle="meet" type="application/x-director" pluginspage="http://www.macromedia.com/shockwave/download/"></embed>');
	document.write('</object>');
}



function popupform(myform, ekle)
{
if (! window.focus)return true;
window.open('', ekle, 'height=275,width=290,scrollbars=no,status=no');
myform.target=ekle;
return true;
}

function favori(ID)
{
	jQuery.ajax( {  
		type: 'GET',
		url:'np-script.php?favori',
		data:'ID=' + ID,
		success: function(sonuc) {
		$('#favorit').html(sonuc);
	   }
	});
}
function favcikar(ID)
{
	jQuery.ajax( {  
		type: 'GET',
		url:'np-script.php?favcikar',
		data:'ID=' + ID,
		success: function(sonuc) {
		$('#favorit').html(sonuc);
	   }
	});
}
function point(ID, P)
{
	jQuery.ajax( {  
		type: 'GET',
		url:'np-script.php?point',
		data:'ID=' + ID+'&P=' + P,
		success: function(sonuc) {
		$('#puanbolum').html(sonuc);
	   }
});
}
function gamelike(ID, P)
{
	jQuery.ajax( {  
		type: 'GET',
		url:'np-script.php?gamelike',
		data:'ID=' + ID+'&P=' + P,
		success: function(sonuc) {
		$('#likebol').html(sonuc);
	   }
});
}
function commentpages(ID, P)
{
	jQuery.ajax( {  
		type: 'POST',
		url:'np-script.php?commentpages',
		data:'ID=' + ID+'&P=' + P,
		success: function(sonuc) {
		$('#commentsarea').html(sonuc);
	   }
});
}
function loadgame(ID)
{
	jQuery.ajax( {  
		type: 'POST',
		url:'np-script.php?loadgame',
		data:'ID=' + ID,
		success: function(sonuc) {
		$('#loadgame').html(sonuc);
	   }
	});
}

setTimeout('gameloader()',10000);
function gameloader() {
var x=document.getElementById('floader').style;
var y=document.getElementById('sloader').style;
if(x.display=='block') { x.display='none'; y.display='block'; }
else { x.display='block'; y.display='none'; }
}

function pgame() {
var x=document.getElementById('ffield').style;
var y=document.getElementById('sfield').style;
if(x.display=='block') { x.display='none'; y.display='block'; }
else { x.display='block'; y.display='none'; }
}

function oyungoster() {
var x=document.getElementById('ilkalan').style;
var y=document.getElementById('sonrakialan').style;
if(x.display=='block') { x.display='none'; y.display='block'; }
else { x.display='block'; y.display='none'; }
}

function popup(theURL,winName,features) { 
window.open(theURL,winName,features);
}

$(document).ready(function() {
	$(".game_comment").hide(); 
	$(".slogan_oyna_alt_menu_orta a:first").addClass("aktif").show(); //Activate first tab
	$(".game_comment:first").show();
	
	$(".slogan_oyna_alt_menu_orta a").click(function() {
		$(".slogan_oyna_alt_menu_orta a").removeClass("aktif");
		$(this).addClass("aktif");
		$(".game_comment").hide();
		var activeTab = $(this).attr("href");
		$(activeTab).fadeIn();
		return false;
	});
});
