function view_message(message)
{ var win;
  win=window.open("","ViewMessage","dependent=yes,height=200,width=300,location=no,menubar=no,resizeable=no,scrollbars=no,status=no,titlebar=no,toolbar=no");
  win.document.write(message);
}

function call_listen(call_id)
{ var win;
  win=window.open("get_phone.php?call_id="+call_id,"ViewMessage","dependent=yes,height=200,width=300,location=no,menubar=no,resizeable=no,scrollbars=no,status=no,titlebar=no,toolbar=no");
}

function trim(str)
{ var start_pos=0;
  var end_pos=str.length;
  
  for(start_pos=0;start_pos<end_pos;start_pos++)
    if(str.charAt(start_pos)!=' ') break;
 
 
  for(end_pos=end_pos-1;end_pos>0;end_pos--)
    if(str.charAt(end_pos)!=' ') break;
  
  if((start_pos==str.length)&&(end_pos==0)) return "";
  
  return str.substring(start_pos, end_pos+1);
}   

function validate_email(email)
{ var reg = new RegExp("[-0-9a-z_]+@[0-9a-z_-^.]+\\.[a-z]", 'i');
  if (!reg.test(email)) return false;
  return true;
}
   
function validate_form(form)
{ var mess="";
  if(!trim(form.name.value)) mess+="The Name is empty.\n";
  if(!validate_email(trim(form.email.value))) mess+="The E-Mail is not valid.\n";
  if(!trim(form.message.value)) mess+="The Message is empty.\n";
  if(mess=='') return true;
  alert(mess);
  return false;
}



function showplayer(filename) {
    var fo = new SWFObject("/inc/flowplayer/FlowPlayer.swf", "FlowPlayer", "50%", "200", "7", "#ffffff", true);
    // need this next line for local testing, it's optional if your swf is on the same domain as your html page
    fo.addParam("allowScriptAccess", "always");
    fo.addVariable("config", "{ playList: [ {overlayId: 'play' }, { url: '"+filename+"' } ], autoBuffering: true, initialScale: 'scale', showPlayListButtons: false}");
    fo.write("flowplayerholder");    
}

function OpenPopup (c) {
window.open(c,
'window',
'width=480,height=530,scrollbars=no,status=no');
}

function OpenPopup2 (c) {
window.open(c,
'window',
'width=650,height=990,scrollbars=no,status=no');
}

function OpenPopup3 (c) {
window.open(c,
'window',
'width=420,height=420,scrollbars=no,status=no');
}

function OpenPopup4 (c) {
window.open(c,
'window',
'width=640,height=640,scrollbars=yes,status=no');
}

function OpenPopup5 (c) {
window.open(c,
'window',
'width=840,height=800,scrollbars=yes,status=no');
}

function OpenPopup6 (c) {
window.open(c,
'window',
'width=930,height=615,scrollbars=no,status=no');
}

function OpenPopup7 (c) {
window.open(c,
'window',
'width=480,height=710,scrollbars=no,status=no');
}
