// Title: Timestamp picker
// Description: See the demo at url
// URL: http://us.geocities.com/tspicker/
// Script featured on: http://javascriptkit.com/script/script2/timestamp.shtml
// Version: 1.0
// Date: 12-05-2001 (mm-dd-yyyy)
// Author: Denis Gritcyuk <denis@softcomplex.com>; <tspicker@yahoo.com>
// Notes: Permission given to use this script in any kind of applications if
//    header lines are left unchanged. Feel free to contact the author
//    for feature requests and/or donations


function load_message(str_target, str_datetime) {
	
	// html generation (feel free to tune it for your particular application)
	// print calendar header
	var str_buffer = new String (
		"<html>\n"+
		"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=windows-1251\">\n"+
		"<link rel=stylesheet type=text/css href=style/style.css>\n"+
		"<head><title>Календарь</title></head>\n"+
		"<form name=\"sale\" method=\"post\" action=\"include/sale.php\" content=\"text/html; charset=windows-1251\">\n"+
		"<body style=\"background-color: #CDCDCD\">\n"+
		"<table class=\"Button\" cellspacing=\"0\" cellspadding=\"0\" border=\"0\" width=\"100%\" style=\"position:absolute;left:0px;top:0px\">\n"+
		"<tr><td><textarea name=\"message\" style=\"width:400; height:150; \" content=\"text/html; charset=windows-1251\"></textarea>\n</td>\n</tr>\n"+
		"<tr><td align=\"center\" ><input type=\"submit\" name=\"Submit\" value=\"Отправить\" class=Button onclick=\"Javascript:parent.hide_message()\"><input type=\"Submit\" name=\"Close\" value=\"Закрыть\" class=Button onclick=\"Javascript:parent.hide_message()\"></td>\n</tr>\n"+
		"</form>\n"+
		"</td>\n</tr>\n</table>\n"
	);

	
	

	return str_buffer;
}


function show_message(str_target,str_datetime){
	var str=load_message(str_target,str_datetime);
	var iCal2doc = iCal2.document;
	iCal2doc.write(str);
	iCal2doc.close();


	el = document.getElementById(str_target);

	xPos = el.offsetLeft;
	tempEl = el.offsetParent;
	while (tempEl != null) {
		xPos += tempEl.offsetLeft;
		tempEl = tempEl.offsetParent;
	}

	yPos = el.offsetTop;
	tempEl = el.offsetParent;
	while (tempEl != null) {
		yPos += tempEl.offsetTop;
		tempEl = tempEl.offsetParent;
	}

	document.getElementById('iCal2').style.top = 300;
	document.getElementById('iCal2').style.left = 300;

}

function hide_message(){

//	document.getElementById('iCal2').style.left=-500
}



