var radsan_window = null;
function initMyPage(){
	jQuery("#sym_input_eposta").focus(function() {  if (jQuery(this).attr('alt')==jQuery(this).val()){ jQuery(this).val(''); }}).focusout( function(){ if (jQuery(this).val()==''){ jQuery(this).val(jQuery(this).attr('alt')); }} );
	jQuery("a.bottom_icons").qtip({ show: 'mouseover',hide: 'mouseout',content: { text:true } ,position: { corner: { target: 'topMiddle',tooltip: 'bottomMiddle' }  }, style: { name:'light',tip: 'bottomMiddle',border: { width: 1,radius: 8,color: '#1e1e1e' } } });
	jQuery("#sym_link_postaal").click( function(e){ e.preventDefault(); initOverlayForUrl('radsan.php?sub=eposta&eposta='+escape(jQuery('#sym_input_eposta').val())); } );
	jQuery("#sym_addtofav").click( function(e){ e.preventDefault();radsanAddToFavorites();} );
	jQuery("#sym_print").click( function(e){ e.preventDefault();radsanPrintPage();} );
	jQuery(".galeri_link").colorbox();
	jQuery("a.video_link").each( function(index,el){ 
	jQuery(el).click( function(e){ e.preventDefault(); window.open(jQuery(this).attr('href'),'video_penceresi','location=0,status=0,scrollbars=1,width=800,height=500');} ); } );
	jQuery("a.gtimggal_link").colorbox({current:'Resim {current} / {total}'});
}
function initOverlayForUrl(urlAddress){
	jQuery.colorbox({ href:urlAddress,onOpen:function(){ jQuery('.hide_on_overlay').hide(); },onClosed:function(){ jQuery('.hide_on_overlay').show(); }  });
}
function radsanAddToFavorites(){
	if (window.sidebar){ // firefox
		window.sidebar.addPanel(title, url, "");	
	}else if(window.opera && window.print){ // opera
		var elem = document.createElement('a');
		elem.setAttribute('href',url);
		elem.setAttribute('title',title);
		elem.setAttribute('rel','sidebar');
		elem.click();
	}else if(document.all){ // ie
		window.external.AddFavorite(url, title);
	}
}
function radsanPrintPage(){
	radsan_window = window.open('', 'radsanprintpage', 'height=450,width=800,status=0,toolbar=0,menubar=0,resizable=1,scrollbars=1');
	radsan_window.document.innerHTML = '';
	radsan_window.document.title = document.title;
	var str = "<html><head><title>"+document.title+"</title>";
	str += '<base href="'+GTECH_BASE_URL+'" />';
	str += '<link rel="stylesheet" type="text/css" media="print,screen,projection" charset="utf-8" href="css/print/index.css" />';
	str += "</head><body>";
	var printedEl = jQuery("#radsanmaincontent");
	//str += "<div class='printtoplogo' ><img src='"+GTECH_BASE_URL+"css/print/toplogo.jpg' border='0' /></div>";
	printedEl.each(function(){ str += ""+jQuery(this).html()+""; });
	str += "<br/><b>Sayfa Adresi : </b>"+document.location.href;
	str += "</body></html>";	
	radsan_window.document.write(str);
	radsan_window.print();
	setTimeout(radsanCloseWindow,10000);
	return true;
}
function radsanCloseWindow(  ){  if (radsan_window){ radsan_window.close();  radsan_window = null; }  }
function radsanAnaMenuSecimi(selector){
	if (jQuery(selector).length>0){
		var pos = jQuery(selector).css('backgroundPosition');
		if (pos.length>5){
			var last3 = pos.substr(pos.length-3,3);
			if (last3=="0px"){
				var newpos = pos.substr(0,pos.length-3)+" -40px";
				jQuery(selector).css('backgroundPosition',newpos);
			}
		}				
	}
}
