//コピーライト
function wCopy(){
	document.write("copyright &copy; 2010 WebCrew Inc. All rights reserved.&nbsp;");
}

//Top Flash　オートアクティブ
function Runfla()
{
    document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="730" height="168" id="top_image">\n');
    document.write('<PARAM name="movie" value="/images/top_image.swf" />\n');
	document.write('<PARAM name="quality" value="high" />\n');
	document.write('<PARAM name="bgcolor" value="#FFFFFF" />\n');
	document.write('<EMBED src="/images/top_image.swf" quality=high bgcolor=#FFFFFF  width="730" height="168" name="top_image" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n');
	document.write('</EMBED>\n');
	document.write('</OBJECT>\n');
}

//スタイルシート振りわけ
mac = (navigator.appVersion.indexOf('Mac')!=-1)?true:false;
if(mac){
		fname="mac.css";
	}
else if(document.getElementById){
		fname="win.css";
	}
else if(document.layers){
		fname="win-ns.css";
	}

if(fname != null) {
	document.write("<link rel='stylesheet' href='/css/"+fname+"' type='text/css'>");
}

//ヘルプウインドウオープン
function helpWin(url) {
	newwin =window.open(url,'help','toolbar=no,location=no,resizable=yes,status=no,scrollbars=yes,width=520,height=520,left=0,top=0');
	newwin.focus();
}

//相互リンク募集フォーム
function mutualWin() {
	newwin =window.open('https://www.webcrew.co.jp/step/contact/mutual_link.html','mutual','toolbar=no,location=no,resizable=yes,status=no,scrollbars=yes,width=500,height=440,left=0,top=0');
	newwin.focus();
}

//ベリサイン
//function popUp(url) {
//sealWin=window.open(url,"win",'menubar=1,status=1,toolbar=0,location=1,directories=0,scrollbars=1,resizable=1,width=500,height=450');
//self.name = "mainWin"; }

//利用規約
function termWin() {
	newwin =window.open('/partner/terms.html','com','toolbar=no,location=no,resizable=yes,status=no,scrollbars=yes,width=520,height=500,left=0,top=0');
	newwin.focus();
}

//ブラウザオープン
function brwsWin(url) {
	newwin =window.open(url,'exp','toolbar=no,location=no,resizable=yes,status=no,scrollbars=yes,width=550,height=400,left=0,top=0');
	newwin.focus();
}

//life Card
function lifeWin() {
	newwin = window.open('/','life','toolbar=no,location=no,resizable=yes,status=no,scrollbars=yes,width=760,height=600,left=0,top=0');
	newwin.focus();
}

///// for キャンペーンフォーム /////

//フォーム背景色
function colorChange() {
	this.skip  = ['submit', 'button', 'radio', 'checkbox', 'select-one', 'select-multiple'];
	this.color = { 'blur': '', 'focus': '#DFF5FF' };

	this.set = function() {
		for (var i = 0; i < document.forms.length; i++) {
			for (var f = 0; f < document.forms[i].length; f++) {
				var elm = document.forms[i][f];
				if(!this.checkSkip(elm)) continue;
				this.setColor(elm, 'focus');
				this.setColor(elm, 'blur');
			}      
		}
	}

	this.checkSkip = function(elm) {
		for(var i in this.skip) {
			if(elm.type == this.skip[i]) return false;
		}
		return true;
	}

	this.setColor = function(elm, type) { 
		var color = this.color[type];
		var event = function() { elm.style.backgroundColor = color; };

		if(elm.addEventListener) {
			elm.addEventListener(type, event, false); 
		} else if(elm.attachEvent) {
			elm.attachEvent('on'+type, event); 
		} else {
			elm['on'+type] = event;
		}
	}
}

// onload時にフォーム背景色設定を実行
window.onload = function() {
   var formColor = new colorChange;
   formColor.set();
}


function pageRedirect(strSiteUrl,strDefId){		
	var strlocationUrl = document.location.search;
	
	if( strlocationUrl == "" || strlocationUrl == null ) {
		strSiteUrl += "?ID=" + strDefId;
	} else {
		var strParam = strlocationUrl.split('?')[1];
		var params = strParam.split('&');
		
		for( var i=0; i < params.length; i++ ) {
			var strKV = params[i].split('=');
			
			if( strKV[0] == "ID" || strKV[0] == "id" ) {
				strSiteUrl += "?ID=" + strKV[1];
			}
		}
	}
	window.open(strSiteUrl);

}

// --- recruit専用 ここから ---
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
// --- recruit専用 ここまで ---
