hs.registerOverlay(
{
thumbnailId: null,
overlayId: 'controlbar',
position: 'top right',
hideOnMouseOut: true
}
);
AlertMessage=function(what){
/*Ext.MessageBox.show({
title: 'Uyarı',
msg: what,
width:250,
shadow: true,
buttons: Ext.MessageBox.OK
});*/
alert(what);
}
hs.showCredits = false;
hs.graphicsDir = '_gfx/highslide/';
window.onload = function() {
hs.preloadImages(5);
}
PeriodicalExecuter.prototype.registerCallback = function() {
this.intervalID = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
}
PeriodicalExecuter.prototype.stop = function() {
clearInterval(this.intervalID);
}
NLGI = function(){
AlertMessage('Bu işlemi yapabilmek için sisteme giriş yapmalısınız.');
}

_get_events=function(start,finish,id){
if(slideshow){
slideshow.stop();
}
$('event_detail').style.visibility='VISIBLE';
$$('#scroller .spot').each(function(element){
element.style.visibility='HIDDEN';
});
var idx='';
if(id>0){
idx='&id='+id;
}
var params='start='+start+'&finish='+finish+idx;
var ajax = new Ajax.Request(
d_address+'/etkinlikkontrol', 
{
method: 'post', 
parameters: params,
onCreate: function(r){
Element.update('event_detail','<img src="http://www.akbanksanat.com/_gfx/loading_transparent.gif" alt="Yükleniyor" style="position:absolute;margin-top:80px;margin-left:80px;">');
},
on200: function(r){
$('event_detail').scrollTop=0;
Element.update('event_detail',r.responseText);
new Insertion.Top('event_detail','<a href="javascript:void(0)" onmouseover="_scroll_start(\'up\',\'event_detail\')" onmouseout="_scroll_end();" style="position:absolute;margin-left:185px;margin-top:15px;"><img src="_gfx/up.gif" alt="Yukarı" /></a><a href="javascript:void(0)" onmouseover="_scroll_start(\'down\',\'event_detail\')" onmouseout="_scroll_end();" style="position:absolute;margin-left:185px;margin-top:175px;"><img src="_gfx/down.gif" alt="Aşağı" /></a>');
}
});
}
var ourInterval;
function _scroll_start(direction, div){
ourInterval = setInterval('_scroll_'+direction+'(\''+div+'\');', 50);
}
function _scroll_end(){
clearInterval(ourInterval);
}
function _scroll_up(div){
$(div).scrollTop = $(div).scrollTop - 5;
}
function _scroll_down(div){
$(div).scrollTop = $(div).scrollTop + 5;
}
function _scroll_right(div){
var px='px';
var marginleft=$(div).style.marginLeft.replace(px,'');
var newmargin=marginleft-5;
$(div).style.marginLeft = newmargin+'px';
}
function _scroll_left(div){
var px='px';
var marginleft=$(div).style.marginLeft.replace(px,'');
var newmargin=marginleft+5;
$(div).style.marginLeft = newmargin+'px';
}
_get_month=function(month,id){
var idx='';
if(id>0){
idx='&id='+id;
}
var params='month='+month+idx;
var ajax = new Ajax.Request(
d_address+'/etkinlikaykontrol', 
{
method: 'post', 
parameters: params,
on200: function(r){
Element.update('calendar',r.responseText);
}
});
}
_switch_language=function(e){
if(e>0){
var params='&language=english';
} else {
var params='&language=turkce';
}
var ajax = new Ajax.Request(
d_address+'/dildegistir', 
{
method: 'post', 
parameters: params,
on200: function(r){
document.location=top.location;
}
});
}
_play=function(file){
window.open(file,null,"height=350,width=340,status=yes,toolbar=no,menubar=no,location=no");
}
function sineInOut(t, b, c, d)
{
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
}

