/* CREATED: 02/12/03 Generic Javascript Functions for Pixation Pty Ltd - Creation Stations */ function string_remove_quotes(field_name) { //function removes single quotation marks from [field_name]// var searchString="'"; var re=new RegExp(searchString,"g"); var replaceStr=""; //get existing value of current field// temp_value=field_name; if (temp_value!="") { temp_value=temp_value.replace(re,replaceStr); } return(temp_value); } function close_window_current() { //close current window// self.close(); } function close_window_current_focus_parent() { window.opener.focus(); close_window_current(); } function update_field_preferences(field_name) { //open window for field preferences// temp_URL="field_preferences.asp?id="+field_name; fieldpreferences=window.open(temp_URL,"fieldpreferences","width=650,height=250,scrollbars=1,resizable=1,status=1,location=0,copyhistory=0,menubar=0"); fieldpreferences.focus(); } function open_window(field_name,window_name,width,height) { //open window for field preferences// temp_URL=field_name; eval(window_name+"=window.open(temp_URL,'"+window_name+"','width="+width+",height="+height+",scrollbars=1,resizable=1,status=1,location=0,copyhistory=0,menubar=0')"); eval(window_name+".focus()"); } function open_ftp_window(field_name,window_name,width,height) { //open window for field preferences// temp_URL=field_name; eval(window_name+"=window.open(temp_URL,'"+window_name+"','width="+width+",height="+height+",scrollbars=1,resizable=1,status=1,location=0,copyhistory=0,menubar=0')"); //eval(window_name+".focus()"); } function open_manage_images() { var ManageImages=window.open("manage_images.asp","ManageImages","width=700,height=600,resizable=1,scrollbars=1,status=1"); ManageImages.moveTo(10,10); } function open_manage_images_update_thumbnail(form_name,form_field_prefix) { var ManageImages=window.open("manage_images.asp?pxa=update_thumbnail&pxfrnm="+form_name+"&pxfrflpr="+form_field_prefix,"ManageImages","width=700,height=600,resizable=1,scrollbars=1,status=1"); ManageImages.moveTo(10,10); } function open_manage_docs() { var ManageDocs=window.open("manage_docs.asp","ManageDocs","width=700,height=600,resizable=1,scrollbars=1,status=1"); ManageDocs.moveTo(10,10); } function open_image_full(field_name,window_name,width,height) { //open window for field preferences// temp_URL=field_name; eval(window_name+"=window.open(temp_URL,'"+window_name+"','width="+width+",height="+height+",scrollbars=0,resizable=1,status=1,location=0,copyhistory=0,menubar=0')"); eval(window_name+".focus()"); } function open_image_resize(form_name,field_name,form_data_flag,temp_URL,image_URL,image_prefix) { //open window for field preferences// var temp_img=""; if (form_data_flag==1) { temp_img=form_return_value(form_name,field_name); image_url=image_prefix+temp_img; } else { temp_img=image_URL; image_url=image_prefix+image_URL; } if (temp_img=="") alert("No image available for preview."); else { temp_URL=temp_URL+"?pxa="+image_url; //alert(temp_URL); ViewImg=window.open(temp_URL,'ViewImg','width=10,height=10,scrollbars=0,resizable=1,status=0,location=0,copyhistory=0,menubar=0'); ViewImg.focus(); } } function go_page_jump(file_name,current_action,order_string) { jump_to_page=form_get_selection('page_jump','page_jump'); document.page_jump.action=file_name+"?pxa="+current_action+"&order="+order_string+"&pxpage="+jump_to_page; document.page_jump.submit(); } function set_default_sort(file_name,current_action,second_action) { document.sort_options.f_action.value='set_default_sort'; document.sort_options.action=file_name+"?pxa="+current_action+"&pxb="+second_action; document.sort_options.submit(); } function TellAFriend(field_name,id_num,pxs) { //open window for tell a friend function// TempURL="tell_a_friend.asp?pxa="+field_name+"&pxs="+pxs+"&id="+id_num; window.open(TempURL,'tellafriend','width=500,height=450,scrollbars=0,resizable=1,status=0,location=0,copyhistory=0,menubar=0'); } function check_breeds_search() { if (form_get_selection('breeds_search','breeds_search')==false) { alert("Please select at least one of the available breeds from the available listing."); set_focus('breeds_search','breeds_search'); } else document.breeds_search.submit(); }