 function showTip(e,divname,flip)
{			
	divid= getTipFromId(divname)
	var mousePosX,mousePosY;
	if (!e) var e = window.event;
			if (e.pageX || e.pageY)
			{
				mousePosX = e.pageX ;
                                mousePosY = e.pageY ;
			}
			else if (e.clientX || e.clientY)
			{
			        mousePosX = e.clientX + document.documentElement.scrollLeft;
				mousePosY = e.clientY + document.documentElement.scrollTop; 
 		               
	                }
			
moveTip(mousePosX,mousePosY,divid,flip);
//alert(divid);
		} //end of function
function HideTip(e,divname)
{
//parentdiv.onmousemove = null;
divid= getTipFromId(divname)
		divid.style.top = -10000+'px';
		divid.style.left = -10000+'px';
}
		
function moveTip(mousePosX,mousePosY,divid,flip)
{
//alert(divid.offsetHeight);
//divid.style.visibility = "hidden";
if(flip==true)
	{
    divid.style.top = mousePosY-(17+divid.offsetHeight)+'px';
	divid.style.left =mousePosX-divid.offsetWidth +40+'px';
	}
	else
	{
	divid.style.top = mousePosY-(17+divid.offsetHeight)+'px';
	divid.style.left =mousePosX-40+'px';
	}
}

