/* Java Script */
/* Copyright © 1997 Bizymoms. All rights reserved. */

/* Bookmark script */
/* Modified to support Opera */
function bookmarksite(title,url){
	if (window.sidebar) // firefox
		window.sidebar.addPanel(title, url, "");
	else if(window.opera && window.print){ // opera
		var elem = document.createElement('a');
		elem.setAttribute('href',url);
		elem.setAttribute('title',title);
		elem.setAttribute('rel','sidebar');
		elem.click();
	} 
	else if(document.all)// ie
		window.external.AddFavorite(url, title);
}

/* Make us your homepage script*/
function setHomepage(){
	if (document.all){
		document.body.style.behavior='url(#default#homepage)';
		document.body.setHomePage('http://www.bizymoms.com');
	}
	else if (window.sidebar){
		if(window.netscape){
			try{  
				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");  
			}  
			catch(e){  
			alert("This action was aviod by your browser,if you want to enable,please enter about:config in your address line,and change the value of signed.applets.codebase_principal_support to true");  
			}
		} 
		var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
		prefs.setCharPref('browser.startup.homepage','http://www.bizymoms.com');
	}
}

//openX URL created
function parseUri (str) {
    var    o   = parseUri.options,
        m   = o.parser[o.strictMode ? "strict" : "loose"].exec(str),
        uri = {},
        i   = 14;

    while (i--) uri[o.key[i]] = m[i] || "";

    uri[o.q.name] = {};
    uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {
        if ($1) uri[o.q.name][$1] = $2;
    });

    return uri;
};

parseUri.options = {
    strictMode: false,
    key: ["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],
    q:   {
        name:   "queryKey",
        parser: /(?:^|&)([^&=]*)=?([^&]*)/g
    },
    parser: {
        strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
        loose:  /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
    }
};

var OA_channel = '/test/preview';
var OA_p=location.protocol=='https:'?'https:':'http:';
var OA_r=Math.floor(Math.random()*99999999);
if (!document.OA_used) document.OA_used = ',';
function OA_adjs(z,n){
	if (z>-1) {
		var az="<"+"script language='JavaScript' type='text/javascript' ";
		az+="src='"+OA_p+"//bizymoms.com/openx/www/delivery/ajs.php?n="+n+"&zoneid="+z;
		az+="&source="+OA_channel+"&exclude="+document.OA_used+"&r="+OA_r;
		az+="&mmm_fo="+(document.mmm_fo)?'1':'0';
		if (document.context) az+= "&context=" + escape(document.context);
		//if (window.location) az+="&loc="+escape(window.location);
		parseUri.options.strictMode = true;
	URL = OA_p + parseUri(window.location).host + parseUri(window.location).path;
	if (URL) az+="&loc="+escape(URL);
	if (URL) az+="&loc="+escape(URL);
		if (document.referrer) az+="&referer="+escape(document.referrer);
			az+="'><"+"/script>";
			document.write(az);
		}
}
function OA_adpop(z,n){
	if (z>-1) {
		var az="<"+"script language='JavaScript' type='text/javascript' ";
		az+="src='"+OA_p+"//bizymoms.com/openx/www/delivery/apu.php?n="+n+"&zoneid="+z;
		az+="&source="+OA_channel+"&exclude="+document.OA_used+"&r="+OA_r;
		if (window.location) az+="&loc="+escape(window.location);
		if (document.referrer) az+="&referer="+escape(document.referrer);
		az+="'><"+"/script>";
		document.write(az);
	}
}

//creating scrollbars
function init_dw_Scroll() {
	var wndo1 = new dw_scrollObj('wn1', 'lyr1');
	wndo1.setUpScrollbar("dragBar1", "track1", "v", 1, 1);
	wndo1.setUpScrollControls('scrollbar1');
}

if (dw_scrollObj.isSupported()) {
	dw_writeStyleSheet('bm_home_includes_new/css/scrollbar_multi.css');
	dw_Event.add(window, 'load', init_dw_Scroll);
}

//login signup dhtml window script
function openjoinus(){
	joinuswindow=dhtmlmodal.open('joinus', 'iframe', '../signup.html', 'Sign UP', 'width=550px,height=270px,center=1,resize=1,scrolling=0')
}
function openlogin(){
	loginwindow=dhtmlmodal.open('login', 'iframe', '../login.html', 'Log In', 'width=550px,height=165px,center=1,resize=1,scrolling=0')
}

//Recommended Doctors Slider
$(function () {
	$('#slider1').anythingSlider({
		easing: "swing",				// Anything other than "linear" or "swing" requires the easing plugin
		autoPlay: true,					// This turns off the entire FUNCTIONALY, not just if it starts running or not
		startStopped: false,			// If autoPlay is on, this can force it to start stopped
		delay: 8000,					// How long between slide transitions in AutoPlay mode
		animationTime: 1000,				// How long the slide transition takes
		hashTags: true,					// Should links change the hashtag in the URL?
		buildNavigation: false,			// If true, builds and list of anchor links to link to each slide
		pauseOnHover: true,				// If true, and autoPlay is enabled, the show will pause on hover
		startText: "",					// Start text
		stopText: "",					// Stop text
		navigationFormatter: null,		// Details at the top of the file on this use (advanced use)
		forwardText: "",				// Link text used to move the slider forward
		backText: "",					// Link text used to move the slider back
		buildArrows: true,				// If true, builds the forwards and backwards buttons
		resizeContents: true,			// If true, solitary images in the panel will expand to fit the panel
		width: 500,						// Override the default CSS width
		height: 260						// Override the default CSS height
	});
	$('#slider2').anythingSlider({
		resizeContents: true,
		autoPlay: true,
		delay: 10000,	
		startText: "",					// Start text
		stopText: "",					// Stop text
		buildNavigation: false,			// If true, builds and list of anchor links to link to each slide
		width: 234,						// if resizeContent is false, this is the default width if panel size is not defined
		height: 195						// if resizeContent is false, this is the default height if panel size is not defined
	});
	$('#slider3').anythingSlider({
		resizeContents: true,
		autoPlay: true,
		delay: 8000,					// How long between slide transitions in AutoPlay mode
		animationTime: 1000,			// How long the slide transition takes
		startText: "",					// Start text
		stopText: "",					// Stop text
		buildNavigation: false,			// If true, builds and list of anchor links to link to each slide
		width: 456,						// if resizeContent is false, this is the default width if panel size is not defined
		height: 245						// if resizeContent is false, this is the default height if panel size is not defined
	});
});
