
var PreloadFlag = false;
var expDays = 90;
var exp = new Date(); 
var tmp = '';
var tmp_counter = 0;
var tmp_open = 0; 
var aaaa = 0;
var hight;

exp.setTime(exp.getTime() + (expDays*24*60*60*1000));

var value;
function setval(val)
{
	value=val;
	
}
function popUppoll(vote_url)
{
	day = new Date();
	id = day.getTime();
	eval("page"
	+ id
	+ " = window.open(vote_url, '"
	+ id
	+ "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=400,left = 300,top = 362');");
	
}
function makevoteurl(vote_id,flag)
{
	if(flag > 0)
	vote_url = "http://www.homeopathyandmore.com/menu/fetch/poll.php?column=" + 1000 + "&vote_id=" + vote_id;
	else
	vote_url = "http://www.homeopathyandmore.com/menu/fetch/poll.php?column=c" + value + "&vote_id=" + vote_id;
	popUppoll(vote_url);
}

function popitup(url)
{
	newwindow=window.open(url,'name','width=1100, height=800, resizable=1, scrollbars=1, location=0');

	if (window.focus) 
	{
			newwindow.focus();
	}
	return false;
}


function PopUp(URL_)
{
	//alert();
	day = new Date();
	id = day.getTime();
	if(!URL_)
	Window.open('www.homeopathyandmore.com/',"Popup",'scrollbars=yes', 'height=600', 'width=600');
	 else
	eval("page" + id + " = window.open(URL_, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=500,left=0,top=0');");
}


function PopUp1(url) 
{
	newwindow=window.open(url,'name','width=400, height=300, resizable=1, scrollbars=1, location=0');

	if (window.focus) 
	{
		newwindow.focus();
	}
        //return false;
} 

function Pop_login(URL_, hight) 
{
	
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL_, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=400,left = 490,top = 362');");
} 


function SetCookie(name, value) 
{
	var argv = SetCookie.arguments;
	var argc = SetCookie.arguments.length;
	var expires = (argc > 2) ? argv[2] : null;
	var path = (argc > 3) ? argv[3] : null;
	var domain = (argc > 4) ? argv[4] : null;
	var secure = (argc > 5) ? argv[5] : false;
	document.cookie = name + "=" + escape(value) +
		((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
		((path == null) ? "" : ("; path=" + path)) +
		((domain == null) ? "" : ("; domain=" + domain)) +
		((secure == true) ? "; secure" : "");
}

function getCookieVal(offset) 
{
	var endstr = document.cookie.indexOf(";",offset);
	if (endstr == -1)
	{
		endstr = document.cookie.length;
	}
	return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie(name) 
{
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	while (i < clen) 
	{
		var j = i + alen;
		if (document.cookie.substring(i, j) == arg)
			return getCookieVal(j);
		i = document.cookie.indexOf(" ", i) + 1;
		if (i == 0)
			break;
	} 
	return null;
}

function ShowHide(id1, id2, id3) 
{
	var res = expMenu(id1);
	if (id2 != '') expMenu(id2);
	if (id3 != '') SetCookie(id3, res, exp);
}
	
function expMenu(id) 
{
	var itm = null;
	if (document.getElementById) 
	{
		itm = document.getElementById(id);
	}
	else if (document.all)
	{
		itm = document.all[id];
	} 
	else if (document.layers)
	{
		itm = document.layers[id];
	}
	if (!itm) 
	{
		// do nothing
	}
	else if (itm.style) 
	{
		if (itm.style.display == "none")
		{ 
			itm.style.display = ""; 
			return 1;
		}
		else
		{
			itm.style.display = "none"; 
			return 2;
		}
	}
	else 
	{
		itm.visibility = "show"; 
		return 1;
	}
}

function showMenu(id)
{
	var itm = null;
	if (document.getElementById) 
	{
		itm = document.getElementById(id);
	}
	else if (document.all)
	{
		itm = document.all[id];
	} 
	else if (document.layers)
	{
		itm = document.layers[id];
	}
	if (!itm) 
	{
		// do nothing
	}
	else if (itm.style) 
	{
		if (itm.style.display == "none")
		{ 
			itm.style.display = ""; 
			return true;
		}
		else
		{
//			itm.style.display = "none"; 
			return true;
		}
	}
	else 
	{
		itm.visibility = "show"; 
		return true;
	}
}

function hideMenu(id)
{
	var itm = null;
	if (document.getElementById) 
	{
		itm = document.getElementById(id);
	}
	else if (document.all)
	{
		itm = document.all[id];
	} 
	else if (document.layers)
	{
		itm = document.layers[id];
	}
	if (!itm) 
	{
		// do nothing
	}
	else if (itm.style) 
	{
		if (itm.style.display == "none")
		{ 
//			itm.style.display = ""; 
			return true;
		}
		else
		{
			itm.style.display = "none"; 
			return true;
		}
	}
	else 
	{
		itm.visibility = "hide"; 
		return true;
	}
}

