//---------------MENUTEXT.JS---------------------
var url='http://www.atikskoda.com/';
//var url='http://murat/atikskoda.com/http/';

function resimgoster(id,yol)
   {
	yeniresim = new Image();
	yeniresim.src = url+'resim.php?rid='+pic[id]+'&yol='+yol+'&boy=250&en=250&default=1';
	document.images['imgslide'].src = yeniresim.src;
	document.getElementById('imglink').href = "javascript:popImage('"+url+"resim.php?rid="+pic[id]+"&yol="+yol+"&boy=800&en=600&default=1','Atik Skoda')";
   }

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}

function BuildMenu()
{
var PositionSpan=document.getElementById('MenuPositionSpan')
var left_pos=findPosX(PositionSpan);
var top_pos=findPosY(PositionSpan);
bwNetscape = (navigator.appName == 'Netscape') ? "True" : "False";
agent = navigator.userAgent;
if (((agent.toLowerCase().indexOf('opera 7')>-1) || (agent.toLowerCase().indexOf('opera/7')>-1))) {bwOpera = "True";} else {bwOpera = "False";}

var TOP_STYLE_ON = "TopOn";
var TOP_STYLE_OVER = "TopOver";
var SUB_STYLE_ON = "SubOn";
var SUB_STYLE_OVER = "SubOver";
var SUB_STYLE_ON_BOTTOM = "SubOnBottom";
var SUB_STYLE_OVER_BOTTOM = "SubOverBottom";
opera_pos = 1;
level_off = 20;
if (bwNetscape == "True") 
	{ 
		opera_pos = 1;
		level_off = 20;
		TOP_STYLE_ON = "TopOn";
		TOP_STYLE_OVER = "NetscapeTopOver";
		SUB_STYLE_ON = "SubOn";
		SUB_STYLE_OVER = "NetscapeSubOver";
		SUB_STYLE_ON_BOTTOM = "SubOnBottom";
		SUB_STYLE_OVER_BOTTOM = "SubOverBottom";
	}
if (bwOpera == "True") 
	{ 
		opera_pos = 4;
		level_off = 22;
		TOP_STYLE_ON = "OperaTopOn";
		TOP_STYLE_OVER = "OperaTopOver";
		SUB_STYLE_ON = "SubOn";
		SUB_STYLE_OVER = "SubOver";
		SUB_STYLE_ON_BOTTOM = "SubOnBottom";
		SUB_STYLE_OVER_BOTTOM = "SubOverBottom";
	}
var skodaTopMenuItems = 
[
	{"itemPosition": [left_pos + opera_pos, top_pos + opera_pos], "itemSize": [12,90], "itemOff": [90,0], "itemStyle": [TOP_STYLE_ON, TOP_STYLE_OVER], "itemUrl": "none"},
	{"itemName": "Atik", "itemSize": [16, 100], "itemOff": [100,0],"itemSubMenu":                 
	[
		{"itemSize": [14, 174], "itemOff": [0,14], "itemLevelOff": [0,level_off], "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER], "itemUrl": "none"},
		{"itemName": "» Genel Müdür Mesajı", "itemUrl": "location.href='"+url+"atik/sirket-perspektifi.php'", "itemDescription": "Genel Müdür Mesajı", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Haberler", "itemUrl": "location.href='"+url+"haberler.php'", "itemDescription": "Hizmetlerimiz", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Hizmetlerimiz", "itemUrl": "location.href='"+url+"atik/hizmetlerimiz.php'", "itemDescription": "Hizmetlerimiz", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Dilek ve Önerileriniz", "itemUrl": "location.href='"+url+"atik/dilek-ve-onerileriniz-form.php'", "itemDescription": "Dilek ve Önerileriniz", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},           		
		{"itemName": "» İnsan Kaynakları", "itemUrl": "location.href='"+url+"atik/insan-kaynaklari.php'", "itemDescription": "İnsan Kaynakları", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},           		
		{"itemName": "» Ulaşım Bilgileri", "itemUrl": "location.href='"+url+"atik/ulasim-bilgileri.php'", "itemDescription": "Ulaşım Bilgileri", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Haklı Müşteri Hattı", "itemUrl": "location.href='"+url+"atik/hakli-musteri.php'", "itemDescription": "Haklı Müşteri Hattı", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» E-Posta", "itemUrl": "location.href='mailto:o.oz@atikskoda.com'", "itemDescription": "E-Posta : o.oz@atikskoda.com", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},           		
		{"itemName": "&nbsp;", "itemStyle": [SUB_STYLE_ON_BOTTOM, SUB_STYLE_OVER_BOTTOM]}
	]},
	{"itemName": "Servis", "itemSize": [16, 85], "itemOff": [85,0],"itemSubMenu":                 
	[	
		{"itemSize": [14, 174], "itemOff": [0,14], "itemLevelOff": [0,level_off], "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER], "itemUrl": "none"},
		{"itemName": "» Servis Araç Sorgulama", "itemUrl": "location.href='"+url+"servis/arac-durum-sorgulama.php'", "itemDescription": "Servis Araç Sorgulama", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Randevu Talep Formu", "itemUrl": "location.href='"+url+"servis/randevu-talep-formu.php'", "itemDescription": "Randevu Talep Formu", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Periyodik Bakım Çizelgesi", "itemUrl": "location.href='"+url+"servis/periyodik-bakim-cizelgesi.php?tur=0'", "itemDescription": "Periyodik Bakım Çizelgesi", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Garanti Kapsamı", "itemUrl": "location.href='"+url+"servis/garanti-kapsami.php'", "itemDescription": "Garanti Kapsamı", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Atik Yol Yardımı", "itemUrl": "location.href='"+url+"servis/atik-yol-yardimi.php'", "itemDescription": "Atik Yol Yardımı", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Anlaşmalı Sigortalar", "itemUrl": "location.href='"+url+"servis/anlasmali-sigortalar.php'", "itemDescription": "Anlaşmalı Sigortalar", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Orijinal Aksesuar & Parçalar", "itemUrl": "location.href='"+url+"skoda/orjinal-aksesuar-ve-parcalar.php'", "itemDescription": "Skoda Orijinal Aksesuar ve Parçaları", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Yedek Parça Sipariş Formu", "itemUrl": "location.href='"+url+"skoda/yedekparca-form.php'", "itemDescription": "Yedek Parça Sipariş Formu", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "&nbsp;", "itemStyle": [SUB_STYLE_ON_BOTTOM, SUB_STYLE_OVER_BOTTOM]}
	]},
	{"itemName": "Skoda Aksesuar", "itemSize": [16, 100], "itemOff": [100,0],"itemSubMenu":                 
	[	
		{"itemSize": [14, 158], "itemOff": [0,14], "itemLevelOff": [0,level_off], "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER], "itemUrl": "none"},
		{"itemName": "» Fabia Aksesur", "itemUrl": "location.href='"+url+"online-fabia/'", "itemDescription": "online-fabia", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Octovia Aksesuar", "itemUrl": "location.href='"+url+"online-octovia'", "itemDescription": "online-octovia", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Roomster Aksesuar", "itemUrl": "location.href='"+url+"online-roomster'", "itemDescription": "online-roomster", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
			{"itemName": "» Superb Aksesuar", "itemUrl": "location.href='"+url+"online-superb'", "itemDescription": "online-superb", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Yeti Aksesuar", "itemUrl": "location.href='"+url+"online-yeti'", "itemDescription": "online-yeti", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]} 	]},
	{"itemName": "Sigorta", "itemSize": [16, 85], "itemOff": [85,0],"itemSubMenu":                 
	[	
		{"itemSize": [14, 174], "itemOff": [0,14], "itemLevelOff": [0,level_off], "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER], "itemUrl": "none"},
		{"itemName": "» Araç Satış Sorgulama", "itemUrl": "location.href='"+url+"sigorta/araba-satis-sorgulama.php'", "itemDescription": "Araç Satış Sorgulama", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},		
		{"itemName": "» Sigorta Teklif", "itemUrl": "location.href='"+url+"sigorta/sigorta-teklif.php'", "itemDescription": "Sigorta Teklif", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Oto", "itemUrl": "location.href='"+url+"sigorta/oto-sigorta.php'", "itemDescription": "Oto", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Kaza", "itemUrl": "location.href='"+url+"sigorta/kaza-sigortasi.php'", "itemDescription": "Kaza", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},           		
		{"itemName": "» Yangın", "itemUrl": "location.href='"+url+"sigorta/yangin-sigortasi.php'", "itemDescription": "Yangın", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Nakliyat", "itemUrl": "location.href='"+url+"sigorta/nakliyat-sigortasi.php'", "itemDescription": "Nakliyat", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},           		           		
		{"itemName": "» Mühendislik", "itemUrl": "location.href='"+url+"sigorta/muhendislik-sigortasi.php'", "itemDescription": "Mühendislik", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Araç Kaza Tespit Tutanağı", "itemUrl": "location.href='"+url+"sigorta/kaza_tutanagi.xls'", "itemDescription": "Araç Kaza Tespit Tutanağı", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "&nbsp;", "itemStyle": [SUB_STYLE_ON_BOTTOM, SUB_STYLE_OVER_BOTTOM]}
	]},

	{"itemName": "Showroom", "itemSize": [16, 83], "itemOff": [83,0],"itemSubMenu":                 
	[	
		{"itemSize": [14, 171], "itemOff": [0,14], "itemLevelOff": [0,level_off], "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER], "itemUrl": "none"},
		{"itemName": "» Yeni Superb", "itemUrl": "location.href='"+url+"skoda/yeni-superb/yeni-superb.php'", "itemDescription": "Superb", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Yeti", "itemUrl": "location.href='"+url+"skoda/skoda-yeti/skoda-yeti.php'", "itemDescription": "Yeti", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Yeni Octavia", "itemUrl": "location.href='"+url+"skoda/yeni-octavia/yeni-octavia.php'", "itemDescription": "Yeni Octavia", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Yeni Fabia", "itemUrl": "location.href='"+url+"skoda/yeni-fabia/yeni-fabia.php'", "itemDescription": "Yeni Fabia", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
				{"itemName": "» Yeni Fabia Combi", "itemUrl": "location.href='"+url+"skoda/yeni-fabia-combi/yeni-fabia-combi.php'", "itemDescription": "Yeni Fabia Combi", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Roomster", "itemUrl": "location.href='"+url+"skoda/skoda-roomster/skoda-roomster.php'", "itemDescription": "Skoda Roomster", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Test Sürüşü Talebi", "itemUrl": "location.href='"+url+"skoda/test-surusu-talebi-form.php'", "itemDescription": "Test Sürüşü Talebi", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},           		
		{"itemName": "» 0 Km Sipariş", "itemUrl": "location.href='"+url+"skoda/sifir-siparis-form.php'", "itemDescription": "0 km Sipariş", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "&nbsp;", "itemStyle": [SUB_STYLE_ON_BOTTOM, SUB_STYLE_OVER_BOTTOM]}
	]},
	{"itemName": "Fiyatlar", "itemSize": [16, 65], "itemOff": [65,0],"itemSubMenu":                 
	[	
		{"itemSize": [14, 171], "itemOff": [0,14], "itemLevelOff": [0,level_off], "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER], "itemUrl": "none"},
		{"itemName": "» Superb", "itemUrl": "location.href='"+url+"fiyatlar/fiyatlar.php?id=4'", "itemDescription": "Superb", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Fabia", "itemUrl": "location.href='"+url+"fiyatlar/fiyatlar.php?id=1'", "itemDescription": "Fabia", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Yeni Fabia", "itemUrl": "location.href='"+url+"fiyatlar/fiyatlar.php?id=6'", "itemDescription": "Fabia", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Octavia A4", "itemUrl": "location.href='"+url+"fiyatlar/fiyatlar.php?id=2'", "itemDescription": "Octavia A4", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Octavia A5", "itemUrl": "location.href='"+url+"fiyatlar/fiyatlar.php?id=3'", "itemDescription": "Octavia A5", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Roomster", "itemUrl": "location.href='"+url+"fiyatlar/fiyatlar.php?id=5'", "itemDescription": "Roomster", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Yeti", "itemUrl": "location.href='"+url+"fiyatlar/fiyatlar.php?id=8'", "itemDescription": "Yeti", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Broşür İsteyin", "itemUrl": "location.href='"+url+"fiyatlar/brosur-talep-formu.php'", "itemDescription": "Broşür İsteyin", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "&nbsp;", "itemStyle": [SUB_STYLE_ON_BOTTOM, SUB_STYLE_OVER_BOTTOM]}
	]},
	{"itemName": "2. El", "itemSize": [16, 65], "itemOff": [65,0],"itemSubMenu":                 
	[	
		{"itemSize": [14, 171], "itemOff": [0,14], "itemLevelOff": [0,level_off], "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER], "itemUrl": "none"},
		{"itemName": "» 2. El Araç Listesi", "itemUrl": "location.href='"+url+"ikinciel/2-el-arac-liste.php?srl=01'", "itemDescription": "2. El Araç Listesi", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Araç Almak  İstiyorum", "itemUrl": "location.href='"+url+"ikinciel/2-el-arac-siparis-form.php'", "itemDescription": "2. El Araç Sipariş", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Araç Satmak İstiyorum", "itemUrl": "location.href='"+url+"ikinciel/arac-satmak-istiyorum-form.php'", "itemDescription": "Araç Satmak İstiyorum", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "&nbsp;", "itemStyle": [SUB_STYLE_ON_BOTTOM, SUB_STYLE_OVER_BOTTOM]}
	]},
	{"itemName": "Oto Kredi", "itemSize": [16, 65], "itemOff": [65,0],"itemSubMenu":                 
	[	
		{"itemSize": [14, 171], "itemOff": [0,14], "itemLevelOff": [0,level_off], "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER], "itemUrl": "none"},
		{"itemName": "» Kampanyalar ve Faiz Oranları", "itemUrl": "location.href='"+url+"otokredi/kampanyalar-ve-baz-faiz-oranlari.php?id=1'", "itemDescription": "Kampanyalar ve baz faiz oranları", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Gerekli Evraklar", "itemUrl": "location.href='"+url+"otokredi/gerekli-evraklar.php'", "itemDescription": "Gerekli Evraklar", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "» Kredi Hakkında Sormak İstediginiz Herşey", "itemUrl": "location.href='"+url+"otokredi/kredi-soru.php'", "itemDescription": "Kredi Hakkında Sormak İstediginiz Herşey", "itemStyle": [SUB_STYLE_ON, SUB_STYLE_OVER]},
		{"itemName": "&nbsp;", "itemStyle": [SUB_STYLE_ON_BOTTOM, SUB_STYLE_OVER_BOTTOM]}
	]}
];
SkodaMenu(skodaTopMenuItems);
menuBuilded=true;
}

var menuBuilded=false

function onResizeRebuildMenu()
{
	if (!menuBuilded)
		return;
	try
	{
		if (document.getElementById('MainMenuSpan') != null)
			{document.body.removeChild(document.getElementById('MainMenuSpan'));}
	}catch(e){}
	BuildMenu();
}
///////////////////////////////////////////////////////////////////////////////////
//-----------------------------------MENU.JS-----------------------------------
defaultItemLevelOnePosition	= [];
defaultItemLevelOneSize = [];
defaultItemLevelOneItemOff = [];
defaultItemLevelOneStyle = [];
defaultItemLevelOneUrl = [];
defaultItemLevelSecondSize = [];
defaultItemLevelSecondItemOff = [];
defaultItemLevelSecondLevelOff = [];
defaultItemLevelSecondStyle = [];
defaultItemLevelSecondUrl = [];

//Main function
function SkodaMenu(menuItems)
{
	//default values for first item level
	defaultItemLevelOnePosition = menuItems[0].itemPosition;
	defaultItemLevelOneSize = menuItems[0].itemSize;
	defaultItemLevelOneItemOff = menuItems[0].itemOff;
	defaultItemLevelOneStyle = menuItems[0].itemStyle;
	defaultItemLevelOneUrl = menuItems[0].itemUrl;

	//defining actual position for first level
	actualPosition = [];
	actualPosition[0] = defaultItemLevelOnePosition[0];
	actualPosition[1] = defaultItemLevelOnePosition[1];
	
	//creating element for printing tags
	element = document.createElement("Span");
	element.id = "MainMenuSpan";

	//loop for menuItems.length items
	// : create new menuItem
	stringHtmlTags = "";
	i = 1;
	for (i; i < menuItems.length; i++)
	{
		//setting position for current item
		currentItemPosition = (menuItems[i].itemPosition == null) ? actualPosition : menuItems[i].itemPosition;
		//setting other values for current item
		currentItemName = (menuItems[i].itemName == null) ? "undefined" : menuItems[i].itemName;
		currentItemSize = [];
		currentItemSize[0] = (menuItems[i].itemSize == null) ? defaultItemLevelOneSize[0] : menuItems[i].itemSize[0];
		currentItemSize[1] = (menuItems[i].itemSize == null) ? defaultItemLevelOneSize[1] : menuItems[i].itemSize[1];
		currentItemStyle = (menuItems[i].itemStyle == null) ? defaultItemLevelOneStyle : menuItems[i].itemStyle;
		currentItemUrl = (menuItems[i].itemUrl == null) ? defaultItemLevelOneUrl : menuItems[i].itemUrl;
		currentItemDescription = (menuItems[i].itemDescription == null) ? "" : menuItems[i].itemDescription;
		currentItemOff = [];
		currentItemOff[0] = (menuItems[i].itemOff == null) ? defaultItemLevelOneItemOff[0] : menuItems[i].itemOff[0];
		currentItemOff[1] = (menuItems[i].itemOff == null) ? defaultItemLevelOneItemOff[1] : menuItems[i].itemOff[1];
		currentItemSubMenu = (menuItems[i].itemSubMenu == null) ? [] : menuItems[i].itemSubMenu;
		
		//string with html tags
		stringHtmlTags += SkodaMenuItem(i, currentItemName, currentItemPosition, currentItemSize, currentItemStyle, currentItemUrl, currentItemDescription, currentItemSubMenu);

		//setting actual position as enter for next item
		actualPosition[0] += currentItemOff[0];
		actualPosition[1] += currentItemOff[1];
	}

	//writing html tags into element and writing to document
	element.innerHTML = stringHtmlTags;
	//joining element with body element
	document.body.appendChild(element);
}

//Definition for one first level item
function SkodaMenuItem(itemLevelOneId, itemName, itemPosition, itemSize, itemStyle, itemUrl, itemDescription, itemSubMenu)
{
	//number of members menu second level
	subMenuItemLength = itemSubMenu.length;
	//event onclick ( go on url or nothing)
//	actiononclick = (itemUrl == "none") ? '' : ' onclick="location.href=\'' + itemUrl + '\';"';
        actiononclick = (itemUrl == "none") ? '' : ' onclick="' + itemUrl + ';"';
	//text in status bar
	actionStatusBar = (itemDescription == "") ? '' : ' self.status = \'' + itemDescription + '\';';
	//creating output string
	outputStringHtmlTags = "";
	outputStringHtmlTags += '<table height="' + itemSize[0] + '" width="' + itemSize[1] + '" cellspacing="0" cellpadding="0" border="0" style="position: absolute; z-index: 100; left: ' + itemPosition[0] + 'px; top: ' + itemPosition[1] + 'px">';
	outputStringHtmlTags += '<tr><td id="levelOne_' + itemLevelOneId + '" width="100%" height="100%" class="' + itemStyle[0] + '" onmouseover="ShowHideSubMenu(\'visible\',' +  itemLevelOneId + '); this.className=\'' + itemStyle[1] + '\'; ' + actionStatusBar + '" onmouseout="this.className=\'' + itemStyle[0] + '\'; ShowHideSubMenu(\'hidden\',' +  itemLevelOneId + ');"' + actiononclick + '>' + itemName + '</td></tr></table>';
	outputStringHtmlTags += SkodaSubMenuItem(itemLevelOneId, itemPosition, itemStyle, itemSubMenu);
	return outputStringHtmlTags;
}

//Definition for second level items
function SkodaSubMenuItem(itemLevelOneId, itemLevelOnePosition, itemLevelOneStyle, subMenuItems)
{
	//default values for second item level
	defaultItemLevelSecondSize[0] = subMenuItems[0].itemSize[0];
	defaultItemLevelSecondSize[1] = subMenuItems[0].itemSize[1];
	defaultItemLevelSecondItemOff[0] = subMenuItems[0].itemOff[0];
	defaultItemLevelSecondItemOff[1] = subMenuItems[0].itemOff[1];
	defaultItemLevelSecondLevelOff[0] = subMenuItems[0].itemLevelOff[0];
	defaultItemLevelSecondLevelOff[1] = subMenuItems[0].itemLevelOff[1];
	defaultItemLevelSecondStyle = subMenuItems[0].itemStyle;
	defaultItemLevelSecondUrl = subMenuItems[0].itemUrl;
	//enter position for sub menu
	itemSubMenuActualPosition = [];
	itemSubMenuActualPosition[0] = itemLevelOnePosition[0];
	itemSubMenuActualPosition[1] = itemLevelOnePosition[1];
	//setting position for table
	itemSubMenuPosition = [];
	itemSubMenuPosition[0] = itemSubMenuActualPosition[0] + defaultItemLevelSecondLevelOff[0];
	itemSubMenuPosition[1] = itemSubMenuActualPosition[1] + defaultItemLevelSecondLevelOff[1];
	//creating table
	stringSubMenuHtmlTags = "";
	stringSubMenuHtmlTags += '<table id="levelSecond_' + itemLevelOneId + '" height="' + defaultItemLevelSecondSize[0] + '" width="' + defaultItemLevelSecondSize[1] + '" cellspacing="0" cellpadding="0" border="0" style="visibility: hidden; position: absolute; z-index: 100; left: ' + itemSubMenuPosition[0] + 'px; top: ' + itemSubMenuPosition[1] + 'px">';

	//creating string with html tags
	j = 1;
	for (j; j < subMenuItems.length; j++)
	{
		//setting other values for current item
		itemSubMenuName = (subMenuItems[j].itemName == null) ? "undefined" : subMenuItems[j].itemName;
		itemSubMenuStyle = (subMenuItems[j].itemStyle == null) ? defaultItemLevelSecondStyle : subMenuItems[j].itemStyle;
		itemSubMenuUrl = (subMenuItems[j].itemUrl == null) ? defaultItemLevelSecondUrl : subMenuItems[j].itemUrl;
		itemSubMenuDescription = (subMenuItems[j].itemDescription == null) ? "" : subMenuItems[j].itemDescription;
		
		//event onclick ( go on url or nothing)
		//actionSubMenuonclick = (itemSubMenuUrl == "none") ? '' : ' onclick="location.href=\'' + itemSubMenuUrl + '\';"';
                  actionSubMenuonclick = (itemSubMenuUrl == "none") ? '' : ' onclick="' + itemSubMenuUrl + ';"';
		//text in status bar
		actionSubMenuStatusBar = (itemSubMenuDescription == "") ? '' : ' self.status = \'' + itemSubMenuDescription + '\';';

		//string with html tags
		stringSubMenuHtmlTags += '<tr><td width="100%" height="' + defaultItemLevelSecondItemOff[1] + '" class="' + itemSubMenuStyle[0] + '" onmouseover="this.className=\'' + itemSubMenuStyle[1] + '\'; ShowHideSubMenu(\'visible\',' +  itemLevelOneId + '); document.getElementById(\'levelOne_' + itemLevelOneId + '\').className = \'' + itemLevelOneStyle[1] + '\';' + actionSubMenuStatusBar + '" onmouseout="this.className=\'' + itemSubMenuStyle[0] + '\'; ShowHideSubMenu(\'hidden\',' +  itemLevelOneId + '); document.getElementById(\'levelOne_' + itemLevelOneId + '\').className = \'' + itemLevelOneStyle[0] + '\';"' + actionSubMenuonclick + '>' + itemSubMenuName + '</td></tr>';
	}
	
	stringSubMenuHtmlTags += '</table>';
	return stringSubMenuHtmlTags;
}

//function for show and hide submenu items
function ShowHideSubMenu(action, itemLevelOneId)
{
	if (document.getElementById('levelSecond_' + itemLevelOneId) != null)
		{document.getElementById('levelSecond_' + itemLevelOneId).style.visibility = action;}
}

////////////////////////////////////////////////////////////////////////////////////////////////

//-------------------------------------script.JS----------------------------------------------

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

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 YY_checkform() { //v4.66
//copyright (c)1998,2002 Yaromat.com
  var args = YY_checkform.arguments; var myDot=true; var myV=''; var myErr='';var addErr=false;var myReq;
  for (var i=1; i<args.length;i=i+4){
    if (args[i+1].charAt(0)=='#'){myReq=true; args[i+1]=args[i+1].substring(1);}else{myReq=false}
    var myObj = MM_findObj(args[i].replace(/\[\d+\]/ig,""));
    myV=myObj.value;
    if (myObj.type=='text'||myObj.type=='password'||myObj.type=='hidden'){
      if (myReq&&myObj.value.length==0){addErr=true}
      if ((myV.length>0)&&(args[i+2]==1)){ //fromto
        var myMa=args[i+1].split('_');if(isNaN(myV)||myV<myMa[0]/1||myV > myMa[1]/1){addErr=true}
      } else if ((myV.length>0)&&(args[i+2]==2)){
          var rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-z]{2,4}$");if(!rx.test(myV))addErr=true;
      } else if ((myV.length>0)&&(args[i+2]==3)){ // date
        var myMa=args[i+1].split("#"); var myAt=myV.match(myMa[0]);
        if(myAt){
          var myD=(myAt[myMa[1]])?myAt[myMa[1]]:1; var myM=myAt[myMa[2]]-1; var myY=myAt[myMa[3]];
          var myDate=new Date(myY,myM,myD);
          if(myDate.getFullYear()!=myY||myDate.getDate()!=myD||myDate.getMonth()!=myM){addErr=true};
        }else{addErr=true}
      } else if ((myV.length>0)&&(args[i+2]==4)){ // time
        var myMa=args[i+1].split("#"); var myAt=myV.match(myMa[0]);if(!myAt){addErr=true}
      } else if (myV.length>0&&args[i+2]==5){ // check this 2
            var myObj1 = MM_findObj(args[i+1].replace(/\[\d+\]/ig,""));
            if(myObj1.length)myObj1=myObj1[args[i+1].replace(/(.*\[)|(\].*)/ig,"")];
            if(!myObj1.checked){addErr=true}
      } else if (myV.length>0&&args[i+2]==6){ // the same
            var myObj1 = MM_findObj(args[i+1]);
            if(myV!=myObj1.value){addErr=true}
      }
    } else
    if (!myObj.type&&myObj.length>0&&myObj[0].type=='radio'){
          var myTest = args[i].match(/(.*)\[(\d+)\].*/i);
          var myObj1=(myObj.length>1)?myObj[myTest[2]]:myObj;
      if (args[i+2]==1&&myObj1&&myObj1.checked&&MM_findObj(args[i+1]).value.length/1==0){addErr=true}
      if (args[i+2]==2){
        var myDot=false;
        for(var j=0;j<myObj.length;j++){myDot=myDot||myObj[j].checked}
        if(!myDot){myErr+='* ' +args[i+3]+'\n'}
      }
    } else if (myObj.type=='checkbox'){
      if(args[i+2]==1&&myObj.checked==false){addErr=true}
      if(args[i+2]==2&&myObj.checked&&MM_findObj(args[i+1]).value.length/1==0){addErr=true}
    } else if (myObj.type=='select-one'||myObj.type=='select-multiple'){
      if(args[i+2]==1&&myObj.selectedIndex/1==0){addErr=true}
    }else if (myObj.type=='textarea'){
      if(myV.length<args[i+1]){addErr=true}
    }
    if (addErr){myErr+='› '+args[i+3]+'\n'; addErr=false}
  }
  if (myErr!=''){alert('Lütfen aşağıdaki uyarıları kontrol ederek tekrar deneyiniz.\t\n\n'+myErr)}
  document.MM_returnValue = (myErr=='');
}

//----------------------------script2.JS------------------------------------------

// BASLANGIÇ VE BITIS TARIHI(YILI) KONTROLÜ
function yilkntrl(frmobj,sec) 
	{
		if (frmobj["myil"+sec].options[frmobj["myil"+sec].selectedIndex].text.indexOf("1930")>=0)   
		{
			frmobj["myil"+(3-sec)].selectedIndex = frmobj["myil"+sec].selectedIndex;   
			return(false);
		}
		if (frmobj["myil"+(3-sec)].options[frmobj["myil"+(3-sec)].selectedIndex].text.indexOf("öncesi")>=0)   
		{
			frmobj["myil"+(3-sec)].selectedIndex=0;
			return(false);
		}   
		if ((frmobj["myil1"].options[frmobj["myil1"].selectedIndex].text.length>0) && (frmobj["myil2"].options[frmobj["myil2"].selectedIndex].text.length>0))
		{
			if (frmobj["myil1"].options[frmobj["myil1"].selectedIndex].value > frmobj["myil2"].options[frmobj["myil2"].selectedIndex].value )
			{
				var tmp;
				tmp=frmobj["myil1"].selectedIndex;
				frmobj["myil1"].selectedIndex = frmobj["myil2"].selectedIndex;
				frmobj["myil2"].selectedIndex = tmp;
			}
			return(false);
		}
	}

//MARKA-MODEL AÇILIR LISTELERI İÇİN GEREKEN script BAŞLANGICI
function stSelect(mtopic_list, stopic_list, mID, sID) {
    if (!(!STL_VAL[mID]) && STL_VAL[mID].length > 0) {
        stopic_list.disabled = false;
        stopic_list.length = STL_VAL[mID].length+1;
        if (sID==0) stopic_list.options[0].selected = true;
        
        for (i = 1; i < stopic_list.length; i++) {
            stopic_list.options[i].value = STL_VAL[mID][i-1];
            stopic_list.options[i].text  = STL_TXT[mID][i-1];
            if (stopic_list.options[i].value==sID && sID!=0) {
                stopic_list.options[i].selected = true;
            } else {
                stopic_list.options[i].selected = false;
            }
        }
    } else {
        stopic_list.length = 1;
        stopic_list.options[0].value = '';
        stopic_list.options[0].text  = '--- Model Seç ---';
        stopic_list.disabled = true;
    }
}

function gsmnokontrol()
{
	var map  = "0123456789";
	var strv = document.frmhaberlist.ceptel.value;
	if(strv.charAt(0) == '0')
		strv = strv.substring(1,strv.length);
	
//	alert(strv.substring(1,strv.length));
	
	var strs = strv.length;
	var strt = '';
	
	for(i=0;i<strs;i++)
	{
		if(map.indexOf(strv.charAt(i)) != -1)
			strt = strt + strv.charAt(i);
	}
	document.frmhaberlist.ceptel.value = strt;
}

function emailkontrol(str)
{
	var rx=new RegExp("^[\\w\.=-]+@[\\w\\.-]+\\.[a-z]{2,4}$");
	return rx.test(str);
}

function haberlistkontrol()
{
	
	if(document.frmhaberlist.adsoyad.value == '')
	{
		alert('Lütfen adınızı ve soyadınızı giriniz!');
		document.frmhaberlist.adsoyad.focus();
		return false;
	}
	
	if(document.frmhaberlist.eposta.value !='')
	{
		if(!emailkontrol(document.frmhaberlist.eposta.value))
		{
			alert('Lütfen geçerli bir eposta adresi giriniz!');
			document.frmhaberlist.eposta.focus();
			return false;
		}
	}
	if(document.frmhaberlist.ceptel.value !='')
	{
		if(document.frmhaberlist.ceptel.value.length !=10)
		{
			alert('Lütfen geçerli bir GSM numarası giriniz!');
			document.frmhaberlist.ceptel.focus();
			return false;
		}
	}
	
	if(document.frmhaberlist.eposta.value =='' && document.frmhaberlist.ceptel.value =='')
	{
		alert('E-posta ve GSM no alanlarından en az birini girmelisiniz.');
		document.frmhaberlist.eposta.focus();
		return false;
	}
}

function undo_format(str)
{
var r_str="";
var len = str.length;
  for (i=0; (i<len) && ( (str.charAt(i)=='0') || (str.charAt(i)==' ')  ) ; i++ );
  str = str.substring(i);
  for (i=0; i<str.length ;i++)
  { 
    if ( (!isNaN(str.charAt(i)) ) && (str.charAt(i)!=' '))
      r_str +=  str.charAt(i);  
  }  
  return r_str;
}

function do_format(str)
{
var r_str="";
var k=1;
var i=str.length-1;
  for (; i>-1 ;i--)
  {
    if (k==3)    
    {
      r_str = str.charAt(i) + r_str; 
      if (i!=0)
         r_str = "." + r_str;
      k=0;
    }
    else
    {
      r_str = str.charAt(i) + r_str; 
    }
    k++; 
  }
  return r_str;
}

function format_tutar(e)
{
 var un_fstr = undo_format(e.value);
 //if(e = document.form1.fiyat) document.form1.fiyat2.value=un_fstr;
 e.value= do_format(un_fstr); 
}
//ÜRÜN FORMUNDAKİ FİYATI PARA FORMATINDA GÖSTEREBİLMEK İÇİN GEREKEN script SONU

function sil(mesaj,yol)
	{	
	 mesaj = unescape(mesaj).replace(/\+/g," ");
	 mesaj = mesaj.replace(/\\n/g,"\n");
	 if(confirm(mesaj))window.location = yol;
	}
	
/////////////////////////////////////RESIM BÜYÜT////////////////////////////////////
PositionX = 0;
PositionY = 0;
defaultWidth  = 500;
defaultHeight = 500;
var AutoClose = true;
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=400,height=400,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Yükleniyor...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>');
close();		
}}


//v1.0
//Copyright 2006 Adobe Systems, Inc. All rights reserved.
function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '<object ';
  for (var i in objAttrs)
    str += i + '="' + objAttrs[i] + '" ';
  str += '>';
  for (var i in params)
    str += '<param name="' + i + '" value="' + params[i] + '" /> ';
  str += '<embed ';
  for (var i in embedAttrs)
    str += i + '="' + embedAttrs[i] + '" ';
  str += ' ></embed></object>';

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "id":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}

