﻿// JavaScript Document

var ImageArray = new Array();

function ImageLoader(ImageName) {
	ImageArray[ImageArray.length] = new Image();
	ImageArray[ImageArray.length-1].src = ImageName;
}


// HINTBOX BEGIN
function hintbox(){
	ishintbox = findObj("hintbox");
	if (!ishintbox) 
	{
		try {
		node = document.createElement("DIV");	
		node.id = "hintbox";
		node.className  = "hintbox";
		AddEvent(node,"mouseover",hintover);
		AddEvent(node,"mouseout",hintout);
		document.body.appendChild(node);
		return node;
		}
		catch(exception)
		{
			alert(exception);
			return false;
		}
	}
	else 
	{
		return ishintbox;
	}
}

function hintover() { selfobj = findObj("hintbox"); selfobj.style.visibility = "visible"}

function hintout() { selfobj = findObj("hintbox"); selfobj.style.visibility = "hidden"}

function showhint(text,px,py){
	box = findObj("hintbox");
	box.innerHTML = text;
	box.style.top = py;
	box.style.left = px;
	box.style.visibility = "visible";
	box.style.backgroundImage="none";
	box.style.fontSize = "9px";
	box.style.fontFamily = "Verdana";
}

function hidehint(){
	box = findObj("hintbox");
	box.style.visibility = "hidden";
}
// HINTBOX END


function browserDetect(){
		this.ver=navigator.appVersion
		this.dom=document.getElementById?1:0
		this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
		this.ie4=(document.all && !this.dom)?1:0;
		this.ns4=(document.layers && !this.dom)?1:0;
		this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
		this.tarayici=(this.ie4 || this.ie5 || this.ns4 || this.ns5)
		return this
	}
	
	
function wW() {

	if (document.all) {
		return document.body.offsetWidth;
	} 
	else {
		return window.innerWidth
	}	
}

function wH() {
	if (document.all) {
		return document.body.offsetHeight;
	} 
	else {
		return window.innerHeight;
	}
}

function sW() {
	return screen.width;
}

function sH() {
	return screen.height;
}	

function fullScreen() 
{
var versiyon=parseInt(navigator.appVersion);
var tarayici=navigator.appName;
if (versiyon>3) 
{	
	if (tarayici=="Netscape"|| tarayici == "Opera") 
	{
		if (top.screenX>0 || top.screenY>0) top.moveTo(0,0);
		if (top.outerWidth < screen.width)top.outerWidth=screen.width;
		if (top.outerHeight < screen.height) top.outerHeight = screen.height;
		return true;
	}	
	else 
	{
		top.moveTo(-4,-4);
		top.resizeTo(screen.width+8,screen.height+8);
		return true;
	}
}
return false;
}

function AddEvent(obj,eventName,func){
	if(obj.attachEvent)
	{
		obj.attachEvent('on'+eventName,func);
	}
	else if(obj.addEventListener)
	{
		obj.addEventListener(eventName,func,false);
	}
}

function findObj(theObj, theDoc)

{

  var p, i, foundObj;

  

  if(!theDoc) theDoc = document;

  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)

  {

    theDoc = parent.frames[theObj.substring(p+1)].document;

    theObj = theObj.substring(0,p);

  }

  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];

  for (i=0; !foundObj && i < theDoc.forms.length; i++) 

    foundObj = theDoc.forms[i][theObj];

  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 

    foundObj = findObj(theObj,theDoc.layers[i].document);

  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);

  

  return foundObj;

}

function getTarget(event) {
	target = event.srcElement;
	if (!target) target = event.target;
	if (target) {return target}else{return false};
}

function getMousePoint(e){
	if(myBrowser.ns4 || myBrowser.ns5){
		x=e.pageX;
		y=e.pageY;
	}
	else {
		x=event.x;
		y=event.y;
	}

	if(myBrowser.ie4 || myBrowser.ie5) {
		y=y+eval(scrolled)
	}
	mp = new Object();
	mp.x=x+10;
	mp.y=y+20;
	return mp;
}

function GetXmlHttpObject(){
        var xmlhttp;

              try
              {
                  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
              }
              catch (e)
              {
                  try
                  {
                      xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                  }
                  catch (E)
                  {
                      xmlhttp = false;
                  }
             }
  
        if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
        {
            try
            {
                xmlhttp = new XMLHttpRequest();
            }
            catch (e)
            {
                xmlhttp = false;
            }
        }

        return xmlhttp;
}

function getNum(str)
{
	var num,where;
	where = str.indexOf("px");
	num = str.substring(0,where);
	return Number(num);
}


function butover(hint) {
p = getMousePoint(event);
showhint(hint,String(p.x)+"px",String(p.y)+"px");
};

function butout(event) {
p = getMousePoint(event);
hidehint();
};

function butmove(event) {
	p = getMousePoint(event);
	h = hintbox();
	h.style.left = String(p.x)+"px";
	h.style.top = String(p.y)+"px";
}

function butclick(event) {
t = getTarget(event);
p = getMousePoint(event)
ActionBuilder(t.action);
};

function basla()
{	
MEbBandı =  '<table width="190" border="0" cellpadding="3" cellspacing="0" class="border1"><tr><td class="Header3"><img src="_image/Web Search.jpg" width="25" height="25" align="absmiddle" />&nbsp;&nbsp;MEB&middot;den</td></tr><tr><td background="_image/tabback.jpg"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="435" height="90"><param name="movie" value="http://www.meb.gov.tr/haberler/xml/6.swf"><param name="quality" value="high"><embed src="http://www.meb.gov.tr/haberler/xml/6.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="420" height="90"></embed></object></td></tr></table>';

 	e = findObj("col2");
	ajaxtab1 = AjaxTab4("tab1","istek1","istek2","istek3","istek4");
	e.appendChild(ajaxtab1);
	ajaxtab1.addreq("istek1","Haberler","lastitem.asp?Category=Haberler");
	ajaxtab1.addreq("istek2","Projeler","lastitem.asp?Category=projeler");
	ajaxtab1.addreq("istek3","Basında Edirne MEM","lastitem.asp?Category=basemem");
	ajaxtab1.addreq("istek4","İhaleler","lastitem.asp?Category=ihaleler");
	ajaxtab1.Request("lastitem.asp?Category=Haberler",ajaxtab1.Content);
	ajaxtab2 = AjaxTab3("tab2","istek11","istek22","istek33");
	


 	e.appendChild(ajaxtab2);
	ajaxtab2.addreq("istek11","Duyurular","lastitem.asp?Category=duyurular");
	ajaxtab2.addreq("istek22","Etkinlikler","lastitem.asp?Category=etkinlik");
	ajaxtab2.addreq("istek33","Avrupa Birliği","lastitem.asp?Category=abirlik");
	ajaxtab2.Request("lastitem.asp?Category=duyurular",ajaxtab2.Content);

	band = document.createElement("div");
	band.setAttribute("align","center");
	band.innerHTML = MEbBandı;
	e.appendChild(band);
	
}

