﻿var posx = 0, posy =0;
var panelTimer;
var touchPNL = document.createElement("DIV");
 touchPNL.id = "touchPNL_parent_div";
 touchPNL.style.display="none";
 
function getMouse(e){
if(e==null) e=window.event;
        if(e.pageX || e.pageY) {
            posx=e.pageX; posy=e.pageY;
        } else if (e.clientX || e.clientY) {
            if(document.documentElement.scrollTop){
                posx=e.clientX+document.documentElement.scrollLeft;
                posy=e.clientY+document.documentElement.scrollTop;
            } else {
                posx=e.clientX+document.body.scrollLeft;
                posy=e.clientY+document.body.scrollTop;
            }
        }
}


//OPENPANEL B&#214;L&#220;M&#220; BASLIYOR//
 var pickCalendarHtml='';
 var pickPPMTHtml='';
 var pickPPCCHtml='';
 
 var pickFriendHtml='<table border="0" width="291" cellspacing="0" cellpadding="0" height="150">\
	<tr>\
		<td height="23" align="left" valign="top" width="181">\
		<img border="0" src="images/topleft.gif" width="181" height="23"></td>\
		<td height="23" align="left" valign="top" width="85">\
		<a target="_blank" href="touch.htm">\
		<img border="0" src="images/topmiddle.gif" width="85" height="23"></a></td>\
		<td height="23" align="left" valign="top" width="25">\
		<a href="javascript:void(0)" onclick="deletePanel(\'touchPNL\')" target="_self">\
		<img border="0" src="images/topright.gif" width="25" height="23"></a></td>\
	</tr>\
	<tr>\
		<td colspan="3" height="125">\
		<table border="0" width="100%" cellspacing="0" cellpadding="0" height="100%">\
			<tr>\
				<td width="3" height="100%" align="left" bgcolor="#FFFFFF">\
				<img border="0" src="images/pipe.gif" width="1" height="100%"></td>\
				<td align="justify" valign="top" bordercolor="#F1F1F1">\
				<table border="0" width="100%" cellspacing="0" cellpadding="0" height="125" bgcolor="#FFFFFF">\
					<tr>\
						<td align="center" valign="top">\
						<iframe name="touchFRM" id="touchFRM" src="blank.htm" height="125" width="284" style="border-style: solid; border-width: 0px" border="0" frameborder="0" scrolling="no">\
						</iframe></td>\
					</tr>\
				</table>\
				</td>\
				<td width="3" height="100%" align="right" bgcolor="#FFFFFF">\
				<img border="0" src="images/pipe.gif" width="1" height="100%"></td>\
			</tr>\
			<tr>\
				<td height="3" align="left" width="3" valign="top">\
				<img border="0" src="images/leftcorner.gif" width="3" height="3"></td>\
				<td height="3" valign="bottom" bgcolor="#FFFFFF">\
				<img border="0" src="images/pipe.gif" width="100%" height="1"></td>\
				<td height="3" width="3" align="right" valign="top">\
				<img border="0" src="images/rightcorner.gif" width="3" height="3"></td>\
			</tr>\
		</table>\
		</td>\
	</tr>\
</table>';
 
