﻿/* shadowbox launch */
function openShadowbox(shadowID, width, height) {
Shadowbox.open( {
	player:'inline', 
	content:'#' + shadowID + '',
	width: width,
	height: height
	}); 
}
/* .shadowbox launch */


window.log = function(){
  log.history = log.history || []; 
  log.history.push(arguments);
  if(this.console){
    console.log( Array.prototype.slice.call(arguments) );
  }
};

//(function(doc){
//  var write = doc.write;
//  doc.write = function(q){ 
//    log('document.write(): ',arguments); 
//    if (/docwriteregexwhitelist/.test(q)) write.apply(doc,arguments);  
//  };
//})(document);


/* Add Bookmark*/
function add_bookmark(url,page_title)
{
	if(window.sidebar) // Firefox / Mozilla
	{ 
		window.sidebar.addPanel(page_title, url,'');
	}
	else if(window.opera) // Opera
	{
		var a = document.createElement('A');
		a.rel = 'sidebar';
		a.target = '_search';
		a.title = page_title;
		a.href = url;
		a.click();
	}
	else if(window.document.all) // IE
	{ 
		window.external.AddFavorite(url, page_title);
	}
	else
	{
		alert('Please press Ctrl+D or Command+D to bookmark');
	}
}

function MM_openBrWindow_(theURL,winName,features) { 
  window.open(theURL,winName,features);
}

function openTermsConditions() {
	MM_openBrWindow_( applicationRoot + '/find-rheumatologist/terms.aspx','','width=460,height=420');
}

function goToRequested(url) {
    window.open(url, "_newWin", 'toolbar,menubar,scrollbars,resizable,location');    
    window.close();
}

function add_spotlight(src,type,cat) {
  var tag_url="//fls.doubleclick.net/activityi;src=" + src + ";type=" + type + ";cat=" + cat + ";ord=1;num="+Math.floor(Math.random()*999999)+"?";
  if(document.getElementById("DCLK_FLDiv")){var flDiv=document.getElementById("DCLK_FLDiv");}
  else{var flDiv=document.body.appendChild(document.createElement("div"));flDiv.id="DCLK_FLDiv";flDiv.style.display="none";}
  var DCLK_FLIframe=document.createElement("iframe");
  DCLK_FLIframe.id="DCLK_FLIframe_"+Math.floor(Math.random()*999999);
  DCLK_FLIframe.src=tag_url;
  flDiv.appendChild(DCLK_FLIframe);
}
