/* Java Script */
/* Copyright © 1997 Bizymoms. All rights reserved. */

/* Top buttons scripts Mouseover, Mouseout, Mousedown */  
function showHotNew(sCateg)
{
	document.getElementById('hotNew').innerHTML = "<IFRAME SRC='hotNewPost.php?subCateg="+sCateg+"' width='100%' height='100%' frameborder='0' scrolling='no'></IFRAME>";
}
function MM_findObj(n, d) { //v4.01
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
		if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
		for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
		if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_nbGroup(event, grpName) { //v6.0
	var i,img,nbArr,args=MM_nbGroup.arguments;
		if (event == "init" && args.length > 2) {
			if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
				img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
				if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
				nbArr[nbArr.length] = img;
					for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
						if (!img.MM_up) img.MM_up = img.src;
						img.src = img.MM_dn = args[i+1];
						nbArr[nbArr.length] = img;
					}
			}
		} else if (event == "over") {
			document.MM_nbOver = nbArr = new Array();
				for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
					if (!img.MM_up) img.MM_up = img.src;
					img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])?args[i+1] : img.MM_up);
					nbArr[nbArr.length] = img;
				}
		} else if (event == "out" ) {
			for (i=0; i < document.MM_nbOver.length; i++) { img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
		} else if (event == "down") {
			nbArr = document[grpName];
				if (nbArr) for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
				document[grpName] = nbArr = new Array();
					for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
						if (!img.MM_up) img.MM_up = img.src;
							img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
							nbArr[nbArr.length] = img;
					}
		}
}

function MM_preloadImages() { //v3.0
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


/* 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');
	}
}

/* Tab content Open, Close script */
function Toggle(item) {
	obj = document.getElementById("X" + item);
	visible=(obj.style.display!="none")
		if (visible) {
			obj.style.display="block";
		} else {
			obj.style.display="block";
		}
}

function Close(item) {
	obj = document.getElementById("X" + item);
	visible=(obj.style.display!="none")
		if (visible) {
			obj.style.display="none";
		} else {
			obj.style.display="none";
		}
}

/* Set SWF files on onload */
function simplePreload() { 
	var args = simplePreload.arguments;
	document.imageArray = new Array(args.length);
		for(var i=0; i<args.length; i++) {
			document.imageArray[i] = new Image;
			document.imageArray[i].src = args[i];
		}
}

//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*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
    }
};
function showSignUp(pageType)
{
	document.getElementById('popup_body').style.height= "450px";
	document.getElementById('popup_header').innerHTML= "Bizymoms Blog Network - Sign Up For FREE";
	document.getElementById('popup_body').innerHTML = "<IFRAME SRC='sign_up.php?loginArea="+pageType+"' width='580px' height='100%' frameborder='0' scrolling='no'></IFRAME>";


	if(navigator.appName == "Netscape") {
	
		

		document.getElementById('dvpopup').style.top = window.pageYOffset+200 +"px";

	} else {


	
		document.getElementById('dvpopup').style.top = document.body.scrollTop+300 + "px";

	}

		document.getElementById('dvpopup').style.display ="inline";
}
function showSignIn(pageType, linkType)
{
	document.getElementById('popup_body').style.height= "150px";
	document.getElementById('popup_header').innerHTML= "Bizymoms Blog Network - Login to Blogger Account";
	document.getElementById('popup_body').innerHTML = "<IFRAME SRC='loginPopup.php?loginArea="+pageType+"&linkType="+linkType+"' width='580px' height='100%' frameborder='0' scrolling='no'></IFRAME>";


	if(navigator.appName == "Netscape") {
	
		document.getElementById('dvpopup').style.top = window.pageYOffset+100 +"px";

	} else {


	
		document.getElementById('dvpopup').style.top = document.body.scrollTop+100 + "px";

	}

		document.getElementById('dvpopup').style.display ="inline";
}


function showTellFriend(urlType)
{
	document.getElementById('popup_body').style.height= "370px";
	document.getElementById('popup_header').innerHTML= " Bizymoms Blog Network - Invite Your Friends To Join";
	document.getElementById('popup_body').innerHTML = "<IFRAME SRC='tellFriend.php?urlType="+urlType+"' width='578px' height='100%' frameborder='0' scrolling='no'></IFRAME>";


	

	if(navigator.appName == "Netscape") {

		document.getElementById('dvpopup').style.top = window.pageYOffset+100 + "px";

	} else {

		document.getElementById('dvpopup').style.top = document.body.scrollTop+100 + "px";

	}

	document.getElementById('dvpopup').style.display ="inline";
}

function showComment(postId)
{
	document.getElementById('popup_body').style.height= "320px";
	document.getElementById('popup_header').innerHTML= "Bizymoms Blog Network - Share your views";
	document.getElementById('popup_body').innerHTML = "<IFRAME SRC='BlogComment.php?postId="+postId+"' width='578px' height='100%' frameborder='0' scrolling='no'></IFRAME>";

	if(navigator.appName == "Netscape") {

		document.getElementById('dvpopup').style.top = window.pageYOffset+100 + "px";

	} else {

		document.getElementById('dvpopup').style.top = document.body.scrollTop+100 + "px";

	}

	document.getElementById('dvpopup').style.display ="inline";
}
function showHowToMarket(pType)
{
	document.getElementById('popup_body').style.height= "320px";
	document.getElementById('popup_header').innerHTML= "Bizymoms Blog Network - Share your views";
	document.getElementById('popup_body').innerHTML = "<IFRAME SRC='how-to-market.php?pType="+pType+"' width='578px' height='100%' frameborder='0' scrolling='no'></IFRAME>";

	if(navigator.appName == "Netscape") {

		document.getElementById('dvpopup').style.top = window.pageYOffset+100 + "px";

	} else {

		document.getElementById('dvpopup').style.top = document.body.scrollTop+100 + "px";

	}

	document.getElementById('dvpopup').style.display ="inline";
}



