init
This commit is contained in:
815
include/asterisk/Asterisk_popup.tpl
Executable file
815
include/asterisk/Asterisk_popup.tpl
Executable file
@@ -0,0 +1,815 @@
|
||||
|
||||
{*
|
||||
|
||||
/**
|
||||
* The contents of this file are subject to the SugarCRM Professional End User
|
||||
* License Agreement ("License") which can be viewed at
|
||||
* http://www.sugarcrm.com/crm/products/sugar-professional-eula.html
|
||||
* By installing or using this file, You have unconditionally agreed to the
|
||||
* terms and conditions of the License, and You may not use this file except in
|
||||
* compliance with the License. Under the terms of the license, You shall not,
|
||||
* among other things: 1) sublicense, resell, rent, lease, redistribute, assign
|
||||
* or otherwise transfer Your rights to the Software, and 2) use the Software
|
||||
* for timesharing or service bureau purposes such as hosting the Software for
|
||||
* commercial gain and/or for the benefit of a third party. Use of the Software
|
||||
* may be subject to applicable fees and any use of the Software without first
|
||||
* paying applicable fees is strictly prohibited. You do not have the right to
|
||||
* remove SugarCRM copyrights from the source code or user interface.
|
||||
*
|
||||
* All copies of the Covered Code must include on each user interface screen:
|
||||
* (i) the "Powered by SugarCRM" logo and
|
||||
* (ii) the SugarCRM copyright notice
|
||||
* in the same form as they appear in the distribution. See full license for
|
||||
* requirements.
|
||||
*
|
||||
* Your Warranty, Limitations of liability and Indemnity are expressly stated
|
||||
* in the License. Please refer to the License for the specific language
|
||||
* governing these rights and limitations under the License. Portions created
|
||||
* by SugarCRM are Copyright (C) 2004-2006 SugarCRM, Inc.; All Rights Reserved.
|
||||
*/
|
||||
|
||||
// $Id$
|
||||
|
||||
*}
|
||||
<!-- BEGIN: main -->
|
||||
<link rel="stylesheet" type="text/css" href="themes/{THEME}/navigation.css?s=4.5.0&c=" />
|
||||
<link rel="stylesheet" type="text/css" href="themes/{THEME}/style.css?s=4.5.0&c=" />
|
||||
<link rel="stylesheet" type="text/css" href="themes/{THEME}/colors.sugar.css?s=4.5.0&c=" />
|
||||
<link rel="stylesheet" type="text/css" href="themes/{THEME}/fonts.normal.css?s=4.5.0&c=" />
|
||||
<link href="themes/{THEME}/colors.sugar.css?s=4.5.0&c=" rel="stylesheet" type="text/css" title="color:sugar" />
|
||||
<link href="themes/{THEME}/colors.blue.css?s=4.5.0&c=" rel="alternate stylesheet" type="text/css" title="color:blue" />
|
||||
<link href="themes/{THEME}/colors.green.css?s=4.5.0&c=" rel="alternate stylesheet" type="text/css" title="color:green" />
|
||||
<link href="themes/{THEME}/colors.purple.css?s=4.5.0&c=" rel="alternate stylesheet" type="text/css" title="color:purple" />
|
||||
<link href="themes/{THEME}/colors.ocher.css?s=4.5.0&c=" rel="alternate stylesheet" type="text/css" title="color:ocher" />
|
||||
|
||||
<link href="themes/{THEME}/fonts.normal.css?s=4.5.0&c=" rel="stylesheet" type="text/css" title="font:normal" />
|
||||
<link href="themes/{THEME}/fonts.larger.css?s=4.5.0&c=" rel="alternate stylesheet" type="text/css" title="font:larger" />
|
||||
<link href="themes/{THEME}/fonts.largest.css?s=4.5.0&c=" rel="alternate stylesheet" type="text/css" title="font:largest" />
|
||||
|
||||
<center><h1>{call_name}</h1></center>
|
||||
|
||||
<hr width="90%">
|
||||
|
||||
<center>
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="90%">
|
||||
<tr>
|
||||
<th colspan="2" class='listViewPaginationTdS1'><h3>Information</h3></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="25%" class="tabDetailViewDL"><slot>Phone Number:</slot></td>
|
||||
<td class="tabDetailViewDF">{call_number}</td>
|
||||
</tr>
|
||||
<!-- BEGIN: account_info_switch -->
|
||||
<tr>
|
||||
<td width="25%" class="tabDetailViewDL"><slot>Account:</slot></td>
|
||||
<td class="tabDetailViewDF">{account_name}</td>
|
||||
</tr>
|
||||
<!-- END: account_info_switch -->
|
||||
<!-- BEGIN: website_switch -->
|
||||
<tr>
|
||||
<td width="25%" class="tabDetailViewDL"><slot>Website:</slot></td>
|
||||
<td class="tabDetailViewDF">{url}</td>
|
||||
</tr>
|
||||
<!-- END: website_switch -->
|
||||
<!-- BEGIN: email_switch -->
|
||||
<tr>
|
||||
<td width="25%" class="tabDetailViewDL"><slot>Email:</slot></td>
|
||||
<td class="tabDetailViewDF">{email}</td>
|
||||
</tr>
|
||||
<!-- END: email_switch -->
|
||||
<!-- BEGIN: addr_switch -->
|
||||
<tr valign="top">
|
||||
<td width="25%" class="tabDetailViewDL"><slot>Address:</slot></td>
|
||||
<td class="tabDetailViewDF">{addrstreet}<br>
|
||||
{addrcity} {addrstate} {addrzip} {addrcountry}
|
||||
</td>
|
||||
</tr>
|
||||
<!-- END: addr_switch -->
|
||||
<!-- BEGIN: billing_addr_switch -->
|
||||
<tr valign="top">
|
||||
<td width="25%" class="tabDetailViewDL"><slot>Billing Address:</slot></td>
|
||||
<td class="tabDetailViewDF">{billingaddrstreet}<br>
|
||||
{billingaddrcity} {billingaddrstate} {billingaddrzip} {billingaddrcountry}
|
||||
</td>
|
||||
</tr>
|
||||
<!-- END: billing_addr_switch -->
|
||||
|
||||
<script type="text/javascript" src="include/asterisk/calendar/e.js"></script>
|
||||
<script type="text/javascript" src="include/asterisk/calendar/d.js"></script>
|
||||
<script type="text/javascript" src="include/asterisk/calendar/homw.js"></script>
|
||||
<script type="text/javascript" src="include/asterisk/calendar/cal.js"></script>
|
||||
|
||||
<div style="position: relative; visibility:hidden; width: 250px; height: 5px; left: -220px; top: 190px; background-color: yellow;">
|
||||
<iframe src="include/asterisk/calendar/calx.html" id="CalFrame" name="CalFrame" style="visibility: hidden; position: relative; z-index: 100;" marginheight="0" marginwidth="0" noresize="" frameborder="0" scrolling="no"></iframe>
|
||||
<script language="javascript" src="include/asterisk/calendar/calx.js"></script>
|
||||
|
||||
<input id="FDate" name="FDate" value="mm/dd/yyyy" type="hidden">
|
||||
</table>
|
||||
<br>
|
||||
<center>
|
||||
<table border="0" cellspacing="0" cellpadding="5" width="90%">
|
||||
<tr>
|
||||
<th align="center">
|
||||
<!-- BEGIN: call_record_switch -->
|
||||
<script language="Javascript">
|
||||
function startRecording(){
|
||||
window.location.href="index.php?module=Contacts&action=AS_Popup&html=Dial&form=Dial&number={call_number}&dialed=0{save_suffix}&start_recording=1";}
|
||||
</script>
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<th align="center"><font color="red">Start Recording:</font></td>
|
||||
</tr><tr>
|
||||
<!--<th align="center"><input type="button" class="button" value=" Start " name="start_recording" id="start_recording" onclick="javascript: startRecording();"></th> -->
|
||||
<th align="center"><input type="button" class="button" value=" Start " name="start_recording" id="start_recording" onclick="javascript: alert('Recording functionality is not currently implemented')"></th>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- END: call_record_switch -->
|
||||
</th>
|
||||
<th align="center">
|
||||
<!-- BEGIN: call_scheduled_switch -->
|
||||
<script>
|
||||
//BEGIN - CREDIT FOR THIS CODE IS GIVEN TO http://www.captain.at/howto-ajax-form-post-request.php
|
||||
var http_request = false;
|
||||
function makePOSTRequest(url, parameters) {
|
||||
http_request = false;
|
||||
if (window.XMLHttpRequest) { // Mozilla, Safari,...
|
||||
http_request = new XMLHttpRequest();
|
||||
if (http_request.overrideMimeType) {
|
||||
// set type accordingly to anticipated content type
|
||||
//http_request.overrideMimeType('text/xml');
|
||||
http_request.overrideMimeType('text/html');
|
||||
}
|
||||
} else if (window.ActiveXObject) { // IE
|
||||
try {
|
||||
http_request = new ActiveXObject("Msxml2.XMLHTTP");
|
||||
} catch (e) {
|
||||
try {
|
||||
http_request = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
||||
if (!http_request) {
|
||||
alert('Cannot create XMLHTTP instance');
|
||||
return false;
|
||||
}
|
||||
|
||||
http_request.onreadystatechange = alertContents;
|
||||
http_request.open('POST', url, true);
|
||||
http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
||||
http_request.setRequestHeader("Content-length", parameters.length);
|
||||
http_request.setRequestHeader("Connection", "close");
|
||||
http_request.send(parameters);
|
||||
}
|
||||
|
||||
function alertContents() {
|
||||
if (http_request.readyState == 4) {
|
||||
if (http_request.status == 200) {
|
||||
//alert(http_request.responseText);
|
||||
result = http_request.responseText;
|
||||
//document.getElementById('myspan').innerHTML = result;
|
||||
} else {
|
||||
alert('There was a problem with the request.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function get(obj) {
|
||||
var poststr = addCall('{call_name}','{call_id}','{type}','{current_user_name}','{current_user_id}');
|
||||
makePOSTRequest('index.php', poststr);
|
||||
}
|
||||
//END - CREDIT FOR THIS CODE IS GIVEN TO http://www.captain.at/howto-ajax-form-post-request.php
|
||||
|
||||
function addCall(call_name, call_id, type, curr_usr_name, curr_usr_id){
|
||||
var date=new Date();
|
||||
var m=date.getMonth();
|
||||
var d=date.getDate();
|
||||
var h=date.getHours();
|
||||
|
||||
var parameters = "module=Calls&name=Call Made To "+call_name+"&direction=Outbound&status=Held&date_start="+date.getFullYear()+"-"+m+"-"+d+"&time_hour_start="+h+"&time_minute_start="+getMinuteTime()+"&duration_hours=0&duration_minutes=15&should_remind=0&assigned_user_name="+curr_usr_name+"&assigned_user_id="+curr_usr_id+"&action=Save";
|
||||
|
||||
if(type=="Contact"){
|
||||
parameters += "&parent_type=Contacts&parent_id="+call_id+"&parent_name="+call_name+"&contact_name="+call_name+"&contact_id="+call_id;
|
||||
}
|
||||
else if(type=="Account"){
|
||||
parameters +="&parent_type=Accounts&parent_id="+call_id+"&parent_name="+call_name;
|
||||
}
|
||||
else if(type=="Lead"){
|
||||
parameters +="&parent_type=Leads&parent_id="+call_id+"&parent_name="+call_name;
|
||||
}
|
||||
|
||||
return parameters;
|
||||
}
|
||||
|
||||
function getMinuteTime(){
|
||||
var date=new Date();
|
||||
if(date.getMinutes()<15)
|
||||
return "0";
|
||||
else if(date.getMinutes()<30)
|
||||
return "15";
|
||||
else if(date.getMinutes()<45)
|
||||
return "30";
|
||||
else
|
||||
return "45";
|
||||
}
|
||||
|
||||
|
||||
function removeScheduled(){
|
||||
document.getElementById('call_scheduled').style.display='none';
|
||||
}
|
||||
</script>
|
||||
<table id="call_scheduled" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<th> Was this call scheduled? </th>
|
||||
</tr><tr>
|
||||
<th><input type="button" class="button" value=" YES " name="call_y_scheduled" id="call_y_scheduled" onclick="javascript:removeScheduled()">   <input type="button" class="button" value=" NO " name="call_n_scheduled" id="call_n_scheduled" onclick="javascript:get(this.parentNode);removeScheduled();"></th>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- END: call_scheduled_switch -->
|
||||
</th>
|
||||
</tr>
|
||||
</table>
|
||||
<!--
|
||||
================================================================================================================================================
|
||||
DISPLAY CALL INFORMATION ABOVE
|
||||
|
||||
QUICK CREATE ABILITY BELOW
|
||||
================================================================================================================================================
|
||||
-->
|
||||
|
||||
<script language="javascript">
|
||||
function show_hide_toggle(elementId, width, height){
|
||||
hide_others(elementId);
|
||||
if (document.getElementById && !document.all) {
|
||||
obj = getObj(elementId);
|
||||
if(obj.style.display == 'none'){
|
||||
resizeWindow(width, height);
|
||||
obj.style.display = '';
|
||||
}
|
||||
else{
|
||||
resizeWindow('550','350');
|
||||
obj.style.display = 'none';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function resizeWindow(width, height){
|
||||
window.resizeTo(width, height);
|
||||
}
|
||||
|
||||
function hide_others(elementId){
|
||||
hideStatus();
|
||||
if(elementId=='div_quickCreateCall'){
|
||||
obj=getObj('div_quickCreateTask');
|
||||
obj.style.display = 'none';
|
||||
obj=getObj('div_quickCreateNote');
|
||||
obj.style.display = 'none';
|
||||
obj=getObj('div_quickCreateMeeting');
|
||||
obj.style.display = 'none';
|
||||
}
|
||||
if(elementId=='div_quickCreateMeeting'){
|
||||
obj=getObj('div_quickCreateTask');
|
||||
obj.style.display = 'none';
|
||||
obj=getObj('div_quickCreateNote');
|
||||
obj.style.display = 'none';
|
||||
obj=getObj('div_quickCreateCall');
|
||||
obj.style.display = 'none';
|
||||
}
|
||||
else if (elementId=='div_quickCreateTask'){
|
||||
obj=getObj('div_quickCreateCall');
|
||||
obj.style.display = 'none';
|
||||
obj=getObj('div_quickCreateNote');
|
||||
obj.style.display = 'none';
|
||||
obj=getObj('div_quickCreateMeeting');
|
||||
obj.style.display = 'none';
|
||||
}
|
||||
else if (elementId=='div_quickCreateNote'){
|
||||
obj=getObj('div_quickCreateTask');
|
||||
obj.style.display = 'none';
|
||||
obj=getObj('div_quickCreateMeeting');
|
||||
obj.style.display = 'none';
|
||||
obj=getObj('div_quickCreateCall');
|
||||
obj.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
function hideStatus(){
|
||||
MeetingStatus=getObj('div_quickCreateMeetingStatus');
|
||||
CallStatus=getObj('div_quickCreateCallStatus');
|
||||
TaskStatus=getObj('div_quickCreateTaskStatus');
|
||||
NoteStatus=getObj('div_quickCreateNoteStatus');
|
||||
|
||||
MeetingStatus.style.display = "none";
|
||||
CallStatus.style.display = "none";
|
||||
TaskStatus.style.display = "none";
|
||||
NoteStatus.style.display = "none";
|
||||
|
||||
}
|
||||
|
||||
function getObj(elementId){
|
||||
return document.getElementById(elementId);
|
||||
}
|
||||
|
||||
function quickCreateMeeting(){
|
||||
var fName = document.form_quickCreateMeeting.elements['name'].value;
|
||||
var fStatus = document.form_quickCreateMeeting.elements['status'].value;
|
||||
var fStartDate = document.form_quickCreateMeeting.elements['fdt'].value;
|
||||
var fStartHour = document.form_quickCreateMeeting.elements['date_start_time_hour'].options[document.form_quickCreateMeeting.elements['date_start_time_hour'].selectedIndex].value;
|
||||
var fStartMinute = document.form_quickCreateMeeting.elements['date_start_time_minute'].options[document.form_quickCreateMeeting.elements['date_start_time_minute'].selectedIndex].value;
|
||||
var fDescription = document.form_quickCreateMeeting.elements['description'].value;
|
||||
|
||||
if(fName == "")
|
||||
{
|
||||
alert("Name field is required");
|
||||
return;
|
||||
}
|
||||
|
||||
if(fStartDate == "")
|
||||
{
|
||||
alert("Date field is required");
|
||||
return;
|
||||
}
|
||||
|
||||
var parameters = "module=Meetings&name="+fName+"&status="+fStatus+"&date_start="+fStartDate+" "+fStartHour+":"+fStartMinute+"&description="+fDescription+"&reminder_checked=1&reminder_time=600&assigned_user_name={current_user_name}&assigned_user_id={current_user_id}&action=Save";
|
||||
|
||||
if("{type}"=="Contact"){
|
||||
parameters += "&parent_type=Contacts&parent_id={call_id}";
|
||||
}
|
||||
else if("{type}"=="Account"){
|
||||
parameters +="&parent_type=Accounts&parent_id={call_id}&parent_name={call_name}";
|
||||
}
|
||||
else if("{type}"=="Lead"){
|
||||
parameters +="&parent_type=Leads&parent_id={call_id}&parent_name={call_name}";
|
||||
}
|
||||
makePOSTRequest('index.php',parameters);
|
||||
|
||||
document.form_quickCreateMeeting.elements['name'].value = "";
|
||||
todayDate(document.form_quickCreateMeeting.elements['fdt']);
|
||||
//document.form_quickCreateMeeting.elements['fdt'].value = "";
|
||||
document.form_quickCreateMeeting.elements['description'].value = "";
|
||||
setHourTime(document.form_quickCreateMeeting.elements['date_start_time_hour']);
|
||||
setMinuteTime(document.form_quickCreateMeeting.elements['date_start_time_minute']);
|
||||
|
||||
show_hide_toggle('div_quickCreateMeeting', '500', '575');
|
||||
MeetingStatus=getObj('div_quickCreateMeetingStatus');
|
||||
MeetingStatus.style.display='';
|
||||
|
||||
}
|
||||
|
||||
function quickCreateCall(){
|
||||
var fName = document.form_quickCreateCall.elements['name'].value;
|
||||
var fDirection = document.form_quickCreateCall.elements['direction'].options[document.form_quickCreateCall.elements['direction'].selectedIndex].value;
|
||||
var fStatus = document.form_quickCreateCall.elements['status'].value;
|
||||
var fStartDate = document.form_quickCreateCall.elements['fdt'].value;
|
||||
var fStartHour = document.form_quickCreateCall.elements['date_start_time_hour'].options[document.form_quickCreateCall.elements['date_start_time_hour'].selectedIndex].value;
|
||||
var fStartMinute = document.form_quickCreateCall.elements['date_start_time_minute'].options[document.form_quickCreateCall.elements['date_start_time_minute'].selectedIndex].value;
|
||||
var fDescription = document.form_quickCreateCall.elements['description'].value;
|
||||
|
||||
if(fName == "")
|
||||
{
|
||||
alert("Subject field is required");
|
||||
return;
|
||||
}
|
||||
if(fStartDate == "")
|
||||
{
|
||||
alert("Date field is required");
|
||||
return;
|
||||
}
|
||||
|
||||
var parameters = "module=Calls&name="+fName+"&direction="+fDirection+"&status="+fStatus+"&date_start="+fStartDate+" "+fStartHour+":"+fStartMinute+"&description="+fDescription+"&duration_hours=0&duration_minutes=15&should_remind=0&assigned_user_name={current_user_name}&assigned_user_id={current_user_id}&action=Save";
|
||||
|
||||
if("{type}"=="Contact"){
|
||||
parameters += "&parent_type=Contacts&parent_id={call_id}";
|
||||
}
|
||||
else if("{type}"=="Account"){
|
||||
parameters +="&parent_type=Accounts&parent_id={call_id}&parent_name={call_name}";
|
||||
}
|
||||
else if("{type}"=="Lead"){
|
||||
parameters +="&parent_type=Leads&parent_id={call_id}&parent_name={call_name}";
|
||||
}
|
||||
makePOSTRequest('index.php',parameters);
|
||||
|
||||
document.form_quickCreateCall.elements['name'].value = "";
|
||||
todayDate(document.form_quickCreateCall.elements['fdt']);
|
||||
//document.form_quickCreateCall.elements['fdt'].value = "";
|
||||
document.form_quickCreateCall.elements['description'].value = "";
|
||||
setHourTime(document.form_quickCreateCall.elements['date_start_time_hour']);
|
||||
setMinuteTime(document.form_quickCreateCall.elements['date_start_time_minute']);
|
||||
|
||||
show_hide_toggle('div_quickCreateCall', '500', '575');
|
||||
CallStatus=getObj('div_quickCreateCallStatus');
|
||||
CallStatus.style.display='';
|
||||
}
|
||||
|
||||
function quickCreateTask(){
|
||||
var fName = document.form_quickCreateTask.elements['name'].value;
|
||||
var fPriority = document.form_quickCreateTask.elements['priority'].value;
|
||||
var fDateDue = document.form_quickCreateTask.elements['fdt'].value;
|
||||
|
||||
if(fName == "")
|
||||
{
|
||||
alert("Subject field is required");
|
||||
return;
|
||||
}
|
||||
|
||||
var parameters = "module=Tasks&name="+fName+"&priority="+fPriority+"&date_due="+fDateDue+"&status=Not Started"+"&assigned_user_name={current_user_name}&assigned_user_id={current_user_id}&action=Save";
|
||||
|
||||
if("{type}"=="Contact"){
|
||||
parameters += "&parent_type=Accounts&parent_id={account_id}&parent_name={account_name}&contact_name={call_name}&contact_id={call_id}";
|
||||
}
|
||||
else if("{type}"=="Account"){
|
||||
parameters +="&parent_type=Accounts&parent_id={call_id}&parent_name={call_name}";
|
||||
}
|
||||
else if("{type}"=="Lead"){
|
||||
parameters +="&parent_type=Leads&parent_id={call_id}&parent_name={call_name}";
|
||||
}
|
||||
makePOSTRequest('index.php', parameters);
|
||||
|
||||
document.form_quickCreateTask.elements['name'].value = "";
|
||||
document.form_quickCreateTask.elements['fdt'].value = "";
|
||||
|
||||
show_hide_toggle('div_quickCreateTask', '500', '575');
|
||||
TaskStatus=getObj('div_quickCreateTaskStatus');
|
||||
TaskStatus.style.display='';
|
||||
}
|
||||
|
||||
function quickCreateNote(){
|
||||
var fName = document.form_quickCreateNote.elements['name'].value;
|
||||
var fDescription = document.form_quickCreateNote.elements['description'].value;
|
||||
|
||||
if(fName == "")
|
||||
{
|
||||
alert("Subject field required");
|
||||
return;
|
||||
}
|
||||
|
||||
var parameters = "module=Notes&name="+fName+"&description="+fDescription+"&assigned_user_name={current_user_name}&assigned_user_id={current_user_id}&action=Save";
|
||||
if("{type}"=="Contact"){
|
||||
parameters += "&parent_type=Accounts&parent_id={account_id}&parent_name={account_name}&contact_name={call_name}&contact_id={call_id}";
|
||||
}
|
||||
else if("{type}"=="Account"){
|
||||
parameters +="&parent_type=Accounts&parent_id={call_id}&parent_name={call_name}";
|
||||
}
|
||||
else if("{type}"=="Lead"){
|
||||
parameters +="&parent_type=Leads&parent_id={call_id}&parent_name={call_name}";
|
||||
}
|
||||
makePOSTRequest('index.php',parameters);
|
||||
|
||||
document.form_quickCreateNote.elements['name'].value = "";
|
||||
document.form_quickCreateNote.elements['description'].value = "";
|
||||
|
||||
show_hide_toggle('div_quickCreateNote', '500', '575');
|
||||
NoteStatus=getObj('div_quickCreateNoteStatus');
|
||||
NoteStatus.style.display='';
|
||||
}
|
||||
|
||||
function todayDate(obj){
|
||||
var myDate = new Date();
|
||||
curr_month = myDate.getMonth() + 1 + '';//to convert to string
|
||||
if(curr_month.length==1){
|
||||
curr_month = "0"+curr_month;
|
||||
}
|
||||
curr_day = myDate.getDate()+'';//to convert to string
|
||||
if(curr_day.length==1){
|
||||
curr_day = "0"+curr_day;
|
||||
}
|
||||
curr_year = myDate.getFullYear();
|
||||
renderDate = curr_month+"/"+curr_day+"/"+curr_year;
|
||||
obj.value = renderDate;
|
||||
}
|
||||
|
||||
function setMinuteTime(obj){
|
||||
var minuteTime = getMinuteTime();
|
||||
if (minuteTime == "00"){
|
||||
obj.selectedIndex = 0;
|
||||
}
|
||||
else if (minuteTime == "15"){
|
||||
obj.selectedIndex = 1;
|
||||
}
|
||||
else if (minuteTime == "30"){
|
||||
obj.selectedIndex = 2;
|
||||
}
|
||||
else {
|
||||
obj.selectedIndex = 3;
|
||||
}
|
||||
}
|
||||
|
||||
function setHourTime(obj){
|
||||
var date = new Date();
|
||||
h = date.getHours();
|
||||
obj.selectedIndex = h;
|
||||
}
|
||||
</script>
|
||||
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="leftColumnModuleHead">
|
||||
<tr>
|
||||
<th width="100%" class="leftColumnModuleName"> </th>
|
||||
</tr>
|
||||
</table>
|
||||
<!--
|
||||
================================================================================================================================================
|
||||
|
||||
QUICK CREATE BUTTONS
|
||||
|
||||
================================================================================================================================================
|
||||
-->
|
||||
|
||||
<br>
|
||||
<center>
|
||||
|
||||
<table width="70%" cellspacing="5">
|
||||
<tr align="center">
|
||||
<td>
|
||||
<input title="QuickMeeting [Alt+M]" accessKey="M" class="button" onclick="show_hide_toggle('div_quickCreateMeeting', '550', '575');" type="submit" name="button" value="QuickMeeting">
|
||||
<input title="QuickCall [Alt+M]" accessKey="M" class="button" onclick="show_hide_toggle('div_quickCreateCall', '550', '575');" type="submit" name="button" value="QuickCall">
|
||||
<input title="QuickTask [Alt+T]" accessKey="T" class="button" onclick="show_hide_toggle('div_quickCreateTask', '550', '575');" type="submit" name="button" value="QuickTask">
|
||||
<input title="QuickNote [Alt+N]" accessKey="N" class="button" onclick="show_hide_toggle('div_quickCreateNote', '550', '575');" type="submit" name="button" value="QuickNote">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div id="div_quickCreateMeetingStatus" style="display:none"><font color="red" size="2"><b>Quick Meeting Saved</b></font></div>
|
||||
<div id="div_quickCreateCallStatus" style="display:none"><font color="red" size="2"><b>Quick Call Saved</b></font></div>
|
||||
<div id="div_quickCreateTaskStatus" style="display:none"><font color="red" size="2"><b>Quick Task Saved</b></font></div>
|
||||
<div id="div_quickCreateNoteStatus" style="display:none"><font color="red" size="2"><b>Quick Note Saved</b></font></div>
|
||||
|
||||
</center>
|
||||
|
||||
<!--
|
||||
================================================================================================================================================
|
||||
|
||||
QUICK CREATE MEETING
|
||||
|
||||
================================================================================================================================================
|
||||
-->
|
||||
<div id="div_quickCreateMeeting" style="display:none">
|
||||
<form id="form_quickCreateMeeting" name="form_quickCreateMeeting">
|
||||
<table width="50%" border="0" cellspacing="1" cellpadding="0" class="none">
|
||||
<tr>
|
||||
<td valign="top" width='25%' class='tabEditViewDF' NOWRAP>
|
||||
Subject: <span class="required">*</span>
|
||||
<br>
|
||||
<input type='text' name='name' id='name' size='20' maxlength='50' value='' title='' tabindex='0' >
|
||||
</td>
|
||||
<td valign="top" width='75%' class='tabEditViewDF' NOWRAP>
|
||||
Status: <span class="required">*</span>
|
||||
<br>
|
||||
<select name="status" id="status" title='' tabindex="0" >
|
||||
<option label="Planned" value="Planned">Planned</option>
|
||||
<option label="Held" value="Held">Held</option>
|
||||
<option label="Not Held" value="Not Held">Not Held</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<td valign="top" width='75%' class='tabEditViewDF' colspan="2" NOWRAP> Start Date & Time: <span class="required">*</span>
|
||||
<br>
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr valign="middle">
|
||||
<td nowrap>
|
||||
|
||||
<input id="fdt" name="fdt" value="" size="10" maxlength="13" class="textfield" onblur="Rem(this);UpdDt(this);" onclick="event.cancelBubble=true;SC(this);" onfocus="SC(this);" type="text">
|
||||
|
||||
<select id="date_start_time_hour" name="date_start_time_hour">
|
||||
<option label="00" value="00">00</option>
|
||||
<option label="01" value="01">01</option>
|
||||
<option label="02" value="02">02</option>
|
||||
<option label="03" value="03">03</option>
|
||||
<option label="04" value="04">04</option>
|
||||
<option label="05" value="05">05</option>
|
||||
<option label="06" value="06">06</option>
|
||||
<option label="07" value="07">07</option>
|
||||
<option label="08" value="08">08</option>
|
||||
<option label="09" value="09">09</option>
|
||||
<option label="10" value="10">10</option>
|
||||
<option label="11" value="11">11</option>
|
||||
<option label="12" value="12">12</option>
|
||||
<option label="13" value="13">13</option>
|
||||
<option label="14" value="14">14</option>
|
||||
<option label="15" value="15">15</option>
|
||||
<option label="16" value="16">16</option>
|
||||
<option label="17" value="17">17</option>
|
||||
<option label="18" value="18">18</option>
|
||||
<option label="19" value="19">19</option>
|
||||
<option label="20" value="20">20</option>
|
||||
<option label="21" value="21">21</option>
|
||||
<option label="22" value="22">22</option>
|
||||
<option label="23" value="23">23</option>
|
||||
</select> :
|
||||
<select id="date_start_time_minute" name="date_start_time_minute">
|
||||
<option label="00" value="00">00</option>
|
||||
<option label="15" value="15">15</option>
|
||||
<option label="30" value="30">30</option>
|
||||
<option label="45" value="45">45</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<td valign="top" width='75%' class='tabEditViewDF' colspan="2" NOWRAP>
|
||||
Description:
|
||||
<br>
|
||||
<textarea id="description" name="description" rows="3" cols="40" title='' tabindex="0"></textarea>
|
||||
</tr>
|
||||
</table>
|
||||
<p>
|
||||
<div style="padding-top: 2px">
|
||||
<input title="Save [Alt+S]" accessKey="S" class="button" onclick="quickCreateMeeting()" type="button" name="button" value="Save">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
================================================================================================================================================
|
||||
|
||||
QUICK CREATE CALL
|
||||
|
||||
================================================================================================================================================
|
||||
-->
|
||||
<div id="div_quickCreateCall" style="display:none">
|
||||
<form id="form_quickCreateCall" name="form_quickCreateCall">
|
||||
<table width="50%" border="0" cellspacing="1" cellpadding="0" class="none">
|
||||
<tr>
|
||||
<td valign="top" width='25%' class='tabEditViewDF' NOWRAP>
|
||||
Subject: <span class="required">*</span>
|
||||
<br>
|
||||
<input type='text' name='name' id='name' size='20' maxlength='50' value='' title='' tabindex='0' >
|
||||
</td>
|
||||
<td valign="top" width='75%' class='tabEditViewDF' NOWRAP>
|
||||
Status: <span class="required">*</span>
|
||||
<br>
|
||||
<select name="status" id="status" title='' tabindex="0" >
|
||||
<option label="Planned" value="Planned">Planned</option>
|
||||
<option label="Held" value="Held">Held</option>
|
||||
<option label="Not Held" value="Not Held">Not Held</option>
|
||||
</select>
|
||||
<select name="direction" id="direction" title='' tabindex="0" >
|
||||
<option label="Inbound" value="Inbound">Inbound</option>
|
||||
<option label="Outbound" value="Outbound">Outbound</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<td valign="top" width='75%' class='tabEditViewDF' colspan="2" NOWRAP> Start Date & Time: <span class="required">*</span>
|
||||
<br>
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr valign="middle">
|
||||
<td nowrap>
|
||||
|
||||
|
||||
<input id="fdt" name="fdt" value="" size="10" maxlength="13" class="textfield" onblur="Rem(this);UpdDt(this);" onclick="event.cancelBubble=true;SC(this);" onfocus="SC(this);" type="text">
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="date_start_time_hour" name="date_start_time_hour">
|
||||
<option label="00" value="00">00</option>
|
||||
<option label="01" value="01">01</option>
|
||||
<option label="02" value="02">02</option>
|
||||
<option label="03" value="03">03</option>
|
||||
<option label="04" value="04">04</option>
|
||||
<option label="05" value="05">05</option>
|
||||
<option label="06" value="06">06</option>
|
||||
<option label="07" value="07">07</option>
|
||||
<option label="08" value="08">08</option>
|
||||
<option label="09" value="09">09</option>
|
||||
<option label="10" value="10">10</option>
|
||||
<option label="11" value="11">11</option>
|
||||
<option label="12" value="12">12</option>
|
||||
<option label="13" value="13">13</option>
|
||||
<option label="14" value="14">14</option>
|
||||
<option label="15" value="15">15</option>
|
||||
<option label="16" value="16">16</option>
|
||||
<option label="17" value="17">17</option>
|
||||
<option label="18" value="18">18</option>
|
||||
<option label="19" value="19">19</option>
|
||||
<option label="20" value="20">20</option>
|
||||
<option label="21" value="21">21</option>
|
||||
<option label="22" value="22">22</option>
|
||||
<option label="23" value="23">23</option>
|
||||
</select> :
|
||||
<select id="date_start_time_minute" name="date_start_time_minute">
|
||||
<option label="00" value="00">00</option>
|
||||
<option label="15" value="15">15</option>
|
||||
<option label="30" value="30">30</option>
|
||||
<option label="45" value="45">45</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<td valign="top" width='75%' class='tabEditViewDF' colspan="2" NOWRAP>
|
||||
Description:
|
||||
<br>
|
||||
<textarea id="description" name="description" rows="3" cols="40" title='' tabindex="0"></textarea>
|
||||
</tr>
|
||||
</table>
|
||||
<p>
|
||||
<div style="padding-top: 2px">
|
||||
<input title="Save [Alt+S]" accessKey="S" class="button" onclick="quickCreateCall()" type="button" name="button" value="Save">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
================================================================================================================================================
|
||||
|
||||
QUICK CREATE TASK
|
||||
|
||||
================================================================================================================================================
|
||||
-->
|
||||
<div id="div_quickCreateTask" style="display:none">
|
||||
<form id="form_quickCreateTask" name="form_quickCreateTask">
|
||||
<table width="50%" cellpadding="3" cellspacing="0" border="0"><tr><td align="left">
|
||||
|
||||
<table width="100%" cellspacing="0" cellpadding="0" class='tabDetailView' id='tabFormPagination'>
|
||||
</table>
|
||||
|
||||
<div id="DEFAULT">
|
||||
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="none">
|
||||
<tr>
|
||||
<td valign="top" width='25%' class='tabEditViewDF' NOWRAP>
|
||||
Subject: <span class="required">*</span>
|
||||
<br>
|
||||
<input type='text' name='name' id='name' size='20' maxlength='50' value='' title='' tabindex='0' >
|
||||
</td>
|
||||
<td valign="top" width='75%' class='tabEditViewDF' NOWRAP>
|
||||
Priority: <span class="required">*</span>
|
||||
<br>
|
||||
<select name="priority" id="priority" title='' tabindex="0" >
|
||||
<option label="High" value="High">High</option>
|
||||
<option label="Medium" value="Medium">Medium</option>
|
||||
<option label="Low" value="Low">Low</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<td valign="top" width='75%' class='tabEditViewDF' colspan="2" NOWRAP> Due Date:
|
||||
<br>
|
||||
|
||||
<input id="fdt" name="fdt" value="" size="10" maxlength="13" class="textfield" onblur="Rem(this);UpdDt(this);" onclick="event.cancelBubble=true;SC(this);" onfocus="SC(this);" type="text">
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<p>
|
||||
<div style="padding-top: 2px">
|
||||
<input title="Save [Alt+S]" accessKey="S" class="button" onclick="quickCreateTask()" type="button" name="button" value="Save">
|
||||
</div>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
================================================================================================================================================
|
||||
|
||||
QUICK CREATE NOTE
|
||||
|
||||
================================================================================================================================================
|
||||
!-->
|
||||
<div id="div_quickCreateNote" style="display:none">
|
||||
<form id="form_quickCreateNote" name="form_quickCreateNote">
|
||||
|
||||
<table width="50%" cellspacing="0" cellpadding="0" class='tabDetailView' id='tabFormPagination'>
|
||||
</table>
|
||||
|
||||
<div id="DEFAULT">
|
||||
<table width="50%" border="0" cellspacing="1" cellpadding="0" class="none">
|
||||
<tr>
|
||||
<td valign="top" width='75%' class='tabEditViewDF' NOWRAP>Note Subject:<span class="required">*</span>
|
||||
<br>
|
||||
<input type='text' name='name' id='name' size='35' maxlength='255' value='' title='' tabindex='0' >
|
||||
</td>
|
||||
</tr><!--<tr>
|
||||
<td valign="top" width='75%' class='tabEditViewDF' NOWRAP>Attachment:
|
||||
<br>
|
||||
<input id="filename" name="filename" type="file" title='' size="35" maxlength='255' value="">
|
||||
</td>
|
||||
</tr>--><tr>
|
||||
<td valign="top" width='75%' class='tabEditViewDF' NOWRAP>Note:
|
||||
<br>
|
||||
<textarea id="description" name="description" rows="3" cols="35" title='' tabindex="0"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<div style="padding-top: 2px">
|
||||
<input title="Save [Alt+S]" accessKey="S" class="button" onclick="quickCreateNote()" type="button" name="button" value="Save">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
todayDate(document.form_quickCreateMeeting.elements['fdt']);
|
||||
todayDate(document.form_quickCreateCall.elements['fdt']);
|
||||
|
||||
setHourTime(document.form_quickCreateMeeting.elements['date_start_time_hour']);
|
||||
setHourTime(document.form_quickCreateCall.elements['date_start_time_hour']);
|
||||
|
||||
setMinuteTime(document.form_quickCreateMeeting.elements['date_start_time_minute']);
|
||||
setMinuteTime(document.form_quickCreateCall.elements['date_start_time_minute']);
|
||||
</script>
|
||||
<!-- END: main -->
|
||||
28
include/asterisk/ast_metadata.php
Executable file
28
include/asterisk/ast_metadata.php
Executable file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
function astPatch($ast_number, $ast_id, $ast_location)
|
||||
{
|
||||
require_once('data/SugarBean.php');
|
||||
require_once('include/asterisk/asterisk_inc.php');
|
||||
|
||||
global $system_config;
|
||||
global $current_user;
|
||||
|
||||
if(isset($system_config->settings['system_asterisk_on']) && $system_config->settings['system_asterisk_on'] == 1 && $current_user->asterisk_extension !="")
|
||||
{
|
||||
$ast_links = new asterisk_popup_link($ast_location, $ast_id);
|
||||
/*
|
||||
* Check which type of link is selected and apply code
|
||||
*/
|
||||
|
||||
if(isset($system_config->settings['system_asterisk_phoneicon_on']) && $system_config->settings['system_asterisk_phoneicon_on'] == 1 )
|
||||
return '<script type="text/javascript"> var number = "'.$ast_number.'"; if(number.length > 2) document.write("'.addslashes($ast_links->create_icon_link($ast_number)).'");</script>';
|
||||
|
||||
|
||||
else
|
||||
return '<script type="text/javascript"> var number = "'.$ast_number.'"; if(number.length > 2) document.write("'.addslashes($ast_links->create_phone_link($ast_number)).'");</script>';
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
136
include/asterisk/asterisk_inc.php
Executable file
136
include/asterisk/asterisk_inc.php
Executable file
@@ -0,0 +1,136 @@
|
||||
<?php
|
||||
|
||||
class asterisk_popup_link
|
||||
{
|
||||
var $popup_height;
|
||||
var $popup_width;
|
||||
var $addr_suffix;
|
||||
var $cur_user;
|
||||
var $focus;
|
||||
|
||||
var $type;
|
||||
var $record;
|
||||
var $theme;
|
||||
|
||||
function asterisk_popup_link($type, $id, $height="330", $width="450")
|
||||
{
|
||||
$this->popup_height="350";
|
||||
$this->popup_width="550";
|
||||
$this->setRecordType($type);
|
||||
$this->setRecord($id);
|
||||
$this->addr_suffix="&type=".$this->type."&record=".$this->record;
|
||||
}
|
||||
|
||||
function setRecord($id)
|
||||
{
|
||||
$this->record = $id;
|
||||
}
|
||||
|
||||
function setRecordType($id_type)
|
||||
{
|
||||
$this->type = $id_type;
|
||||
}
|
||||
|
||||
function Addr_String($string)
|
||||
{
|
||||
$this->addr_suffix=$this->addr_suffix.$string;
|
||||
}
|
||||
|
||||
function getAddr()
|
||||
{
|
||||
return $this->addr_suffix;
|
||||
}
|
||||
|
||||
function getLayoutDefs(){
|
||||
return array(
|
||||
|
||||
// list of what Subpanels to show in the DetailView
|
||||
|
||||
'subpanel_setup' => array(
|
||||
'activities' => array(
|
||||
'order' => 10,
|
||||
'sort_order' => 'desc',
|
||||
'sort_by' => 'date_start',
|
||||
'title_key' => 'LBL_ACTIVITIES_SUBPANEL_TITLE',
|
||||
'type' => 'collection',
|
||||
'subpanel_name' => 'activities', //this values is not associated with a physical file.
|
||||
'module'=>'Activities',
|
||||
|
||||
'top_buttons' => array(
|
||||
array('widget_class' => 'SubPanelTopCreateTaskButton'),
|
||||
array('widget_class' => 'SubPanelTopScheduleMeetingButton'),
|
||||
array('widget_class' => 'SubPanelTopScheduleCallButton'),
|
||||
//array('widget_class' =>'SubPanelTopCreateNoteButton'),
|
||||
//array('widget_class' => 'SubPanelTopComposeEmailButton'),
|
||||
),
|
||||
'collection_list' => array(
|
||||
'meetings' => array(
|
||||
'module' => 'Meetings',
|
||||
'subpanel_name' => 'ForActivities',
|
||||
'get_subpanel_data' => 'meetings',
|
||||
),
|
||||
)
|
||||
),
|
||||
|
||||
'history' => array(
|
||||
'order' => 20,
|
||||
'sort_order' => 'desc',
|
||||
'sort_by' => 'date_modified',
|
||||
'title_key' => 'LBL_HISTORY_SUBPANEL_TITLE',
|
||||
'type' => 'collection',
|
||||
'subpanel_name' => 'history', //this values is not associated with a physical file.
|
||||
'module'=>'History',
|
||||
|
||||
'top_buttons' => array(
|
||||
array('widget_class' => 'SubPanelTopCreateNoteButton'),
|
||||
//array('widget_class' => 'SubPanelTopArchiveEmailButton'),
|
||||
//array('widget_class' => 'SubPanelTopSummaryButton'),
|
||||
),
|
||||
|
||||
'collection_list' => array(
|
||||
'meetings' => array(
|
||||
'module' => 'Meetings',
|
||||
'subpanel_name' => 'ForHistory',
|
||||
'get_subpanel_data' => 'meetings',
|
||||
),
|
||||
'tasks' => array(
|
||||
'module' => 'Tasks',
|
||||
'subpanel_name' => 'ForHistory',
|
||||
'get_subpanel_data' => 'tasks',
|
||||
),
|
||||
'calls' => array(
|
||||
'module' => 'Calls',
|
||||
'subpanel_name' => 'ForHistory',
|
||||
'get_subpanel_data' => 'calls',
|
||||
),
|
||||
'notes' => array(
|
||||
'module' => 'Notes',
|
||||
'subpanel_name' => 'ForHistory',
|
||||
'get_subpanel_data' => 'notes',
|
||||
),
|
||||
'emails' => array(
|
||||
'module' => 'Emails',
|
||||
'subpanel_name' => 'ForHistory',
|
||||
'get_subpanel_data' => 'emails',
|
||||
),
|
||||
)
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
function create_icon_link($phone_num)
|
||||
{
|
||||
return "<a href='#' onclick='window.open(\"index.php?module=Contacts&action=AS_Popup&html=Dial&form=Dial&number=".$phone_num."&to_pdf=1&dialed=1&type=".$this->type."&record=".$this->record."\",\"Dialing\",\"width=".$this->popup_width.",height=".$this->popup_height.",resizable=0,scrollbars=1\")'><img src=\"include/images/phone_icon.png\" width=10 height=10 border=0></a><img src=\"include/images/spacer.png\" width=5 border=0>".$phone_num;
|
||||
}
|
||||
|
||||
function create_phone_link($phone_num)
|
||||
{
|
||||
return "<img src=\"include/images/spacer.png\" width=5 border=0><a href='#' onclick='window.open(\"index.php?module=Contacts&action=AS_Popup&html=Dial&form=Dial&number=".$phone_num."&to_pdf=1&dialed=1&type=".$this->type."&record=".$this->record."\",\"Dialing\",\"width=".$this->popup_width.",height=".$this->popup_height.",resizable=0,scrollbars=1\")'>".$phone_num."</a>";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
////////END ASTERISK PATCH////////
|
||||
|
||||
?>
|
||||
75
include/asterisk/calendar/cal.js
Executable file
75
include/asterisk/calendar/cal.js
Executable file
@@ -0,0 +1,75 @@
|
||||
function GetDowStart() {return 0;}function GetDateFmt() {return "mmddyy";}function GetDateSep() {return "/";}
|
||||
function ShowCalendar(eP,eD,eDP,dmin,dmax)
|
||||
{
|
||||
SCal(eP,eD,eDP,dmin,dmax);
|
||||
}
|
||||
function ShowCalSimp(fm,eD,eDP,dmin,dmax){
|
||||
if(!dmin)dmin='3/1/2005';if(!dmax)dmax='1/25/2006';
|
||||
if(fm){SetNextFocus(objNext(fm,eD));SetPrevFocus(objPrev(fm,eD));}
|
||||
SCal(eD,eD,eDP,dmin,dmax);
|
||||
}
|
||||
|
||||
var zz, zv, d, fTSR;
|
||||
d = new Date();
|
||||
fTSR=0;
|
||||
zv = d.getTime();
|
||||
zz = "&zz="+zv;
|
||||
|
||||
var gBF=false;
|
||||
function GoTo(u){window.top.location = u + zz;}
|
||||
function Go(u){window.top.location = u;}
|
||||
|
||||
function BF(){gBF=true;}
|
||||
|
||||
function Foci(o){if(!gBF && IsVis(o)){o.focus();}}
|
||||
|
||||
function IsVis(o)
|
||||
{
|
||||
if(!o || o.type=="hidden")
|
||||
return false;
|
||||
|
||||
while(o && o.style && o.style.display!='none')
|
||||
{
|
||||
o = o.parentNode;
|
||||
}
|
||||
return !o || !o.style;
|
||||
}
|
||||
|
||||
|
||||
function TEK(a,evt){
|
||||
var keycode;
|
||||
if (window.event){ keycode = window.event.keyCode; evt = window.event;}
|
||||
else if(evt) {keycode = evt.which;}
|
||||
else {return true;}
|
||||
if(13==keycode){evt.cancelBubble = true; evt.returnValue = false; eval(a);}
|
||||
}
|
||||
|
||||
function getObj(objID)
|
||||
{
|
||||
if (document.getElementById) {return document.getElementById(objID);}
|
||||
else if (document.all) {return document.all[objID];}
|
||||
else if (document.layers) {return document.layers[objID];}
|
||||
}
|
||||
|
||||
function objNext(f,d)
|
||||
{
|
||||
var fFnd=false,el=f.elements,i=0;
|
||||
for(;i < el.length;i++)
|
||||
{
|
||||
if('hidden'!=el[i].type && false==el[i].disabled && IsVis(el[i]) && fFnd)return el[i];
|
||||
if(d.id==el[i].id)fFnd=true;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function objPrev(f,d)
|
||||
{
|
||||
var fFnd=false,el=f.elements,i=el.length - 1;
|
||||
for(;i >= 0;i--)
|
||||
{
|
||||
if('hidden'!=el[i].type && false==el[i].disabled && IsVis(el[i]) && fFnd)return el[i];
|
||||
if(d.id==el[i].id)fFnd=true;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function DoNothing() {return false;}
|
||||
530
include/asterisk/calendar/calx.html
Executable file
530
include/asterisk/calendar/calx.html
Executable file
@@ -0,0 +1,530 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head>
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
|
||||
<style>
|
||||
* {margin:0;padding:0;font:8pt arial;}
|
||||
a {color:#333399;}
|
||||
a:link {color:#333399;}
|
||||
a:hover {color:#FF6600;}
|
||||
.pointer {cursor:pointer;cursor:hand;}
|
||||
|
||||
#OutBdr {position:absolute; top:0px; left:0px; height:186px; overflow:hidden; background-color:#336699;}
|
||||
#InBdr {position:absolute; top:1px; left:1px; height:184px; overflow:hidden; background-color:white;}
|
||||
|
||||
.today {color:#FF0000;}
|
||||
.invalid {color:#999999;cursor:default;}
|
||||
.picked {background-color:#CCCCCC;}
|
||||
#BotNav {position:absolute; top:161px; width:297px; text-align:center; overflow:hidden;}
|
||||
#BotNav #Close {position:relative;top:1px;text-decoration:none; height:20px; line-height:20px;}
|
||||
|
||||
.navControl {position:absolute;height:22px; width:19px; z-index:50; background-color:#7694bf;}
|
||||
.navImg {position:relative;top:2px;cursor:pointer;cursor:hand;}
|
||||
|
||||
#monthcontainer {position:absolute;width:288px;height:162px; overflow:hidden;background-color:white;}
|
||||
#monthlist {position:relative;left:0px; top:0px; height:162px;}
|
||||
.month {position:absolute;width:148px; height:166px; overflow:hidden;}
|
||||
.month .title {position:relative;width:148px;height:22px;overflow:hidden;color:white;text-align:center;line-height:22px; background:#7694bf;font-weight: bold;}
|
||||
.month .weekdays_top {width:148x;height:4px;overflow:hidden;}
|
||||
.month .body {width:140px;height:136px;overflow:hidden;padding-right:4px;padding-left:4px;}
|
||||
.month .weekdays {width:148px; height:16px; overflow:hidden;}
|
||||
.month .weekday {position:relative; float:left; top:-4px; width:20px; height:16px; overflow:hidden; text-align:center; font-weight:bold; line-height:20px; color:#336699;}
|
||||
.month .dates {width:148px; height:120px; overflow:hidden;}
|
||||
.month .bottom {width:148px; height:8px; overflow:hidden;}
|
||||
.month .dates div {float:left; width:20px; height:20px; overflow:hidden; text-align:center; font-weight:bold; line-height:20px;}
|
||||
.titleFill {height:22px;width:1px;background-color:#7694BF;}
|
||||
.calendarFill {height:165px;width:1px;background-color:#D7DCE8;}
|
||||
</style>
|
||||
<meta content="MSHTML 6.00.2900.2873" name="GENERATOR"></head><body onload="DoLoad()" bgcolor="white" text="black">
|
||||
<div style="width: 299px;" id="OutBdr">
|
||||
<div style="width: 297px;" id="InBdr">
|
||||
<div id="NavPrev" class="navControl">
|
||||
<img id="PImg" class="navImg" style="left: 4px; visibility: hidden;" title="" onclick="handlePrev()" alt="Previous Month" src="calx_data/bubble_left_onblue.gif">
|
||||
</div>
|
||||
<div style="left: 278px;" id="NavNext" class="navControl">
|
||||
<img id="NImg" class="navImg" style="left: 0px; visibility: visible;" title="" onclick="handleNext()" alt="Next Month" src="calx_data/bubble_right_onblue.gif">
|
||||
</div>
|
||||
<div>
|
||||
<div style="width: 297px;" id="monthcontainer">
|
||||
<div style="left: 0px; top: 0px;" id="monthlist"><div style="left: -1px; position: absolute;"><div style="height: 22px;" class="titleFill"></div><div style="height: 140px;" class="calendarFill"></div></div><div style="left: 0px;" class="month"><div class="title">November 2006</div><div class="weekdays_top"></div><div class="body"><div class="weekdays"><div class="weekday">S</div><div class="weekday">M</div><div class="weekday">T</div><div class="weekday">W</div><div class="weekday">T</div><div class="weekday">F</div><div class="weekday">S</div></div><div class="dates"><div class="invalid"></div><div class="invalid"></div><div class="invalid"></div><div class="invalid">1</div><div class="invalid">2</div><div class="invalid">3</div><div class="invalid">4</div><div class="invalid">5</div><div class="invalid">6</div><div class="invalid">7</div><div class="invalid">8</div><div class="invalid">9</div><div class="invalid">10</div><div class="invalid">11</div><div class="invalid">12</div><div class="invalid">13</div><div class="invalid">14</div><div class="invalid">15</div><div class="invalid">16</div><div class="invalid">17</div><div class="invalid">18</div><div class="invalid">19</div><div class="invalid">20</div><div class="invalid">21</div><div class="invalid">22</div><div class="invalid">23</div><div class="invalid">24</div><div class="invalid">25</div><div class="invalid">26</div><div class="invalid">27</div><div class="pointer today">28</div><div class="pointer">29</div><div class="pointer">30</div></div></div><div class="bottom"></div></div><div style="left: 148px; position: absolute;"><div style="height: 22px;" class="titleFill"></div><div style="height: 140px;" class="calendarFill"></div></div><div style="left: 149px;" class="month"><div class="title">December 2006</div><div class="weekdays_top"></div><div class="body"><div class="weekdays"><div class="weekday">S</div><div class="weekday">M</div><div class="weekday">T</div><div class="weekday">W</div><div class="weekday">T</div><div class="weekday">F</div><div class="weekday">S</div></div><div class="dates"><div class="invalid"></div><div class="invalid"></div><div class="invalid"></div><div class="invalid"></div><div class="invalid"></div><div class="pointer">1</div><div class="pointer">2</div><div class="pointer">3</div><div class="pointer">4</div><div class="pointer">5</div><div class="pointer">6</div><div class="pointer">7</div><div class="pointer">8</div><div class="pointer">9</div><div class="pointer">10</div><div class="pointer">11</div><div class="pointer">12</div><div class="pointer">13</div><div class="pointer">14</div><div class="pointer">15</div><div class="pointer">16</div><div class="pointer">17</div><div class="pointer">18</div><div class="pointer">19</div><div class="pointer">20</div><div class="pointer">21</div><div class="pointer">22</div><div class="pointer">23</div><div class="pointer">24</div><div class="pointer">25</div><div class="pointer">26</div><div class="pointer">27</div><div class="pointer">28</div><div class="pointer">29</div><div class="pointer">30</div><div class="pointer">31</div></div></div><div class="bottom"></div></div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="BotNav" style="border-top: 1px solid rgb(215, 220, 232);"><a id="Close" href="javascript:CloseCal()">Close</a></div>
|
||||
</div><!--"InBdr"-->
|
||||
</div><!--"OutBdr"-->
|
||||
|
||||
<script type="text/javascript">
|
||||
Function.prototype.bind = function(object) {
|
||||
var m_method = this;
|
||||
return function() {
|
||||
return m_method.apply(object, arguments);
|
||||
}
|
||||
}
|
||||
|
||||
function atoi(a){var i=parseInt(a);return isNaN(i)?0:i;}
|
||||
|
||||
var g_calMonthList = null;
|
||||
|
||||
function calMonth(m,y,pObj,pxLeft,dtSelected)
|
||||
{
|
||||
this.m_month = m;
|
||||
this.m_year = y;
|
||||
this.m_pxLeft = pxLeft;
|
||||
this.m_domElement = null;
|
||||
|
||||
this.getMonth = function(){return this.m_month;}
|
||||
this.getYear = function(){return this.m_year;}
|
||||
this.getPxLeft = function(){return this.m_pxLeft;}
|
||||
this.getDomElement = function(){return this.m_domElement;}
|
||||
|
||||
this.createDomElement = function(m,y,dtSelected)
|
||||
{
|
||||
var mty=DOW(1,m,y);
|
||||
var c=wp.GetMonthCount(m,y);
|
||||
|
||||
// Draw current month?
|
||||
var fCur=(y==new Date().getFullYear()&&m==new Date().getMonth());
|
||||
|
||||
// Draw selected month?
|
||||
var fSel=(dtSelected&&y==dtSelected.getFullYear()&&m==dtSelected.getMonth());
|
||||
|
||||
var datesE=document.createElement('div');
|
||||
datesE.className="dates";
|
||||
|
||||
var szDays="";
|
||||
var dayE=null;
|
||||
for(i=0;i<mty;i++)
|
||||
{
|
||||
dayE=document.createElement('div');
|
||||
dayE.className="invalid";
|
||||
datesE.appendChild(dayE);
|
||||
}
|
||||
for(i=1;i<c+1;i++)
|
||||
{
|
||||
var d=new Date(y,m,i);
|
||||
if((!g_dtMin||d>=g_dtMin)&&(!g_dtMax||d<=g_dtMax)) // Valid date?
|
||||
{
|
||||
var szClass="pointer";
|
||||
if(fSel && i==dtSelected.getDate())szClass+=" picked";
|
||||
if(fCur && i==new Date().getDate())szClass+=" today";
|
||||
|
||||
dayE=document.createElement('div');
|
||||
dayE.className=szClass;
|
||||
dayE.y = y; dayE.m = m; dayE.i = i;
|
||||
dayE.onclick=DtClk;
|
||||
dayE.onmousemove=DtHvr;
|
||||
dayE.onmouseout=DtExt;
|
||||
|
||||
dayE.appendChild(document.createTextNode(i));
|
||||
datesE.appendChild(dayE);
|
||||
}
|
||||
else
|
||||
{
|
||||
dayE=document.createElement('div');
|
||||
dayE.className="invalid";
|
||||
dayE.appendChild(document.createTextNode(i));
|
||||
datesE.appendChild(dayE);
|
||||
}
|
||||
}
|
||||
|
||||
var titleE=document.createElement('div');
|
||||
titleE.className="title";
|
||||
titleE.appendChild(document.createTextNode(FmtTitle(m,y)));
|
||||
|
||||
var monthTopE=document.createElement('div');
|
||||
monthTopE.className="weekdays_top";
|
||||
|
||||
var weekdaysE=document.createElement('div');
|
||||
weekdaysE.className="weekdays";
|
||||
|
||||
for(i=0;i<7;i++)
|
||||
{
|
||||
var weekdayE=document.createElement('div');
|
||||
weekdayE.className="weekday";
|
||||
weekdayE.appendChild(document.createTextNode(rW[(i+wp.GetDowStart())%7]));
|
||||
weekdaysE.appendChild(weekdayE);
|
||||
}
|
||||
|
||||
var monthBodyE=document.createElement('div');
|
||||
monthBodyE.className="body";
|
||||
monthBodyE.appendChild(weekdaysE);
|
||||
monthBodyE.appendChild(datesE);
|
||||
|
||||
var monthBotE=document.createElement('div');
|
||||
monthBotE.className="bottom";
|
||||
|
||||
var monthE=document.createElement('div');
|
||||
monthE.className="month";
|
||||
|
||||
monthE.appendChild(titleE);
|
||||
monthE.appendChild(monthTopE);
|
||||
monthE.appendChild(monthBodyE);
|
||||
monthE.appendChild(monthBotE);
|
||||
|
||||
return monthE;
|
||||
}
|
||||
|
||||
var verticalDiv = document.createElement('div');
|
||||
|
||||
var tFill=document.createElement('div'); // title fill
|
||||
tFill.className="titleFill";
|
||||
tFill.style.height=22+"px";
|
||||
verticalDiv.appendChild(tFill);
|
||||
|
||||
var cFill=document.createElement('div'); // calendar fill
|
||||
cFill.className="calendarFill";
|
||||
cFill.style.height=140+"px";
|
||||
verticalDiv.appendChild(cFill);
|
||||
|
||||
verticalDiv.style.left=pxLeft - 1+"px";
|
||||
verticalDiv.style.position='absolute';
|
||||
pObj.appendChild(verticalDiv);
|
||||
|
||||
this.m_domElement = this.createDomElement(this.m_month, this.m_year, dtSelected);
|
||||
|
||||
// Position and insert
|
||||
this.m_domElement.style.left = pxLeft+"px";
|
||||
pObj.appendChild(this.m_domElement);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
var g_cMonthSpacing=1;
|
||||
var g_cMonthWidth=148;
|
||||
function calMonthList(cM,m,y)
|
||||
{
|
||||
this.m_pxLeft=0;
|
||||
this.m_pxLeftShift=g_cMonthWidth+g_cMonthSpacing;
|
||||
this.m_cMonths=cM; // # visible months
|
||||
this.m_rgcalMonths=new Array();
|
||||
this.m_bPrev=false;this.m_bNext=false;
|
||||
this.m_bReady=true;
|
||||
this.m_lowIndex=0;
|
||||
|
||||
this.getFirstMonth = function(){return (this.m_rgcalMonths&&this.m_rgcalMonths.length>0)?this.m_rgcalMonths[0]:null;}
|
||||
this.getLastMonth = function(){return (this.m_rgcalMonths&&this.m_rgcalMonths.length>0)?this.m_rgcalMonths[this.m_rgcalMonths.length-1]:null;}
|
||||
|
||||
this.init = function(m,y)
|
||||
{
|
||||
// Reset what we currently have
|
||||
this.m_pxLeft = 0;
|
||||
while( getObj("monthlist").childNodes.length ) getObj("monthlist").removeChild(getObj("monthlist").childNodes[0]);
|
||||
getObj("monthlist").style.left = this.m_pxLeft+"px";
|
||||
getObj("monthlist").style.top = "0px"; // set this so it can be accessed via script
|
||||
|
||||
this.m_bPrev=false;this.m_bNext=false;
|
||||
|
||||
for(var i=0;i<this.m_cMonths;i++)
|
||||
{
|
||||
this.m_rgcalMonths[i] = new calMonth(m,y,getObj("monthlist"),(i*this.m_pxLeftShift),g_dtPick);
|
||||
|
||||
// increment month
|
||||
y=y+(m==11?1:0);
|
||||
m=(m+1)%12;
|
||||
}
|
||||
}
|
||||
|
||||
this.navPrev = function()
|
||||
{
|
||||
if(this.m_bReady) this.m_bReady = false;
|
||||
else return null;
|
||||
|
||||
var cM=this.getFirstMonth().getMonth();
|
||||
var cY=this.getFirstMonth().getYear();
|
||||
var pY=cY-(cM==0?1:0);
|
||||
var pM=(cM+11)%12;
|
||||
|
||||
// Create and draw the new month
|
||||
var cPxLeft = this.getFirstMonth().getPxLeft();
|
||||
var prevMonth = new calMonth(pM,pY,getObj("monthlist"),cPxLeft-this.m_pxLeftShift,g_dtPick);
|
||||
|
||||
// Update visible month array
|
||||
for(var i=this.m_cMonths-1;i>0;i--) this.m_rgcalMonths[i]=this.m_rgcalMonths[i-1];
|
||||
this.m_rgcalMonths[i] = prevMonth;
|
||||
|
||||
// Scroll the new month into view
|
||||
this.m_pxLeft += this.m_pxLeftShift;
|
||||
scrollAction(getObj("monthlist"), null, new position(this.m_pxLeft,null), null);
|
||||
this.m_bPrev = true;
|
||||
}
|
||||
|
||||
this.navNext = function()
|
||||
{
|
||||
if(this.m_bReady) this.m_bReady = false;
|
||||
else return null;
|
||||
|
||||
var cM=this.getLastMonth().getMonth();
|
||||
var cY=this.getLastMonth().getYear();
|
||||
var nY=cY+(cM==11?1:0);
|
||||
var nM=(cM+1)%12;
|
||||
|
||||
// Create and draw the new month
|
||||
var cPxLeft = this.getLastMonth().getPxLeft();
|
||||
var nextMonth = new calMonth(nM,nY,getObj("monthlist"),cPxLeft+this.m_pxLeftShift,g_dtPick);
|
||||
|
||||
// Update visible month array
|
||||
for(var i=0;i<this.m_cMonths-1;i++) this.m_rgcalMonths[i]=this.m_rgcalMonths[i+1];
|
||||
this.m_rgcalMonths[i] = nextMonth;
|
||||
|
||||
// Scroll the new month into view
|
||||
this.m_pxLeft -= this.m_pxLeftShift;
|
||||
scrollAction(getObj("monthlist"), null, new position(this.m_pxLeft,null), null);
|
||||
this.m_bNext = true;
|
||||
}
|
||||
|
||||
this.cleanList = function()
|
||||
{
|
||||
if(this.m_bPrev)
|
||||
{
|
||||
// remove month & fill
|
||||
if(this.m_lowIndex == 0)
|
||||
{
|
||||
getObj("monthlist").removeChild(getObj("monthlist").childNodes[2]);
|
||||
getObj("monthlist").removeChild(getObj("monthlist").childNodes[2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
getObj("monthlist").removeChild(getObj("monthlist").firstChild);
|
||||
getObj("monthlist").removeChild(getObj("monthlist").firstChild);
|
||||
}
|
||||
this.m_lowIndex = 1;
|
||||
this.m_bPrev = false;
|
||||
}
|
||||
else if(this.m_bNext)
|
||||
{
|
||||
// remove month & fill
|
||||
if(this.m_lowIndex == 0)
|
||||
{
|
||||
getObj("monthlist").removeChild(getObj("monthlist").firstChild);
|
||||
getObj("monthlist").removeChild(getObj("monthlist").firstChild);
|
||||
}
|
||||
else
|
||||
{
|
||||
getObj("monthlist").removeChild(getObj("monthlist").childNodes[2]);
|
||||
getObj("monthlist").removeChild(getObj("monthlist").childNodes[2]);
|
||||
}
|
||||
this.m_lowIndex = 0;
|
||||
this.m_bNext = false;
|
||||
}
|
||||
this.m_bReady = true;
|
||||
}
|
||||
|
||||
this.init(m,y);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
function handlePrev()
|
||||
{
|
||||
g_calMonthList.navPrev();
|
||||
UpdPrev();
|
||||
UpdNext();
|
||||
}
|
||||
|
||||
function handleNext()
|
||||
{
|
||||
g_calMonthList.navNext();
|
||||
UpdNext();
|
||||
UpdPrev();
|
||||
}
|
||||
|
||||
function position(x,y)
|
||||
{
|
||||
this.m_x=x;
|
||||
this.m_y=y;
|
||||
|
||||
this.getX=function(){return this.m_x;}
|
||||
this.getY=function(){return this.m_y;}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
function scrollAction(domElement,startPos,endPos,duration,iterCount)
|
||||
{
|
||||
this.m_domElement = domElement;
|
||||
this.m_startPos = startPos;
|
||||
this.m_endPos = endPos;
|
||||
this.m_duration = duration;
|
||||
this.m_iterCount = iterCount;
|
||||
|
||||
var eL=atoi(this.m_domElement.style.left);
|
||||
var eT=atoi(this.m_domElement.style.top);
|
||||
|
||||
// Default startPos to current position
|
||||
if(null==this.m_startPos || (null==this.m_startPos.getX() && null==this.m_startPos.getY()))
|
||||
this.m_startPos = new position(eL,eT);
|
||||
else
|
||||
{
|
||||
if(null==this.m_startPos.getX()) this.m_startPos = new position(eL,this.m_startPos.getY());
|
||||
if(null==this.m_startPos.getY()) this.m_startPos = new position(this.m_startPos.getX(),eT);
|
||||
}
|
||||
|
||||
// Default endPos to current position
|
||||
if(null==this.m_endPos)
|
||||
this.m_endPos = new position(eL,eT);
|
||||
else
|
||||
{
|
||||
if(null==this.m_endPos.getX()) this.m_endPos = new position(eL,this.m_endPos.getY());
|
||||
if(null==this.m_endPos.getY()) this.m_endPos = new position(this.m_endPos.getX(),eT);
|
||||
}
|
||||
|
||||
if(null==this.m_duration) this.m_duration = 200; // Default is 1/5 sec
|
||||
if(null==this.m_iterCount) this.m_iterCount = 10; // Move element 10 times
|
||||
|
||||
// Calc pixels/iteration
|
||||
this.m_incX = (this.m_endPos.getX()-this.m_startPos.getX())/this.m_iterCount;
|
||||
this.m_incY = (this.m_endPos.getY()-this.m_startPos.getY())/this.m_iterCount;
|
||||
|
||||
this.nextIter = function()
|
||||
{
|
||||
this.m_iter++;
|
||||
this.m_domElement.style.left = (this.m_startPos.getX()+Math.floor(this.m_iter*this.m_incX))+"px";
|
||||
this.m_domElement.style.top = (this.m_startPos.getY()+Math.floor(this.m_iter*this.m_incY))+"px";
|
||||
if(this.m_iter<this.m_iterCount) setTimeout("this.nextIter();",this.m_duration/this.m_iterCount);
|
||||
else setTimeout("g_calMonthList.cleanList();",this.m_duration/this.m_iterCount);
|
||||
}
|
||||
|
||||
this.m_iter = 0;
|
||||
this.nextIter();
|
||||
|
||||
return this;
|
||||
}
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
var wp=window.parent;
|
||||
var cf=null;
|
||||
var g_fCL=false;
|
||||
var g_eInp=0;
|
||||
var g_dtMin,g_dtMax;
|
||||
var g_dtPick;
|
||||
|
||||
function getObj(objID)
|
||||
{
|
||||
if(document.getElementById){return document.getElementById(objID);}
|
||||
else if(document.all){return document.all[objID];}
|
||||
else if(document.layers){return document.layers[objID];}
|
||||
}
|
||||
function EvtObj(e){if(!e)e=window.event;return e;}
|
||||
function stopBubble(e){e.cancelBubble=true;if(e.stopPropagation)e.stopPropagation();}
|
||||
function EvtTgt(e)
|
||||
{
|
||||
var el;
|
||||
if(e.target)el=e.target;
|
||||
else if(e.srcElement)el=e.srcElement;
|
||||
if(el.nodeType==3)el=el.parentNode; // defeat Safari bug
|
||||
return el;
|
||||
}
|
||||
|
||||
function GetCF(){if (!cf)cf=wp.getObj('CalFrame');return cf;}
|
||||
function DoLoad()
|
||||
{
|
||||
g_fCL=true;
|
||||
}
|
||||
|
||||
function DoCal(eD,eDP,dmin,dmax,cM)
|
||||
{
|
||||
var dt=wp.GetInputDate(eD.value);
|
||||
if(null==dt&&null!=eDP){dt=wp.GetInputDate(eDP.value);}
|
||||
|
||||
g_dtPick=dt;
|
||||
if(dmin&&""==dmin)dmin=null;
|
||||
if(dmax&&""==dmax)dmax=null;
|
||||
if(null==dt)
|
||||
{
|
||||
// Check for valid min date and use that, else use current
|
||||
dt=new Date();
|
||||
if(dmin&&dt<new Date(dmin))dt=new Date(dmin);
|
||||
}
|
||||
|
||||
SetMinMax(dmin?new Date(dmin):null,dmax?new Date(dmax):null);
|
||||
|
||||
if(null==cM)cM=2; // Default to 2 month display
|
||||
UpdCal(cM,dt.getMonth(),dt.getFullYear());
|
||||
|
||||
g_eInp=eD;
|
||||
|
||||
// prevent Mozilla from flickering
|
||||
setTimeout("ShowCal()",1);
|
||||
}
|
||||
|
||||
function ShowCal()
|
||||
{
|
||||
if ("none"==GetCF().style.display) {GetCF().style.display="block";}// FF drawing bug
|
||||
GetCF().style.visibility="visible";
|
||||
}
|
||||
|
||||
function UpdCal(cM,m,y)
|
||||
{
|
||||
// Size the frame
|
||||
var pxSpacing = g_cMonthSpacing*(cM-1);
|
||||
getObj("OutBdr").style.width=((g_cMonthWidth*cM)+2+pxSpacing)+"px";
|
||||
getObj("InBdr").style.width=((g_cMonthWidth*cM)+pxSpacing)+"px";
|
||||
getObj("monthcontainer").style.width=((g_cMonthWidth*cM)+pxSpacing)+"px";
|
||||
getObj("NavNext").style.left = ((g_cMonthWidth*cM)+pxSpacing-19)+"px";
|
||||
GetCF().style.width=((g_cMonthWidth*cM)+2+pxSpacing)+"px";
|
||||
GetCF().style.height=186+"px";
|
||||
|
||||
g_calMonthList = null;
|
||||
g_calMonthList = new calMonthList(cM,m,y);
|
||||
|
||||
UpdNext();
|
||||
UpdPrev();
|
||||
}
|
||||
|
||||
function UpdNext()
|
||||
{
|
||||
var currMonth=g_calMonthList.getLastMonth();
|
||||
var nm=currMonth.getMonth();
|
||||
var ny=currMonth.getYear();
|
||||
|
||||
var hd=(!g_dtMax||!(ny>g_dtMax.getFullYear()||(ny==g_dtMax.getFullYear()&&parseInt(nm)>=g_dtMax.getMonth())));
|
||||
getObj('NImg').style.visibility=hd?"visible":"hidden";
|
||||
}
|
||||
|
||||
function UpdPrev()
|
||||
{
|
||||
var currMonth=g_calMonthList.getFirstMonth();
|
||||
var pm=currMonth.getMonth();
|
||||
var py=currMonth.getYear();
|
||||
|
||||
var hd=(!g_dtMin||!(py<g_dtMin.getFullYear()||(py==g_dtMin.getFullYear()&&parseInt(pm)<=g_dtMin.getMonth())));
|
||||
getObj('PImg').style.visibility=hd?"visible":"hidden";
|
||||
}
|
||||
function DtHvr(e){EvtTgt(EvtObj(e)).style.backgroundColor="#FFDD99";}
|
||||
function DtExt(e){EvtTgt(EvtObj(e)).style.backgroundColor="";}
|
||||
function DtClk(e)
|
||||
{
|
||||
var element = EvtTgt(EvtObj(e))
|
||||
wp.CalDateSet(g_eInp,element.i,element.m+1,element.y);
|
||||
if(g_eInp.onblur){g_eInp.onblur();}
|
||||
GetCF().style.visibility="hidden";
|
||||
wp.SetCalShown(false);
|
||||
wp.CalendarCallback();
|
||||
}
|
||||
function CloseCal(){
|
||||
if(wp.getObj('CalDiv'))
|
||||
{
|
||||
wp.CalSetFocus(g_eInp);
|
||||
wp.getObj('CalDiv').style.visibility="hidden";
|
||||
GetCF().style.visibility="hidden";
|
||||
wp.SetCalShown(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
wp.CalSetFocus(g_eInp);
|
||||
GetCF().style.visibility="hidden";
|
||||
wp.SetCalShown(false);
|
||||
}
|
||||
}
|
||||
function SetMinMax(n,x){g_dtMin=n;g_dtMax=x;}
|
||||
function FmtTitle(m,y){return rN[m]+"\u00a0\u00a0"+y.toString()}
|
||||
// LOC Comment: Month name.
|
||||
var rN=new Array(12);rN[0]="January";rN[1]="February";rN[2]="March";rN[3]="April";rN[4]="May";rN[5]="June";rN[6]="July";rN[7]="August";rN[8]="September";rN[9]="October";rN[10]="November";rN[11]="December";
|
||||
// LOC Comment: Weekday abbrv.
|
||||
var rW=new Array(7);rW[0]="S";rW[1]="M";rW[2]="T";rW[3]="W";rW[4]="T";rW[5]="F";rW[6]="S";
|
||||
function DOW(d,m,y){var dt=new Date(y,m,d);return(dt.getDay()+(7-wp.GetDowStart()))%7;}
|
||||
</script>
|
||||
</body></html>
|
||||
159
include/asterisk/calendar/calx.js
Executable file
159
include/asterisk/calendar/calx.js
Executable file
@@ -0,0 +1,159 @@
|
||||
var cF=null;var cW=null;var g_tid=0;var g_cP,g_eD,g_eDP,g_dmin,g_dmax;
|
||||
var nextFocus;var g_fNoCal=false;
|
||||
|
||||
function getEventObj(e){if(!e)e=window.event;return e;}
|
||||
|
||||
function stopBubble(e){e=getEventObj(e);e.cancelBubble=true;if(e.stopPropagation)e.stopPropagation();}
|
||||
|
||||
function CB(){stopBubble(event);}
|
||||
|
||||
function SCal(cP,eD,eDP,dmin,dmax){
|
||||
clearTimeout(g_tid);
|
||||
if(g_fNoCal){
|
||||
g_fNoCal=false;
|
||||
return;
|
||||
}
|
||||
if(g_calShown && eD==g_eD)
|
||||
return;
|
||||
g_calShown = true;
|
||||
g_calCB = null;
|
||||
g_cP=cP;
|
||||
g_eD=eD;
|
||||
g_eDP=eDP;
|
||||
g_dmin=dmin;
|
||||
g_dmax=dmax;
|
||||
WaitCal();
|
||||
}
|
||||
function CancelCal(){clearTimeout(g_tid);if(!cF)cF=getObj('CalFrame');cF.style.visibility="hidden";g_calShown=false;}
|
||||
function WaitCal()
|
||||
{
|
||||
if(!cW)cW=frames['CalFrame'];
|
||||
|
||||
if(null==cW||null==cW.g_fCL||false==cW.g_fCL){
|
||||
g_tid=setTimeout("WaitCal()", 200);
|
||||
}
|
||||
else{
|
||||
if(!cF)cF=getObj('CalFrame');
|
||||
cF.style.visibility="hidden";
|
||||
setTimeout("DoCal()",1);
|
||||
}
|
||||
}
|
||||
function DoCal(){PosCal(g_cP);
|
||||
if(!cW)cW=frames['CalFrame'];
|
||||
cW.DoCal(g_eD,g_eDP,g_dmin,g_dmax);}
|
||||
|
||||
function getScrollTop()
|
||||
{
|
||||
if(document.documentElement.scrollTop) return document.documentElement.scrollTop;
|
||||
if(document.body.scrollTop) return document.body.scrollTop;
|
||||
if(window.pageYOffset) return window.pageYOffset;
|
||||
return 0;
|
||||
}
|
||||
|
||||
function getWinHeight()
|
||||
{
|
||||
if(window.innerHeight) return window.innerHeight;
|
||||
if(document.documentElement.clientHeight) return document.documentElement.clientHeight;
|
||||
if(document.body.clientHeight) return document.body.clientHeight;
|
||||
return 0;
|
||||
}
|
||||
|
||||
function PosCal(cP)
|
||||
{
|
||||
var dB=document.body;var eL=0;var eT=0;
|
||||
if(!cF)
|
||||
cF=getObj('CalFrame');
|
||||
for(var p=cP;p&&p.tagName!='BODY';p=p.offsetParent){
|
||||
/*
|
||||
eL+=p.offsetLeft;
|
||||
eT+=p.offsetTop;
|
||||
*/
|
||||
|
||||
eL+=p.offsetLeft;
|
||||
eT+=p.offsetTop;
|
||||
}
|
||||
|
||||
var eH=cP.offsetHeight;
|
||||
var dH=parseInt(cF.style.height);
|
||||
var sT=getScrollTop();
|
||||
|
||||
if(eT-dH>=sT&&eT+eH+dH>getWinHeight()+sT)
|
||||
eT-=dH;
|
||||
else
|
||||
eT+=eH;
|
||||
|
||||
/*static fixed position for now */
|
||||
cF.style.left = 200+'px';
|
||||
cF.style.top = 50+'px';
|
||||
|
||||
/*positioning px here
|
||||
var eH=cP.offsetHeight;
|
||||
var dH=parseInt(cF.style.height);
|
||||
var sT=getScrollTop();
|
||||
if(eT-dH>=sT&&eT+eH+dH>getWinHeight()+sT)
|
||||
eT-=dH;
|
||||
else eT+=eH;
|
||||
cF.style.left=eL+'px';
|
||||
cF.style.top=eT+'px';
|
||||
*/
|
||||
}
|
||||
|
||||
function SetNextFocus(e){nextFocus=e;if(nextFocus)nextFocus.onfocus=CancelCal;}
|
||||
function SetPrevFocus(e){if(e)e.onfocus=CancelCal;}
|
||||
|
||||
function FGoNextFocus(){if(nextFocus){nextFocus.focus();return true;}return false;}
|
||||
|
||||
function CalSetFocus(e){if(e){g_fNoCal=true;e.focus();setTimeout("EndCalFocus()", 200);}}
|
||||
function EndCalFocus(){g_fNoCal=false;}
|
||||
|
||||
function CalDateSet(eInp,d,m,y,giveFocus)
|
||||
{
|
||||
var ds=GetDateSep();
|
||||
var fmt=GetDateFmt();
|
||||
|
||||
if(fmt=="mmddyy")eInp.value=m+ds+d+ds+y;
|
||||
else if(fmt=="ddmmyy")eInp.value=d+ds+m+ds+y;
|
||||
else eInp.value=y+ds+m+ds+d;
|
||||
if(!giveFocus)
|
||||
CalSetFocus(eInp);
|
||||
}
|
||||
|
||||
var g_calShown = false;
|
||||
function SetCalShown(fcshown){g_calShown=fcshown;}
|
||||
|
||||
var g_calCB;
|
||||
function CalendarCallback(){if(g_calCB)g_calCB();}
|
||||
function SetCalendarCallback(cb){g_calCB=cb;}
|
||||
|
||||
|
||||
function GetInputDate(t)
|
||||
{
|
||||
if(!t.length) return null;
|
||||
t=t.replace(/\s+/g,"");
|
||||
if(t.match(/[^-|\d|\.|\/]/)) return null;
|
||||
var rgt=t.split(/-|\.|\//);
|
||||
for(var i=0;i<rgt.length;i++) rgt[i]=parseInt(rgt[i],10);
|
||||
if(!rgt[1]) return null;
|
||||
var m,d,y;
|
||||
var fmt=GetDateFmt();
|
||||
if(fmt=="yymmdd")
|
||||
{
|
||||
if(!rgt[2]) return null;
|
||||
m=rgt[1];d=rgt[2];y=rgt[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
if(fmt=="mmddyy"){m=rgt[0];d=rgt[1];}
|
||||
else{m=rgt[1];d=rgt[0];}//fmt=="ddmmyy"
|
||||
if(rgt[2])y=rgt[2];
|
||||
else y=DefYr(m-1,d);
|
||||
}
|
||||
m-=1;if(y<100)y+=2000;
|
||||
if(y<1601||y>4500||m<0||m>11||d<1||d>GetMonthCount(m,y))return null;
|
||||
return new Date(y,m,d);
|
||||
}
|
||||
|
||||
var rM=new Array(12);rM[0]=rM[2]=rM[4]=rM[6]=rM[7]=rM[9]=rM[11]=31;rM[3]=rM[5]=rM[8]=rM[10]=30;rM[1]=28;
|
||||
function GetMonthCount(m,y){var c=rM[m];if((1==m)&&IsLY(y))c++;return c;}
|
||||
function IsLY(y){if(0==y%4&&((y%100!=0)||(y%400==0)))return true;else return false;}
|
||||
function DefYr(m,d){var dt=new Date();var yC=(dt.getYear()<1000)?1900+dt.getYear():dt.getYear();if(m<dt.getMonth()||(m==dt.getMonth()&&d<dt.getDate()))yC++;return yC;}
|
||||
152
include/asterisk/calendar/d.js
Executable file
152
include/asterisk/calendar/d.js
Executable file
@@ -0,0 +1,152 @@
|
||||
var pwid = '';
|
||||
var cwid = '';
|
||||
var bB = true;
|
||||
var bFlex = false;
|
||||
|
||||
var FCity = '';
|
||||
var TCity = '';
|
||||
var FTLA = '';
|
||||
var TTLA = '';
|
||||
var TCityId = '6022969';
|
||||
|
||||
var FDate = 'mm/dd/yy';
|
||||
var TDate = 'mm/dd/yy';
|
||||
var MDate = '';
|
||||
var CalS = '';
|
||||
var CalE = '';
|
||||
|
||||
var FTime = '362';
|
||||
var TTime = '362';
|
||||
|
||||
var rooms = 1;
|
||||
var minR = 1;
|
||||
var maxR = 9;
|
||||
var minA = 0;
|
||||
var maxA = 6;
|
||||
var minS = 0;
|
||||
var maxS = 6;
|
||||
var minC = 0;
|
||||
var maxC = 6;
|
||||
|
||||
var nR = 1;
|
||||
var aRA;
|
||||
var aRS;
|
||||
var aRC;
|
||||
var aRCA;
|
||||
var Inf = 'l';
|
||||
|
||||
var TL = '';
|
||||
var CCl = 'NoPreference';
|
||||
var SText = 'Search for flights';
|
||||
|
||||
var tl = '';
|
||||
var ti = '';
|
||||
var te = '';
|
||||
var nm = 12;
|
||||
|
||||
var arrColors = new Array('Red', 'Lime', 'Yellow', 'Aqua', 'Blue', 'Green', 'White','Silver', 'Teal', 'Orange', 'Pink');
|
||||
var arrMN = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July','August', 'September', 'October', 'November', 'December');
|
||||
var arrCC = new Array('NoPreference|No Preference','Economy|Economy','Compact|Compact','Midsize|Midsize','Standard|Standard','FullSize|Full Size','Premium|Premium','Luxury|Luxury','Convertible|Convertible','Minivan|Minivan','SUV|Sport Utility Vehicle','SportsCar|Sports Car');
|
||||
var arrSR = new Array('0|Show all','10|1 Star or more','20|2 Stars or more','30|3 Stars or more','40|4 Stars or more','50|5 Stars');
|
||||
var arrFD = new Array('|-Select from the list-','ATL|Atlanta, GA (ATL-Hartsfield Intl.)','AUS|Austin, TX (AUS-Austin-Bergstrom International Airport)','BWI|Baltimore, MD (BWI-Baltimore Washington)','BOS|Boston, MA (BOS-Logan Intl.)','CLT|Charlotte, NC (CLT-Douglas Intl.)','ORD|Chicago, IL (ORD-O\'Hare)','CLE|Cleveland, OH (CLE-Hopkins Intl.)','CMH|Columbus, OH (CMH-Port Columbus Intl.)','DFW|Dallas, TX (DFW-Dallas-Fort Worth Intl.)','DEN|Denver, CO (DEN-Denver Intl.)','DTW|Detroit, MI (DTW-Wayne County)','FLL|Fort Lauderdale, FL (FLL)','RSW|Fort Myers, FL (RSW-Southwest Florida Regional)','BDL|Hartford, CT (BDL-Bradley Intl.)','HNL|Honolulu, Oahu, HI (HNL-Honolulu Intl.)','IAH|Houston, TX (IAH-Bush Intercontinental)','IND|Indianapolis, IN (IND-Indianapolis Intl.)','JAX|Jacksonville, FL (JAX-Jacksonville Intl.)','MCI|Kansas City, MO (MCI-Kansas City Intl.)','LAS|Las Vegas, NV (LAS-McCarran Intl.)','LAX|Los Angeles, CA (LAX-Los Angeles Intl.)','MIA|Miami, FL (MIA-Miami Intl.)','MSP|Minneapolis, MN (MSP-Minneapolis-St. Paul Intl.)','BNA|Nashville, TN (BNA)','MSY|New Orleans, LA (MSY-New Orleans Intl.)','JFK|New York, NY (JFK-Kennedy)','LGA|New York, NY (LGA-LaGuardia)','EWR|Newark, NJ (EWR-Newark International Airport)','OAK|Oakland, CA (OAK-Oakland Intl.)','SNA|Orange County, CA (SNA-John Wayne Intl.)','MCO|Orlando, FL (MCO-Orlando Intl.)','PHL|Philadelphia, PA (PHL-Philadelphia Intl.)','PHX|Phoenix, AZ (PHX-Sky Harbor Intl.)','PIT|Pittsburgh, PA (PIT-Greater Pittsburgh Intl.)','PDX|Portland, OR (PDX-Portland Intl.)','RDU|Raleigh, NC (RDU-Raleigh Durham Intl.)','RNO|Reno, NV (RNO-Reno-Tahoe International)','SLC|Salt Lake City, UT (SLC-Salt Lake City Intl.)','SAT|San Antonio, TX (SAT-San Antonio Intl.)','SAN|San Diego, CA (SAN-Lindbergh Field)','SFO|San Francisco, CA (SFO-San Francisco Intl.)','SJC|San Jose, CA (SJC-San Jose Intl.)','SEA|Seattle, WA (SEA-Seattle Tacoma)','STL|St. Louis, MO (STL-Lambert-St. Louis Intl.)','TPA|Tampa, FL (TPA-Tampa Intl.)','DCA|Washington, DC (DCA-Ronald Reagan National)','IAD|Washington, DC (IAD-Dulles)','PBI|West Palm Beach, FL (PBI-Palm Beach Intl.)');
|
||||
var arrTL = new Array('0,1,10|1 - 10 nights','1,0,0|Weekend','0,2,4|2 - 4 nights','0,3,5|3 - 5 nights','0,5,7|5 - 7 nights','0,7,10|7 - 10 nights','0,1,1|1 night','0,2,2|2 nights','0,3,3|3 nights','0,4,4|4 nights','0,5,5|5 nights','0,6,6|6 nights','0,7,7|7 nights','0,8,8|8 nights','0,9,9|9 nights','0,10,10|10 nights');
|
||||
var arrTD = new Array('6023185|Africa','203|Alaska','6023099|Asia','6023738|Australia-South Pacific','13|Bahamas','20|Bermuda','6023742|Canada-New England-NY','6022969|Caribbean','6023743|Caribbean-Eastern','6023744|Caribbean-Southern','6023745|Caribbean-Western','6022967|Europe','213|Hawaii','500010|India-Indian Ocean','6023183|Mediterranean','117|Mexico','6023182|Middle East','500001|North America','6023756|North Pacific','-2|Nowhere (no port stops)','6023753|Panama Canal','6023117|South America','-3|Transatlantic','-4|Transpacific','-5|World');
|
||||
//var arrST = new Array('|- Any State -','AL|AL-Alabama','AK|AK-Alaska','AZ|AZ-Arizona','AR|AR-Arkansas','CA|CA-California','CO|CO-Colorado','CT|CT-Connecticut','DE|DE-Delaware','DC|DC-District of Columbia','FL|FL-Florida','GA|GA-Georgia','HI|HI-Hawaii','ID|ID-Idaho','IL|IL-Illinois','IN|IN-Indiana','IA|IA-Iowa','KS|KS-Kansas','KY|KY-Kentucky','LA|LA-Louisiana','ME|ME-Maine','MD|MD-Maryland','MA|MA-Massachusetts','MI|MI-Michigan','MN|MN-Minnesota','MS|MS-Mississippi','MO|MO-Missouri','MT|MT-Montana','NE|NE-Nebraska','NV|NV-Nevada','NH|NH-New Hampshire','NJ|NJ-New Jersey','NM|NM-New Mexico','NY|NY-New York','NC|NC-North Carolina','ND|ND-North Dakota','OH|OH-Ohio','OK|OK-Oklahoma','OR|OR-Oregon','PA|PA-Pennsylvania','RI|RI-Rhode Island','SC|SC-South Carolina','SD|SD-South Dakota','TN|TN-Tennessee','TX|TX-Texas','UT|UT-Utah','VT|VT-Vermont','VA|VA-Virginia','WA|WA-Washington','WV|WV-West Virginia','WI|WI-Wisconsin','WY|WY-Wyoming');
|
||||
var arrST = new Array('|--','AL|AL','AK|AK','AZ|AZ','AR|AR','CA|CA','CO|CO','CT|CT','DE|DE','DC|DC','FL|FL','GA|GA','HI|HI','ID|ID','IL|IL','IN|IN','IA|IA','KS|KS','KY|KY','LA|LA','ME|ME','MD|MD','MA|MA','MI|MI','MN|MN','MS|MS','MO|MO','MT|MT','NE|NE','NV|NV','NH|NH','NJ|NJ','NM|NM','NY|NY','NC|NC','ND|ND','OH|OH','OK|OK','OR|OR','PA|PA','RI|RI','SC|SC','SD|SD','TN|TN','TX|TX','UT|UT','VT|VT','VA|VA','WA|WA','WV|WV','WI|WI','WY|WY');
|
||||
//var arrT1 = new Array('12AM|12:00 AM','1AM|1:00 AM','2AM|2:00 AM','3AM|3:00 AM','4AM|4:00 AM','5AM|5:00 AM','6AM|6:00 AM','7AM|7:00 AM','8AM|8:00 AM','9AM|9:00 AM','10AM|10:00 AM','11AM|11:00 AM','12PM|12:00 PM','1PM|1:00 PM','2PM|2:00 PM','3PM|3:00 PM','4PM|4:00 PM','5PM|5:00 PM','6PM|6:00 PM','7PM|7:00 PM','8PM|8:00 PM','9PM|9:00 PM','10PM|10:00 PM','11PM|11:00 PM','361|Morning','362|Any','721|Noon','1081|Evening');
|
||||
var arrT1 = new Array('362|Any','12AM|12 AM','1AM|1 AM','2AM|2 AM','3AM|3 AM','4AM|4 AM','5AM|5 AM','6AM|6 AM','7AM|7 AM','8AM|8 AM','9AM|9 AM','10AM|10 AM','11AM|11 AM','12PM|12 PM','1PM|1 PM','2PM|2 PM','3PM|3 PM','4PM|4 PM','5PM|5 PM','6PM|6 PM','7PM|7 PM','8PM|8 PM','9PM|9 PM','10PM|10 PM','11PM|11 PM','361|Morn.','721|Noon','1081|Eve.');
|
||||
//var arrT2 = new Array('361|Morning','362|Any','721|Noon','1081|Evening');
|
||||
|
||||
var nextFocus = null;
|
||||
|
||||
function GetDefault(E)
|
||||
{
|
||||
var t = '';
|
||||
var d = '2';
|
||||
var a = new Array();
|
||||
|
||||
switch (E)
|
||||
{
|
||||
case 'A':if(cwid == '1' || cwid == '7'){d = '1';}for (var i = minR; i < (maxR + 1); i++){if (i != maxR){t = t + d + ',';}else{t = t + d;}}return t;break;
|
||||
case 'S':for (var i = minR; i < (maxR + 1); i++){if (i != maxR){t = t + '0,';}else{t = t + '0';}}return t;break;
|
||||
case 'C':for (var i = minR; i < (maxR + 1); i++){if (i != maxR){t = t + '0,';}else{t = t + '0';}}return t;break;
|
||||
case 'CA':
|
||||
for (var i = 1; i < (maxC + 1); i++){if (i != maxC){t = t + '-1,';} else{t = t + '-1';}};
|
||||
for (var i = 0; i < maxR; i++){a[i] = t.split(',');}return a;break;
|
||||
case 'FT':return '362||11AM|361|361|11AM|362||';break;
|
||||
case 'TT':return '362||11AM|1081|1081|11AM|362||';break;
|
||||
}
|
||||
}
|
||||
|
||||
function RemG(el)
|
||||
{
|
||||
var n = el.id.substr(3);
|
||||
switch (el.id.substr(0,3))
|
||||
{
|
||||
case 'fcy':FCity = el.value;DE('FCity').value = FCity;break;
|
||||
case 'tcy':if(n == ''){TCity = el.value;DE('TCity').value = TCity;}break;
|
||||
case 'tci':TCityId = el.value;DE('TCityId').value = TCityId;break;
|
||||
case 'fct':FTLA = el.value;DE('FTLA').value = FTLA;break;
|
||||
case 'tct':TTLA = el.value;DE('TTLA').value = TTLA;break;
|
||||
case 'fdt':FDate = el.value;DE('FDate').value = FDate;break;
|
||||
case 'tdt':TDate = el.value;DE('TDate').value = TDate;break;
|
||||
case 'mon':MDate = el.value;DE('MDate').value = MDate;break;
|
||||
case 'ftt':FTime = el.value;DE('FTime').value = FTime;break;
|
||||
case 'ttt':TTime = el.value;DE('TTime').value = TTime;break;
|
||||
case 'trl':TL = el.value;DE('TL').value = TL;break;
|
||||
case 'ccl':CCl = el.value;DE('CarC').value = CCl;break;
|
||||
case 'rrr':nR = el.options[el.selectedIndex].value;DE('nR').value = nR;break;
|
||||
case 'rad':aRA[n - 1] = el.options[el.selectedIndex].value;DE('aRA').value = aRA.join('|');break;
|
||||
case 'rse':aRS[n - 1] = el.options[el.selectedIndex].value;DE('aRS').value = aRS.join('|');break;
|
||||
case 'rch':aRC[n - 1] = el.options[el.selectedIndex].value;DE('aRC').value = aRC.join('|');break;
|
||||
case 'rca':n = n.split('_');aRCA[n[0] - 1][n[1] - 1] = el.options[el.selectedIndex].value;DE('aRCA').value = aRCA.join('|');break;
|
||||
case 'rIS':if (el.checked){Inf = 's';}DE('Inf').value = Inf;break;
|
||||
case 'rIL':if (el.checked){Inf = 'l';}DE('Inf').value = Inf;break;
|
||||
}
|
||||
}
|
||||
|
||||
function GetSavedValuesG()
|
||||
{
|
||||
var v;
|
||||
v = DE('FCity').value;if (v != '') {FCity = v;}
|
||||
v = DE('TCity').value;if (v != '') {TCity = v;}
|
||||
v = DE('TCityId').value;if (v != '') {TCityId = v;}
|
||||
v = DE('FTLA').value;if (v != '') {FTLA = v;}
|
||||
v = DE('TTLA').value;if (v != '') {TTLA = v;}
|
||||
v = DE('FDate').value;if (v != '') {FDate = v;}
|
||||
v = DE('TDate').value;if (v != '') {TDate = v;}
|
||||
v = DE('MDate').value;if (v != '') {MDate = v;}
|
||||
v = DE('FTime').value;if (v != '') {FTime = v;}
|
||||
v = DE('TTime').value;if (v != '') {TTime = v;}
|
||||
v = DE('CarC').value;if (v != '') {CCl = v;}
|
||||
v = DE('nR').value;if (v != '') {nR = v;}
|
||||
v = DE('aRA').value;if (v != '') {aRA = v.split('|');}
|
||||
v = DE('aRS').value;if (v != '') {aRS = v.split('|');}
|
||||
v = DE('aRC').value;if (v != '') {aRC = v.split('|');}
|
||||
v = DE('aRCA').value;if (v != '') {aRCA = v.split('|');for (var j = 0; j < aRCA.length; j++){aRCA[j] = aRCA[j].split(',');}}
|
||||
v = DE('Inf').value;if (v != '') {Inf = v;}
|
||||
CalS = DE('CalS').value;
|
||||
CalE = DE('CalE').value;
|
||||
|
||||
var sdt = new Date(CalS);
|
||||
var edt = new Date(CalE);
|
||||
var j = 0;
|
||||
var sm = sdt.getMonth() + 1;
|
||||
var em = 12;
|
||||
if(sdt.getYear() == edt.getYear())
|
||||
{
|
||||
em = edt.getMonth() + 1;
|
||||
}
|
||||
for (var i = sm;i <= em;i++)
|
||||
{
|
||||
j = j + 1;
|
||||
}
|
||||
if(edt.getYear() > sdt.getYear())
|
||||
{
|
||||
for (var i = 1;i <= edt.getMonth() + 1;i++)
|
||||
{
|
||||
j = j + 1;
|
||||
}
|
||||
}
|
||||
if(j > 0){nm = j;}
|
||||
}
|
||||
801
include/asterisk/calendar/e.js
Executable file
801
include/asterisk/calendar/e.js
Executable file
@@ -0,0 +1,801 @@
|
||||
function I()
|
||||
{
|
||||
//CancelCal();
|
||||
if(DE('r1')!=null){if(DE('r1').checked){hw('1');return;}}
|
||||
if(DE('r2')!=null){if(DE('r2').checked){hw('2');return;}}
|
||||
if(DE('r3')!=null){if(DE('r3').checked){hw('3');return;}}
|
||||
if(DE('r4')!=null){if(DE('r4').checked){hw('4');return;}}
|
||||
if(DE('r5')!=null){if(DE('r5').checked){hw('5');return;}}
|
||||
if(DE('r6')!=null){if(DE('r6').checked){hw('6');return;}}
|
||||
if(DE('r7')!=null){if(DE('r7').checked){hw('7');return;}}
|
||||
if(DE('r8')!=null){if(DE('r8').checked){hw('8');return;}}
|
||||
if(DE('r9')!=null){if(DE('r9').checked){hw('9');return;}}
|
||||
var b = DE('BundleType').value;
|
||||
if(b=='3'){hw('4');return;}
|
||||
if(b=='7'){hw('5');return;}
|
||||
if(b=='6'){hw('6');return;}
|
||||
if(b=='5'){hw('7');return;}
|
||||
//hw('');
|
||||
}
|
||||
|
||||
function SO()
|
||||
{
|
||||
var p = '';
|
||||
if(typeof(bPageHasDCCoreOffer) != 'undefined')
|
||||
{
|
||||
if(bPageHasDCCoreOffer)
|
||||
{
|
||||
switch (cwid)
|
||||
{
|
||||
case '1':case '7':p = 'Flight';break;
|
||||
case '2':p = 'Hotel';break;
|
||||
case '3':p = 'Car';break;
|
||||
case '4':case '5':case '6':p = 'Package';break;
|
||||
case '8':p = 'Cruise';break;
|
||||
case '9':p = 'Activity';break;
|
||||
}
|
||||
setOffer(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function GetFields(t)
|
||||
{
|
||||
sb.Reset();
|
||||
switch (t)
|
||||
{
|
||||
case 'F':
|
||||
case 'FH':
|
||||
case 'FHC':
|
||||
case 'FC':
|
||||
sb.Concat('<div class="bl1">');
|
||||
sb.Concat('<div class="flmed">' + GetGL('fcy','Leaving from:') + '<br/>' + GetCy(t,'F') + '</div>');
|
||||
sb.Concat('<div class="frmed">' + GetGL('tcy','Going to:') + '<br/>' + GetCy(t,'T') + '</div>');
|
||||
sb.Concat('</div>');
|
||||
sb.Concat('<div class="bl1">');
|
||||
sb.Concat('<div class="flmed">');
|
||||
sb.Concat('<div class="fl">' + GetGL('fdt','Departing:') + '<br/>' + GetDt(t,'F') + '</div>');
|
||||
sb.Concat('<div class="fr">' + GetGL('ftt','Time:') + '<br/>' + GetT(t,'F') + '</div>');
|
||||
sb.Concat('</div>');
|
||||
sb.Concat('<div class="frmed">');
|
||||
sb.Concat('<div class="fl">' + GetGL('tdt','Returning:') + '<br/>' + GetDt(t,'T') + '</div>');
|
||||
sb.Concat('<div class="fr">' + GetGL('ttt','Time:') + '<br/>' + GetT(t,'T') + '</div>');
|
||||
sb.Concat('</div>');
|
||||
sb.Concat('</div>');
|
||||
break;
|
||||
case 'FL':
|
||||
tl = 'Don\'t see the city you\'re looking for?';
|
||||
ti = tl;
|
||||
te = 'Flexible-date searches are currently available only for our most popular routes. You can still search for flights in the usual way by putting in your departure and return dates.';
|
||||
sb.Concat('<div class="bl1">' + GetGL('fct','Leaving from:') + '<br/>' + GetDD('fct',arrFD,FTLA,'large','',' onchange="Rem(this);"') + '</div>');
|
||||
sb.Concat('<div class="bl1">' + GetGL('tct','Going to:') + '<br/>' + GetDD('tct',arrFD,TTLA,'large','',' onchange="Rem(this);"') + '</div>');
|
||||
sb.Concat('<div class="bl1" style="padding-bottom:12px;">' + GetTT(tl,ti,te,0,'','',true) + '</div>');
|
||||
sb.Concat('<div class="bl1">');
|
||||
sb.Concat('<div class="flmed">' + GetGL('mon','Departure month:') + '<br/>' + GetM(nm,MDate,'','',' onchange="Rem(this);"') + '</div>');
|
||||
sb.Concat('<div class="frmed">' + GetGL('trl','Trip length:') + '<br/>' + GetDD('trl',arrTL,TL,'','',' onchange="Rem(this);"') + '</div>');
|
||||
sb.Concat('</div>');
|
||||
sb.Concat('<div class="clearer"></div>');
|
||||
break;
|
||||
case 'H':
|
||||
sb.Concat('<div class="bl1">' + GetGL('tcy','Destination:') + '<br/>' + GetCy(t,'T') + '</div>');
|
||||
sb.Concat('<div class="bl1">');
|
||||
sb.Concat('<div class="flmed">' + GetGL('fdt','Check-in:') + '<br/>' + GetDt(t,'F') + '</div>');
|
||||
sb.Concat('<div class="frmed">' + GetGL('tdt','Check-out:') + '<br/>' + GetDt(t,'T') + '</div>');
|
||||
sb.Concat('</div>');
|
||||
break;
|
||||
case 'C':
|
||||
sb.Concat('<div class="bl1">');
|
||||
sb.Concat('<div class="flmed">' + GetGL('tcy','Pick-up location:') + '<br/>' + GetCy(t,'T') + '</div>');
|
||||
sb.Concat('<div class="frmed">' + GetGL('ccl','Car type:') + '<br/>' + GetDD('ccl',arrCC,CCl,'','',' onchange="Rem(this);"') + '</div>');
|
||||
sb.Concat('</div>');
|
||||
sb.Concat('<div class="bl1">');
|
||||
sb.Concat('<div class="flmed">');
|
||||
sb.Concat('<div class="fl">' + GetGL('fdt','Pick-up:') + '<br/>' + GetDt(t,'F') + '</div>');
|
||||
sb.Concat('<div class="fr">' + GetGL('ftt','Time:') + '<br/>' + GetT(t,'F') + '</div>');
|
||||
sb.Concat('</div>');
|
||||
sb.Concat('<div class="frmed">');
|
||||
sb.Concat('<div class="fl">' + GetGL('tdt','Drop-off:') + '<br/>' + GetDt(t,'T') + '</div>');
|
||||
sb.Concat('<div class="fr">' + GetGL('ttt','Time:') + '<br/>' + GetT(t,'T') + '</div>');
|
||||
sb.Concat('</div>');
|
||||
sb.Concat('</div>');
|
||||
break;
|
||||
case 'HC':
|
||||
sb.Concat('<div class="bl1">' + GetGL('tcy','Destination:') + '<br/>' + GetCy('H','T') + '</div>');
|
||||
sb.Concat('<div class="bl1">');
|
||||
sb.Concat('<div class="flmed">');
|
||||
sb.Concat('<div class="fl">' + GetGL('fdt','Check-in:') + '<br/>' + GetDt(t,'F') + '</div>');
|
||||
sb.Concat('<div class="fr">' + GetGL('ftt','Pick-up:') + '<br/>' + GetT('C','F') + '</div>');
|
||||
sb.Concat('</div>');
|
||||
sb.Concat('<div class="frmed">');
|
||||
sb.Concat('<div class="fl">' + GetGL('tdt','Check-out:') + '<br/>' + GetDt(t,'T') + '</div>');
|
||||
sb.Concat('<div class="fr">' + GetGL('ttt','Drop-off:') + '<br/>' + GetT('C','T') + '</div>');
|
||||
sb.Concat('</div>');
|
||||
sb.Concat('</div>');
|
||||
break;
|
||||
case 'Cr':
|
||||
sb.Concat('<div class="bl1" style="padding-bottom:10px;">');
|
||||
sb.Concat('<b>Note:</b> Cruise air and hotel stays are offered after you select the cruise.');
|
||||
sb.Concat('</div>');
|
||||
sb.Concat('<div class="bl1">' + GetGL('tci','Select a top destination:') + '<br/>' + GetDD('tci',arrTD,TCityId,'large','',' onchange="Rem(this);"') + '</div>');
|
||||
sb.Concat('<div class="bl1">' + GetGL('mon','Departing in:') + '<br/>' + GetM(18,MDate,'','',' onchange="Rem(this);"') + '</div>');
|
||||
break;
|
||||
}
|
||||
sb.Concat('<div class="clearer"></div>');
|
||||
return sb.GetValue();
|
||||
}
|
||||
|
||||
function GetM(n,d,c,s,j)
|
||||
{
|
||||
var dt = new Date();
|
||||
var y = dt.getFullYear();
|
||||
var dd = d;
|
||||
var c1 = 'class="med" ';
|
||||
var s1 = '';
|
||||
if(c != ''){c1 = 'class="' + c + '" ';}
|
||||
if(s != ''){s1 = 'style="' + s + '" ';}
|
||||
if (dd == '' && n == 18)
|
||||
{
|
||||
var nextMonth = new Date(dt.setMonth(dt.getMonth() + 1,1));
|
||||
dd = nextMonth.getMonth() + '-' + nextMonth.getFullYear();
|
||||
}
|
||||
dt = new Date();
|
||||
var t = '<select id="mon" name="mon" ' + c1 + s1 + j +'>';
|
||||
if (n == 18){t = t + '<option value="1/1/4501">All dates</option>';}
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
if (dt.getFullYear() == y){t = t + '<option value="' + dt.getMonth() + '-' + dt.getFullYear() +'">' + arrMN[dt.getMonth()] + '</option>';}
|
||||
else{t = t + '<option value="' + dt.getMonth() + '-' + dt.getFullYear() +'">' + arrMN[dt.getMonth()] + ' ' + dt.getFullYear() + '</option>';}
|
||||
dt.setMonth(dt.getMonth() + 1,1);
|
||||
}
|
||||
t = t + '</select>';
|
||||
return t.replace('value="' + dd + '"','value="' + dd + '" selected="selected"');
|
||||
}
|
||||
|
||||
function SetCC()
|
||||
{
|
||||
var d = DE('divCC');
|
||||
if (d != null)
|
||||
{
|
||||
if (cwid == '7'){SH(d,1);d.innerHTML = '<div class="bl1">' + GetGL('ccl','Car type:') + '<br/>' + GetDD('ccl',arrCC,CCl,'','',' onchange="Rem(this);"') + '</div><div class="clearer"></div>';}
|
||||
else{SH(d,0);}
|
||||
}
|
||||
}
|
||||
|
||||
function GetR(j)
|
||||
{
|
||||
var t = '';
|
||||
var tt = '';
|
||||
rooms = GetRC();
|
||||
t = t + '<select id="rrr" name="rrr"' + j + '>';
|
||||
for (i = minR; i < (maxR + 1); i++)
|
||||
{
|
||||
tt = i == 9 ? '+' : '';
|
||||
if (i == rooms){t = t + '<option value=' + i + ' selected>' + i + tt + '</option>';}
|
||||
else {t = t + '<option value=' + i + '>' + i + tt +'</option>';}
|
||||
}
|
||||
t = t + '</select>';
|
||||
return t;
|
||||
}
|
||||
|
||||
function GetA(r,s,j)
|
||||
{
|
||||
var t = '';
|
||||
var nA = parseInt(aRA[r - 1]);
|
||||
if (s==false)
|
||||
{
|
||||
var nS = parseInt(aRS[r - 1]);
|
||||
if ((nA + nS) <= maxA){nA = nA + nS;}
|
||||
}
|
||||
if (nA > maxA){nA = 1;}
|
||||
var ddName = 'rad' + r;
|
||||
t = t + '<select id="' + ddName + '" name="' + ddName + '"' + j + '>';
|
||||
for (i = minA; i < (maxA + 1); i++)
|
||||
{
|
||||
if (i == nA){t = t + '<option value=' + i + ' selected>' + i + '</option>';}
|
||||
else{t = t + '<option value=' + i + '>' + i + '</option>';}
|
||||
}
|
||||
t = t + '</select>';
|
||||
return t;
|
||||
}
|
||||
|
||||
function GetS(r,j)
|
||||
{
|
||||
var t = '';
|
||||
var ddName = 'rse' + r;
|
||||
t = t + '<select id="' + ddName + '" name="' + ddName + '"' + j + '>';
|
||||
|
||||
for (i = minS; i < (maxS + 1); i++)
|
||||
{
|
||||
if (i == aRS[r - 1]){t = t + '<option value=' + i + ' selected>' + i + '</option>';}
|
||||
else{t = t + '<option value=' + i + '>' + i + '</option>';}
|
||||
}
|
||||
t = t + '</select>';
|
||||
return t;
|
||||
}
|
||||
|
||||
function GetC(r,j)
|
||||
{
|
||||
var t = '';
|
||||
var s = '';
|
||||
if(aRC[r - 1] > maxC){s = maxC;}else{s = aRC[r - 1];}
|
||||
var ddName = 'rch' + r;
|
||||
t = t + '<select id="' + ddName + '" name="' + ddName + '"' + j + '>';
|
||||
for (i = minC; i < (maxC + 1); i++)
|
||||
{
|
||||
if (i == s){t = t + '<option value=' + i + ' selected>' + i + '</option>';}
|
||||
else{t = t + '<option value=' + i + '>' + i + '</option>';}
|
||||
}
|
||||
t = t + '</select>';
|
||||
return t;
|
||||
}
|
||||
|
||||
function GetCA(r,c,j)
|
||||
{
|
||||
var t = '';
|
||||
var ddName = 'rca' + r + '_' + c;
|
||||
t = t + '<select id="' + ddName + '" name="' + ddName + '" ' + j + '>';
|
||||
if (aRCA[r - 1][c - 1] == -1){t = t + '<option value="-1" selected>-?-</option>';}
|
||||
else{t = t + '<option value="-1">-?-</option>';}
|
||||
if (aRCA[r - 1][c - 1] == 0){t = t + '<option value="0" selected><1</option>';}
|
||||
else{t = t + '<option value="0"><1</option>';}
|
||||
for (i = 1; i < 19; i++)
|
||||
{
|
||||
if (i == aRCA[r - 1][c - 1]){t = t + '<option value=' + i + ' selected>' + i + '</option>';}
|
||||
else{t = t + '<option value=' + i + '>' + i + '</option>';}
|
||||
}
|
||||
t = t + '</select>';
|
||||
return t;
|
||||
}
|
||||
|
||||
function SetRASC(n,s)
|
||||
{
|
||||
var h = '';
|
||||
var t = '(19+)';
|
||||
if(s){t = '(19-64)'};
|
||||
|
||||
if(DE('aRA').value == ''){aRA = GetDefault('A').split(',');}
|
||||
if(DE('aRS').value == ''){aRS = GetDefault('S').split(',');}
|
||||
if(DE('aRC').value == ''){aRC = GetDefault('C').split(',');}
|
||||
if(DE('aRCA').value == ''){aRCA = GetDefault('CA');}
|
||||
|
||||
rooms = GetRC();
|
||||
|
||||
if ((cwid == '4') || (cwid == '5') || (cwid == '6')){maxC = 5;} else{maxC = 6;}
|
||||
if (cwid == '2')
|
||||
{
|
||||
if (rooms == 9){maxA = 99; minA = 9;maxC = 99;}
|
||||
else {maxA = 14; minA = 1;}
|
||||
}
|
||||
else
|
||||
{
|
||||
maxA = 6;
|
||||
}
|
||||
|
||||
sb.Reset();
|
||||
if (n == 1)
|
||||
{
|
||||
sb.Concat('<div class="bl1">');
|
||||
sb.Concat('<div class="flrasc">' + GetGL('rad1','Adults ' + t + ':') + '<br/>' + GetA(1,s,' onchange="Rem(this);"') + '</div>');
|
||||
sb.Concat('<div class="flrasc">' + GetGL('rse1','Seniors (65+):') + '<br/>' + GetS(1,' onchange="Rem(this);"') + '</div>');
|
||||
sb.Concat('<div class="flrasc">' + GetGL('rch1','Children (0-18):') + '<br/>' + GetC(1,' onchange="Rem(this);SetCA(' + n + ',' + s + ');"') + '</div>');
|
||||
sb.Concat('</div>');
|
||||
sb.Concat('<div class="clearer"></div>');
|
||||
}
|
||||
else if (n == 2)
|
||||
{
|
||||
for (var j = 1; j < (parseInt(rooms) + 1); j++)
|
||||
{
|
||||
if (j == 1)
|
||||
{
|
||||
sb.Concat('<div class="bl1">');
|
||||
sb.Concat('<div class="flrasc1"><br/>' + GetGL('rrr','Rooms:') + '<br/>' + GetR(' onfocus="HCal();" onchange="Rem(this);SetRASC(' + n + ',' + s + ');"') + '</div>');
|
||||
if (rooms == 1 || rooms == 9)
|
||||
{
|
||||
sb.Concat('<div class="flrasc2"> </div>');
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.Concat('<div class="flrasc2"><br/><br/>Room ' + j + '</div>');
|
||||
}
|
||||
sb.Concat('<div class="flrasc1">' + GetGL('rad1','Adults <br/>' + t + ':') + '<br/>' + GetA(j,s,' onchange="Rem(this);"') + '</div>');
|
||||
if(s)
|
||||
{
|
||||
sb.Concat('<div class="flrasc1">' + GetGL('rse1','Seniors <br/>(65+):') + '<br/>' + GetS(j,' onchange="Rem(this);"') + '</div>');
|
||||
}
|
||||
sb.Concat('<div class="flrasc3">' + GetGL('rch1','Children <br/>(0-18):') + '<br/>' + GetC(j,' onchange="Rem(this);SetCA(' + n + ',' + s + ');"') + '</div>');
|
||||
sb.Concat('</div>');
|
||||
if(rooms == 9) {break;}
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.Concat('<div class="bl1">');
|
||||
sb.Concat('<div class="flrasc1"> </div>');
|
||||
sb.Concat('<div class="flrasc2">Room ' + j + '</div>');
|
||||
sb.Concat('<div class="flrasc1">' + GetA(j,s,' onchange="Rem(this);"') + '</div>');
|
||||
if(s)
|
||||
{
|
||||
sb.Concat('<div class="flrasc1">' + GetS(j,' onchange="Rem(this);"') + '</div>');
|
||||
}
|
||||
sb.Concat('<div class="flrasc3">' + GetC(j,' onchange="Rem(this);SetCA(' + n + ',' + s + ');"') + '</div>');
|
||||
sb.Concat('</div>');
|
||||
}
|
||||
}
|
||||
sb.Concat('<div class="clearer"></div>');
|
||||
}
|
||||
h = sb.GetValue();
|
||||
var d = DE('divRASC');
|
||||
if (d != null)
|
||||
{
|
||||
if (h != ''){SH(d,1);d.innerHTML = h;}
|
||||
else{SH(d,0);}
|
||||
}
|
||||
if (rooms == 9)
|
||||
{
|
||||
SH(DE('divCA'),0);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetCA(n,s);
|
||||
}
|
||||
if (cwid==2){SetST(cwid);}
|
||||
}
|
||||
|
||||
function SetCA(n,s)
|
||||
{
|
||||
sb.Reset();
|
||||
var h = '';
|
||||
var nC = 0;
|
||||
var ddC;
|
||||
var i;
|
||||
var j;
|
||||
var cat = 1;
|
||||
var CA = false;
|
||||
var cu = '';
|
||||
rooms = GetRC();
|
||||
|
||||
if (rooms == '9'){return;}
|
||||
if (n > 0)
|
||||
{
|
||||
for (i = 1; i < (parseInt(rooms) + 1); i++)
|
||||
{
|
||||
ddC = DE('rch' + i);
|
||||
if (ddC != null){nC = parseInt(ddC.options[ddC.selectedIndex].value);if (nC > 0){CA = true;break;}}
|
||||
}
|
||||
}
|
||||
if (CA)
|
||||
{
|
||||
if (n == 1){cat = 0;}
|
||||
if (s){cu = 'ChildUpdate();';}
|
||||
sb.Concat('<div class="bl3">' + GetCAText(cat) + '</div>');
|
||||
if(n == 1)
|
||||
{
|
||||
ddC = DE('rch1');
|
||||
nC = parseInt(ddC.options[ddC.selectedIndex].value);
|
||||
sb.Concat('<div class="bl1">');
|
||||
for (i = 1; i < (nC + 1); i++)
|
||||
{
|
||||
sb.Concat('<div class="flca1">' + GetGL('rca1_' + i,'Child ' + i + ':') + '<br/>' + GetCA(1,i,' onchange="Rem(this);' + cu + '"') + '</div>');
|
||||
}
|
||||
sb.Concat('</div>');
|
||||
sb.Concat(GetInfantHTML());
|
||||
}
|
||||
else if(n == 2)
|
||||
{
|
||||
for (j = 1; j < (parseInt(rooms) + 1); j++)
|
||||
{
|
||||
ddC = DE('rch' + j);
|
||||
if (ddC != null)
|
||||
{
|
||||
nC = parseInt(ddC.options[ddC.selectedIndex].value);
|
||||
if (nC > 0)
|
||||
{
|
||||
sb.Concat('<div class="bl1">');
|
||||
sb.Concat('<div class="flca"><br/>Room ' + j + '</div>');
|
||||
sb.Concat('<div class="flca2">');
|
||||
for (i = 1; i < (nC + 1); i++)
|
||||
{
|
||||
sb.Concat('<div class="flca1">' + GetGL('rca' + j + '_' + i,'Child ' + i + ':') + '<br/>' + GetCA(j,i,' onchange="Rem(this);' + cu + '"') + '</div>');
|
||||
}
|
||||
sb.Concat('</div>');
|
||||
sb.Concat('</div>');
|
||||
sb.Concat('<div class="clearer"></div>');
|
||||
}
|
||||
}
|
||||
}
|
||||
sb.Concat(GetInfantHTML());
|
||||
}
|
||||
sb.Concat('<div class="clearer"></div>');
|
||||
sb.Concat('<div class="clearer"></div>');
|
||||
}
|
||||
h = sb.GetValue();
|
||||
var d = DE('divCA');
|
||||
if (d != null)
|
||||
{
|
||||
if (h != ''){SH(d,1);d.innerHTML = h;if(s){ChildUpdate()};}
|
||||
else{SH(d,0);}
|
||||
}
|
||||
}
|
||||
|
||||
function GetRC()
|
||||
{
|
||||
if(nR > maxR){return maxR;}else{return nR;}
|
||||
}
|
||||
|
||||
function GetCAText(n)
|
||||
{
|
||||
var t = new Array('We will search for any applicable airfare discounts.<br><a href="/pub/agent.dll?qscr=hgen&rhtx=HTX_FLTSRCH_RT&hfnm=h_FW_default.htx#travs">Airline age rules and unaccompanied minors</a>', 'Discounts may be offered to children of certain ages.');
|
||||
return '<b>Specify ages of children at time of travel:</b><br>' + t[n];
|
||||
}
|
||||
|
||||
function GetInfantHTML()
|
||||
{
|
||||
var t = '';
|
||||
var Check1 = '';
|
||||
var Check2 = '';
|
||||
if (Inf == 'l'){Check2 = 'checked="checked"';}
|
||||
if (Inf == 's'){Check1 = 'checked="checked"';}
|
||||
var cl = 'chkFF';
|
||||
if (document.all){cl = 'chkIE'}
|
||||
t = t + '<div id="divHBWinf" class="bl2" style="display:none;padding-top:8px;">';
|
||||
t = t + '<b>Infants (under 2):</b><br/>';
|
||||
t = t + '<input id="rIL" name="infs" type="radio" value="2" ' + Check2 + ' onclick="Rem(this);" class="' + cl + '" /><label for="rIL">laps</label> ';
|
||||
t = t + '<input id="rIS" name="infs" type="radio" value="1" ' + Check1 + ' onclick="Rem(this);" class="' + cl + '" /><label for="rIS">seats</label>';
|
||||
//t = t + '<input id="rIL" type="radio" value="2" name="infs" ' + Check2 + ' onclick="Rem(this);" />laps';
|
||||
//t = t + '<input id="rIS" type="radio" value="1" name="infs" ' + Check1 + ' onclick="Rem(this);" />seats';
|
||||
t = t + '</div>';
|
||||
return t;
|
||||
}
|
||||
|
||||
function ChildUpdate()
|
||||
{
|
||||
var bI = false;
|
||||
var nCA = -1;
|
||||
for (var i = 1; i < (maxR + 1); i++)
|
||||
{
|
||||
for (var j = 1; j < (maxC + 1); j++)
|
||||
{
|
||||
dd = DE('rca' + i + '_' + j);
|
||||
if (dd != null)
|
||||
{
|
||||
nCA = dd.options[dd.selectedIndex].value;
|
||||
if ((nCA == 0) || (nCA == 1)){bI = true;break;}
|
||||
}
|
||||
}
|
||||
if (bI){break;}
|
||||
}
|
||||
dd = DE('divHBWinf');
|
||||
if (dd != null)
|
||||
{
|
||||
if (bI){SH(dd,1);}
|
||||
else{SH(dd,0);}
|
||||
}
|
||||
}
|
||||
|
||||
function SetSearchType()
|
||||
{
|
||||
var b = DE('BundleType');
|
||||
if (cwid == '1'){b.value = 1;}
|
||||
if (cwid == '2'){b.value = 2;}
|
||||
if (cwid == '3'){b.value = 4;}
|
||||
if (cwid == '4'){b.value = 3;}
|
||||
if (cwid == '5'){b.value = 7;}
|
||||
if (cwid == '6'){b.value = 6;}
|
||||
if (cwid == '7'){b.value = 5;}
|
||||
if (cwid == '8'){b.value = 8;}
|
||||
if (cwid == '9'){b.value = 9;}
|
||||
}
|
||||
|
||||
function SetSTG()
|
||||
{
|
||||
sb.Reset();
|
||||
sb.Concat('<div style="float:right;">');
|
||||
sb.Concat('<div style="clear:both;">');
|
||||
sb.Concat('<div style="float:left;">');
|
||||
sb.Concat('<div class="wizBtnLB" onclick="SF();" onmouseover="stmo(\'' + SText + '\');">');
|
||||
sb.Concat('<div class="wizBtnRB">');
|
||||
sb.Concat('<div class="wizBtnMB">' + SText + '</div>');
|
||||
sb.Concat('</div></div></div></div>');
|
||||
//if(SText == "Search for flights" && (!DE('flx') || !DE('flx').checked))
|
||||
if(cwid == '1' && !bFlex)
|
||||
{
|
||||
sb.Concat('<div style="clear:both;">');
|
||||
sb.Concat('<div style="float:left;margin-top:8px;">');
|
||||
sb.Concat('<div class="wizBtnLB" onclick="SFBundle(3);" onmouseover="stmo(\'Search for flights \+ hotels \');">');
|
||||
sb.Concat('<div class="wizBtnRB">');
|
||||
sb.Concat('<div class="wizBtnMB">Search for flights + hotels</div>');
|
||||
sb.Concat('</div></div></div></div>');
|
||||
}
|
||||
sb.Concat('</div>');
|
||||
sb.Concat('<div class="clearer"></div>');
|
||||
|
||||
SetIH('divWst',sb.GetValue());
|
||||
}
|
||||
|
||||
function stmo(wst){window.status = wst;}
|
||||
|
||||
function SetTeleMessage()
|
||||
{
|
||||
var tele = DE('divTele');
|
||||
switch (cwid)
|
||||
{
|
||||
case '1':case '2':case '3':case '7':case '8':case '9':SH(tele,0);break;
|
||||
case '4':case '5':case '6':SH(tele,1);break;
|
||||
}
|
||||
}
|
||||
|
||||
function GetGI(i,d,c,s,j,m)
|
||||
{
|
||||
var c1 = 'class="med" ';
|
||||
var s1 = '';
|
||||
var m1 = 'maxlength="255"';
|
||||
if(document.all){s1 = 'margin-top:-1px;margin-bottom:-1px;';}
|
||||
if(c != ''){c1 = 'class="' + c + '" ';}
|
||||
if(s != '' || s1 != ''){s1 = 'style="' + s + s1 + '" ';}
|
||||
if(m != ''){m1 = 'maxlength="' + m + '" ';}
|
||||
return '<input id="' + i + '" name="' + i + '" value="' + d + '" type="text" ' + m1 + c1 + s1 + j + ' />';
|
||||
}
|
||||
|
||||
function GetGL(i,t){return '<label for="' + i +'" style="cursor:default;">' + t + '</label>';}
|
||||
|
||||
function GetDD(i,a,d,c,s,j)
|
||||
{
|
||||
var a1;
|
||||
var d1 = '';
|
||||
var c1 = 'class="med" ';
|
||||
var s1 = '';
|
||||
if(c != ''){c1 = 'class="' + c + '" ';}
|
||||
if(s != ''){s1 = 'style="' + s + '" ';}
|
||||
for (var k = 0; k < a.length; k++)
|
||||
{
|
||||
a1 = a[k].split('|');
|
||||
d1 = d1 + '<option value="' + a1[0] + '">' + a1[1] + '</option>';
|
||||
}
|
||||
d1 = '<select id="' + i + '" name="' + i + '" ' + c1 + s1 + j + '>' + d1 + '</select>';
|
||||
return d1.replace('value="' + d + '"','selected="selected" value="' + d + '"');
|
||||
}
|
||||
|
||||
function GetCB(i,v,t,d,c,s,j)
|
||||
{
|
||||
var chk = '';
|
||||
var v1 = '';
|
||||
var c1 = 'class="med" ';
|
||||
var c2 = 'class="chkFF" ';
|
||||
if(document.all){c2 = 'class="chkIE" ';}
|
||||
var s1 = '';
|
||||
if(v != ''){v1 = 'value="' + v + '" ';}
|
||||
if(c != ''){c1 = 'class="' + c + '" ';}
|
||||
if(s != ''){s1 = 'style="' + s + '" ';}
|
||||
if(d == '1'){chk = 'checked="checked" ';}
|
||||
//return '<label ' + c1 + '><input id="' + i + '" name="' + i.substr(0,3) + '" type="checkbox" ' + v1 + chk + s1 + j + ' />' + t + '</label>';
|
||||
|
||||
return '<input id="' + i + '" name="' + i.substr(0,3) + '" type="checkbox" ' + v1 + chk + c2 + s1 + j + ' /><label for="' + i +'" ' + c1 + '>' + t + '</label>';
|
||||
}
|
||||
|
||||
function GetCy(t,n)
|
||||
{
|
||||
var c = '';
|
||||
if(t == 'H'){c = 'large';}
|
||||
if (n == 'F'){return GetGI('fcy',FCity,c,'',' autocomplete="off" onblur="Rem(this);" onfocus="HCal();this.select();"','100');}
|
||||
else if (n == 'T'){return GetGI('tcy',TCity,c,'',' autocomplete="off" onblur="Rem(this);" onfocus="HCal();this.select();"','100');}
|
||||
}
|
||||
|
||||
function GetDt(t,n)
|
||||
{
|
||||
var c = 'small';
|
||||
if(t == 'H'){c = '';}
|
||||
if (n == 'F'){return GetGI('fdt',FDate,c,'',' onblur="Rem(this);UpdDt(this);" onclick="event.cancelBubble=true;SC(this);" onfocus="SC(this);"','12');}
|
||||
else if (n == 'T'){return GetGI('tdt',TDate,c,'',' onblur="Rem(this);" onclick="event.cancelBubble=true;SC(this);" onfocus="SC(this);"','12');}
|
||||
}
|
||||
|
||||
function UpdDt(e)
|
||||
{
|
||||
switch(e.id)
|
||||
{
|
||||
case "fdt":
|
||||
var f = DE('fdt');
|
||||
var t = DE('tdt');
|
||||
break;
|
||||
case "pfd":
|
||||
var f = DE('pfd');
|
||||
var t = DE('ptd');
|
||||
break;
|
||||
default:
|
||||
var f = null;
|
||||
var t = null;
|
||||
break;
|
||||
}
|
||||
|
||||
if(null!=f&&null!=t&&null!=GetInputDate(f.value)&&(null==GetInputDate(t.value)||GetInputDate(f.value)>GetInputDate(t.value))){t.value=f.value;}
|
||||
}
|
||||
|
||||
function GetT(t,n)
|
||||
{
|
||||
var d = FTime;
|
||||
var a = arrT1;
|
||||
if(n == 'T'){d = TTime;}
|
||||
if(t == 'C'){a = arrT1.slice(0,25).slice(1,25);if((d.indexOf('AM') < 0 && d.indexOf('PM') < 0) || d == '0AM'){d = '11AM';}}
|
||||
if (n == 'F'){return GetDD('ftt',a,d,'small','',' onchange="Rem(this);" onfocus="HCal();"');}
|
||||
else if (n == 'T'){return GetDD('ttt',a,d,'small','',' onchange="Rem(this);" onfocus="HCal();"');}
|
||||
}
|
||||
|
||||
function sd(e,c)
|
||||
{
|
||||
var t = '';
|
||||
if(c != ''){t = ' class="' + c + '"';}
|
||||
return '<div' + t + '>' + e + '</div>';
|
||||
}
|
||||
|
||||
function SetIH(id,v){var e = DE(id);e.innerHTML = '';e.innerHTML = v;}
|
||||
|
||||
function Trim(s)
|
||||
{
|
||||
var st = s.toString();
|
||||
while(st.charAt(0) == ' '){st = st.substring(1);}
|
||||
while(st.charAt(st.length - 1) == ' '){st = st.substring(0,st.length-2);}
|
||||
return st;
|
||||
}
|
||||
|
||||
function DE(el){return document.getElementById(el);}
|
||||
|
||||
function SH(e,s){if(s){e.style.display = 'block';}else{e.style.display = 'none';}}
|
||||
|
||||
var aS = new Array();
|
||||
function SB(){this.Concat = Concat;this.GetValue = GetValue;this.Reset = Reset;}
|
||||
function Concat(StringToConcat){this.aS[this.aS.length] = StringToConcat;}
|
||||
function GetValue(){return this.aS.join('');}
|
||||
function Reset(){this.aS = null;this.aS = new Array();}
|
||||
|
||||
function SC(el)
|
||||
{
|
||||
if (DE('CalFrame') == null){return;}
|
||||
var id = el.id;
|
||||
var n = el.id.substr(3);
|
||||
if (id.substr(0,3) == 'fdt')
|
||||
{
|
||||
el.select();
|
||||
if(n == ''){
|
||||
ShowCalendar(el,el,null,CalS,CalE);
|
||||
}
|
||||
else if(n == '2'){
|
||||
ShowCalendar(el,el,DE('fdt'),CalS,CalE);
|
||||
}
|
||||
else{
|
||||
ShowCalendar(el,el,DE('fdt' + (n - 1)),CalS,CalE);
|
||||
}
|
||||
}
|
||||
if (id.substr(0,3) == 'tdt'){
|
||||
el.select();
|
||||
ShowCalendar(el,el,DE('fdt'),CalS,CalE);
|
||||
}
|
||||
if (id.substr(0,3) == 'pfd'){
|
||||
el.select();
|
||||
ShowCalendar(el,el,DE('fdt'),CalS,CalE);
|
||||
}
|
||||
if (id.substr(0,3) == 'ptd'){
|
||||
el.select();
|
||||
ShowCalendar(el,el,DE('pfd'),CalS,CalE);
|
||||
}
|
||||
}
|
||||
|
||||
function HCal(e)
|
||||
{
|
||||
var c = DE('CalFrame');
|
||||
//if (c!=null){SH(c,false);}
|
||||
if (c!=null){CancelCal();}
|
||||
var d;
|
||||
d = DE('fdt');
|
||||
if (d!=null){d.value = d.value;}
|
||||
d = DE('tdt');
|
||||
if (d!=null){d.value = d.value;}
|
||||
}
|
||||
|
||||
function SrvyCheck()
|
||||
{
|
||||
var aWiz = {'1':'1','2':'4','3':'3','4':'9','5':'9','6':'9','7':'9','8':'6','9':'28'};
|
||||
var aRate = {'1':58,'2':159,'3':1491,'4':331,'5':331,'6':331,'7':331,'8':2500,'9':500};
|
||||
QualifiedForSurvey(aWiz[cwid], true, 45, aRate[cwid]);
|
||||
return;
|
||||
}
|
||||
|
||||
function SFBundle(bundleId)
|
||||
{
|
||||
DE("BundleType").value = bundleId;
|
||||
SF();
|
||||
}
|
||||
|
||||
function SF()
|
||||
{
|
||||
SrvyCheck();
|
||||
MacIEHack();
|
||||
document.Wiz.submit();
|
||||
}
|
||||
|
||||
function enter(e){var k;if(e.keyCode){k=e.keyCode;}if(e.which){k=e.which;}if(k=='13'){e.cancelBubble=true;SF();}}
|
||||
|
||||
function GetTT(tl,ti,te,w,bc,i,f)
|
||||
{
|
||||
var w1 = 250;
|
||||
var bc1 = '666666';
|
||||
var i1 = '/eta/tip_icon.gif';
|
||||
var i2 = '';
|
||||
if(f){i2 = '<img src="/eta/tip_icon.gif" alt="" style="margin-right:3px;" />';}
|
||||
|
||||
if(w != ''){w1 = w;}
|
||||
if(bc != ''){bc1 = bc;}
|
||||
if(i != ''){i1 = i;}
|
||||
|
||||
return i2 + '<a href="#" onmouseover="stmo(\'' + tl.replace(/\'/g,'\\\'') + '\');return true;" onmouseout="stmo(\'\');return true;" onclick="event.cancelBubble=true;STT(this,\'' + ti.replace(/\'/g,'\\\'') + '\',\'' + te.replace(/\'/g,'\\\'') + '\',' + w1 + ',\'' + bc1 + '\',\'' + i1 + '\');return false;">' + tl + '</a>';
|
||||
}
|
||||
|
||||
function MacIEHack()
|
||||
{
|
||||
var dd;
|
||||
var nc = 0;
|
||||
var ua = navigator.userAgent;
|
||||
if(ua.indexOf('MSIE') > -1 && ua.indexOf('Mac') > -1)
|
||||
{
|
||||
switch (cwid)
|
||||
{
|
||||
case '1':case '7':case '2':case '4':case '5':case '6':
|
||||
aRA = GetDefault('A').split(',');
|
||||
aRS = GetDefault('S').split(',');
|
||||
aRC = GetDefault('C').split(',');
|
||||
aRCA = GetDefault('CA');
|
||||
for(var i = 1; i <= nR; i++)
|
||||
{
|
||||
dd = DE('rad' + i);
|
||||
aRA[i-1] = dd.options[dd.selectedIndex].value;
|
||||
dd = DE('rse' + i);
|
||||
if(dd!=null){aRS[i-1] = dd.options[dd.selectedIndex].value;}
|
||||
dd = DE('rch' + i);
|
||||
nc = dd.options[dd.selectedIndex].value;
|
||||
aRC[i-1] = nc;
|
||||
if (nc > 0)
|
||||
{
|
||||
for (var j = 1; j <= nc; j++)
|
||||
{
|
||||
dd = DE('rca' + i + '_' + j);
|
||||
aRCA[i-1][j-1] = dd.options[dd.selectedIndex].value;
|
||||
}
|
||||
}
|
||||
}
|
||||
DE('aRA').value = aRA.join('|');
|
||||
DE('aRS').value = aRS.join('|');
|
||||
DE('aRC').value = aRC.join('|');
|
||||
DE('aRCA').value = aRCA.join('|');
|
||||
break;
|
||||
case '3':case '8':case '9':
|
||||
break;
|
||||
}
|
||||
if(cwid!='2'&&cwid!='8'&&cwid!='9')
|
||||
{
|
||||
dd=DE('ftt');DE('FTime').value=dd.options[dd.selectedIndex].value;
|
||||
dd=DE('ttt');DE('TTime').value=dd.options[dd.selectedIndex].value;
|
||||
}
|
||||
if(cwid=='8'){dd=DE('mon');DE('MDate').value=dd.options[dd.selectedIndex].value;}
|
||||
}
|
||||
}
|
||||
|
||||
function ecsf(){document.ec.submit();}
|
||||
function ece(e){var k;if(e.keyCode){k=e.keyCode;}if(e.which){k=e.which;}if(k=='13'){e.cancelBubble=true;ecsf();}}
|
||||
|
||||
function getObj(objID)
|
||||
{
|
||||
if (document.getElementById) {return document.getElementById(objID);}
|
||||
else if (document.all) {return document.all[objID];}
|
||||
else if (document.layers) {return document.layers[objID];}
|
||||
}
|
||||
|
||||
var g_rgFreeEventElements=new Array();
|
||||
g_rgFreeEventElements[0] = window;
|
||||
function AddFreeEventElement(elm){FreeEventsOnUnLoad(); g_rgFreeEventElements[g_rgFreeEventElements.length]=elm;}
|
||||
var g_clearElementProps = ['onmouseover','onmouseout','onmousedown','onmouseup','onmousemove','onclick','onkeypress','onkeydown','onkeyup','onblur','onfocus',];
|
||||
var g_fFreeEventOnUnLoad = false;
|
||||
function FreeEventsOnUnLoad()
|
||||
{
|
||||
if (!g_fFreeEventOnUnLoad)
|
||||
{
|
||||
if (window.attachEvent){window.attachEvent("onunload", function(){var el;for(var d = g_rgFreeEventElements.length;d--;){el = g_rgFreeEventElements[d];for(var c = g_clearElementProps.length;c--;){el[g_clearElementProps[c]] = null;}}});}
|
||||
g_fFreeEventOnUnLoad=true;
|
||||
}
|
||||
}
|
||||
246
include/asterisk/calendar/homw.js
Executable file
246
include/asterisk/calendar/homw.js
Executable file
@@ -0,0 +1,246 @@
|
||||
//var bC = true;
|
||||
//window.onload = I;
|
||||
|
||||
function hw(id)
|
||||
{
|
||||
if (id == pwid){return};
|
||||
//if (pwid=='9'&&(parseInt(aRS[0])==0&&parseInt(aRA[0])==0)){aRA = GetDefault('A').split(',');};
|
||||
cwid = id;
|
||||
DE('r' + id).checked = true;
|
||||
SO();
|
||||
SetSearchType();
|
||||
// SetST(cwid);
|
||||
SetMOT(cwid);
|
||||
SetTeleMessage();
|
||||
BuildFields();
|
||||
pwid = cwid;
|
||||
SetST(cwid);
|
||||
//DE('e').style.display = 'none';
|
||||
}
|
||||
|
||||
function BuildFields()
|
||||
{
|
||||
switch (pwid){case '4':case '5':switch (cwid){case '4':case '5':if(!bB){pwid = cwid;return;};break;}break;}
|
||||
if (bB){GetSavedValues();}
|
||||
bB = false;
|
||||
SetIH('divWFields',GetFieldsHTML());
|
||||
BuildRASC();
|
||||
SetCC();
|
||||
}
|
||||
function BuildRASC()
|
||||
{
|
||||
switch (pwid){case '1':case '4':case '5':switch (cwid){case '1':case '4':case '5':if (bB){return ''};break;}break;}
|
||||
var n = 0;
|
||||
switch (cwid)
|
||||
{
|
||||
case '1':case '7':n = 1;break;
|
||||
case '2':case '4':case '5':case '6':n = 2;break;
|
||||
case '3':case '8':n = 0;break;
|
||||
default:n = 0;break;
|
||||
}
|
||||
var s = true;
|
||||
if (cwid == '2' || cwid == '6'){s = false;minA = 1;}else{minA = 0;}
|
||||
if (cwid == '2'){maxR = 9;}else{maxR = 3;}
|
||||
SetRASC(n,s);
|
||||
}
|
||||
|
||||
function GetFieldsHTML()
|
||||
{
|
||||
var t = '';
|
||||
switch (cwid)
|
||||
{
|
||||
case '1':case '4':case '5':case '7':t = GetFields('F');break;
|
||||
case '2':t = GetFields('H');break;
|
||||
case '3':t = GetFields('C');break;
|
||||
case '6':t = GetFields('HC');break;
|
||||
case '8':t = GetFields('Cr');break;
|
||||
default:t = '';break;
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
function GetSavedValues()
|
||||
{
|
||||
GetSavedValuesG();
|
||||
}
|
||||
|
||||
function Rem(el)
|
||||
{
|
||||
RemG(el);
|
||||
}
|
||||
|
||||
function SetMOT(id)
|
||||
{
|
||||
var s2 = '';
|
||||
switch (id)
|
||||
{
|
||||
case '1':
|
||||
s2 = 'Additional options: <br><a href="#" onmouseover="window.status=\'Flight search\';return(true);" onmouseout="window.status=\'\'" onclick="SetOtherOptsURL(1);return(false);">' + GetOtherOptionsText(1) + '</a>, <a href="#" onmouseover="window.status=\'Flight search\';return(true);" onmouseout="window.status=\'\'" onclick="SetOtherOptsURL(2);return(false);">' + GetOtherOptionsText(2) + '</a>';
|
||||
break;
|
||||
case '2':
|
||||
s2 = 'Additional options: <br><a href="#" onmouseover="window.status=\'Hotel search\';return(true);" onmouseout="window.status=\'\'" onclick="SetOtherOptsURL(1);return(false);">' + GetOtherOptionsText(1) + '</a>';
|
||||
break;
|
||||
case '3':
|
||||
s2 = 'Additional options: <br><a href="#" onmouseover="window.status=\'Car search\';return(true);" onmouseout="window.status=\'\'" onclick="SetOtherOptsURL(1);return(false);">' + GetOtherOptionsText(1) + '</a>';
|
||||
break;
|
||||
case '4':
|
||||
s2 = 'Additional options: <br><a href="#" onmouseover="window.status=\'Package search\';return(true);" onmouseout="window.status=\'\'" onclick="SetOtherOptsURL(1);return(false)">' + GetOtherOptionsText(1) + '</a>';
|
||||
break;
|
||||
case '5':
|
||||
s2 = 'Additional options: <br><a href="#" onmouseover="window.status=\'Package search\';return(true);" onmouseout="window.status=\'\'" onclick="SetOtherOptsURL(1);return(false)">' + GetOtherOptionsText(1) + '</a>';
|
||||
break;
|
||||
case '6':
|
||||
s2 = 'Additional options: <br><a href="#" onmouseover="window.status=\'Package search\';return(true);" onmouseout="window.status=\'\'" onclick="SetOtherOptsURL(1);return(false)">' + GetOtherOptionsText(1) + '</a>';
|
||||
break;
|
||||
case '7':s2 = '';break;
|
||||
case '8':
|
||||
s2 = 'Additional options: <br><a href="#" onmouseover="window.status=\'Cruise search\';return(true);" onmouseout="window.status=\'\'" onclick="SetOtherOptsURL(1);return(false)">' + GetOtherOptionsText(1) + '</a>';
|
||||
break;
|
||||
case '9':s2 = '';break;
|
||||
}
|
||||
if(s2 == ''){SH(DE('divO1'),0);}else{SH(DE('divO1'),1);SetIH('divO1',s2);}
|
||||
}
|
||||
|
||||
function GetOtherOptionsText(n)
|
||||
{
|
||||
var s = '';
|
||||
switch (cwid)
|
||||
{
|
||||
case '1':if(n==1){s = 'Flexible dates';}if(n==2){s = 'One way trips...';}break;
|
||||
case '2':s = 'Hotel name, hotel class...';break;
|
||||
case '3':s = 'One-way rentals, in-city rentals...';break;
|
||||
case '4':case '5':case '6':s = 'Multiple destinations...';break;
|
||||
case '7':s = '';break;
|
||||
case '8':s = 'Cruise line, length, star rating ...';break;
|
||||
case '9':s = '';break;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
function SetOtherOptsURL(n)
|
||||
{
|
||||
var URL;
|
||||
var DestId;
|
||||
URL = 'TCity=' + TCity + '&FDate=' + FDate + '&TDate=' + TDate;
|
||||
switch (cwid)
|
||||
{
|
||||
case '1':case '4':case '5':case '7':URL = 'FCity=' + FCity + '&' + URL + '&FTime=' + FTime + '&TTime=' + TTime;break;
|
||||
case '2':break;
|
||||
case '3':case '6':URL = URL + '&FTime=' + FTime + '&TTime=' + TTime;break;
|
||||
case '8':URL = 'TCityId=' + TCityId + '&MDate=' + MDate;break;
|
||||
default:break;
|
||||
}
|
||||
switch (cwid)
|
||||
{
|
||||
case '4':URL = URL + '&wt=FH';break;
|
||||
case '5':URL = URL + '&wt=FHC';break;
|
||||
case '6':URL = URL + '&wt=HC';break;
|
||||
default:break;
|
||||
}
|
||||
URL = URL + GetRASCCAString();
|
||||
switch (cwid)
|
||||
{
|
||||
case '1':
|
||||
URL = '/daily/flights/default.asp?' + URL;
|
||||
if(n==1){URL = URL + '&flex=1';}
|
||||
//if(n==2){URL = URL + '&st=2';}
|
||||
break;
|
||||
case '2':
|
||||
URL = '/daily/hotels/default.asp?' + URL;
|
||||
break;
|
||||
case '3':
|
||||
URL = '/daily/cars/default.asp?' + URL + '&CCl=' + CCl;;
|
||||
break;
|
||||
case '4':
|
||||
case '5':
|
||||
case '6':
|
||||
URL = '/daily/packages/default.asp?' + URL;
|
||||
break;
|
||||
case '7':
|
||||
URL = '/daily/flights/default.asp?' + URL + '&CCl=' + CCl;;
|
||||
break;
|
||||
case '8':
|
||||
URL = '/daily/cruise/default.asp?' + URL;
|
||||
break;
|
||||
}
|
||||
document.location.href = URL + '&ao=1';
|
||||
}
|
||||
|
||||
function SetST(id)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case '1':SText = 'Search for flights';break;
|
||||
case '2':SText = rooms == 9 ? 'Request 9+ hotel rooms' : 'Search for hotel';break;
|
||||
case '3':SText = 'Search for cars';break;
|
||||
case '4':SText = 'Search for flights + hotels';break;
|
||||
case '5':SText = 'Search for flights + hotels + cars';break;
|
||||
case '6':SText = 'Search for hotels + cars';break;
|
||||
case '7':SText = 'Search for flights + cars';break;
|
||||
case '8':SText = 'Search for cruises';break;
|
||||
case '9':SText = 'Search for activities';break;
|
||||
}
|
||||
SetSTG();
|
||||
}
|
||||
|
||||
function GetRASCCAString()
|
||||
{
|
||||
var k = '';
|
||||
switch (cwid)
|
||||
{
|
||||
case '1':
|
||||
case '7':
|
||||
k = k + '&NumRoom=1';
|
||||
k = k + '&NumAdult=' + aRA[0];
|
||||
k = k + '&NumSenior=' + aRS[0];
|
||||
if (aRC[0] > 0)
|
||||
{
|
||||
k = k + '&NumChild=' + aRC[0];
|
||||
for (var i = 0; i < aRC[0]; i++)
|
||||
{
|
||||
k = k + '&Child' + (i + 1) + 'Age=' + aRCA[0][i];
|
||||
}
|
||||
if (Inf == 's'){k = k + '&InfantInSeat=1';}
|
||||
else{k = k + '&InfantInSeat=2';}
|
||||
}
|
||||
break;
|
||||
case '2':
|
||||
case '4':
|
||||
case '5':
|
||||
case '6':
|
||||
k = k + '&NumRoom=' + nR;
|
||||
for (var i = 0; i < nR; i++)
|
||||
{
|
||||
if (nR == 1){k = k + '&NumAdult=' + aRA[i];k = k + '&NumSenior=' + aRS[i];}
|
||||
else{k = k + '&NumAdult' + (i + 1) + '=' + aRA[i];k = k + '&NumSenior' + (i + 1) + '=' + aRS[i];}
|
||||
if (aRC[i] > 0)
|
||||
{
|
||||
if (nR == 1){k = k + '&NumChild=' + aRC[i];}
|
||||
else{k = k + '&NumChild' + (i + 1) + '=' + aRC[i];}
|
||||
for (var j = 0; j < aRC[i]; j++)
|
||||
{
|
||||
if (i == 0){k = k + '&Child' + (j + 1) + 'Age=' + aRCA[i][j];}
|
||||
else{k = k + '&Rm' + (i + 1) + 'Child' + (j + 1) + 'Age=' + aRCA[i][j];}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Inf == 's'){k = k + '&InfantInSeat=1';}
|
||||
else{k = k + '&InfantInSeat=2';}
|
||||
break;
|
||||
case '8':break;
|
||||
}
|
||||
return k;
|
||||
}
|
||||
|
||||
function GetCruiseDatesString()
|
||||
{
|
||||
var k = '';
|
||||
if (MDate == '1/1/4501'){k = '&sdat=1/1/4501';}
|
||||
else
|
||||
{
|
||||
var aD = MDate.split('-');
|
||||
var cd = new Date();
|
||||
if ((aD[0]==cd.getMonth()) && (aD[1]==cd.getFullYear())){k = k + '&sdat=' + (cd.getMonth() + 1) + '/' + cd.getDate() + '/' + cd.getFullYear();}
|
||||
else{k = k + '&sdat=' + (parseInt(aD[0]) + 1) + '/1/' + aD[1];}
|
||||
}
|
||||
return k;
|
||||
}
|
||||
86
include/asterisk/calendar/launcher.js
Executable file
86
include/asterisk/calendar/launcher.js
Executable file
@@ -0,0 +1,86 @@
|
||||
var openedWin = null;
|
||||
var wpercent = 100;
|
||||
|
||||
function launch(){
|
||||
var args = launch.arguments
|
||||
var url = args[0]
|
||||
var width = args[1]
|
||||
var height = args[2]
|
||||
|
||||
if (!url || !width || !height) {
|
||||
alert("Error");
|
||||
} else {
|
||||
var scr_w = screen.availWidth
|
||||
var scr_h = screen.availHeight
|
||||
var target_w = 0
|
||||
var target_h = 0
|
||||
wpercent = 100
|
||||
|
||||
if(width >= scr_w || height >= scr_h){
|
||||
if((width+8) >= (height+27)){
|
||||
target_w = scr_w - 8 //target width is screen width - 8
|
||||
wpercent = Math.floor((target_w * 100)/width) //get percentage scaled down
|
||||
target_h = Math.floor((height * wpercent)/100) - 27 //scale height to percentage then subtract standard title bar height
|
||||
wpercent = Math.floor((target_h * 100)/height) //re-adjust percentage
|
||||
target_w = Math.floor((width * wpercent)/100) //scale width to new percentage
|
||||
width = target_w
|
||||
height = target_h
|
||||
}else if((height+27) > (width+8)){
|
||||
target_h = scr_h - 27
|
||||
wpercent = Math.floor((target_h * 100)/height)
|
||||
target_w = Math.floor((width * wpercent)/100) - 8
|
||||
wpercent = Math.floor((target_w * 100)/width)
|
||||
target_h = Math.floor((height * wpercent)/100)
|
||||
width = target_w
|
||||
height = target_h
|
||||
}
|
||||
}
|
||||
_launch(url, width, height, args[3], args[4], args[5], args[6], args[7], args[8], args[9]);
|
||||
}
|
||||
}
|
||||
|
||||
function _launch(){
|
||||
closeChild()
|
||||
|
||||
var args = _launch.arguments
|
||||
var url = args[0]
|
||||
var width = args[1]
|
||||
var height = args[2]
|
||||
var resizable = args[3] ? "yes" : "no"
|
||||
var scrollbars = args[4] ? "yes" : "no"
|
||||
var toolbar = args[5] ? "yes" : "no"
|
||||
var menubar = args[6] ? "yes" : "no"
|
||||
var status = args[7] ? "yes" : "no"
|
||||
var address = args[8] ? "yes" : "no"
|
||||
var directories = args[9] ? "yes" : "no"
|
||||
|
||||
var NewX = Math.max(0, Math.floor((screen.availWidth-(width+8))/2));
|
||||
var NewY = Math.max(0, Math.floor((screen.availHeight-(height+27))/2));
|
||||
|
||||
var params = ''
|
||||
|
||||
params += "width="+width // 1
|
||||
params += ",height="+height // 2
|
||||
params += ",screenx="+NewX
|
||||
params += ",screeny="+NewY
|
||||
params += ",left="+NewX
|
||||
params += ",top="+NewY
|
||||
params += ",resizable="+resizable // 3
|
||||
params += ",scrollbars="+scrollbars // 4
|
||||
params += ",toolbar="+toolbar // 5
|
||||
params += ",menubar="+menubar // 6
|
||||
params += ",status="+status // 7
|
||||
params += ",location="+address // 8
|
||||
params += ",directories="+directories // 9
|
||||
|
||||
openedWin = window.open(url, "demodashboard", params);
|
||||
}
|
||||
|
||||
function closeChild () {
|
||||
if (openedWin != null) {
|
||||
if (!openedWin.closed) {
|
||||
openedWin.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
onunload = closeChild;
|
||||
Reference in New Issue
Block a user