
function newWindow(mypage,w,h)
{   
   h = screen.height * 0.85;
   w = screen.width * 0.95;


   winprops = "scrollbars=yes,menubar=no,locationbar=no,toolbar=no,resizable=yes,dependent=yes,alwaysRaised=yes,hotkeys=no,directories=no,status=yes," + ' height=' + h +',width=' + w;

   win = window.open(mypage,"theMailMonster",winprops);

}


function navTo(page) {

   window.location = page;

}

function changeFrame(page) {

   document.all.main.src = page;

}

function displayFrame(table,db,otherSQL)
{ 
    document.all.frame1.src="SYS_showRecs.php?tableName=" + table + "&db=" + db + "&" + otherSQL;
}

function displayFramePrint(dir)
{ 

    document.all.frame1.src="showdirectory.php?dir=" + dir;
}



function displayFrameFiles(page)
{ 
    document.all.showFrame.src=page;

}

function setID(idValue)
{ 
   document.all.UPDATE_ID.value = idValue;
}


function goToPageAdd(tableName,db)
{ 
  window.location = 'SYS_addRecs.php?tableName=' + tableName + '&db=' + db
}
function goToPageEdit(tableName,db)
{

  if(document.all.UPDATE_ID.value != '') 
     window.location = 'SYS_editRecs.php?tableName=' + tableName + '&keyID=' + document.all.UPDATE_ID.value  + '&db=' + db;
}

function goToPageDel(tableName,db)
{ 
 if(document.all.UPDATE_ID.value != '') 
   window.location = 'SYS_delRecs.php?tableName=' + tableName + '&keyID=' + document.all.UPDATE_ID.value  + '&db=' + db;
}


function tblColHand(tbl) {
        tbl.style.cursor='pointer'
}


function updateTable()
{
     document.Update_Table.submit();
}

function Select_Value_Set(SelectName, Value) {
  SelectObject = document.all[SelectName];
  for(index = 0; index < SelectObject.length; index++) 
  {
     if(SelectObject[index].value == Value)
       SelectObject.selectedIndex = index;
  }
}


function showSmallPage(page)
{
   move = screen ? 
		',left=' + ((screen.width - 300) >> 1) + ',top=' + ((screen.height - 200) >> 1) : '', 
   o_colWindow = window.open(page, null, "help=no,status=no,scrollbars=no,resizable=no" + move + ",width=400,height=200,dependent=yes", true);
}


function openNewWindow(mypage,w,h)
{   
   h = screen.height * 0.85;
   w = screen.width * 0.82;


   winprops = "scrollbars=yes,menubar=no,locationbar=no,toolbar=no,resizable=yes,dependent=yes,alwaysRaised=yes,hotkeys=no,directories=no,status=yes," + ' height=' + h +',width=' + w;

   win = window.open(mypage,"theMailMonster",winprops);

}

function deleteAdvertiserAccount() 
{
      if(confirm("Are you sure you want to Delete your Account?"))
      {
          navTo('advertiser_DeleteAccount.php');
      }
}

function checkForEnter(formName)
{
   nn=(document.layers)?true:false; 
   ie=(document.all)?true:false; 
   function keyDown(e) { 
       var evt=(e)?e:(window.event)?window.event:null;
       if(evt){
           var key=(evt.charCode)?evt.charCode:((evt.keyCode)?evt.keyCode:((evt.which)?evt.which:0));
           if(key==13){
              document.all[formName].submit();
           }
       }
   }
   document.onkeydown=keyDown; 
   if(nn) document.captureEvents(Event.KEYDOWN); 
}

//******************************************
//***** Payment Fuctions           *********
//******************************************

function quickDepositChangeAmt(thisVal)
{
  document.PAYPAL_FORM.amount.value = thisVal;
  document.PAYPAL_FORM.item_name.value = "Campaign Credit Deposit - $" + thisVal + "";
}

function submitPaypal()
{
  document.all.paypalText.innerHTML = "<B><I>PayPal Payments Page Loading. Please wait...</I></B>";
  document.PAYPAL_FORM.submit();

}

function payPalOpenWindow()
{
   openNewWindow('advertiser_QuickDeposit.php?countryId=1')
}


function getCurrency(inputCountryId)
{
   if (inputCountryId==null || inputCountryId=="")
      countryId = parseInt(countryId); 
   else
      countryId = parseInt(inputCountryId); 

    return cn_currency[countryId];
}