getSize = function() {
if (document.all) {
myWidth  = (document.documentElement.clientWidth) ? document.documentElement.clientWidth : document.body.clientWidth;
myHeight = (document.documentElement.clientHeight) ? document.documentElement.clientHeight : document.body.clientHeight;
myScroll = (document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
} else {
myWidth = window.innerWidth;
myHeight = window.innerHeight;
myScroll = window.pageYOffset;
}
    if (window.innerHeight && window.scrollMaxY) {
        myScrollWidth = document.body.scrollWidth;
myScrollHeight = window.innerHeight + window.scrollMaxY;
} else if (document.body.scrollHeight > document.body.offsetHeight) {
myScrollWidth = document.body.scrollWidth;
myScrollHeight = document.body.scrollHeight;
} else {
myScrollWidth = document.body.offsetWidth;
myScrollHeight = document.body.offsetHeight;
}
}
function findElementPos(elemFind)
{
var elemX = 0;
var elemY = 0;
do {
elemX += elemFind.offsetLeft;
elemY += elemFind.offsetTop;
} while ( elemFind = elemFind.offsetParent )
return Array(elemX, elemY);
}


var currentSection = "frame1-pane";
var h_s = "-tab";
var f_s = "-pane";

function _scroll_frames(){
ScrollArrow('right','carousel_navigation','scroller','frame1-pane');
}

function ScrollSection(link, scrollArea, offset){
if (currentSection == link) {
return;
}
lastSection = currentSection;
currentSection = link;
    sectionTab = currentSection.split("-")[0] + h_s;
    $(sectionTab).className = "selected";
    if (lastSection) {
    lastTab = lastSection.split("-")[0] + h_s;
    $(lastTab).className = "normal";
}
theScroll = $(scrollArea);
position = findElementPos($(link));
if (offset != "") {
offsetPos = findElementPos($(offset));
position[0] = position[0] - offsetPos[0];
}
scrollStart(theScroll, theScroll.scrollLeft, position[0], "horiz");
}
ScrollArrow = function (direction, toolbar, scrollArea, offset) {
toolbarElem = $(toolbar);
toolbarNames = new Array();
if (toolbarElem.hasChildNodes())
{
var children = toolbarElem.childNodes;
for (var i = 0; i < children.length; i++) 
{
if (toolbarElem.childNodes[i].tagName == "A") {
toolbarNames.push(toolbarElem.childNodes[i].id.split("-")[0]);
}
}
}
for (var i = 0; i < toolbarNames.length; i++) {
if (toolbarNames[i] == currentSection.split("-")[0]) {
if (direction == "left") {
if (i - 1 < 0) {
gotoTab = toolbarNames[toolbarNames.length - 1];
} else {
gotoTab = toolbarNames[i - 1];
}
} else {
if ((i + 1) > (toolbarNames.length - 1)) {
gotoTab = toolbarNames[0];
} else {
gotoTab = toolbarNames[i + 1];
}
}
}
}
ScrollSection(gotoTab+f_s, scrollArea, offset);
}
var scrollanim = {time:0, begin:0, change:0.0, duration:0.0, element:null, timer:null};

scrollStart=function(elem, start, end)
{
if (scrollanim.timer != null) {
clearInterval(scrollanim.timer);
scrollanim.timer = null;
}
scrollanim.time = 0;
scrollanim.begin = start;
scrollanim.change = end - start;
scrollanim.duration = 25;
scrollanim.element = elem;
scrollanim.timer = setInterval("scrollHorizAnim();", 15);
}

scrollHorizAnim=function()
{
if (scrollanim.time > scrollanim.duration) {
clearInterval(scrollanim.timer);
scrollanim.timer = null;
}
else {
move = sineInOut(scrollanim.time, scrollanim.begin, scrollanim.change, scrollanim.duration);
scrollanim.element.scrollLeft = move;
scrollanim.time++;
}
}
fixpng=function(){
var arVersion = navigator.appVersion.split("MSIE");
var version = parseFloat(arVersion[1]);

if ((version >= 5.5) && (document.body.filters)) 
{
   $$('.transparent_image').each(function(element){
var imgsrc=element.src;
var height=element.height;
var width=element.width;
element.src= 'http://www.akbanksanat.com/gfx/px.gif';
element.height=height;
element.width=width;
element.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+imgsrc+'",sizingMethod="scale")';
});

$$('.transparent').each(function(element){
var bgimg=element.currentStyle.backgroundImage || element.style.backgroundImage;
if (bgimg.match(/^url[("']+(.*\.png)[)"']+$/i)){
var s = RegExp.$1;
element.style.backgroundImage = 'none';
element.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+s+'",sizingMethod="scale")';
}
});
}
}
function ADDC(){
var params=Form.serialize('newcomment');
if(!$F('comment') || !$F('email') || !$F('name')){
alert('Lütfen tüm alanları doldurunuz!');
return false;
} else {
var ajax = new Ajax.Request(
'http://www.akbanksanat.com/yorumekle', 
{
method: 'post', 
parameters: params, 
onComplete: function(r){
if(r.responseText=="1"){
alert('Yorumunuz onaylandıktan sonra yayınlanacaktır.\n\nTeşekkür ederiz...');
$('newcomment_div').style.display='none';
} else {
alert(r.responseText);
}
}
});
}
return false;

}