//Takvim icin Panel acma fonksiyonu//
function openCalendarCoord(dateValue)
{
myposx = 259;
myposy = 474;

pickCalendarHtml='<table border="0" width="510" cellspacing="0" cellpadding="0" height="195">\
	<tr>\
		<td height="35" align="left" valign="bottom" width="60">\
		<img border="0" src="images/pages/topleft.gif" width="60" height="35"></td>\
		<td height="35" align="left" valign="bottom" width="425">\
		<img border="0" src="images/pages/topmiddle.gif" width="425" height="35"></td>\
		<td height="35" align="left" valign="bottom" width="25">\
		<a href="javascript:void(0)" onclick="deletePanel(\'touchPNL\')" target="_self">\
		<img border="0" src="images/pages/topright.gif" width="25" height="35"></a></td>\
	</tr>\
	<tr>\
		<td colspan="3" height="160">\
		<table border="0" width="100%" cellspacing="0" cellpadding="0" height="100%">\
			<tr>\
				<td width="3" height="100%" align="left" bgcolor="#FFFFFF">\
				<img border="0" src="images/pages/pipe.gif" width="1" height="100%"></td>\
				<td align="justify" valign="top" bordercolor="#F1F1F1">\
				<table border="0" width="100%" cellspacing="0" cellpadding="0" height="160" bgcolor="#FFFFFF">\
					<tr>\
						<td align="center" valign="top">\
						<iframe name="touchFRM" id="touchFRM" src="pages/monthlyCalendar.aspx?page=' + dateValue + '" height="160" width="503" style="border-style: solid; border-width: 0px" border="0" frameborder="0" scrolling="auto">\
						</iframe></td>\
					</tr>\
				</table>\
				</td>\
				<td width="3" height="100%" align="right" bgcolor="#FFFFFF">\
				<img border="0" src="images/pages/pipe.gif" width="1" height="100%"></td>\
			</tr>\
			<tr>\
				<td height="3" align="left" width="3" valign="top">\
				<img border="0" src="images/pages/leftcorner.gif" width="3" height="3"></td>\
				<td height="3" valign="bottom" bgcolor="#FFFFFF">\
				<img border="0" src="images/pages/pipe.gif" width="100%" height="1"></td>\
				<td height="3" width="3" align="right" valign="top">\
				<img border="0" src="images/pages/rightcorner.gif" width="3" height="3"></td>\
			</tr>\
		</table>\
		</td>\
	</tr>\
</table>';

 makeCalendarPanel('touchPNL_child',myposx,myposy,516,205,'none',1,99999,pickCalendarHtml);
 //new AutoComplete("user", function() { return "FriendAutoComplete.jsp?t=" + this.text.value });
}


//Touch icin Panel acma fonksiyonu//
function openPickCoord()
{

waitMe();

var rightedge = document.body.clientWidth-posx;
var bottomedge = document.body.clientHeight-posy+document.body.scrollTop;

var newposx,newposy;
//alert("clientWidth:"+document.body.clientWidth+"\n"+"Posx:"+posx+"\n"+"RightEdge:"+rightedge);
//alert("clientHeight:"+document.body.clientHeight+"\n"+"Posy:"+posy+"\n"+"BottomEdge:"+bottomedge);

if (rightedge < 305)
{
newposx = posx - 305;
}
else
{
newposx = posx;
}

if (bottomedge > 291)
{
newposy = posy;
}
else
{
    if (bottomedge > 160)
    {
    newposy = posy;
    }
    else
    {
    newposy = posy-160;
    }
}


 makePanel('touchPNL_child',newposx,newposy,305,160,'none',1,99999,pickFriendHtml);
 //new AutoComplete("user", function() { return "FriendAutoComplete.jsp?t=" + this.text.value });
}



//PayPerMoneyTransfer
//PayPerMoneyTransfer
function openPPMTCoord()
{
myposx = 359;
myposy = 274;

pickPPMTHtml='<table border="0" width="470" cellspacing="0" cellpadding="0" height="405">\
	<tr>\
		<td height="35" align="left" valign="bottom" width="60">\
		<img border="0" src="images/pages/topleft.gif" width="60" height="35"></td>\
		<td height="35" align="left" valign="bottom" width="385">\
		<img border="0" src="images/pages/topmiddle.gif" width="385" height="35"></td>\
		<td height="35" align="left" valign="bottom" width="25">\
		<a href="javascript:void(0)" onclick="deletePanel(\'touchPNL\')" target="_self">\
		<img border="0" src="images/pages/topright.gif" width="25" height="35"></a></td>\
	</tr>\
	<tr>\
		<td colspan="3" height="370">\
		<table border="0" width="100%" cellspacing="0" cellpadding="0" height="100%">\
			<tr>\
				<td width="3" height="100%" align="left" bgcolor="#FFFFFF">\
				<img border="0" src="images/pages/pipe.gif" width="1" height="100%"></td>\
				<td align="justify" valign="top" bordercolor="#F1F1F1">\
				<table border="0" width="100%" cellspacing="0" cellpadding="0" height="370" bgcolor="#FFFFFF">\
					<tr>\
						<td align="center" valign="top">\
						<iframe name="touchFRM" id="touchFRM" src="pages/PayPerMoneyTransfer.aspx" height="370" width="463" style="border-style: solid; border-width: 0px" border="0" frameborder="0" scrolling="auto">\
						</iframe></td>\
					</tr>\
				</table>\
				</td>\
				<td width="3" height="100%" align="right" bgcolor="#FFFFFF">\
				<img border="0" src="images/pages/pipe.gif" width="1" height="100%"></td>\
			</tr>\
			<tr>\
				<td height="3" align="left" width="3" valign="top">\
				<img border="0" src="images/pages/leftcorner.gif" width="3" height="3"></td>\
				<td height="3" valign="bottom" bgcolor="#FFFFFF">\
				<img border="0" src="images/pages/pipe.gif" width="100%" height="1"></td>\
				<td height="3" width="3" align="right" valign="top">\
				<img border="0" src="images/pages/rightcorner.gif" width="3" height="3"></td>\
			</tr>\
		</table>\
		</td>\
	</tr>\
</table>';

 makePPMTPanel('touchPNL_child',myposx,myposy,476,415,'none',1,99999,pickPPMTHtml);
 //new AutoComplete("user", function() { return "FriendAutoComplete.jsp?t=" + this.text.value });
}

