OBGYN.net Staff

home / authors / obgynnet-staff

Articles


Site Logo

halo popup

May 26th 2011

/* @override http://dev.facilitydude.com/css/facilitydude.css *//* @group Blog */.social_links li#tellfriendhover { position: relative;}#tellfriend { position: absolute; margin-top: 250px; *margin-top: 250px; /* IE7 and below */ *margin-left: 100px; /* IE7 and below */ left: 60px; color: #fff; padding: 15px; margin-bottom: 20px; width: 450px; z-index: 5000; border: 1px solid #ccc; -webkit-border-radius: 5px; -moz-border-radius: 5px; background-color: #f2f2f2;}#tellfriend a.close { position: absolute; right: -10px; top: -10px; _right: 0px; /* IE6 and below */ _top: 0px; /* IE6 and below */ background: url(http://imaging.ubmmedica.com/all/jquery/fancy_closebox.png) no-repeat; height: 30px; width: 30px; overflow: hidden; text-indent: -1000px;}#tellfriend form textarea { height: 80px;}/* @end *//* @group Forms */.contact-form { padding: 15px; margin-bottom: 20px; border: 1px solid #ccc; -webkit-border-radius: 5px; -moz-border-radius: 5px; background-color: #f2f2f2; z-index:5000;}.contact-form form input.std_input { margin-bottom: 10px;}form label.clear { clear: both; float: left; margin-top: 10px;}form label.full { width: 99%;}form label.required { font-weight: bold;}form select { margin-bottom: 10px; background-color: #fff; border: 1px solid #ccc; font: 14px "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; color: #6e6e6e;}form label { --color: #808080; color: #000000; font-size: 14px;}form input.std_input,form textarea { --border: 1px solid #ccc; width: 90%; font: 15px "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; padding: 5px; padding-left:20px; color: #6e6e6e; --background-color: transparent; --border-style: none; border: 1px solid #ccc; -webkit-border-radius: 5px; -moz-border-radius: 5px;}form table { width: 100%;}form table input.std_input { width: 93%;}form table.three-col input.std_input { width: 90%;}form input.form_but { margin-top: 10px; float: left; background-color: #93ba31; border: 3px solid #afdd39; color: #fff; font: bold 15px "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; -webkit-border-radius: 5px; -moz-border-radius: 5px; padding: 5px 10px;}#message_std, #subject { border: none; background-color: #f2f2f2; color: #3B3B3B; font: 14px "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;}#message_std { padding-left: 25px;}.loading { float:right; background:url(http://imaging.ubmmedica.com/all/jquery/ajax-loader-clock.gif) no-repeat 1px; height:50px; width:50px; display:none; color: black;}.done { background:url(iconIdea.gif) no-repeat 2px; padding-left:20px; font-family:arial; font-size:12px; width:70%; margin:20px auto; display:none}.element * { padding:5px; margin:2px; font-family:arial; font-size:12px;}.element label { float:left; width:450px; font-weight:700; text-align: left;}.element input.text { float:left; width:270px; padding-left:20px;}.element .textarea { height:120px; width:270px; padding-left:20px;}.element .hightlight { border:2px solid #9F1319; background:url(http://imaging.ubmmedica.com/all/jquery/iconCaution.gif) no-repeat 2px; background-color: #FFFFFF;}.element #submit { float:right; margin-right:10px;}div .help { color: black;}#dialog-overlay { /* set it to fill the whil screen */ width:100%; height:100%; /* transparency for different browsers */ filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity: 0.5; opacity: 0.5; background:#000; /* make sure it appear behind the dialog box but above everything else */ position:absolute; top:0; left:0; z-index:3000; /* hide it by default */ display:none;}/* @end */$jq.fn.fadeToggle = function(speed, easing, callback) { return this.animate({opacity: 'toggle'}, speed, easing, callback);};$jq.fn.clearForm = function() { return this.each(function() { var type = this.type, tag = this.tagName.toLowerCase(); if (tag == 'form') return $jq(':input',this).clearForm(); if (type == 'text' || type == 'password' || tag == 'textarea') this.value = ''; else if (type == 'checkbox' || type == 'radio') this.checked = false; else if (tag == 'select') this.selectedIndex = -1; });};function launchbutton(){ $jq(function() { //Overlay // get the screen height and width var maskHeight = $jq(document).height(); var maskWidth = $jq(window).width(); // calculate the values for center alignment var dialogTop = (maskHeight/3) - ($jq('#dialog-box').height()); var dialogLeft = (maskWidth/2) - ($jq('#dialog-box').width()/2); // assign values to the overlay and dialog box $jq('#dialog-overlay').css({height:maskHeight, width:maskWidth}).show(); //clear the form $jq('#from').clearForm(); $jq('#to').clearForm(); $jq('#name').clearForm(); $jq('#message_custom').clearForm(); //re-enable the fields $jq('.std_input').removeAttr('disabled'); //but lock out non-editable ones :-) $jq('#subject').attr('disabled','true'); $jq('#message_std').attr('disabled','true'); //hide the loading message $jq('.loading').hide(); $jq('.done').hide(); $jq("#tellfriend").fadeToggle('slow'); });}var hostname=window.location.hostname;var linkArray = new Array();linkArray['www.cancernetwork.com'] = "cn";//change these when we have final link valueslinkArray['www.consultantlive.com'] = "cl";linkArray['www.diagnosticimaging.com'] = "di";linkArray['www.psychiatrictimes.com'] = "pt";linkArray['www.physicianspractice.com'] = "p2";linkArray['mediakit.ubmmedica.com'] = "ubm";linkArray['hcp.obgyn.net'] = "hcp";linkArray['www.musculoskeletalnetwork.com'] = "msn";linkArray['hcp.pediatricsconsultantlive.com'] = "ped";//for testinglinkArray['localhost'] = "localhost";var refererrLink = "";try{ referrerLink = linkArray[hostname];}catch (err) //might not be in array{}$jq(document).ready(function() { $jq('#tellfriend').hide(); $jq('a.email').click(function() { //Overlay // get the screen height and width var maskHeight = $jq(document).height(); var maskWidth = $jq(window).width(); // calculate the values for center alignment var dialogTop = (maskHeight/3) - ($jq('#dialog-box').height()); var dialogLeft = (maskWidth/2) - ($jq('#dialog-box').width()/2); // assign values to the overlay and dialog box $jq('#dialog-overlay').css({height:maskHeight, width:maskWidth}).show(); //clear the form $jq('#from').clearForm(); $jq('#to').clearForm(); $jq('#name').clearForm(); $jq('#message_custom').clearForm(); //re-enable the fields $jq('.std_input').removeAttr('disabled'); //but lock out non-editable ones :-) $jq('#subject').attr('disabled','true'); $jq('#message_std').attr('disabled','true'); //hide the loading message $jq('.loading').hide(); $jq('.done').hide(); $jq("#tellfriend").fadeToggle('slow'); }); $jq('#tellfriend a.close').click(function() { //Overlay // get the screen height and width var maskHeight = $jq(document).height(); var maskWidth = $jq(window).width(); // calculate the values for center alignment var dialogTop = (maskHeight/3) - ($jq('#dialog-box').height()); var dialogLeft = (maskWidth/2) - ($jq('#dialog-box').width()/2); // hide the overlay $jq('#dialog-overlay').hide(); //clear the form $jq('#from').clearForm(); $jq('#to').clearForm(); $jq('#name').clearForm(); $jq('#message_custom').clearForm(); //re-enable the fields $jq('.std_input').removeAttr('disabled'); //but lock out non-editable ones :-) $jq('#subject').attr('disabled','true'); $jq('#message_std').attr('disabled','true'); //hide the loading message $jq('.loading').hide(); $jq('.done').hide(); $jq("#tellfriend").fadeToggle('slow'); });});$jq(document).ready(function() { //if submit button is clicked $jq('#submit').click(function () { //Get the data from all the fields var sn = $jq('input[name=sn]'); var se = $jq('input[name=se]'); var re = $jq('input[name=re]'); //remove extra spaces between emails var mc = $jq('textarea[name=mc]'); var ms = $jq('input[name=ms]'); var sub = $jq('input[name=sub]'); //Simple validation to make sure user entered something //If error found, add hightlight class to the text field //Also email address validation on sender and recipient fields var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; if (sn.val()=='') { sn.addClass('hightlight'); return false; } else sn.removeClass('hightlight'); if (se.val()=='') { se.addClass('hightlight'); return false; } else if(!emailReg.test(se.val())) { se.addClass('hightlight'); return false; } else se.removeClass('hightlight'); if (re.val()=='') { re.addClass('hightlight'); return false; } else re.removeClass('hightlight'); //strip out whitespace between address var re_clean = re.val().replace(/ /g,''); //need to split values first var recipient_emails = re_clean.split(';') for (i = 0; i< recipient_emails.length; i++) { if(!emailReg.test(recipient_emails[i])) { re.addClass('hightlight'); return false; } } //organize the data properly var data = 'sn=' + sn.val() + '&se=' + se.val() + '&re=' + re.val() + '&mc=' + mc.val() + '&sub=' + sub.val() + '&ms=' + ms.val() + '&referrer=' + referrerLink; //disabled all the text fields $jq('.std_input').attr('disabled','true'); //show the loading sign $jq('.loading').show(); //$jq('.loading').fadeIn('slow'); //start the ajax $jq.ajax({ //this is the php file that processes the data and send mail url: "http://hcp.obgyn.net/all/emailfriend.php", //GET method is used type: "GET", //pass the data data: data, //Do not cache the page cache: false, //success success: function (html) { //if process.php returned 1/true (send mail success) //if (html==1) { //hide the form $jq('#tellfriend').fadeOut('slow'); //show the success message $jq('.done').fadeIn('slow'); //if process.php returned 0/false (send mail failed) //} else alert('Sorry, unexpected error. Please try again later.'); } }); //cancel the submit button default behaviours $jq('#dialog-overlay').hide(); return false; });});

Read More

© 2024 MJH Life Sciences

All rights reserved.