
// ***************************
// Function pop_EmailSendWnd()
// ***************************

function pop_EmailSendWnd()
{

 //processing to replace carriage return with a special character
 var lWebFrmMessage = document.FormOnlineEmail.InputMessage.value;
 lWebFrmMessage     = lWebFrmMessage.replace(/\r\n/g,"<br>");
 lWebFrmMessage     = lWebFrmMessage.replace(/\r/g,"<br>");
 lWebFrmMessage     = lWebFrmMessage.replace(/\n/g,"<br>");

 var url = 'http://www.wamp-it.com/wamp-email-message.php?' +
           'argEmail=' + document.FormOnlineEmail.InputEmail.value +
           '&argSubject=' + document.FormOnlineEmail.InputSubject.value +
           '&argFullName=' + document.FormOnlineEmail.InputFullName.value +
           '&argTelephone=' + document.FormOnlineEmail.InputTelephone.value +
           '&argMessage=' + lWebFrmMessage;

 //remove a attribute if you don't want it to show up
 var popit = window.open(url,'console','scrollbars=0,resizable=0,menubar=0,width=450,height=450');

 popit.moveTo(50,50);
 if (window.focus) {popit.focus()}

 return true;
}


// ************************
// Function pop_MapWindow()
// ************************

function pop_MapWindow(url)
{
 //remove a attribute if you don't want it to show up
 var popit = window.open(url,'console','scrollbars=0,resizable=0,menubar=0,width=605,height=660');
 popit.moveTo(50,50);
 if (window.focus) {popit.focus()}
}


// **********************
// Function pop_PictWnd()
// **********************

function pop_PictWnd(url)
{
 //pop up a window to show picture
 var popit = window.open(url,'wamp','scrollbars=0,resizable=0,menubar=0,width=380,height=294');

 popit.moveTo(50,50);
 if (window.focus) {popit.focus()}
}


// ****************************
// Function pop_FeedbackUsWnd()
// ****************************

function pop_FeedbackUsWnd()
{

 var lFormErrorMsg = "";
 var lAlertWndMsg = "";

 if (document.FormOnlineEmail.InputEmail.value.length ==0 || (document.FormOnlineEmail.InputEmail.value.indexOf("@",0) == -1 || document.FormOnlineEmail.InputEmail.value.indexOf(".",0) == -1)) {
     lFormErrorMsg +="WARNING ! Please enter valid email address";
 }
 if ((lFormErrorMsg != "")){
     lFormErrorMsg += alert(lAlertWndMsg + lFormErrorMsg);

     document.FormOnlineEmail.InputEmail.focus();
     return true;
 }


 //processing to replace carriage return with a special character
 var lWebFrmMessage = document.FormOnlineEmail.InputMessage.value;
 lWebFrmMessage     = lWebFrmMessage.replace(/\r\n/g,"<br>");
 lWebFrmMessage     = lWebFrmMessage.replace(/\r/g,"<br>");
 lWebFrmMessage     = lWebFrmMessage.replace(/\n/g,"<br>");

 var url = 'http://www.wamp-it.com/wamp-email-message.php?' +
           'argEmail=' + document.FormOnlineEmail.InputEmail.value +
           '&argSubject=' + document.FormOnlineEmail.InputSubject.value +
           '&argFullName=' + document.FormOnlineEmail.InputFullName.value +
           '&argTelephone=' + document.FormOnlineEmail.InputTelephone.value +
           '&argMessage=' + lWebFrmMessage;

 //remove a attribute if you don't want it to show up
 var popit = window.open(url,'console','scrollbars,resizable,width=450,height=450');

 popit.moveTo(50,50);
 if (window.focus) {popit.focus()}

 return true;
}


// *******************************
// Function clean_WebPageAddress()
// *******************************

function clean_WebPageAddress(url)
{
 var lThisPageAddress = url;
 var lIndexQuestionMark = lThisPageAddress.indexOf("?",0);
 var lIndexHashSymbol = lThisPageAddress.indexOf("#",0);

 // remove Question Mark from web address
 if (lIndexQuestionMark != -1)
 {
   lThisPageAddress = lThisPageAddress.substring(0,lIndexQuestionMark);
 }

 // remove Hash Sign from web address
 if (lIndexHashSymbol != -1)
 {
   lThisPageAddress = lThisPageAddress.substring(0,lIndexHashSymbol);
 }

 return lThisPageAddress;
}


// ********************************
// Function build_WebPageFullLink()
// ********************************

function build_WebPageFullLink(url)
{
 var lThisPageAddress = url;
 lThisPageAddress = clean_WebPageAddress(lThisPageAddress);

 lThisPageAddress = '<b><a href="' + lThisPageAddress + '">' + lThisPageAddress + '<\/a><\/b>';

 return lThisPageAddress;
}


// ******************************
// Function pop_ShareWebPageWnd()
// ******************************

function pop_ShareWebPageWnd()
{
 var url = 'http://www.wamp-it.com/wamp-email-web-url.php?' +
           'argEmail=' + document.FormShareWebPage.InputEmail.value +
           '&argWebPageAddress=' + document.FormShareWebPage.InputWebPageAddress.value;

 //remove a attribute if you don't want it to show up
 var popit = window.open(url,'console','scrollbars=0,resizable=0,menubar=0,width=450,height=210');

 popit.moveTo(50,50);
 if (window.focus) {popit.focus()}

 return true;
}