//PayPerMoneyTransfer
//PayPerMoneyTransfer





//PayPerCreditCard
//PayPerCreditCard
function openPPCCCoord()
{
myposx = 359;
myposy = 274;

pickPPCCHtml='<table border="0" width="470" cellspacing="0" cellpadding="0" height="365">\
	<tr>\
		<td height="35" align="left" valign="bottom" width="60">\
		<img border="0" src="images/pages/topleft.gif" width="60" height="35"></td>\
		<td height="35" align="left" valign="bottom" width="385">\
		<img border="0" src="images/pages/topmiddle.gif" width="385" height="35"></td>\
		<td height="35" align="left" valign="bottom" width="25">\
		<a href="javascript:void(0)" onclick="deletePanel(\'touchPNL\')" target="_self">\
		<img border="0" src="images/pages/topright.gif" width="25" height="35"></a></td>\
	</tr>\
	<tr>\
		<td colspan="3" height="320">\
		<table border="0" width="100%" cellspacing="0" cellpadding="0" height="100%">\
			<tr>\
				<td width="3" height="100%" align="left" bgcolor="#FFFFFF">\
				<img border="0" src="images/pages/pipe.gif" width="1" height="100%"></td>\
				<td align="justify" valign="top" bordercolor="#F1F1F1">\
				<table border="0" width="100%" cellspacing="0" cellpadding="0" height="320" bgcolor="#FFFFFF">\
					<tr>\
						<td align="center" valign="top">\
						<iframe name="touchFRM" id="touchFRM" src="pages/PayPerCreditCard.aspx" height="320" width="463" style="border-style: solid; border-width: 0px" border="0" frameborder="0" scrolling="auto">\
						</iframe></td>\
					</tr>\
				</table>\
				</td>\
				<td width="3" height="100%" align="right" bgcolor="#FFFFFF">\
				<img border="0" src="images/pages/pipe.gif" width="1" height="100%"></td>\
			</tr>\
			<tr>\
				<td height="3" align="left" width="3" valign="top">\
				<img border="0" src="images/pages/leftcorner.gif" width="3" height="3"></td>\
				<td height="3" valign="bottom" bgcolor="#FFFFFF">\
				<img border="0" src="images/pages/pipe.gif" width="100%" height="1"></td>\
				<td height="3" width="3" align="right" valign="top">\
				<img border="0" src="images/pages/rightcorner.gif" width="3" height="3"></td>\
			</tr>\
		</table>\
		</td>\
	</tr>\
</table>';

 makePPCCPanel('touchPNL_child',myposx,myposy,476,365,'none',1,99999,pickPPCCHtml);
 //new AutoComplete("user", function() { return "FriendAutoComplete.jsp?t=" + this.text.value });
}

//PayPerCreditCard
//PayPerCreditCard





