function DvBLogin()
{
	URL = '../xml/login.php';
	pars = "login_name="+$('loginName').value+"&login_pwd="+$('loginPwd').value;
	//alert(pars);
	var myAjax = new Ajax.Request(URL,{
       			 	 								 	method:'get',
       			 	 	 								parameters: pars, 
       			 	 	 								onComplete: function(originalRequest)
       			 	 	 														{
       			 	 	 															if(originalRequest.responseText)
       			 	 	 															{
       			 	 	 																alert(originalRequest.responseText);
       			 	 	 															}
       			 	 	 															else
       			 	 	 															{
       			 	 	 																window.location.reload(true);
       			 	 	 															}
       			 	 	 														}
       			 	 	 								});	
}

function DvBLogout()
{
	URL = '../xml/logout.php';
	pars = '';
	var myAjax = new Ajax.Request(URL,{
       			 	 								 	method:'get',
       			 	 	 								parameters: pars, 
       			 	 	 								onComplete: function(originalRequest)
       			 	 	 														{
       			 	 	 															window.location.reload(true);
       			 	 	 														}
       			 	 	 								});	
}

function changePersonalPic(mainTable)
{
 	viewportwidth = window.innerWidth;
 	viewportheight = window.innerHeight	
 	// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight 
 	if (typeof window.innerWidth != 'undefined')
 	{
  	viewportwidth = window.innerWidth;
    viewportheight = window.innerHeight;
 	}
	// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
 	else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth !='undefined' && document.documentElement.clientWidth != 0)
 	{
		viewportwidth = document.documentElement.clientWidth,
		viewportheight = document.documentElement.clientHeight
	}
 	// older versions of IE
 	else
 	{
		viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
		viewportheight = document.getElementsByTagName('body')[0].clientHeight
	}
	//$(divID).setStyle({Height: viewportheight, width: viewportwidth });
	viewportwidth  = Math.ceil(Math.round(viewportwidth / 2) - Math.round($(mainTable).getAttribute("width") / 2));
	viewportheight = Math.ceil(Math.round(viewportheight / 2) - Math.round($(mainTable).getAttribute("height") / 2));
	//Math.round(viewportheight / 4);
	this.popup = $(mainTable);	
	$(mainTable).setStyle({top: viewportheight, left: viewportwidth });
	$(mainTable).show();
	//$(divID).setStyle({top: document.body.scrollTop });	
	//$(divID).appear({ duration: jsduration, from: jsfrom, to: jsto });	
}

function addLink2Pic()
{
	$('showPicLink').src = $('EditPicLink').value;	
	$('PicLink').value = $('EditPicLink').value;
	$('showEditPic').src = "";
	$('EditPicLink').value = "";
	//closepopupDiv('divEditPicLink','divEditPicLinkTable');
	hidePopup('divEditPicLinkTable')
}

function previewLink2Pic()
{
	$('showEditPic').src = $('EditPicLink').value;
}

function EditForm(divID)
{
	$('Edit'+divID).show();
	$(divID).hide();	
}

function ShowForm(divID)
{
	$(divID).show();
	$('Edit'+divID).hide();	
}

function getRegister(id)
{
	var secretCode = $('secretcode1_' + id).value + $('secretcode2_' + id).value + $('secretcode3_' + id).value + $('secretcode4_' + id).value;
	pars = 'pdtCode='+ $('pdtcode' + id).value +'&secretCode='+ secretCode +'&id='+id;
	URL="../xml/register.php";
	connectionAjax(URL,pars,'register'+id);
}

function historyYear(year)
{
	window.location = 'DvBpersonalInfo.php?type=history&page=1&filterDate='+year;
}
