// Created by Tendure Interactive
// Developer by MGC

var xmlhttp = false;
//Check if we are using IE.
try {
	//If the javascript version is greater than 5.
	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
	//If not, then use the older active x object.
	try {
		//If we are using IE.
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	} catch (E) {
		//Else we must be using a non-IE browser.
		xmlhttp = false;
	}
}

//If we are using a non-IE browser, create a javascript instance of the object.
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
	xmlhttp = new XMLHttpRequest();
}

//Function to run a word grabber script.
function ichatlarf (objx,fm){
	var form = document.getElementById(fm);
	var j = document.getElementById(fm).length;
	
	var postRequest = new String("");
	var n,v;// n -> name , v -> value
	//create information in post
	for(var i=0;i<j;i++){
		n = form[i].name;
		v = form[i].value;
		postRequest += encodeURI(escape(n)) + '=' + encodeURI(escape(v)) + '&';
	}
	
	var obj = document.getElementById(objx);
	serverpage = "varis01.cfm";
	xmlhttp.open("POST", serverpage, true);
	xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
	xmlhttp.setRequestHeader('Content-Language','tr');
	xmlhttp.onreadystatechange = function() {
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			obj.innerHTML = xmlhttp.responseText;
		}
	}
	xmlhttp.send(postRequest);
}
function dishatlarf (objx,fm){
	var form = document.getElementById(fm);
	var j = document.getElementById(fm).length;
	
	var postRequest = new String("");
	var n,v;// n -> name , v -> value
	//create information in post
	for(var i=0;i<j;i++){
		n = form[i].name;
		v = form[i].value;
		postRequest += encodeURI(escape(n)) + '=' + encodeURI(escape(v)) + '&';
	}
	
	var obj = document.getElementById(objx);
	serverpage = "varis02.cfm";
	xmlhttp.open("POST", serverpage, true);
	xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
	xmlhttp.setRequestHeader('Content-Language','tr');
	xmlhttp.onreadystatechange = function() {
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			obj.innerHTML = xmlhttp.responseText;
		}
	}
	xmlhttp.send(postRequest);
}
function atama(a){
	document.getElementById("varis").value = a;
}
function atama2(a){
	document.getElementById("varisaa").value = a;
}

$.fn.tendure_nav = function(options) {
    
  options = $.extend({speed: 50}, options || {});
  
  this.each(function() {
    
    var root = this, zIndex = 1000;
    
    function getSubnav(ele) {
      if (ele.nodeName.toLowerCase() == 'li') {
        var subnav = $('> ul', ele);
        return subnav.length ? subnav[0] : null;
      } else {
        return ele;
      }
    }
    
    function getActuator(ele) {
      if (ele.nodeName.toLowerCase() == 'ul') {
        return $(ele).parents('li')[0];
      } else {
        return ele;
      }
    }
    
    function hide() {
      var subnav = getSubnav(this);
      if (!subnav) return;
      $.data(subnav, 'cancelHide', false);
      setTimeout(function() {
        if (!$.data(subnav, 'cancelHide')) {
          $(subnav).slideUp(options.speed);
        }
      }, 100);
    }
	
  
    function show() {
      var subnav = getSubnav(this);
      if (!subnav) return;
      $.data(subnav, 'cancelHide', true);
      $(subnav).css({zIndex: zIndex++}).slideDown(options.speed);
      if (this.nodeName.toLowerCase() == 'ul') {
        var li = getActuator(this);
        $(li).addClass('hover');
        $('> a', li).addClass('hover');
      }
    }
    
    $('ul, li', this).hover(show, hide);
    $('li', this).hover(
      function() { $(this).addClass('hover'); $('> a', this).addClass('hover'); },
      function() { $(this).removeClass('hover'); $('> a', this).removeClass('hover');  }
    );
    
  });
  
};

$(document).ready(function() {
	$("#tab001").fadeIn("fast");
	$(".tab001").addClass("tab001A");
	$('#tab> li> a').click(function() {
		wtab = $(this).attr("rel");
		otab = $(this).attr("class") + "A";
		$(".tab001A").removeClass("tab001A");
		$(".tab002A").removeClass("tab002A");
		$(".tab003A").removeClass("tab003A");
		$(".tab004A").removeClass("tab004A");
		$(this).addClass(otab);
		$('#tab_content> ul> li').hide();
		$(wtab).fadeIn("slow");
	});
	$(function() {
		$('#nav').tendure_nav();
	});
	
	$('#newsList').innerfade({
		animationtype: 'fade',
		speed: 300,
		timeout: 5000,
		type: 'random',
		containerheight: '30px'
	});

});

function os(){
	window.open("https://online.ido.com.tr","","top=0,left=0,width=1024,height=768, status, resizable=yes")
}

function inthrt(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features+",left=17");
}

function idoacenta(){
	window.open("http://www.ido.com.tr/int_acente/index.html","","top=0,left=261,width=468,height=550,status,resize=no")
}

function iptalpopup(pop_link){
	var popup
	popup = window.open(pop_link,"iptal","toolbar=no,location=no,scrollbars=yes,width=580,height=200,left=200");
	popup.focus()
}

//sanaltur javascript fonksiyonlari
function makro360() 	{
	return document.getElementById("makropano");
}
function gemilermenu(){
	makro360().call( "action(turkceolsun);action(yenimenuac);");
}
function iskelelermenu(){
	makro360().call( "action(turkceolsun);action(iskelemenuac);");
}
function fleetmenu()	{
	makro360().call( "action(ingilizceolsun);action(yenimenuac);");
}
function terminalmenu(){
	makro360().call( "action(ingilizceolsun);action(iskelemenuac);");
}
function osmangazi(){
	makro360().call( "action(turkceolsun);action(panosman);" );  
}
function yardim(){
	makro360().call( "action(turkceolsun);action(yardim);" );  
}
function help(){
	makro360().call( "action(ingilizceolsun);action(yardim);" );  
}
function pan(panto){
	makro360().call( "action(pan" +panto + ")" );
}
