/**
# ######################################################################
# Project:     PHPLinkDirectory: Version 2.1.3
#
# **********************************************************************
# Copyright (C) 2004-2006 NetCreated, Inc. (http://www.netcreated.com/)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
# **********************************************************************
#
# For questions, help, comments, discussion, etc., please join the
# PHP Link Directory Forum http://www.phplinkdirectory.com/forum/
#
# @link           http://www.phplinkdirectory.com/
# @copyright      2004-2007 NetCreated, Inc. (http://www.netcreated.com/)
# @projectManager David DuVal <david@david-duval.com>
# @package        PHPLinkDirectory
# ######################################################################
*/


/* Build confirmation box for link removal */
function link_rm_confirm(msg)
{
   var message = msg.length > 3 ? msg : "Are you sure you want to remove this link?\n Note: links can not be restored after removal!";
   var answer = confirm (message);

   if (!answer)
      return false;

   return true;
}

/* Build confirmation box for category removal */
function categ_rm_confirm(msg)
{
   var message = msg.length > 3 ? msg : "Are you sure you want to remove this category and all it's subcategories?\n Note: categories can not be restored after removal!";
   answer = confirm (message);

   if (!answer)
      return false;

   return true;
}

/* Build confirmation box for user account removal */
function user_rm_confirm(msg)
{
   var message = msg.length > 3 ? msg : "Are you sure you want to remove this user account?\n Note: user accounts can not be restored after removal!";
   answer = confirm (message);

   if (!answer)
      return false;

   return true;
}

/* Build confirmation box for payment listing removal */
function payment_rm_confirm(msg)
{
   var message = msg.length > 3 ? msg : "Are you sure you want to remove this payment?\n Note: payment listings can not be restored after removal!";
   answer = confirm (message);

   if (!answer)
      return false;

   return true;
}

function createXmlHttpObj1()
{
	if ( window.XMLHttpRequest )
		return new XMLHttpRequest();
	else if ( window.ActiveXObject )
		return new ActiveXObject("Microsoft.XMLHTTP");
	else
	{
		alert( 'Please upgrade your browser' );
		return false;
	}
}
function gradient(id, level)
{
	var box = document.getElementById(id);
	box.style.opacity = level;
	box.style.MozOpacity = level;
	box.style.KhtmlOpacity = level;
	box.style.filter = "alpha(opacity=" + level * 100 + ")";
	box.style.display="block";
	return;
}


function fadein(id) 
{
	var level = 0;
	while(level <= 1)
	{
		setTimeout( "gradient('" + id + "'," + level + ")", (level* 1000) + 10);
		level += 0.01;
	}
}
// Open the lightbox
var PX='',PY='';

	function doSomething(e)
    {
		//alert(e);
		//alert($(window).scrollTop());
		var scrheight=eval($(window).scrollTop())+eval($(window).height());
		
		var totheight=((scrheight)-400);
		var scrwidth=($(window).width()-600)/2;
			
		PY=totheight;
		PX=scrwidth;
		//alert(PY);
   }

function openbox1(formtitle, fadin,img_name)
{  //alert(formtitle);alert(fadin);alert(img_name);
	var box1 = document.getElementById('box1'); 
	box1.style.top=PY+"px";
  	box1.style.left=PX+"px";
	
	document.getElementById('sentsucc1').style.display="none";
	document.getElementById('sentsucc').style.display="block";
		
	document.getElementById('filter1').style.display='block';
	document.getElementById('mid').value=fadin;
	document.getElementById('h1').innerHTML="Send "+formtitle+"&nbsp;a Partner Request?";
	
	document.getElementById('h2').innerHTML="<img src='"+img_name+"' width='100px;' height='103px;'   style='border: solid 1px #0E5BDA;' border='0' />";
	document.getElementById('h3').innerHTML="<strong>"+formtitle+"</strong>Send a Partner Request";	
	document.getElementById('h3').innerHTML="<strong>"+formtitle+"</strong> will have to confirm your Partner Request.";
	//User name will have to confirm your request. Please only send this partner request if know him personally.
	
	if(fadin)
	{
		gradient("box1",1);
		fadein("box1");
	}
	else
	{ 	
		box.style.display='block';
	}  	
}

function Open_SendPartnerRequest(formtitle, fadin,img_name,url)
{   //alert(url);alert(fadin);alert(img_name);
	var box1 = document.getElementById('box1p'); 
	box1.style.top=PY+"px";
  	box1.style.left=PX+"px";
	
	document.getElementById('sentsucc1').style.display="none";
	document.getElementById('sentsucc').style.display="block";
		
	document.getElementById('filter1p').style.display='block';
	document.getElementById('mid').value=fadin;
	document.getElementById('h1').innerHTML="Send "+formtitle+"&nbsp;a Partner Request?";
	
	document.getElementById('h2').innerHTML="<img src='"+url+img_name+"' width='100px;' height='103px;'   style='border: solid 1px #1C69E8;' border='0' />";
	document.getElementById('h3').innerHTML="<strong>"+formtitle+"</strong>Send a Partner Request";	
	document.getElementById('h3').innerHTML="<strong>"+formtitle+"</strong> will have to confirm your Partner Request.";
	//User name will have to confirm your request. Please only send this partner request if know him personally.
	
	if(fadin)
	{
		gradient("box1p",1);
		fadein("box1p");
	}
	else
	{ 	
		box.style.display='block';
	}  	
}

function closepopbox1p()
{
   document.getElementById('box1p').style.display='none';
   document.getElementById('filter1p').style.display='none';
   
}
// Close the lightbox
function closepopbox1()
{
   document.getElementById('box1').style.display='none';
   document.getElementById('filter1').style.display='none';
   
}

