// Common JScript For Bazargani News Source Code
// Developed by:   Elham Esmaieli
// Date:           06 October 2008


// parameters

/* -------Go to specific link------------  */
function goToURL(url){
    window.location.href = url;
}

/* -------Change image SRC------------  */
function changeImage(imgId, imgSrc){
    document.getElementById(imgId).src = imgSrc;
}

/* -------Change background color------------  */
function changeBackground(objId, bgColor){
    document.getElementById(objId).style.backgroundColor = bgColor;
}

/* -------Active current tab and disactive others------------  */
function activeCurrentTab(tabCount, obj, objId, bgColor){
    tabId = obj.id;
    tab = tabId.substring(0,5);
    currentTab = tabId.substring(5,6);
    for(var c=1; c<=tabCount; c++){
        document.getElementById(tab + c).childNodes[0].className = 'tabRDisactive';
        document.getElementById(tab + c).childNodes[1].className = 'tabMDisactive';
        document.getElementById(tab + c).childNodes[2].className = 'tabLDisactive';
    }
    document.getElementById(tabId).childNodes[0].className = 'tabRActive';
    document.getElementById(tabId).childNodes[1].className = 'tabMActive';
    document.getElementById(tabId).childNodes[2].className = 'tabLActive';    
    document.getElementById(objId).style.backgroundColor = bgColor;
}

/* -------Right Pan item Over and out------------  */
function clickToShowNext(divId){
	n = parseInt(divId.substring(7,8)) + 1;
	if (n == 4){
		n = 1;
	}
	
	s = divId.substring(0,7);
	
	nxt = s + n;
	document.getElementById(divId).style.display = 'none';
	document.getElementById(nxt).style.display = 'block';
}

