// CSS Selector
var css = '/css/';
if (navigator.userAgent.indexOf('Mac') != -1){
	if ((navigator.userAgent.indexOf('OS X') < 1) && (!document.all)){
		css += 'select_mac_nscs.css';
	}
	else {
		css += 'select_def.css';
	}
}
else {
	css += 'select_def.css';
}
document.write('<link rel ="stylesheet" href="' + css + '" type="text/css">');

function langChange()
{
  var i = document.fm_login.lang.selectedIndex;
  url = '/lang_change.php?' + fm_login.lang.options[i].value;
  window.top.location.href=url;
}

// Swap Image
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];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

// Popup Help Window
// Help Window
function pwinHelp(anc){
	url = 'http://www.daj.ne.jp/help/index.html';
	if (anc != 0) url += '#' + anc;
	var w = window.open(url, 'help', 'width=650,height=600,resizable=1,scrollbars=1');
	w.focus();
}

// Image License
function pwinLicense(url) {
	if( url == null ) url = 'http://www.daj.ne.jp/about/image_license.php';
	var w = window.open(url, 'ImageLicense', 'width=650,height=600,resizable=1,scrollbars=1');
	w.focus();
}

// CD Image Preview
function cdPreview(id) {
	var w = window.open('/cdrom/image_preview.html', id, 'width=366,height=400,resizable=0,scrollbars=0');
	w.focus();
}

// Reminder
//function pwinReminder() {
//	var w = window.open('../login/reminder_form.html', 'reminder', 'width=560,height=400,res//izable=1,scrollbars=1');
//	w.focus();
//}
function pwinReminder() {
	var w = window.open('./reminder_form.html', 'reminder', 'width=560,height=400,resizable=1,scrollbars=1');
	w.focus();
}

// Mail Zine
function pwinMailzine() {
	var w = window.open('/mailmaga/mailmaga.html', 'mailzine', 'width=560,height=480,resizable=1,scrollbars=1');
	w.focus();
}

// Apply
function pwinApply() {
	var w = window.open('/work_collection.php', 'apply', 'width=560,height=480,resizable=1,scrollbars=1');
	w.focus();
}

// Image Folder
function ifolderMenu(act) {
	switch (act) {
		case 'new':
			val = new Array('./newfolder.php',400,300);
			break;
		case 'delete':
			val = new Array('removefolder.php',400,300);
			break;
		case 'mail':
			val = new Array('./introfolder.php',500,400);
			break;
		default :
			val = 0;
	}
	if (val != 0){
		wf = window.open(val[0], act, 'width=' + val[1] + ',height=' + val[2] + ',resizable=0,scrollbars=0');
		wf.focus();
	}
}
function ifolderMenu1(url) {
	wf = window.open(url, 'delete', 'width=400,height=300,resizable=0,scrollbars=0');
	wf.focus();
}

