/*
# Project Name: Link Doctor (LinkDr)
# Project Description: Reciprocal Link Exchange Manager and Automatic, Scheduled Back-link Re-Validator
# Version: 0.6.4
# URL: http://linkdr.net/
# Author: Gavriel Fleischer (info@linkdr.net)
# Copyright: (C) 2006-2010 (See: http://linkdr.net/copyright)
# File name: linkdr.js
# $LastChangedDate: 2010-03-03 10:20:36 +0200 (Wed, 03 Mar 2010) $
*/

function ldr_set_cookie( name, value, expires, path, domain, secure ) {
	// set time, it's in milliseconds
	var today = new Date();
	today.setTime( today.getTime() );

	/*
	if the expires variable is set, make the correct
	expires time, the current script below will set
	it for x number of days, to make it for hours,
	delete * 24, for minutes, delete * 60 * 24
	*/
	if ( expires ) {
		expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date( today.getTime() + (expires) );

	document.cookie = name + "=" +escape( value ) +
		( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
		( ( path ) ? ";path=" + path : "" ) +
		( ( domain ) ? ";domain=" + domain : "" ) +
		( ( secure ) ? ";secure" : "" );
}

function ldr_change_lang(lang, href) {
	ldr_set_cookie("ldr_lang",lang,31);
	if (href && href != "#")
		location.href = href;
	else
		location.reload(true);
}
