(function(){
var bds = {
util: {}
};
var c = document.getElementById('kw').parentNode;
bds.util.getWinWidth = function(){
return window.document.documentElement.clientWidth;
};
bds.util.setFormWidth = function(){
var width = bds.util.getWinWidth();
if(width < 1217) {bds.util.setClass(c, 'ip_short', 'add')}
else {bds.util.setClass(c, 'ip_short', 'remove')};
};
bds.util.setClass = function(obj, class_name, set) {
var ori_class = obj.className,
has_class_p = -1,
ori_class_arr = [],
new_class = '';
if(ori_class.length) ori_class_arr = ori_class.split(' ');
for( i in ori_class_arr) {
if(ori_class_arr[i] == class_name) has_class_p = i;
}
if( set == 'remove' && has_class_p >= 0) {
ori_class_arr.splice(has_class_p, 1);
new_class = ori_class_arr.join(' ');
obj.className = new_class;
} else if( set == 'add' && has_class_p < 0) {
ori_class_arr.push(class_name);
new_class = ori_class_arr.join(' ');
obj.className = new_class;
}
}
bds.util.setFormWidth();
if (typeof document.addEventListener != "undefined") {
window.addEventListener('resize', bds.util.setFormWidth, false);
document.getElementById('kw').addEventListener('focus', function(){bds.util.setClass(c,'iptfocus', 'add');}, false);
document.getElementById('kw').addEventListener('blur', function(){bds.util.setClass(c,'iptfocus', 'remove');}, false);
} else {
window.attachEvent('onresize', bds.util.setFormWidth, false);
document.getElementById('kw').attachEvent('onfocus', function(){bds.util.setClass(c,'iptfocus', 'add');}, false);
document.getElementById('kw').attachEvent('onblur', function(){bds.util.setClass(c,'iptfocus', 'remove');}, false);
}
})();
//</script>