var pausecontent2=new Array()

pausecontent2[0]='<a href="satinalma/">Alım Komisyonu Başkanlığı İhale Duyuruları<br />Satın Alma Müdürlüğü ile iletişime geçmek veya detaylı bilgi almak için lütfen buraya tıklayınız</a>'
pausecontent2[1]='<a href="http://www.flykthy.com" target="_blank"> Caretta Caretta eMagazine hizmetinizde!!! </br> Caretta Caretta dergimizi online olarak okuyabilirsiniz!!!</a>'
pausecontent2[2]='20 OCAK 2010 dan itibaren Kıbrıs/Türkiye arası veya Türkiye/Kıbrıs arası seyahat edecek yolcularımıza tek yön 20 Euro + vergiler, ücret uygulaması başlıyor. '



function pausescroller(content, divId, divClass, delay){
this.content=content
this.tickerid=divId
this.delay=delay
this.mouseoverBol=0 
this.hiddendivpointer=1 
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
var scrollerinstance=this
if (window.addEventListener)
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent)
window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById)
setTimeout(function(){scrollerinstance.initialize()}, 500)
}
pausescroller.prototype.initialize=function(){
this.tickerdiv=document.getElementById(this.tickerid)
this.visiblediv=document.getElementById(this.tickerid+"1")
this.hiddendiv=document.getElementById(this.tickerid+"2")
this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.getinline(this.visiblediv, this.hiddendiv)
this.hiddendiv.style.visibility="visible"
var scrollerinstance=this
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent) 
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}
pausescroller.prototype.animateup=function(){
var scrollerinstance=this
if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
setTimeout(function(){scrollerinstance.animateup()}, 50)
}
else{
this.getinline(this.hiddendiv, this.visiblediv)
this.swapdivs()
setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
}
}

pausescroller.prototype.swapdivs=function(){
var tempcontainer=this.visiblediv
this.visiblediv=this.hiddendiv
this.hiddendiv=tempcontainer
}

pausescroller.prototype.getinline=function(div1, div2){
div1.style.top=this.visibledivtop+"px"
div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
}

pausescroller.prototype.setmessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1) 
setTimeout(function(){scrollerinstance.setmessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=this.content.length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
this.animateup()
}
}

pausescroller.getCSSpadding=function(tickerobj){ 
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle) 
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}
/* Preload */

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
/* Preload */

/* Calendar */
iens6=document.all||document.getElementById
ns4=document.layers

function moveHandler(e){
	if (e == null) { e = window.event }       
	if (e.button<=1&&dragOK){
		//savedTarget.style.left=e.clientX-dragXoffset+'px';
		currentSlider = parseInt(savedTarget.id.substring(3));
		//alert(currentSlider);
		if(e.clientY-dragYoffset < itemLimits[currentSlider][1] && e.clientY-dragYoffset > itemLimits[currentSlider][0]){
			//contentHeight = getContentHeight(currentSlider);
			savedTarget.style.top = (e.clientY-dragYoffset) +'px';
			document.getElementById("content_"+currentSlider).style.top = ((e.clientY-dragYoffset)*itemLimits[currentSlider][2])*(-1)+"px";
			//alert(parseInt(document.getElementById(savedTarget.id).style.top.substring(0, document.getElementById(savedTarget.id).style.top.indexOf('px'))));
			//document.getElementById(savedTarget.id).style.top = e.clientY-dragYoffset-itemLimits[currentSlider][2] + "px";
		}
		return false;
	}
}
function cleanup(e) {
	document.onmousemove = null;
	document.onmouseup = null;
	savedTarget.style.cursor = orgCursor;
	dragOK = false;
}
function dragHandler(e){
	var htype='-moz-grabbing';
	if (e == null) { e = window.event; htype='move';}
	var target = e.target != null ? e.target : e.srcElement;
	orgCursor=target.style.cursor; 
	//alert(target.id);
	if (target.id.substring(0, 3)=="fi_") {
		savedTarget = target;
		target.style.cursor = htype;
		dragOK = true;
		//alert(savedTarget.id);
		//dragXoffset=e.clientX-parseInt(savedTarget.style.left);
		//alert(savedTarget.style.top.substring(0, savedTarget.style.top.indexOf('p')));
		dragYoffset = e.clientY - parseInt(savedTarget.style.top.substring(0, savedTarget.style.top.indexOf('p')));
		document.onmousemove = moveHandler;
		document.onmouseup = cleanup;
		return false;
	}
}

