function email_newsletter_signup() { if(echeck(document.frmSignUpNews.mailing_list_email.value)) { document.frmSignUpNews.submit(); } else { alert("Please enter a valid email."); } } function reset_email_input() { if(document.email_reset == undefined) { document.frmSignUpNews.mailing_list_email.value = ''; document.email_reset=1; } } function new_window(which_file,w,h,with_scroll,fixed_size) { LP = (screen.width) ? (screen.width-w)/2 : 0; TP = (screen.height) ? (screen.height-h)/2 : 0; if (fixed_size) { fixed_size = "yes"; } else { fixed_size = "no"; } if (with_scroll) { with_scroll = "yes"; } else { with_scroll = "no"; } if (typeof(cWin) != "undefined") { cWin.close(); } cWin = window.open(which_file, "StagingMadeSimpleWin","width="+w+",height="+h+",scrollbars="+with_scroll+",location=no,left="+LP+",top="+TP+",menubar=no,resizable="+fixed_size+",toolbar=no,status=no"); } function email_page(uri) { var w = 500; var h = 400; var LP = (screen.width) ? (screen.width-w)/2 : 0; var TP = (screen.height) ? (screen.height-h)/2 : 0; EmailListingPage = window.open("pages/email_page_form.php?uri=" + uri, "EmailListingPage","width=" + w + ",height=" + h + ",scrollbars=no,location=no,left="+LP+",top="+TP+",menubar=no,resizable=yes,toolbar=no,status=no"); } function view_listing(id) { document.location.href = 'index.php?display=portfolio_listing&listing_id=' + id; } function view_listing_testimonial(id) { document.location.href = 'index.php?display=testimonial_listing&listing_id=' + id; } function view_image(id) { new_window('view_image.php?img_id=' + id, 600,600, 'no', 'yes'); } function view_portfolio_image(dir, file_index, w, h) { LP = (screen.width) ? (screen.width-w)/2 : 0; TP = (screen.height) ? (screen.height-h)/2 : 0; file_index = (file_index != '') ? file_index : ""; //new_window("view_portfolio_image.php?dir=" + dir + "&file_index=" + file_index, w, h, 'no', 'yes'); PortfolioWin = window.open("view_portfolio_image.php?dir=" + dir + "&file_index=" + file_index, "PortfolioWin","width="+w+",height="+h+",scrollbars=no,location=no,left="+LP+",top="+TP+",menubar=no,resizable=yes,toolbar=no,status=no"); } function resizeWin(w, h) { //alert("w: " + w + " h: " + h); window.resizeTo(w,h); } function view_portfolio_page(page_num, view_limit) { document.location.href = 'index.php?display=portfolio&portfolio_page_num=' + page_num + '&portfolio_view_limit=' + view_limit; } function view_testimonial_page(page_num, view_limit) { document.location.href = 'index.php?display=testimonial&testimonial_page_num=' + page_num + '&testimonial_view_limit=' + view_limit; } function change_view_limit(display) { var view_limit = document.getElementById('view_limit').options[document.getElementById('view_limit').selectedIndex].value; document.location.href = 'index.php?display=' + display + '&portfolio_page_num=1&portfolio_view_limit=' + view_limit; } function change_view_limit_testimonial(display) { var view_limit = document.getElementById('view_limit').options[document.getElementById('view_limit').selectedIndex].value; document.location.href = 'index.php?display=' + display + '&testimonial_page_num=1&testimonial_view_limit=' + view_limit; } function register() { } function echeck(str) { var at="@" var dot="." var lat=str.indexOf(at) var lstr=str.length var ldot=str.indexOf(dot) if (str.indexOf(at)==-1){ return false } if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){ return false } if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){ return false } if (str.indexOf(at,(lat+1))!=-1){ return false } if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){ return false } if (str.indexOf(dot,(lat+2))==-1){ return false } if (str.indexOf(" ")!=-1){ return false } return true; }