function getPageStr(){
	var page, url,pos;
	url = window.location.href;
	pos = url.indexOf("#");
	if((pos < 0) || ((pos + 1) == url.length)){
		page = "";
	} else {
		page = url.substr(pos + 1, url.length - pos);
	}
	
	return page;
}


function openSearch(url){
	var param = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=400,height=600";
	var newWin = window.open(url, "WEBOOK_Search", param);
	newWin.focus();
}

// from WEBOOK
function openSearch0(){
	openSearch("../search3/index.html");
}

function openSearch1(){
	openSearch("webook/search/index.html");
}


function openRefurl(url){
	var param = "toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=800,height=600";
	var newWin = window.open(url, "WEBOOK_Refurl", param);
	newWin.focus();
}

function openHelp(url){
	var param = "toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=900,height=700";
	var newWin = window.open(url, "WEBOOK_Help", param);
	newWin.focus();
}

function openHelp0(){
	openHelp("../help3/index.html");
}

function openHelp1(){
	openHelp("../help4/index.html");
}

function openHelp2(){
	openHelp("../help5/index.html");
}

function insObj(){
	insObj0("981", "650");
}

function insObj2(){
	insObj0("100%", "100%");
}


function insObj0(w, h){
	var page = getPageStr();
	var str;
	str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="' + w + '" height="' + h + '">';
	str += '\n';
	str += '<param name="movie" value="flash.swf';
	if(page.length > 0){
		str += '?StartPage=' + page;
	}
	str += '" />';
	str += '\n';
	str += '<param name="quality" value="best" />';
	str += '\n';
	str += '<param name="menu" value="false" />';
	str += '\n';
	str += '<embed src="flash.swf';
	if(page.length > 0){
		str += '?StartPage=' + page;
	}
	str += '" menu="false" quality="best" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + w + '" height="' + h + '"></embed>';
	str += '\n';
	str += '</object>';
	document.write(str);
}

function openImgCut(url){
	var param = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes";
	var newWin = window.open(url, "WEBOOK_ImgCut", param);
	newWin.focus();
}

