﻿var fieldArray = new Array();
fieldArray[0] = "full_name|Full Name|blank";
fieldArray[1] = "email|Email address|email,blank";
var bgImgCounter = 0;
function getUrlInBackground(url) {
                                one = eval("bgImage" + bgImgCounter + " = new Image()");
                                two = eval("bgImage" + bgImgCounter + ".src = '" + url + "'");
                                bgImgCounter++;
}
function submitForm(f, type){
                var url = '';
                if(validate(fieldArray, f)){
                                var url = "https://creditconcepts.insidesales.com/do=noauth/add_lead?";
                                                url += "oi=1";
                                                url += "&routing_rule_id=7";
                                                url += "&lead_source_id=43";
                                                url += "&lead_status_id=1";
                                                url += "&account_name="+f.full_name.value;
                                                url += "&phone="+f.phone.value;
                                                url += "&email="+f.email.value;
                                                url += "&selected_campaign_id=1";
                                                url += "&save=1";
                                           //     url += "&return_status_info_id=1";
                                                url += "&no_html=1";
                                                url += "&dup_campaign_id=17";
                                                url += "&dup_basis=phone,email";
                                                url += "&relate_to_dup=1";
												url += "&call_now=1";
                                if (type == "ebook")
                                {
                                                                url += "&lead_source_id=38";
                                }

                               
                                getUrlInBackground(url);
                               
//                                f.category2.value = f.full_name.value;
//                                f.category3.value = f.email.value;
//                                f.custom_Phone.value = f.phone.value;
                                return true;
                }
                return false;
}
 
 
function myPopup(url) {
                window.open( url, "myWindow", "status = 1, height = 350, width = 400, resizable = 0" )
}
