	var Mono = {};
	var userAgent = navigator.userAgent.toLowerCase();
 	Mono.fn = Mono.prototype = {};
	
	Mono.Browser = {
		Version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1],
		Safari: /webkit/.test( userAgent ),
		Opera: /opera/.test( userAgent ),
		IE: /msie/.test( userAgent ) && !/opera/.test( userAgent ),
		Mozilla: /mozilla/.test( userAgent ) && !/(compatible|webkit)/.test( userAgent )
	};
	Mono.Css = {
		Add:function (selector , rules ,style) {
			if(!(document.getElementById('MonoMagicCss'))) {
				var StyleSheet = document.createElement('STYLE');
				StyleSheet.id = "MonoMagicCss";
				StyleSheet.media = "screen";
				StyleSheet.type = "text/css";
				StyleSheet.setAttribute("type", "text/css");
				StyleSheet.setAttribute("media", "screen");
				StyleSheet.setAttribute("id" ,"MonoMagicCss");
				document.getElementsByTagName("head")[0].appendChild(StyleSheet);
			}
			else
				var StyleSheet = document.getElementById('MonoMagicCss');
			
			if(Mono.Browser.IE)
			{
				Sheet = Mono.Css.findCustomCss();
				Sheet.addRule(selector,rules,0)
			}
			else
				StyleSheet.appendChild(document.createTextNode(selector + " {" + rules + "}"));
		},
		findCustomCss:function()
		{
			for(i = 0 ; i<document.styleSheets.length;i++)
			{
				if(document.styleSheets[i].id == 'MonoMagicCss')
					return document.styleSheets[i];
			}
			return false;
		}
	}
	
	Mono.Event = {
		ready:function(Fn) {
			Mono.Event.addEvent(window, "load", Fn)
		},
		
		addEvent:function(elm, evType, fn, useCapture) {
			if (elm.addEventListener) {
				elm.addEventListener(evType, fn, useCapture);
				return true;
			} 
			else if (elm.attachEvent) {
				var r = elm.attachEvent("on"+evType, fn);
				return r;
			} 
			else
				return false;
		}
	}
  
	Mono.XML = {
		Request:null,
		loadFile:function(File) {
			
			if(Mono.XML.Request == null) {
				
				if (document.implementation && document.implementation.createDocument)
					Mono.XML.Request = document.implementation.createDocument("", "", null);
				else if (window.ActiveXObject)
					Mono.XML.Request = new ActiveXObject("Microsoft.XMLDOM");
				else
					Mono.XML.Request =  null;
			}
			Mono.XML.Request.load(File);
		},
		
		ready:function(fn) {
			
			if (window.ActiveXObject) {
				Mono.XML.Request.onreadystatechange = function () {
					if (Mono.XML.Request.readyState == 4)
						fn();
				};
			}
			else
				Mono.XML.Request.onload =  fn;
		}
	}
  
	Mono.Opener = {
		hideObject:new Array(),
		speed:30,
		Init:function() {
			var ULS = document.getElementsByTagName("ul");
			for ( i=0; i<ULS.length; i++ )  {
				thisUl = ULS[i];
				if ( ( (' '+thisUl.className+' ').indexOf("Opener") != -1 ) && ( thisUl.id ) ) 
					Mono.Opener.start(thisUl);
			}
		},
		start:function(obj)
		{
			hideObject = Mono.Opener.hideObject;
			hideObject.push(obj);
			hideObject[hideObject.length-1].style.display = 'block';
			hideObject[hideObject.length-1]['Height'] = obj.offsetHeight;
			hideObject[hideObject.length-1]['Status'] = 'closed';
			hideObject[hideObject.length-1].style.display = 'none';
			hideObject[hideObject.length-1].style.overflow = 'hidden';
			hideObject[hideObject.length-1].style.height = 0;
		},
		open:function(i)
		{
			speed = Mono.Opener.speed;
			hideObject = Mono.Opener.hideObject;
			obj = hideObject[i];
			if(obj)
			{
				obj.style.display='block';
				height = hideObject[i]['Height'];
				if(parseInt(obj.style.height) < height) {
					if(parseInt(obj.style.height)+speed > height)
						add = height - (parseInt(obj.style.height));
					else 
						add = speed;
					obj.style.height = parseInt(obj.style.height)+add+"px";
					window.setTimeout('Mono.Opener.open('+i+')',1);
				}
				else {
					hideObject[i]['Status'] = 'opened';
					Mono.Cookie.writeCookie('MonoOpener',i,9000);
				}
			}
		},
		close:function(i)
		{
			hideObject = Mono.Opener.hideObject;
			obj = hideObject[i];
			if(obj) {
				height = hideObject[i]['Height'];
				speed = Mono.Opener.speed;
				hideObject[i]['Status'] = 'closed';
				if(parseInt(obj.style.height) > 0) {
					if(parseInt(obj.style.height)-speed < 0)
						add = parseInt(obj.style.height);
					else
						add = speed;
					obj.style.height = (parseInt(obj.style.height)-add)+"px";
					window.setTimeout('Mono.Opener.close('+i+')',1);
				}
				else {
					obj.style.height = 0 ;
					obj.style.display = 'none' ;
				}
			}
		},
		Set:function(id)
		{
			hideObject = Mono.Opener.hideObject;
			obj = document.getElementById(id);
			for( i = 0 ; i < hideObject.length ; i++) {
				if(id == hideObject[i].id && hideObject[i]['Status']!='opened')
					z = i;
				if(hideObject[i]['Status']=='opened' && id != hideObject[i].id)
					Mono.Opener.close(i);
			}
			Mono.Opener.open(z);
		}
	}
	
  	Mono.Cookie = {
  	writeCookie:function(name, value, hours) {
		if(hours==null || hours=="")
			hours=1; 
		var life=new Date(); 
		life.setTime(life.getTime()+(hours*60*60*1000));
		var LifeTime="; expires="+life.toGMTString();   
		document.cookie = name+"="+escape(value)+LifeTime+"; path=/";
	},
	
	readCookie:function(name) {
		var getCookie = document.cookie;
		var BeginContent = name + "=";
		var Start = getCookie.indexOf("; " + BeginContent);
		if (Start == -1) {
			Start = getCookie.indexOf(BeginContent);
			if (Start != 0)
				return null;
		}
		else
			Start += 2;
		var Last = getCookie.indexOf(";", Start);
		if (Last == -1)
			Last = getCookie.length;
		var Content=getCookie.substring(Start + BeginContent.length, Last);
		Content=unescape(Content);
		return Content;
	},
	
	deleteCookie:function(name) {
		document.cookie = name+"="+escape("")+-1+"; path=/";
	}
  }
  
  	Mono.LightBox = {
	  Screen:null,
	  Content:null,
	  Title:null,
	  ImageArea:null,
	  CloseGifPath:'http://www.monointeraktif.com/MonoLib/Javascript/LightBox/Image/close.gif',
	  Opacity:80,
	  backgroundColor:'#000',
	  Images: new Array(),
	  showTitle:true,
	  Init:function(backgroundColor,opacity) {
		  	Mono.LightBox.createNodes();
			Mono.LightBox.createCss();
		  	Mono.LightBox.initLightBoxElements();
	  },
	  fix:function() {
			Mono.LightBox.Screen.style.height = document.body.clientHeight+"px";
			Mono.LightBox.Content.style.height = document.body.clientHeight+"px";
	  },
	  initLightBoxElements:function() {
		var Links = document.getElementsByTagName("a");
			for ( i=0; i<Links.length; i++ )  {
				thisLink = Links[i];
				if ( ( (' '+thisLink.rel+' ').indexOf("LightBox") != -1 ) && ( thisLink.rel ) ) 
					Mono.LightBox.start(thisLink);
			}
	  },
	  start:function(thisLink) {
		 if(  (' '+thisLink.rel+' ').indexOf("[") != -1 && (' '+thisLink.rel+' ').indexOf("]") != -1 ) {
			 
		 }
		 else {
			Images = Mono.LightBox.Images;
			src =thisLink.href; 
			thisLink.href = "javascript:Mono.LightBox.show("+(Images.length)+")";
			Mono.LightBox.show();
			Img = new Image();
			Img.src = src;
			Img.title = thisLink.title;
			Img.alt = thisLink.title;
			Img.onclick = Mono.LightBox.hide;
			
			Mono.LightBox.ImageArea.appendChild(Img);
			
			Img.width = Img.offsetWidth;
			Img.height = Img.offsetHeight;
			
			Images.push(Img);
			 
			  	LightBoxTitle = document.createElement('div');
		  		Mono.LightBox.Content.appendChild(LightBoxTitle);
		  		LightBoxTitle.id = "LightBoxTitle";
		  		Mono.LightBox.Title = document.getElementById('LightBoxTitle');
				Mono.LightBox.Title.innerHTML = Img.title;
				Mono.LightBox.Title.style.width = Img.width + "px";
				
				CloseImg = new Image();
				CloseImg.src = Mono.LightBox.CloseGifPath;
				CloseImg.title = 'Kapat';
				CloseImg.alt = 'Kapat';
				CloseImg.id = 'LightBoxCloseImg';
				CloseImg.onclick = Mono.LightBox.hide;
				Mono.LightBox.Title.appendChild(CloseImg);
			
			Mono.LightBox.hide();
		 }
	  },
	  show:function(id) {
		  Mono.LightBox.Screen.style.display = "block";
		  Mono.LightBox.Content.style.display = "block";
		  Mono.LightBox.Screen.style.visibility = "visible";
		  Mono.LightBox.Content.style.visibility = "visible"; 
		  if(id != null) {
			  if(Mono.Browser.IE)
				  scroll(0,0);
		  }
	  },
	  hide:function(id) {
		  Mono.LightBox.Screen.style.display = "none";
		  Mono.LightBox.Content.style.display = "none";
		  Mono.LightBox.Screen.style.visibility = "hidden";
		  Mono.LightBox.Content.style.visibility = "hidden";
	  },
	  createNodes:function() {
		  LightBoxScreen = document.createElement('div');
		  document.body.appendChild(LightBoxScreen);
		  LightBoxScreen.id = "LightBoxScreen";
		  Mono.LightBox.Screen = document.getElementById('LightBoxScreen');
		  
		  LightBoxContent = document.createElement('div');
		  document.body.appendChild(LightBoxContent);
		  LightBoxContent.id = "LightBoxContent";
		  Mono.LightBox.Content = document.getElementById('LightBoxContent');
		  
		  LightBoxImageArea = document.createElement('span');
		  Mono.LightBox.Content.appendChild(LightBoxImageArea);
		  LightBoxImageArea.id = "LightBoxImageArea";
		  Mono.LightBox.ImageArea = document.getElementById('LightBoxImageArea');
	  },
	  createCss:function() {
		backgroundColor = Mono.LightBox.backgroundColor;
		opacity = Mono.LightBox.Opacity;   
		opacityIE = opacity;
		opacityFF = opacity/100;
		Mono.Css.Add('#LightBoxScreen', 'filter:alpha(opacity='+opacityIE+');-moz-opacity:'+opacityFF+';opacity:'+opacityFF+';background:'+backgroundColor+';display:none;visibility:hidden;width:100%;position:absolute;top:0;left:0;height:100%;z-index:99998');
		Mono.Css.Add('#LightBoxContent', 'display:none;visibility:hidden;width:100%;position:absolute;top:0;left:0;height:100%;z-index:99999');
		Mono.Css.Add('#LightBoxImageArea', 'margin:10% auto 0 auto;display:block');
		Mono.Css.Add('#LightBoxImageArea img', 'border :10px #FFF solid;border-bottom:50px solid #FFF;margin:10% auto 0 auto; display:block;position:relative');
		Mono.Css.Add('#LightBoxCloseImg', 'cursor:pointer;margin:-20px auto;background:#FFF;z-index:99999999;position:relative;color:#333;font-size:11px;font-weight:bold;float:right');
		if(!Mono.Browser.IE ) {
			Mono.Css.Add('html>body #LightBoxScreen', 'position:fixed'); 
			Mono.Css.Add('html>body #LightBoxContent', 'position:fixed');
		}
		if(Mono.Browser.IE ) {
			Mono.LightBox.Screen.style.height = document.body.clientHeight+"px";
			Mono.LightBox.Content.style.height = document.body.clientHeight+"px";
			window.onresize = Mono.LightBox.fix;
		}
		Mono.Css.Add('#LightBoxTitle', 'margin:-30px auto;background:#FFF;z-index:99999999;position:relative;color:#333;font-size:11px; font-weight:bold');
	  }
  }
  
  Mono.Effect = {
	Obje:null,
	setObje:function(obj) {
	},
	fadeIn:function(){
	},
	fadeOut:function(){
	},
	inner:function(){
	},
	outer:function(){
	},
	fader:function(){
		if(Mono.Effect.Obje.style.opacity <= 100) {
			Mono.Effect.Obje.style.opacity = Mono.Effect.Obje.style.opacity + 1;
			window.setTimeout( "Mono.Effect.fader",1);
		}
	}
  }
  
  	Mono.Element = {
		Obje:null,
		HideStatus:false,
		Set:function(element) {
			if(document.getElementById(element)) {
				Mono.Element.Obje = document.getElementById(element);
			}
			else {
				return false;
			}
			if(Mono.Element.getDefaultStyle('display') == 'none' || Mono.Element.Obje.style.display == 'none') {
				Mono.Element.Obje.style.display = "none";
				Mono.Element.HideStatus=true;
			}
			else
				Mono.Element.HideStatus=false;

			return Mono.Element;
		},
		Get:function() {
			return Mono.Element.Obje;
		},
		Show:function() {
			//alert(Mono.Element.Obje);
			Mono.Element.Obje.style.display = 'block';
			Mono.Element.HideStatus = false;
		},
		Hide:function() {
			Mono.Element.Obje.style.display = 'none';
			Mono.Element.HideStatus = true;
		},
		getDimension:function() {
			if(Mono.Element.HideStatus)
				Mono.Element.Obje.style.display = "block";
				
			H=Mono.Element.Obje.offsetHeight;
			W=Mono.Element.Obje.offsetWidth;
			
			if(Mono.Element.HideStatus)
				Mono.Element.Obje.style.display = "none";
			return { Height:H, Width:W }
		},
		getDefaultStyle:function(style) {
            if(document.defaultView)
			    return document.defaultView.getComputedStyle(Mono.Element.Obje,null)[style];
            else
                return false;
		}
	}
    
    Mono.Ajax = {
        Conn:null,
        Init:function() {
        	if(window.XMLHttpRequest) {
				Mono.Ajax.Conn =  new XMLHttpRequest();
				if (Mono.Ajax.Conn.overrideMimeType){
					Mono.Ajax.Conn.overrideMimeType('text/xml;charset=utf-8');
				}
			}
			else if(window.ActiveXObject){
				try{
					Mono.Ajax.Conn = new ActiveXObject("Msxml2.XMLHTTP");
				}
				catch (e){
					try{
						Mono.Ajax.Conn = new ActiveXObject("Microsoft.XMLHTTP");
					}
					catch (e) {}
				}
			}
			if (Mono.Ajax.Conn == null){
				alert('Cannot create XMLHTTP instance');
				return false;
			}
        },
		Open:function( type, file, callfunction, post ){
			var Con = Mono.Ajax.Conn;
			Con.open(type,file,true);
			Con.onreadystatechange = eval(callfunction);
            if( post != null)         {
                Con.setRequestHeader('If-Modified-Since', 'Sat, 1 Jan 2000 00:00:00 GMT');
                Con.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
                Con.setRequestHeader('Content-length', post.length);
                Con.setRequestHeader('Connection', 'close'); 
            }
			Con.send(post);
		}
    }
    
    