function doCalendarDateCheck()
{
  if (document.forms[0].depDateMonth == null || document.forms[0].retDateMonth == null)
  {
    return true;
  }

  var depDate = null;
  var retDate = null;

  var depDateLen = document.forms[0].depDateMonth.length;

  if (!depDateLen)
  {
    depDate = document.forms[0].depDateMonth.value;
  }
  else
  {
    for (var x = 0; x < depDateLen; x++)
    {
      if (document.forms[0].depDateMonth[x].checked)
      {
        depDate = document.forms[0].depDateMonth[x].value;
        break;
      }
    }
  }

  var retDateLen = document.forms[0].retDateMonth.length;

  if (!retDateLen)
  {
    retDate = document.forms[0].retDateMonth.value;
  }
  else
  {
    for (var x = 0; x < retDateLen; x++)
    {
      if (document.forms[0].retDateMonth[x].checked)
      {
        retDate = document.forms[0].retDateMonth[x].value;
        break;
      }
    }
  }

  depDate = depDate.substring(2,5) + "," + depDate.substring(0,2) + ", 00:00:01";
  retDate = retDate.substring(2,5) + "," + retDate.substring(0,2) + ", 00:00:01";

  if (Date.parse(depDate) > Date.parse(retDate))
  {
    alert("Date/time is before date/time of previous leg");
    return false;
  }

  return true;
}


// add functions to auto update the date selections to prevent a user
// from attempting to book flights out of sequence

// initialize the date
var now = new Date();
var depmonthnumber = now.getMonth();
var retmonthnumber = now.getMonth();
var monthday    = now.getDate();
var year        = now.getYear();

var defaultDepart = '2';
		
var defaultReturn = '2';
	

//vars for the configurable date advance set in SAT
//var defaultDepart;
//var defaultReturn;

// is this a leap year
function leapYear(theYear) { 
	if ( ((theYear % 4 == 0) && (theYear % 100 != 0)) || (theYear % 400 == 0) ) { 
		return true; 
	} else { 
		return false;
	} 
} 

function updateReturnDate(formName) {
	// create new date objects just in case
	var d = new Date(); 
	var dYear = d.getFullYear(); 
	var dMonth = formName.depMonth.selectedIndex; 
	var dDay = formName.depDay.selectedIndex; 
	var today = new Date(); 
	// set the return day and month currently selected to variables
	var rDy = formName.retDay.selectedIndex; 
	var rMon =formName.retMonth.selectedIndex;
	// get the year
	var rYr = d.getFullYear(); 
	// for next year if the return month is numerically less than the 
	//current month then add 1 year
	if (formName.retMonth.selectedIndex < d.getMonth())
	{ 
		rYr = rYr+1; 
	} 
	// for next year same as above only for departure
	if (formName.depMonth.selectedIndex < d.getMonth())
	{ 
		dYear = dYear+1; 
	} 
	rDate = new Date(rYr, rMon, rDy); 
	dDate = new Date(dYear, dMonth, dDay+defaultDepart);
	var rYear = dYear; 
	var rMonth = '0'; 
	var rDay = '0'; 
	// 30 Days: April-3 June-5 September-8 November-10 
	// 31 Days: January-0, March-2, May-4, July-6, August-7, October-9, December-11 
	// 28 Days: February-1 
	// For Months with 31 days 
	if ( (dMonth == '0' || dMonth == '2' || dMonth == '4' || dMonth == '6' || dMonth == '7' || dMonth == '9' || dMonth == '11' )){ 
		if (dDay == '29') { 
			rDay = '0'; 
	// If December, set month back to '0' for January 
		if (dMonth == '11') { 
			rMonth = '0'; 
		} else { 
			rMonth = dMonth + 1; 
		} 
	} else if (dDay == '30') { 
	rDay = '1'; 
	// If December, set month back to '0' for January 
		if (dMonth == '11') { 
			rMonth = '0'; 
		} else { 
			rMonth = dMonth + 1; 
		} 
	} else { 
		rDay = dDay + 2; 
		rMonth = dMonth; 
	} 			
			// For Months with 30 days 
			} else if ((dMonth == '3' || dMonth == '5' || dMonth == '8' || dMonth == '10' )) { 
			/* test for invalid dates */ 
				if (dDay == '30') { 
					dDay = '30'; eval (formName.depDay.selectedIndex = dDay); 
				} 
				if (dDay == '28' || dDay == '29') { 
					rDay = '0'; 
					rMonth = dMonth + 1; 
				} else if (dDay == '30') { 
					rDay = '1'; 
					rMonth = dMonth + 1; 
				} else { 
					rDay = dDay + 2; 
					rMonth = dMonth; 
				} 
				// For February, check for leapyear. 
			} else if (dMonth == '1') { 
				if (dMonth > rMonth) { rYear += 1; } 
			// Check to see if Feb 29, 30, or 31 is selected for NON-leapyear. 
			// If so, set departure date to Feb 28. 
				if ((!leapYear(rYear) && dDay == '28') || dDay == '29' || dDay == '30') { 
					dDay = dDay; eval (formName.depDay.selectedIndex = dDay); 
				} 
				if ((leapYear(rYear) && dDay == '27') || (!leapYear(rYear) && dDay == '26') || dDay ==29 ) { 
					rDay = '0'; rMonth = dMonth + 1; 
				} else if ((leapYear(rYear) && dDay == '28') || (!leapYear(rYear) && dDay == '27') || dDay == '30' || (!leapYear(rYear) && dDay == '28')) { 
				rDay = '1'; 
				rMonth = dMonth + 1; 
				} else { 
					rDay = dDay + 2; 
					rMonth = dMonth; 
				} 
			} 
		//check to see if on different page 
		if(formName.dateChanged != null && formName.dateChanged.value == 'true') return; 
		if(formName.retDay.changed == null && formName.changed == null){ 
			eval (formName.retDay.selectedIndex = rDay); 
		} 
		if( formName.retMonth.changed == null && formName.changed == null){ 
			eval (formName.retMonth.selectedIndex = rMonth); 
		} 
		return; 
} 