function getTipFromId(id)
{
	if(document.layers)
	{
	return document.layers[id];
	}
	if(document.getElementById)
	{
	return document.getElementById(id);
	}
    if(document.all)
	{
	return document.all[id];
	}

	return ;
	
}
	function Toggle(obj){
	    var objId = document.getElementById(obj);
	    objId.style.display = (objId.style.display == "none")?"":"none"; 
	}

    function ValidEvent(){
    if (document.frm.title.value=="") {
    	alert("Please enter event title.")
    	document.frm.title.focus()
    return false }
    }
    	
	
	function checkIt(string){
		place = detect.indexOf(string) + 1;
		thestring = string;
		return place;
	}

	function ValidEmailgrp(){
		if (document.frm.groups.value=="") {
			alert("Please select groups to email.")
			document.frm.groups.focus()
		return false }
		if (document.frm.title.value=="") {
			alert("Please enter email title.")
			document.frm.title.focus()
		return false }
		if (document.frm.des.value=="") {
			alert("Please enter email content.")
			document.frm.des.focus()
		return false }
	}
	
	function ValidLoginMain(){
	    if (document.frm.email.value=="") {
	    	alert("Lütfen mail adresinizi tanımlayın.")
	    	document.frm.username.focus()
	    return false }
	    if (document.frm.password.value=="") {
	    	alert("Lütfen şifrenizi tanımlayın.")
	    	document.frm.password.focus()
	    return false }
		if (document.frm.strCAPTCHA.value=="") {
	    	alert("Lütfen Güvenlik Kodunu tanımlayın.")
	    	document.frm.strCAPTCHA.focus()
	    return false }
		
	} 
	
	function ValidReminder(){
	    if (document.frm.username.value=="") {
	    	alert("Please enter your username.")
	    	document.frm.username.focus()
	    return false }
	    if (document.frm.email.value=="") {
	    	alert("Please enter your email address.")
	    	document.frm.email.focus()
	    return false }
	} 
	
	function DelFile(ID, CID) {
		if (confirm("Delete File ?")) {
			window.location.replace("file_del.asp?ID=" + ID + "&CID=" + CID );
		}
	}
	    function NewWindow(mypage, myname, w, h, scroll) {
	    	var winl = (screen.width - w) / 2;
	    	var wint = (screen.height - h) / 2;
	    	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll
	    	win = window.open(mypage, myname, winprops)
	    	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
	    }
	
	function ValidSettings(){
	if (document.frm.path.value=="") {
		alert("Please enter path value.")
		document.frm.path.focus()
	return false }
	if (document.frm.url.value=="") {
		alert("Please enter URL value.")
		document.frm.url.focus()
	return false }
	if (document.frm.email.value=="") {
		alert("Please enter email address.")
		document.frm.email.focus()
	return false }
	if (document.frm.smtp.value=="") {
		alert("Please enter smtp server address.")
		document.frm.smtp.focus()
	return false }
	}
	
	function LogOut() {
		if (confirm("LÜTFEN GÜVENLI ÇIKISI ONAYLAYINIZ")) {
			window.location.replace("index.asp?Logout=True");
		}
	}
	
	function validateGroupAdd(){
		if (document.frm.name.value=="") {
			alert("Please enter group name.")
			document.frm.name.focus()
		return false }
	}
	
	
	function validateAgentAdd(){
		if (document.frm.name.value=="") {
			alert("Please enter agent name.")
			document.frm.name.focus()
		return false }
		if (document.frm.username.value=="") {
			alert("Please enter desired username.")
			document.frm.username.focus()
		return false }
		if (document.frm.password.value=="") {
			alert("Please enter desired password.")
			document.frm.password.focus()
		return false }	
		if (document.frm.email.value=="") {
			alert("Please enter agent email address.")
			document.frm.email.focus()
		return false }	
	}
	
	function validateAgentEdit(){
		if (document.frm.name.value=="") {
			alert("Please enter agent name.")
			document.frm.name.focus()
		return false }
		if (document.frm.password.value=="") {
			alert("Please enter desired password.")
			document.frm.password.focus()
		return false }	
		if (document.frm.email.value=="") {
			alert("Please enter agent email address.")
			document.frm.email.focus()
		return false }	
	}
	
	function validateCalEdit(){
		if (document.frm.name.value=="") {
			alert("Please enter calendar name.")
			document.frm.name.focus()
		return false }
		if (document.frm.password.value=="") {
			alert("Please enter desired password.")
			document.frm.password.focus()
		return false }	
		if (document.frm.des.value=="") {
			alert("Please enter calendar description.")
			document.frm.des.focus()
		return false }	
	}
	
	function validateCalAdd(){
		if (document.frm.name.value=="") {
			alert("Please enter calendar name.")
			document.frm.name.focus()
		return false }
		if (document.frm.username.value=="") {
			alert("Please enter desired username.")
			document.frm.username.focus()
		return false }	
		if (document.frm.password.value=="") {
			alert("Please enter desired password.")
			document.frm.password.focus()
		return false }	
	}
	
	
	function DelGroup(ID,NAME) {
		if (confirm("Delete Group: "+ NAME + " ? All calendars in this group will be unassigned.")) {
			window.location.replace("group_del.asp?ID=" + ID );
		}
	}
	function DelOrdOriginator(ID,NAME,ORDID) {
	if (confirm("IPTAL EDILECEK SIPARIS VE SILINECEK ORIGINATOR: "+ NAME + " LÜTFEN ISLEMI ONAYLAYIN.")) {
			window.location.replace("admin_originator_ord_del.asp?ID=" + ID +"&ORDID=" +ORDID );
		}
	}
	function DelAdOriginator(ID,NAME,CLID) {
	if (confirm("SILINECEK ORIGINATOR: "+ NAME + " LÜTFEN ISLEMI ONAYLAYIN.")) {
			window.location.replace("admin_originator_del.asp?ID=" + ID +"&CLID=" +CLID );
		}
	}
	function BckOriginator(ID,NAME,CLID) {
	if (confirm("AKTIFLESTIRILECEK ORIGINATOR: "+ NAME + " LÜTFEN ISLEMI ONAYLAYIN.")) {
			window.location.replace("admin_originator_back.asp?ID=" + ID +"&CLID=" +CLID );
		}
	}
	function BackOriginator(ID,NAME) {
	if (confirm("AKTIFLESTIRILECEK ORIGINATOR: "+ NAME + " LÜTFEN ISLEMI ONAYLAYIN.")) {
			window.location.replace("originator_back.asp?ID=" + ID  );
		}
	}
	function DelOriginator(ID,NAME,CLID) {
	if (confirm("SILINECEK ORIGINATOR: "+ NAME + " LÜTFEN ISLEMI ONAYLAYIN.")) {
			window.location.replace("originator_del.asp?ID=" + ID );
		}
	}
	function DecOriginator(ID,NAME,CLID) {
		if (confirm("RED EDILECEK ORIGINATOR: "+ NAME + " LÜTFEN ISLEMI ONAYLAYIN.")) {
			window.location.replace("admin_originator_dec.asp?ID=" + ID +"&CLID=" +CLID );
		}
	}
	function AprOriginator(ID,NAME,CLID) {
		if (confirm("ONAYLANACAK ORIGINATOR: "+ NAME + " LÜTFEN ISLEMI ONAYLAYIN.")) {
			window.location.replace("admin_originator_apr.asp?ID=" + ID +"&CLID=" +CLID );
		}
	}
	function DelAgent(ID,NAME) {
		if (confirm("Delete Agent: "+ NAME + " ?" )) {
			window.location.replace("agent_del.asp?ID=" + ID );
		}
	}
	
	function DelCal(ID,NAME) {
		if (confirm("Delete Calendar: "+ NAME + " ?" )) {
			window.location.replace("cal_del.asp?ID=" + ID);
		}
	}
	
	function MakeActive(ID,NAME,REST) {
		if (confirm("Activate Calendar: "+ NAME + " ?" )) {
			window.location.replace("toogle.asp?a=1&ID=" + ID + REST);
		}
	}
	
	function MakeInactive(ID,NAME,REST) {
		if (confirm("Deactivate Calendar: "+ NAME + " ?" )) {
			window.location.replace("toogle.asp?a=0&ID=" + ID + REST);
		}
	}