
function printItem(itemID)
{
	window.showModalDialog('common/printIndexItem.aspx?id=' + itemID);
}
function sendItemToFriend(itemID)
{
	window.showModalDialog('common/sendItemToFriend.aspx?id=' + itemID);
}

var regExp = /<\/?[^>]+>/gi;
function ReplaceTags(xStr){
	xStr = xStr.replace(regExp,"");
    return xStr;
}
function addLoadEvent(func) 
{
    var oldonload = window.onload;
    if (typeof window.onload != 'function') 
        window.onload = func;
    else 
        window.onload = function() 
        {
            if (oldonload) 
                oldonload();
			func();
        }
}
// JavaScript Document

 
function CreateFlashControl(DivID, WIDTH, HEIGHT, URL, WMODE,MENU)
{

  var d = document.getElementById(DivID);
	
	FlObj='<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0  width=' + WIDTH + ' height=' + HEIGHT +'>'
	FlObj=FlObj+'<param name="movie" value=' + URL + '>'
	FlObj=FlObj+'<param name="wmode" value=' + WMODE + '>'	
	FlObj=FlObj+'<param name="menu" value=' + MENU + '>'
	FlObj=FlObj+'<embed src='+ URL +'  wmode=' + WMODE + ' quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=' + WIDTH + ' height=' + HEIGHT +'></embed></object>'
d.innerHTML =FlObj;	
	
}

function opendoc(x)
{
	switch(x)
	{
	case 1: 
		document.location.href = 'index.aspx?id=1872';
		break;
	case 2:
		document.location.href = 'index.aspx?id=1845';
		break;
	case 3:
		document.location.href = 'index.aspx?id=1847';
		break;
	case 4:
		document.location.href = 'index.aspx?id=1848';
		break;

	}
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {

	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) 
		{
		//alert(document[changeImages.arguments[i]].src)
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		buttons_001_over = newImage("/images/RightHpPic1Hover.JPG");
		buttons_002_over = newImage("/images/RightHpPic2Hover.JPG");
		buttons_003_over = newImage("/images/RightHpPic3Hover.JPG");
		buttons_004_over = newImage("/images/RightHpPic4Hover.JPG");
		buttons_035_over = newImage("/images/sidemenuhoverbg.gif");
		preloadFlag = true;
	}
}
function SetJS(location,tag){
var objRef = document.getElementById('__BANNER_' + location);
objRef.innerHTML = tag


}

addLoadEvent(preloadImages);


function setListeners()
	{
		inputList = document.getElementsByTagName("INPUT");
		for(i=0;i<inputList.length;i++){
		if(inputList[i].attachEvent)
		inputList[i].attachEvent("onpropertychange",restoreStyles);
		else if(inputList[i].addEventListener)
			inputList[i].addEventListener("propertychange",restoreStyles,false);
		else
			inputList[i].onpropertychange = restoreStyles;
		inputList[i].style.backgroundColor = "";
    }
    selectList = document.getElementsByTagName("SELECT");
    for(i=0;i<selectList.length;i++){
    if(selectList[i].attachEvent)
		selectList[i].attachEvent("onpropertychange",restoreStyles);
		else if(selectList[i].addEventListener)
			selectList[i].addEventListener("propertychange",restoreStyles,false);
		else
			selectList[i].onpropertychange = restoreStyles;
		selectList[i].style.backgroundColor = "";
    }
}

addLoadEvent(setListeners);

function restoreStyles(){
    if(event.srcElement.style.backgroundColor != "")
        event.srcElement.style.backgroundColor = "";
}

function SetFlashJS(location,d,s,tag,width,height){
//var objRef = parent.document.getElementById('');
CreateFlashControl('__BANNER_' + location,width,height,tag,"Transparent","");
}

function populateIframe(langID,mainID)
{

var frm;
				var acronyms = document.getElementsByTagName("acronym"), ids = [];
				
				for(var i=0,len=acronyms.length; i<len; i++)
					ids[ids.length] = acronyms[i].id.split("_BANNER_")[1];

				if(!ids.length) ;
				frm = document.getElementById("banners_load_frame");
				frm.src = "BannersHandler.axd?mainID=" + mainID+ "&langID=" + langID + "&ids=" + ids.join(",");
				
				
				
}

	function showPicture(src)
	{
		window.open('ImageView.aspx?img='+src,'picture','scrollbar:no statusbar:no')
	}


var bpss={
    
    bubble: function(id) {
		if($(id)) {
			if($(id).visible() == false) { /*$(id).show();*/ Effect.Appear(id); }
			else { $(id).hide(); }
		}
	}
}
function WindowOpen(address)
{
	window.open(address,"demo","width=1004,height=700,scrollbars=0,resizable=1,toolbar=0,status=0,location=0,menubar=0,top=0,left=0")
}