function validateDate(theForm) { 
	var d = new Date(); 
	var dYear = d.getFullYear(); 
	var formName = eval('document.' + theForm); 
	var dMonth = formName.depMonth.selectedIndex; 
	var dDay = formName.depDay.selectedIndex; 
	// For Months with 31 days 
	if ( (dMonth == '0' || dMonth == '2' || dMonth == '4' || dMonth == '6' || dMonth == '7' || dMonth == '9' || dMonth == '11' )){ if (dDay == '30' || dDay == '31') { dDay = '29'; 
	//eval (formName.departureDay.selectedIndex = dDay); 
	} 
	// For Months with 30 days 
	} else if ((dMonth == '3' || dMonth == '5' || dMonth == '8' || dMonth == '10' )) { if (dDay == '30' || dDay == '31') { dDay = '29'; eval (formName.depDay.selectedIndex = dDay); } 
	// For February, check for leapyear. 
	} else if (dMonth == '1') { 
		if ((!leapYear(dYear) && dDay == '28') || dDay == '29' || dDay == '30') { 
			dDay = '27'; 
			eval (formName.depDay.selectedIndex = dDay); 
		} 
	} 
} 
	
function validateReturn(theForm) { 
	var d = new Date(); 
	var dYear = d.getFullYear(); 
	var formName = eval('document.' + theForm); 
	var dMonth = formName.retMonth.selectedIndex; 
	var dDay = formName.retDay.selectedIndex; 
	// For Months with 31 days 
	if ( (dMonth == '0' || dMonth == '2' || dMonth == '4' || dMonth == '6' || dMonth == '7' || dMonth == '9' || dMonth == '11' )){ 
		if (dDay == '30' || dDay == '31') { 
			dDay = '29'; 
			//eval (formName.returnDay.selectedIndex = dDay); 
		} 
	// For Months with 30 days 
	} else if ((dMonth == '3' || dMonth == '5' || dMonth == '8' || dMonth == '10' )) {
		if (dDay == '30' || dDay == '31') { 
			dDay = '29'; 
			eval (formName.retDay.selectedIndex = dDay); 
		} 
		// For February, check for leapyear. 
	} else if (dMonth == '1') { 
		if ((!leapYear(dYear) && dDay == '28') || dDay == '29' || dDay == '30') { 
			dDay = '27'; 
			eval (formName.retDay.selectedIndex = dDay); 
		} 
	} 
} 

