function appear(domId){ $("#other_sites").fadeIn("slow"); } function fadeOther(domId){ $("#other_sites").fadeOut("slow"); } function validForm() { var err = 0; if (document.tellafriend.your_name.value == "") { document.getElementById('your_name_error').innerHTML = 'Please enter your name'; err++; } else { document.getElementById('your_name_error').innerHTML = ''; } if (document.tellafriend.your_email.value == "") { document.getElementById('your_email_error').innerHTML = 'Please enter your email'; err++; } else { document.getElementById('your_email_error').innerHTML = ''; } if (document.tellafriend.friends_name.value == "") { document.getElementById('friends_name_error').innerHTML = 'Please enter your friends name'; err++; } else { document.getElementById('friends_name_error').innerHTML = ''; } if (document.tellafriend.friends_email.value == "") { document.getElementById('friends_email_error').innerHTML = 'Please enter your friend email'; err++; } else { document.getElementById('friends_email_error').innerHTML = ''; } if (err > 0) { return false; } else { return true; } } function checkStuff() { document.getElementById('error_terms').innerHTML = ''; document.getElementById('error_confirm').innerHTML = ''; document.getElementById('error_mail').innerHTML = ''; document.getElementById('blankfirstname').innerHTML = ''; document.getElementById('blanklastname').innerHTML = ''; document.getElementById('blankemailaddress').innerHTML = ''; if (document.leads.ba.value == "0") { document.getElementById('error_attending').innerHTML = ''; document.getElementById('error_select').innerHTML = ''; } var fls = 0; if (document.leads.agree.checked == false) { document.getElementById('error_terms').innerHTML = 'Please confirm you accept the competition terms and conditions'; fls = 1; } if (document.leads.emailaddress.value != document.leads.currentemail.value) { if (document.leads.confirmaddress.value != document.leads.emailaddress.value) { document.getElementById('error_confirm').innerHTML = 'Please ensure your email addresses match'; fls = 1; } } if (document.leads.ba.value == "0") { if (document.leads.segment.value == "0") { document.getElementById('error_select').innerHTML = 'Please select a category that best describes you'; fls = 1; } } if (document.leads.firstname.value == "") { document.getElementById('blankfirstname').innerHTML = 'First name cannot be blank'; fls = 1; } if (document.leads.surname.value == "") { document.getElementById('blanklastname').innerHTML = 'Last name cannot be blank'; fls = 1; } if (document.leads.emailaddress.value == "") { document.getElementById('blankemailaddress').innerHTML = 'Please enter a valid email address'; fls = 1; } if (checkRadio() != true && document.leads.ba.value == "0") { fls = 1; } if (document.leads.ba.value == "0") { if (checkRadioB() != true && document.leads.ba.value == "0") { fls = 1; } } if (fls == 0) { return true; } else if (fls == 1) { return false; } } function checkRadio() { var radio_choice = false; for (counter = 0; counter < document.leads.staycontact.length; counter++) { if (document.leads.staycontact[counter].checked) { radio_choice = true; } } if (!radio_choice) { document.getElementById('error_mail').innerHTML = "Please select 'Yes' if you would like to recieve updates from us or 'No' if you don't"; return false; } else { return true; } } function checkRadioB() { var radio_choice = false; for (counter = 0; counter < document.leads.attending.length; counter++) { if (document.leads.attending[counter].checked) { radio_choice = true; } } if (!radio_choice) { document.getElementById('error_attending').innerHTML = "Please select 'Yes' if you are attending uni or 'No' if you're not."; return false; } else { return true; } } function add_bookmark() { var title = document.title; var url = document.location; if(window.sidebar) // Firefox { window.sidebar.addPanel(title, url,''); } else if(window.opera)//Opera { var a = document.createElement("A"); a.rel = "sidebar"; a.target = "_search"; a.title = title; a.href = url; a.click(); } else if(document.all) //IE { window.external.AddFavorite(url, title); } } var popup_on_complete = null; var hover_box; function create_blocking_element() { window.scroll(0, 0); var blocking_div = document.createElement('div'); blocking_div.setAttribute('id', 'blockingdiv'); blocking_div.style.backgroundColor = '#000000'; blocking_div.style.opacity = 0.50; blocking_div.style.filter = 'alpha(opacity=50)'; blocking_div.style.position = 'absolute'; document.documentElement.style.overflow = 'hidden'; blocking_div.style.width = '100%'; blocking_div.style.height = '100%'; blocking_div.style.top = '0px'; blocking_div.style.left = '0px'; blocking_div.style.zIndex = 1001; document.body.appendChild(blocking_div); } function popup_detail(on_complete_function) { var width = '48%'; var height = '520px'; create_blocking_sub_element(); hover_box = document.createElement('div'); hover_box.setAttribute('id', 'hover_box'); hover_box.style.width = width; hover_box.style.height = height; hover_box.style.position = 'absolute'; hover_box.style.top = '25px'; hover_box.style.left = '26%'; hover_box.style.border = '0 none'; hover_box.style.backgroundColor = '#FFFFFF'; hover_box.style.zIndex = 1002; var title_bar = document.createElement('table'); var title_body = document.createElement('tbody'); var title_row = document.createElement('tr'); var title_cell = document.createElement('td'); title_bar.setAttribute('id', 'hover_title'); hover_box.appendChild(title_bar); title_bar.appendChild(title_body); title_body.appendChild(title_row); title_row.appendChild(title_cell); title_cell.setAttribute('align', 'right'); title_cell.style.height = '20px'; title_cell.style.width = '100%'; title_cell.style.padding = '2px'; title_cell.style.paddingRight = '4px'; title_cell.innerHTML = ''; title_bar.style.width = '100%'; title_bar.setAttribute('cellspacing', '0'); title_bar.setAttribute('cellpadding', '0'); title_bar.style.borderCollapse = 'collapse'; var content_row = document.createElement('tr'); title_body.appendChild(content_row); var content_td = document.createElement('td'); content_td.style.padding = '10px'; content_td.innerHTML = '
Tell us who you are and we can make sure we keep you up to date with the most helpful information. Are you a domestic or an international student?
'; content_row.appendChild(content_td); document.body.appendChild(hover_box); popup_on_complete = on_complete_function; } function popup_detail_complete() { var hover_box = document.getElementById('hover_box'); hover_box.parentNode.removeChild(hover_box); var blocking_el = document.getElementById('blockingdiv'); blocking_el.parentNode.removeChild(blocking_el); document.documentElement.style.overflow = 'auto'; } function popup_tisc_helppack_form() { create_blocking_element(); var hover_box = document.createElement('div'); hover_box.id = 'hover_box'; hover_box.style.top = '10%'; hover_box.style.left = '10%'; hover_box.style.position = 'absolute'; hover_box.style.border = '0 none'; hover_box.style.backgroundColor = '#FFFFFF'; hover_box.style.zIndex = 1002; hover_box.innerHTML = '| Close |
';
blocking_div_x.backgroundcolor = '#ffffff';
blocking_div_x.border = '2px solid #555555';
blocking_div_x.padding = '3px';
blocking_div_x.style.zIndex = 1003;
document.body.appendChild(blocking_div_x);
}
function getY( oElement )
{
var iReturnValue = 0;
while( oElement != null ) {
iReturnValue += oElement.offsetTop;
oElement = oElement.offsetParent;
}
return iReturnValue;
}
function course_popup_detail(on_complete_function,unitcode)
{
var width = '46%';
var height = '500px';
create_blocking_sub_element();
hover_box = document.createElement('div');
hover_box.setAttribute('id', 'hover_box');
hover_box.style.width = width;
hover_box.style.height = height;
hover_box.style.position = 'absolute';
hover_box.style.top = '10px';
hover_box.style.left = '25%';
hover_box.style.border = '0 none';
hover_box.style.backgroundColor = '#ffffff';
hover_box.style.margin = "15px";
hover_box.style.padding = "10px";
hover_box.style.zIndex = 1002;
$.ajax({
type: "POST",
url: "/Ccpr/course_structure/unit.php?unittxt=" + unitcode,
success: function(html){
hover_box.innerHTML = html;
}
});
document.body.appendChild(hover_box);
popup_on_complete = on_complete_function;
}
function taf_popup_detail(on_complete_function)
{
var width = '46%';
var height = '500px';
create_blocking_sub_element();
hover_box = document.createElement('div');
hover_box.setAttribute('id', 'hover_box');
hover_box.style.width = width;
hover_box.style.height = height;
hover_box.style.position = 'absolute';
hover_box.style.top = '10px';
hover_box.style.left = '25%';
hover_box.style.border = '0 none';
hover_box.style.backgroundColor = '#ffffff';
hover_box.style.margin = "15px";
hover_box.style.padding = "10px";
hover_box.style.zIndex = 1002;
var title_bar = document.createElement('table');
var title_body = document.createElement('tbody');
var title_row = document.createElement('tr');
var title_cell = document.createElement('td');
title_bar.setAttribute('id', 'hover_title');
hover_box.appendChild(title_bar);
title_bar.appendChild(title_body);
title_body.appendChild(title_row);
title_row.appendChild(title_cell);
title_cell.setAttribute('align', 'right');
title_cell.style.height = '1px';
title_cell.style.width = '100%';
title_cell.style.background = '#ffffff';
title_cell.style.padding = '2px';
title_cell.style.paddingRight = '4px';
title_cell.innerHTML = '';
title_bar.style.width = '100%';
title_bar.setAttribute('cellspacing', '0');
title_bar.setAttribute('cellpadding', '0');
title_bar.style.borderCollapse = 'collapse';
var content_row = document.createElement('tr');
title_body.appendChild(content_row);
var content_td = document.createElement('td');
content_td.style.padding = '10px';
$.ajax({
type: "POST",
url: "/Ccpr/tell_a_friend/tellafriend.php",
success: function(html){
content_td.innerHTML = html;
var urlarr = document.location.href;
var urlarrb = urlarr.split("?");
var urllink = urlarrb[0];
urllink = urllink.replace("#","");
document.getElementById('url').value = urllink;
document.getElementById('link').value = urllink;
document.getElementById('link').innerHTML = urllink;
//var form = html.getElementById('tellafriend');
//alert(html);
$("#tellafriend").ajaxForm(function() {
if (validForm()) {
$("#tellafriend_container").empty();
$("#tellafriend_container").html("Your submission has been mailed to your friend");
} else {
return false;
}
});
}
});
content_row.appendChild(content_td);
document.body.appendChild(hover_box);
popup_on_complete = on_complete_function;
}
function course_popup_detail_complete()
{
var hover_box = document.getElementById('hover_box');
hover_box.parentNode.removeChild(hover_box);
var blocking_el = document.getElementById('blockingdiv');
blocking_el.parentNode.removeChild(blocking_el);
document.documentElement.style.overflow = 'auto';
}
function course_popup_detail_sub_complete()
{
var hover_box = document.getElementById('hover_box');
hover_box.parentNode.removeChild(hover_box);
var blocking_el = document.getElementById('blockingdiv');
blocking_el.parentNode.removeChild(blocking_el);
var blocking_ela = document.getElementById('blockingdivx');
blocking_ela.parentNode.removeChild(blocking_ela);
document.documentElement.style.overflow = 'auto';
}
function taf_popup_detail_complete()
{
var hover_box = document.getElementById('hover_box');
hover_box.parentNode.removeChild(hover_box);
var blocking_el = document.getElementById('blockingdiv');
blocking_el.parentNode.removeChild(blocking_el);
document.documentElement.style.overflow = 'auto';
}
function terms_popup_detail(on_complete_function)
{
var width = '46%';
var height = '500px';
create_blocking_sub_element();
hover_box = document.createElement('div');
hover_box.setAttribute('id', 'hover_box');
hover_box.style.width = width;
hover_box.style.height = height;
hover_box.style.position = 'absolute';
hover_box.style.top = '10px';
hover_box.style.left = '25%';
hover_box.style.border = '0 none';
hover_box.style.backgroundColor = '#ffffff';
hover_box.style.margin = "15px";
hover_box.style.padding = "10px";
hover_box.style.overflow = "auto";
hover_box.style.zIndex = 1002;
$.ajax({
type: "POST",
url: "http://www.taj.edu.au/Terms/",
success: function(html){
hover_box.innerHTML = html;
}
});
document.body.appendChild(hover_box);
popup_on_complete = on_complete_function;
}