var tag_search_f_array = [
'--不限--', '孝顺女', '小资女', '秀外慧中',
'理性女', '感性女', '善良', '事业女',
'气质女', '美女', '居家女', '爱运动',
'美食家', '野蛮女友', '宅女', '直爽',
'爱小动物', '小可爱', '自由职业'];
var tag_search_m_array = [
'--不限--', '孝顺男', '酷男', '责任心',
'经济适用男', '憨直', '感性男', '事业男',
'睿智', '猥琐男', '幽默男', '爱旅行',
'宅男', '体贴', '有魄力', '仗义',
'经理人', '帅哥', '稳重'];

function redirect2(object, selectValue, defaultValue, isUniversity,id)
{
	for (m = object.options.length; m >= 0; m--) {
		object.options[m] = null;
	}
	var newOption = '';
	var selected = ''
	var key;
	if (isUniversity) {
		for (key in SOK[selectValue]) {
			newOption = new Option(SOK[selectValue][key], key);
			if (key == defaultValue) {
				newOption.id="opt_selected"+id;
			}
			object.options.add(newOption);
		}
		if (my_getbyid('opt_selected'+id)) {
			my_getbyid('opt_selected'+id).selected = true;
		}
	} else {
		for (key in LOK[selectValue]) {
			newOption = new Option(LOK[selectValue][key], key);
			if (key == defaultValue) {
				newOption.id="opt_selected"+id;
			}
			object.options.add(newOption);
		}
		if (my_getbyid('opt_selected'+id)) {
			my_getbyid('opt_selected'+id).selected = true;
		}
	}
}

function RefreshTag(ob,value,select_id)
{
	for (m = ob.options.length; m >= 0; m--) {
		ob.options[m] = null;
	}
	if(value=='m') {
		tag_array=tag_search_m_array;
	}
	if(value=='f') {
		tag_array=tag_search_f_array;
	}
	for(m = 0; m < tag_array.length; m++) {
		newOption = new Option(tag_array[m],m);
		if(select_id==m) newOption.id="opt_selected"+select_id;
		ob.options.add(newOption);
	}
	if (my_getbyid('opt_selected'+select_id)) {
		my_getbyid('opt_selected'+select_id).selected = true;
	}
}

function getCookie(c_name)
{
	if (document.cookie.length>0) {
		c_start=document.cookie.indexOf(c_name + "=");
		if (c_start!=-1) {
			c_start=c_start + c_name.length+1;
			c_end=document.cookie.indexOf(";",c_start);
			if (c_end==-1) c_end=document.cookie.length;
			return decodeURIComponent(document.cookie.substring(c_start,c_end));
		}
	}
	return null;
}

function SetMaxSelect(ob,type,start,cur,longstr)
{
	for (m = ob.options.length; m >= 0; m--) {
		ob.options[m] = null;
	}
	if(type == 1) {
		if(start < 18) start = 18;
		end = 99;
	}
	if(type == 2) {
		if(start < 140) start = 140;
		end = 260;
	}
	if(longstr) {
		newOption = new Option("--不限--",0);
		ob.options.add(newOption);
	}else {
		newOption = new Option("不限",0);
		ob.options.add(newOption);
	}
	for(m = start; m <= end; m++) {
		newOption = new Option(m,m);
		if(cur == m) newOption.id="opt_selected" + cur;
		ob.options.add(newOption);
	}
	if (my_getbyid('opt_selected'+cur)) {
		my_getbyid('opt_selected'+cur).selected = true;
	}
}

function insertFlash(elm, url, w, h, id)
{
 if (!document.getElementById(elm)) return;
 var str = '';
 str += '<embed width="'+ w +'" height="'+ h +'" src="'+ url +'" quality="autohigh" wmode="opaque" type="application/x-shockwave-flash" plugspace="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" id='+id+'></embed>';
 document.getElementById(elm).innerHTML = str;
}