function updateChangedDate(selectObject){ 
	selectObject.changed = true; 
	if(selectObject.form.dateChanged) selectObject.form.dateChanged.value = true; 
} 

// end the date advance code


function makeArray(n) {
this.length = n;
return this;
}
function whoCheckedIt() {
	if (!document.airAvailSemiForm.out.length) {
		document.airAvailSemiForm.itin_selected.value = document.airAvailSemiForm.out.value;
	}
	else {
		for (var i = 0; i <document.airAvailSemiForm.out.length; i++) {
			if (document.airAvailSemiForm.out[i].checked) {
				document.airAvailSemiForm.itin_selected.value = i;
			}
		}
	}
	document.airAvailSemiForm.submit();    
}

//
// global declarations and initialization
//
function init () {
	theDate         = new Date();
	today           = new Date();
	currMonth       = today.getMonth();
	msPerDay        = 24*60*60*1000;
	cookieString    = "dispMonth="+currMonth+";";
	document.cookie = cookieString;
	startOfString   = document.cookie.indexOf("dispMonth");
	countbegin      = document.cookie.indexOf("=",startOfString) + 1;
	countend        = document.cookie.indexOf(";",countbegin);
	if (countend == -1) {
		countend = document.cookie.length;
	}
	dispMonth     = eval("document.cookie.substring(countbegin,countend)");
	firstOfMonth  = new Date(today.getYear(),dispMonth,1);
	monthName = new Array("","January","February","March","April","May","June","July","August","September","October","November","December");
}
//
// entry point
//

function openCalendar (monthFldName, dateFldname, monthFldName1, dateFldname1, formNumber) {
	init();
	formNum  = formNumber;
	//NQF: begin 
	//added to accept LHS variable of this type : arr(x)

	for (var j=0; j<document.forms[formNum].length; j++) {
		if (document.forms[formNum].elements[j].name.toLowerCase() == monthFldName.toLowerCase()) {
			monthFld = "elements["+j+"]";
			dispMonth = document.forms[formNum].elements[j].selectedIndex;
		} 
		if (document.forms[formNum].elements[j].name.toLowerCase() == dateFldname.toLowerCase() ) {
			dateFld = "elements["+j+"]";
		}
		
		if(monthFldName1!=''){
			if ( document.forms[formNum].elements[j].name.toLowerCase() == monthFldName1.toLowerCase()) {
				monthFld1 = "elements["+j+"]";
			}
		} else {
			monthFld1 = '';
		}
		
		if(dateFldname1!=''){
			if ( document.forms[formNum].elements[j].name.toLowerCase() == dateFldname1.toLowerCase() ) {
			dateFld1 ="elements["+j+"]";
			} 
		} else {
			dateFld1 ='';
		}
	}
	//NQF: end
	windowOptions  = "toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,copyhistory=yes,width=275,height=290";
	calendarWindow = this.open("","calendarWindow",windowOptions);
	calendarWindow.callingForm = this;
	redraw(-1);
}

