/* BASE HREF */ function base_href(path) { return 'http://www.cvinfo.lt/' + path; // return 'http://localhost/cvinfo.lt/' + path; } /* EXTERNAL LINKS */ function externalLinks() { if (!document.getElementsByTagName) { return; } var anchors = document.getElementsByTagName("a"); for (var i = 0; i < anchors.length; i ++) { var anchor = anchors[i]; if (anchor.getAttribute('href') && anchor.getAttribute('rel') == 'external') { anchor.target = '_blank'; } } } /* DATA FORMS */ function do_update() { document.forms.list.job.value = 'update'; document.forms.list.submit(); } function do_list_update(id) { var form_id = 'list_' + id; var form = document.getElementById(form_id); form.job.value = 'update'; form.submit(); } function do_delete(message) { if (confirm(message) == true) { document.forms.list.job.value = 'delete'; document.forms.list.submit(); } } function do_list_delete(id, message) { var form_id = 'list_' + id; var form = document.getElementById(form_id); if (confirm(message) == true) { form.job.value = 'delete'; form.submit(); } } function do_submit() { document.forms.frm.action.value = 'save'; } /* AGREEMENT POP-UP */ function view_agreement(type) { switch (type) { case "registration": window.open(''+base_href("_agreements/")+'registration_agreement.php','_blank','location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,height=600,width=700,top=150,left=150'); break; case "service": window.open(''+base_href("_agreements/")+'service_agreement.php','_blank','location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,height=600,width=700,top=150,left=150'); break; } } /* SEND CV POP-UP */ function send_cv(worker_id, company_id, job_id) { window.open(''+base_href("_pop/")+'send_cv.php?worker_id='+worker_id+'&company_id='+company_id+'&job_id='+job_id+'','_blank','location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,height=600,width=700,top=150,left=150'); } /* SEND JOB POP-UP */ function send_job(company_id, worker_id, cv_id) { window.open(''+base_href("_pop/")+'send_job.php?company_id='+company_id+'&worker_id='+worker_id+'&cv_id='+cv_id+'','_blank','location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,height=600,width=700,top=150,left=150'); } /* SEND PROPOSAL POP-UP */ function send_proposal(company_id, proposal_id) { window.open(''+base_href("_pop/")+'send_proposal.php?company_id='+company_id+'&proposal_id='+proposal_id+'','_blank','location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,height=450,width=700,top=150,left=150'); } /* SEND PASSWORD POP-UP */ function send_password() { window.open(''+base_href("_pop/")+'send_password.php'+'','_blank','location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,height=330,width=700,top=150,left=150'); } /* SEND LINK POP-UP */ function send_link(link_title, link_url) { window.open(''+base_href("_pop/")+'send_link.php?link_title='+link_title+'&link_url='+escape(link_url)+'','_blank','location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,height=450,width=700,top=150,left=150'); } /* PRINT PAGE POP-UP */ function print_page(url) { // var url = base_href(url); window.open(''+url+'&print_page=true'+'','_blank','location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,height=600,width=700,top=150,left=150'); } /* HINTS */ function show_hint(text, left, top) { var frame = document.getElementById('iframe_hint'); frame.style.display = 'block'; if (navigator.appName == 'Netscape') { frame.style.left = left + 20 + 'px'; frame.style.top = top - 86 + 'px'; } if (navigator.appName == 'Microsoft Internet Explorer') { frame.style.left = left + 20 + 'px'; frame.style.top = top - 90 + 'px'; } window.frames[0].document.getElementById('divHint').innerHTML = text; } function hide_hint() { var frame = document.getElementById('iframe_hint'); frame.style.display = 'none'; window.frames[0].document.getElementById('divHint').innerHTML = ''; } /* SEARCH FORMS */ function show_div(image_id, div_id) { image = document.getElementById(image_id); div = document.getElementById(div_id); if (div.style.display == 'none') { image.src = '_images/delete.gif'; div.style.display = 'inline'; } else { image.src = '_images/add.gif'; div.style.display = 'none'; } } function do_choose() { document.forms.frm.job.value = 'choose'; } /* ADMIN FORMS */ function view_worker(worker_id) { window.open(''+base_href("_admin/")+'view_worker.php?worker_id='+worker_id+'','_blank','location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,height=600,width=740,top=150,left=150'); } function view_company(company_id) { window.open(''+base_href("_admin/")+'view_company.php?company_id='+company_id+'','_blank','location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,height=600,width=740,top=150,left=150'); } function view_service(company_id) { window.open(''+base_href("_admin/")+'view_service.php?company_id='+company_id+'','_blank','location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,height=600,width=740,top=150,left=150'); } function view_cv(worker_id, cv_id) { window.open(''+base_href("_admin/")+'view_cv.php?worker_id='+worker_id+'&cv_id='+cv_id+'','_blank','location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,height=600,width=740,top=150,left=150'); } function view_job(company_id, job_id) { window.open(''+base_href("_admin/")+'view_job.php?company_id='+company_id+'&job_id='+job_id+'','_blank','location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,height=600,width=740,top=150,left=150'); } function view_proposal(company_id, proposal_id) { window.open(''+base_href("_admin/")+'view_proposal.php?company_id='+company_id+'&proposal_id='+proposal_id+'','_blank','location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,height=600,width=740,top=150,left=150'); } function view_order(order_id) { window.open(''+base_href("_admin/")+'view_order.php?order_id='+order_id+'','_blank','location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,height=600,width=740,top=150,left=150'); } function view_invoice(invoice_number, invoice_type) { window.open(''+base_href("_admin/")+'view_invoice.php?invoice_number='+invoice_number+'&invoice_type='+invoice_type+'','_blank','location=0,menubar=0,resizable=0,scrollbars=1,status=0,titlebar=0,toolbar=0,height=600,width=740,top=150,left=150'); } /* TEXTAREA MAXLENGTH */ function maxlength(object, length) { if(object.value.length > length) { object.value = object.value.substring(0, length); } }