/* GENERAL FUNCTIONS */

/* UA IE (work with universal script) */
var nUaIE=nUa.indexOf("MSIE ")!=-1;

/* UA IE6 (work with universal script) */
var nUaIE6=nUa.indexOf("MSIE 6")!=-1;

/* UA UNDER IE 7 (work with universal script) */
var nUaUIE7=nUa.slice(nUa.indexOf("MSIE ")+"MSIE ".length,nUa.indexOf("MSIE ")+"MSIE ".length+1)<8;

/* IMG ROLLOVER */
$(document).ready(function(){
	$(".rollover").hover(
		function () { //hover
		var srcOvr=$(this).attr('src').replace('_def.','_ovr.');
			$(this).attr('src',srcOvr);
		},
		function () { //out
		var srcDef=$(this).attr('src').replace('_ovr.','_def.');
			$(this).attr('src',srcDef);
		}
	);
});

/* SUB WINDOW OPEN */
function openSWin(uri,name,w,h) {
	sub=window.open(uri,name,"location=no,directories=no,scrollbars=1,resizable=0,width="+w+",height="+h+",left=5,top=5");
	sub.focus();
}

/* FLOAT WINDOW MASK SIZE */
function mskSpread(id){
	var w=$(document).width()+'px';
	if(nUaIE6){
		w=$(document).width()-18+'px';
	}
	$(id).width(w).height($(document).height()+'px');
}

/* BLANK ICON ADD */
$(document).ready(function(){
	$('.newsIdx dd a,.mediaList .itemName a').each(function(){
		if($(this).attr('target')=='_blank'){
			$(this).append('<img src="/resources_shared/images/icn_popup.gif" alt="" width="9" height="9" class="iconR" />');
		};
	});
});


////////////////////////////////////////////////////////////////////////////////
/// ”z—ñ index IE‘Îô
////////////////////////////////////////////////////////////////////////////////

if(!Array.indexOf){
	Array.prototype.indexOf=function(object){
		for(var i=0;i<this.length;i++){
			if(this[i]==object) return i;
		}
		return -1;
	}
}


////////////////////////////////////////////////////////////////////////////////
/// ƒŠƒ“ƒN“®ì—}Ž~
////////////////////////////////////////////////////////////////////////////////

function evtCncl(event){
	if(!event){
		event=WIN.event;
	}
	if(event.preventDefault){
		event.preventDefault();
	}else{
		event.returnValue=false;
	}
}


////////////////////////////////////////////////////////////////////////////////
/// ”wŒiƒLƒƒƒbƒVƒ… IE6‘Îô
////////////////////////////////////////////////////////////////////////////////
//No more IE6 background flicker
$(function () {
    if ($.browser.msie && $.browser.version == 6) {
        try {
            document.execCommand('BackgroundImageCache', false, true);
        } catch(e) {}
    }
});