//
// repaint the calendar
//
function redraw(increment) {
	calendarWindow.callingForm = this;
	//Y2K Browser compatibility issues. getYear() function works for IE.. but had to be
	//altered to appear correctly for Netscape. 
	if (navigator.appName =='Netscape' ) {
	newYear = today.getYear();
	newYear = 1900 + newYear;
	}
	else {  newYear = today.getYear();
	}
	var tmpDate = new Date();
	tmpDate.setMonth(dispMonth);
	if ( tmpDate.getTime() < today.getTime() )
	newYear++;
	firstOfMonth = new Date(newYear,dispMonth,1);
	//End Y2K Browser fix. 
	calendarWindow.document.open();
	calTitle = "<TITLE>Tarih Seciniz<\/TITLE>";
	
	
	calendarWindow.document.write(calTitle);
	drawCalendar(firstOfMonth);
	calendarWindow.document.write(htmlBuffer);
	calendarWindow.document.close();
	calendarWindow.callingForm = this;
	//calendarWindow.focus();
	/*if (increment == 1) {
		calendarWindow.document.forms[0].monthUp.focus();
	}else {
		calendarWindow.document.forms[0].monthDn.focus();
	}*/
}
//
// fill the calling forms date and month
//
function fillDate(filler) {
	var m = monthNum-1;
	var d = filler-1;
	
	eval("document.forms[" + formNum + "]." + monthFld + ".selectedIndex=" + m);
	eval("document.forms[" + formNum + "]." + dateFld  + ".selectedIndex=" + d);
	
	if(monthFld1!=''){
		eval("document.forms[" + formNum + "]." + monthFld1 + ".selectedIndex=" + m);
	}
	if(dateFld1!=''){
		eval("document.forms[" + formNum + "]." + dateFld1  + ".selectedIndex=" + d);
	}
	calendarWindow.close();
}
//
// set the month
//
function changeMonth (increment) {
nextMonth = dispMonth;
if (increment == 1) {
nextMonth++;
} else {
nextMonth--;
}
if (nextMonth == 12)
   nextMonth = 0;
if (nextMonth == -1)
   nextMonth = 11;
dispMonth = nextMonth;
document.cookie="dispMonth="+nextMonth;
redraw(increment);

}
//
// generate the calendar document
//
function drawCalendar (theDate) {
	monthNum = theDate.getMonth() + 1;
	htmlBuffer  = "<HTML><head><title>Calendar</title><link type='text/css' href='calendar.css' rel='stylesheet'></head><BODY BGCOLOR=#ffffff><FORM>";
	
	htmlBuffer += "<CENTER><TABLE border='1' cellpadding='0' cellspacing='1' bordercolor='#9FCAC0'#6699cc><TH COLSPAN=1 class='fontPopupCalendarBackground'><INPUT class='input_button' TYPE=BUTTON NAME=monthDn id=monthDn VALUE=\"<<\" onClick=callingForm.changeMonth(-1)>";
	htmlBuffer += "<TH COLSPAN=5 class='font_title_dark' width='150'>"+monthName[monthNum];
	// getYear returns the year in year - 1900
	// this causes ugly display
	var tempYear = theDate.getYear()
	if ( tempYear <= 1900 ) {
	tempYear += 1900;
	}
	htmlBuffer += " " + tempYear;
	htmlBuffer += "</FONT><td COLSPAN=1 align='center' class='fontPopupCalendarBackground'><INPUT class='input_button' TYPE=BUTTON NAME=monthUp VALUE=\">>\" onClick=callingForm.changeMonth(1)></td><TR>";
	htmlBuffer += "<TH class='font_title_light_bold'><FONT COLOR=#000000>S</FONT><TH  class='font_title_light_bold'><FONT COLOR=#000000>M</FONT><TH  class='font_title_light_bold'><FONT COLOR=#000000>T</FONT><TH  class='font_title_light_bold'><FONT COLOR=#000000>W</FONT><TH  class='font_title_light_bold'><FONT COLOR=#000000>T</FONT><TH  class='font_title_light_bold'><FONT COLOR=#000000>F</FONT><TH  class='font_title_light_bold'><FONT COLOR=#000000>S</FONT><TR>";
	drawBody(theDate);
	htmlBuffer += "<\/TABLE><\/BODY><\/HTML>";
}
//
// generate the calendar body
//
function drawBody (theDate) {
//a fix for DST problem
theDate.setHours(11);
theDate.setMinutes(30);
thisMonth = theDate.getMonth();
thisDate  = theDate.getDate();
firstSunday(theDate);
for (w=0; w<6; w++) {
for (d=0; d<7; d++) {
date = theDate.getDate();
htmlBuffer   += "<TD ALIGN=CENTER class='font_default_center'>";
// skip previous month
if (theDate.getMonth() != thisMonth) {
htmlBuffer += "<BR>";
} else {
htmlBuffer += "<INPUT class='input_cal' TYPE=BUTTON NAME="+date+" VALUE=";
if ( date < 10 ) {
htmlBuffer += "0";
}
htmlBuffer += date+" onClick=callingForm.fillDate(" + date + ")>";
}
// increment the date
newTime = theDate.getTime() + msPerDay;
theDate.setTime(newTime);

}
htmlBuffer += "<TR>";
}
htmlBuffer += "<\/FORM>";
}
//
// reset the startdate to get the
// previous sunday before the current date
// so that the drawing can begin from a sunday
//
function firstSunday (fromDate) {
while (fromDate.getDay() != 0) {
newTime = fromDate.getTime() - msPerDay;
fromDate.setTime(newTime);
}
}