//###########################################################################################
//###########################################################################################
//###########################################################################################
//###########################################################################################
//#############                                                                                                                                                  #############
//#############                                                                                                                                                  #############
//#############				© Clipart of.com                                                                                                #############
//#############				                                                                                                                       #############
//#############                                                                                                                                                  #############
//###########################################################################################
//###########################################################################################
//###########################################################################################
//###########################################################################################



var now = new Date();	
var now_D = now.getDate();
var now_M = now.getMonth();
var now_Y = now.getYear();








function check_login_1() {
	//alert('Hello');
	if (document.cookie && document.cookie.indexOf('login') > -1)	{
		var info=read_cookie('login');
		//alert(info);
		if (info[2] == 'true'){location.href="http://www.cartoonsof.com/cgi-bin/admin.pl?username="+info[0]+"&password="+info[1];}
		else{location.href="http://www.cartoonsof.com/cgi-bin/admin.pl";}
		}
	return;
}

function check_login(username,password) {
		var info=[username,password]; 
		create_cookie('login', info); 
		//alert(document.cookie);
		location.href="http://www.cartoonsof.com/cgi-bin/admin.pl?do=login&username="+info[0]+"&password="+info[1];
}

function create_cookie(name,value) {
	order = value + "; ";
	var date = new Date();
	date.setTime(date.getTime()+(360*24*60*60*1000));
	var expires = "; expires="+date.toGMTString();
	document.cookie = name+"="+order+expires+"; path=/; domain=.cartoonsof.com;";
	return;
}

function read_cookie(name)	{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
		{
		var c = ca[i];
		while (c.charAt(0)==' ') { c = c.substring(1,c.length);}
		if (c.indexOf(nameEQ) === 0) { return c.substring(nameEQ.length,c.length);}
		}
	return null;
}





function kill_cookie() {
//	alert('Killed the Cookie');

	var name = "login";
	var order = "; ";
	var date = new Date();
	date.setTime(date.getTime()+(-1*24*60*60*1000));
	var expires = "; expires="+date.toGMTString();

	document.cookie = name+"="+order+expires+"; path=/; domain=.cartoonsof.com;";
}



