var wpop=takSec='';
var sosHTML='';
var sosSit=['twitter','facebook'];
var sosTit=['Twitter','Facebook'];

function Git(url){
	document.location=url;
}

function Obj(id){
	if (!document.getElementById) return false;
	return document.getElementById(id);
}

function yp2(loc){
	window.open(loc,'win','width=200,height=50,top=20,left=20');
}

function yp(loc,w,h){if (!window.popup){ac(loc,w,h);}else{if (!popup.closed){popup.close();ac(loc,w,h)}else{ac(loc,w,h)}}}
function ac(loc,w,h){popup=window.open(loc,'popup','scrollbars=yes,status=yes,directories=no,menubar=no,resizable=yes,toolbar=no,width='+w+',height='+h+',screenX=50,screenY=50,top=50,left=50');}

function Pop(resim,w,h){
	if (!w || !h) return;

	x=screen.width/2-w/2, y=(screen.height-60)/2-h/2;

	if (document.all) w+=16;

	if (wpop && !wpop.closed) wpop.close();
	wpop=window.open(resim,'','scrollbars=yes,status=yes,directories=no,menubar=no,resizable=yes,toolbar=no,width='+w+',height='+h+',top='+y+',left='+x);

	wpop.document.open();
	wpop.document.write('<html><title>Senkop Müzik</title><style>BODY {margin:0; background:url('+resim.href+') no-repeat;}</style><body></body></html>');
	wpop.document.close();
	wpop.focus();

	return false;
}

function Yaz(urele){
	window.open(urele,'yzc','status=yes,top=50,left=50,scrollbars=yes,resizable=yes,width=490,height=500');
	return false;
}

function Gonder(urele){
	window.open(urele,'gndr','status=yes,top=50,left=50,scrollbars=yes,resizable=yes,width=490,height=500');
	return false;
}

function Goster(obj){
	Obj(obj).style.display='block';
}

function Gosterme(obj){
	Obj(obj).style.display='none';
}

function UrunIsimOffset(){
	$('.urun .isim').each(function(){
		if ($(this).children(0).attr('offsetHeight')<20) $(this).css('top','132px');
		$(this).css('visibility','visible');
	});
}

function DLKontrol(){
	f=document.frmdl;
	hata='';
	if (frmdl.i1.value.indexOf('@')==-1) hata='Lütfen e-posta adresinizi yazınız.';
	if (!hata) return true;
	alert(hata);
	return false;
}

function NSA(){
	t='';
	b='          ';

	t+='- Alışveriş sepetinizi oluşturun\n';
	t+=b+'Ürün detay sayfalarındaki sepete ekle düğmesini\n';
	t+=b+'kullanarak alışveriş sepetinizi oluşturun.\n\n';

	t+='- Sepetinizi onaylayın\n';
	t+=b+'Alışverişinizi bitirdiğinizde sepetinizi kontrol edip,\n';
	t+=b+'sepeti onayla düğmesini tıklayın.\n\n';

	t+='- Bilgilerinizi girin\n';
	t+=b+'Fatura sevkiyat ve kredi kartı bilgilerinizi girin.\n\n';

	t+='- Siparişinizi verin\n';
	t+=b+'Verdiğiniz tüm bilgileri son kez kontrol edip siparişinizi\n';
	t+=b+'verin. "Senkop Müzik" Online satış temsilcimiz gerekli\n';
	t+=b+'kontrolleri yapıp en kısa sürede sizinle iletişime geçecektir.'+b+'\n\n';

	t+='- Teslimat\n';
	t+=b+'Kargo ücreti alıcıya aittir.\n';
	t+=b+'Ürününüz Yurtiçi Kargo ile sigortalı olarak size ulaştırılacaktır.\n';
	t+=b+'Teslimat sırasında ürününüzün orjinal ambalajının zarar\n';
	t+=b+'görmemiş olmasına dikkat ediniz. Zarar görmüş ambalajları\n';
	t+=b+'teslim almayınız. Firmamızla iletişime geçiniz.\n\n';

	t+='- Güvenlik\n';
	t+=b+'Sipariş işlemlerinde 128 bit SSL veri şifrelemesi kullanılmaktadır.\n';
	t+=b+'Senkop.com.tr\'nin SSL sertifikasını incelemek için GeoTrust\n';
	t+=b+'logosuna tıklayabilirsiniz.\n\n';

	alert(t);
}

function Taksit(){
	$('#kartListe').show();
	KartGoster(1);
}

function KartGoster(n){
	$('.kart492').hide();
	$('#kart'+n).show();

	$('LI[id^=liKart]').css('background','none');
	$('#liKart'+n).css('background','steelblue');

	$('LI[id^=liKart]').children(0).css('color','#a00');
	$('#liKart'+n).children(0).css('color','#fff');
}

function SosBuk(site){
	u=encodeURIComponent(location.href);
	t=encodeURIComponent(document.title);

	if (site=='twitter') url='http://twitter.com/home?status='+t+' - '+u;
	if (site=='stumbleupon') url='http://www.stumbleupon.com/submit?url='+u+'&title='+t;
	if (site=='myspace') url='http://www.myspace.com/Modules/PostTo/Pages/?u='+u+'&t='+t;
	if (site=='google') url='http://www.google.com/bookmarks/mark?op=add&bkmk='+u+'&title='+t;
	if (site=='facebook') url='http://www.facebook.com/sharer.php?u='+u+'&t='+t;
	if (site=='friendfeed') url='http://friendfeed.com/?url='+u+'&title='+t;
	if (site=='delicious') url='http://del.icio.us/post?v=2&url='+u+'&notes=&tags=&title='+t;

	if (site=='browser') if (window.sidebar){window.sidebar.addPanel(document.title,location.href,'');} else if (window.external){window.external.AddFavorite(location.href,document.title);} else if (window.opera && window.print) return false;
	window.open(url);
	return false;
}

function Sosyal(){
	for (i=0; i<sosSit.length; i++){
		sosHTML+='<a href="javascript:;" onclick="SosBuk(\''+sosSit[i]+'\');" title="'+sosTit[i]+'"><img src="images/ikon_'+sosSit[i]+'.png"></a>\n';
	}
	$('#sosyal DIV').html(sosHTML);
}

$(function(){
	UrunIsimOffset();
	Sosyal();
});