function suggestPost()
{
	document.getElementById('popup_body').style.height= "370px";
	document.getElementById('popup_header').innerHTML= " Bizymoms Blog Network - Suggest a Post";
	document.getElementById('popup_body').innerHTML = "<IFRAME SRC='suggestPost.php' width='578px' height='100%' frameborder='0' scrolling='no'></IFRAME>";


	

	if(navigator.appName == "Netscape") {

		document.getElementById('dvpopup').style.top = window.pageYOffset+100 + "px";

	} else {

		document.getElementById('dvpopup').style.top = document.body.scrollTop+100 + "px";

	}

	document.getElementById('dvpopup').style.display ="inline";
}

function showUploadPage(pageType) 
{
	if(pageType=='upload')
	{
		document.getElementById('pageHolder').innerHTML= "<IFRAME SRC='submitContent.php' width='950px' height='740px' frameborder='0' scrolling='no'></IFRAME>";
	}
	if(pageType=='syndicate')
	{
		document.getElementById('pageHolder').innerHTML= "<IFRAME SRC='syndic.php' width='950px' height='740px' frameborder='0'></IFRAME>";
		//xmlhttpPost('syndic.php','catId='+catId,returnUploadPage,' Loading Scrapping page.<br>Please wait...');
	}
	
}

function showMoreSubCats() 
{
	document.getElementById('popup_body').style.height= "450px";
		document.getElementById('popup_header').innerHTML= " Bizymoms Blog Network - View More Blog Categories";

document.getElementById('popup_body').innerHTML = "<IFRAME SRC='moreSubCats.php?p1=A&p2=B&p3=C' width='570' height='100%' frameborder='0' scrolling='no'></IFRAME>";

	if(navigator.appName == "Netscape") {

		document.getElementById('dvpopup').style.top = window.pageYOffset+150 + "px";

	} else {

		document.getElementById('dvpopup').style.top = document.body.scrollTop+150 + "px";

	}

	document.getElementById('dvpopup').style.display ="inline";

}


function popupClose()
{
	document.getElementById('dvpopup').style.display ="none";
}
function show_vote(postId,memb) 
{
	document.getElementById('dvMessage').innerHTML = "<IFRAME SRC='votes.php?postId="+postId+"&memb="+memb+"&submit=true' width='100%' height='100%' frameborder='0' scrolling='no'></IFRAME>";
}
function show_vote_home(memb) 
{
	document.getElementById('dvMessage').innerHTML = "<IFRAME SRC='votesBlogger.php?au_id="+memb+"&submit=true' width='100%' height='100%' frameborder='0' scrolling='no'></IFRAME>";
}


function caste_vote(id, opacStart, opacEnd, millisec)
{

	var object = document.getElementById(id).style;

    var speed = Math.round(millisec / 100);

    var timer = 0;

	

	if(opacStart > opacEnd)

	{

		for(i = opacStart; i >= opacEnd; i--)

		{

            setTimeout("change_img(" + i + ",'" + id + "',"+opacStart+","+opacEnd+")",(timer * speed));

            timer++;

		}
	//document.getElementById(id).style.visibility= "hidden";
		//	document.getElementById(id).innerHTML = "<table cellpadding=\"0\" cellspacing=\"0\" width=\"600\" style=\"border:3px solid #cb7930\"><tr><td id=\"adBody\">&nbsp;</td></tr></table>";
   } 

	else if(opacStart < opacEnd)
   {

		document.getElementById(id).style.display='inline';

		

        for(i = opacStart; i <= opacEnd; i++)
		{

            setTimeout("change_img(" + i + ",'" + id + "',"+opacStart+","+opacEnd+")",(timer * speed));

            timer++;

        }

    }

}
function changeImage()
{
}


function change_img(opacity, id,opacStart,opacEnd)

{

	var object = document.getElementById(id).style;

    object.opacity = (opacity / 100);

    object.MozOpacity = (opacity / 100);

    object.KhtmlOpacity = (opacity / 100);

    object.filter = "alpha(opacity=" + opacity + ")";


	if(opacStart > opacEnd && opacity==0)

	{

		document.getElementById(id).style.display='none';
				document.getElementById(id).innerHTML="<img src='images/voting_icon_down.gif'>";
				//document.getElementById('voteMsg').innerHTML= "You have successfully voted";
					caste_vote('dvVote',0,100,1400);

	}	

	

}
function votePostBlogger(memb)
{
	document.getElementById('popup_body').style.height= "170px";

	document.getElementById('popup_header').innerHTML= " Bizymoms Blog Network - Voting to a Blogger";
	document.getElementById('popup_body').innerHTML = "<IFRAME SRC='votesBlogger.php?au_id="+memb+"' width='578px' height='100%' frameborder='0' scrolling='no'></IFRAME>";



	if(navigator.appName == "Netscape") {

		document.getElementById('dvpopup').style.top = window.pageYOffset+300 + "px";

	} else {

		document.getElementById('dvpopup').style.top = document.body.scrollTop+300 + "px";

	}

	document.getElementById('dvpopup').style.display ="inline";
}
