/* 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 openWindow(url,win,features) { 
  window.open(url,win,features);
}

function openInjectionTranscript(page) {
	openWindow( applicationRoot + '/global/injection-transcript-'+ page +'.aspx','Transcript','scrollbars=yes,resizable=no,width=572,height=516');
}

function openVideoTranscript() {
	openWindow( applicationRoot + '/global/video-transcript.aspx','Transcript','scrollbars=yes,resizable=no,width=572,height=350');
}

function openCommercialTranscript() {
	openWindow( applicationRoot + '/ra/commercial-transcript.aspx','Transcript','scrollbars=yes,resizable=no,width=572,height=500');
}

function openVideoNewTranscript(id) {
	openWindow( applicationRoot + '/global/video-transcript.aspx?id='+id,'Transcript','scrollbars=yes,resizable=no,width=572,height=350');
}

function openCommercialTranscript() {
	openWindow( applicationRoot + '/ra/commercial-transcript.aspx','Transcript','scrollbars=yes,resizable=no,width=572,height=500');
}

function openTerms() {
	openWindow( applicationRoot + '/global/terms-conditions.aspx','Terms','scrollbars=yes,resizable=no,width=572,height=516');
}

function openISI() {
	openWindow( applicationRoot + '/global/safety-information.aspx','ISI','scrollbars=yes,resizable=no,width=572,height=516');
}

function openReferFriend() {
	openWindow( applicationRoot + '/global/refer-friend.aspx?url='+escape(window.location.href),'Refer','scrollbars=yes,resizable=no,width=620,height=500');
}

function openRAStories() {
	openWindow( applicationRoot + '/ra/full-story.aspx','Story','scrollbars=yes,resizable=no,width=460,height=500');
}

function openPsTranscript(id) {
	openWindow( applicationRoot + '/psoriasis/transcript.aspx?id='+id,'Transcript','scrollbars=yes,resizable=no,width=572,height=516');
}

function openCDStories(id) {
	openWindow( applicationRoot + '/crohns/full-story.aspx?id='+id,'Story','scrollbars=yes,resizable=no,width=460,height=500');
}

function openDisclaimer(url) {
	openWindow( applicationRoot + '/global/leaving-site.aspx?url=' + url,'winDisclaimer','width=370,height=500');
}

function openSpanishDisclaimer(url) {
	openWindow( applicationRoot + '/global/leavingspanish-site.aspx?url=' + url,'winDisclaimer','width=370,height=500');
}

function goToRequested(url) {
    window.open(url, "_newWin", 'toolbar,menubar,scrollbars,resizable,location');    
    window.close();
}

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 openSpanishISI() {
	MM_openBrWindow_( applicationRoot + '/global/safety-information-spanish.aspx','ISI','scrollbars=yes,resizable=no,width=572,height=516');
}

function openInjectionTranscript(page) {
	MM_openBrWindow_( applicationRoot + '/global/injection-transcript-'+ page +'.aspx','Transcript','scrollbars=yes,resizable=no,width=572,height=516');
}

function openSpanishPenTranscript() {
	MM_openBrWindow_( applicationRoot + '/spanishinjection/transcript-pen.aspx','Transcript','scrollbars=yes,resizable=no,width=572,height=516');
}

function openSpanishSyringeTranscript() {
	MM_openBrWindow_( applicationRoot + '/spanishinjection/transcript-syringe.aspx','Transcript','scrollbars=yes,resizable=no,width=572,height=516');
}

///// LOCATOR - START //////
function mapLoad() { 
	if(typeof(AppRoot) != 'undefined')
		load();
}

function mapUnload() {  
	if(typeof(AppRoot) != 'undefined')
		GUnload();
}
///// LOCATOR - END //////


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');
	}
}

var results;
function setresult(dataresult) {
    results = dataresult;
   // return results;
}

function getresults(){
return results;
}

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);
}