function makePanel(id,L,T,W,H,bgColor,visible,zIndex,obj1) 
{
 //document.getElementById(id+'_parent_div').innerHTML= '\n<DIV class="dragme" id='+id+' style="position:absolute'
 touchPNL.innerHTML= '\n<DIV id='+id+' style="position:absolute'
  +'; left:'+L
  +'; top:'+T
  +'; width:'+W
  +'; height:'+H
  +'; clip:rect(0,'+W+','+H+',0)'
  +'; visibility:'+(null==visible || 1==visible ? 'visible':'hidden')
  +(null==zIndex  ? '' : '; z-index:'+zIndex)
  +(null==bgColor ? '' : '; background-color:'+bgColor)
  +'">' + obj1 + '</DIV>';
  touchPNL.style.display='';
 

deletePanel('touchPNL');
document.body.appendChild(touchPNL);
document.getElementById('touchFRM').src="blank.htm";



if (document.addEventListener != null)
{ // e.g. Firefox, Opera, Safari
document.getElementById("touchPNL_parent_div").addEventListener("mouseout", closeMe, true);
document.getElementById("touchPNL_parent_div").addEventListener("mouseover", waitMe, true);
}
else
{ // e.g. Internet Explorer (also would work on Opera)
document.getElementById("touchPNL_parent_div").attachEvent("onmouseout", closeMe);
document.getElementById("touchPNL_parent_div").attachEvent("onmouseover", waitMe);
}

}



function makeCalendarPanel(id,L,T,W,H,bgColor,visible,zIndex,obj1) 
{
 //document.getElementById(id+'_parent_div').innerHTML= '\n<DIV class="dragme" id='+id+' style="position:absolute'
 touchPNL.innerHTML= '\n<DIV id='+id+' style="position:absolute'
  +'; left:'+L
  +'px; top:'+T
  +'px; width:'+W
  +'; height:'+H
  +'; clip:rect(0,'+W+','+H+',0)'
  +'; visibility:'+(null==visible || 1==visible ? 'visible':'hidden')
  +(null==zIndex  ? '' : '; z-index:'+zIndex)
  +(null==bgColor ? '' : '; background-color:'+bgColor)
  +'">' + obj1 + '</DIV>';
  touchPNL.style.display='';
 
//deletePanel('touchPNL');
document.body.appendChild(touchPNL);
}



function makePPMTPanel(id,L,T,W,H,bgColor,visible,zIndex,obj1) 
{
 //document.getElementById(id+'_parent_div').innerHTML= '\n<DIV class="dragme" id='+id+' style="position:absolute'
 touchPNL.innerHTML= '\n<DIV id='+id+' style="position:absolute'
  +'; left:'+L
  +'px; top:'+T
  +'px; width:'+W
  +'; height:'+H
  +'; clip:rect(0,'+W+','+H+',0)'
  +'; visibility:'+(null==visible || 1==visible ? 'visible':'hidden')
  +(null==zIndex  ? '' : '; z-index:'+zIndex)
  +(null==bgColor ? '' : '; background-color:'+bgColor)
  +'">' + obj1 + '</DIV>';
  touchPNL.style.display='';
 
//deletePanel('touchPNL');
document.body.appendChild(touchPNL);
}

function makePPCCPanel(id,L,T,W,H,bgColor,visible,zIndex,obj1) 
{
 //document.getElementById(id+'_parent_div').innerHTML= '\n<DIV class="dragme" id='+id+' style="position:absolute'
 touchPNL.innerHTML= '\n<DIV id='+id+' style="position:absolute'
  +'; left:'+L
  +'px; top:'+T
  +'px; width:'+W
  +'; height:'+H
  +'; clip:rect(0,'+W+','+H+',0)'
  +'; visibility:'+(null==visible || 1==visible ? 'visible':'hidden')
  +(null==zIndex  ? '' : '; z-index:'+zIndex)
  +(null==bgColor ? '' : '; background-color:'+bgColor)
  +'">' + obj1 + '</DIV>';
  touchPNL.style.display='';
 
//deletePanel('touchPNL');
document.body.appendChild(touchPNL);
}

function closeMe()
{panelTimer = setTimeout("deletePanel('touchPNL')",1000);}

function waitMe()
{clearTimeout(panelTimer);}



function deletePanel(id) 
{

ua=navigator.userAgent;
brw=ua.indexOf("MSIE");
if (document.getElementById(id + '_parent_div')!= undefined)
{
  document.getElementById(id + '_parent_div').style.display='none';
  document.getElementById(id + '_parent_div').innerHTML="";
 
 if (brw!=-1)//IE
  {
  document.body.removeChild(touchPNL_parent_div);
  }
}
  
}


//window.onload = function ()
//{markSearchTerms('arkada&#351;,lider,d&#252;r&#252;st');}