﻿function RemoveDiv (DivId){
	document.getElementById(DivId).style.display = "none";
	document.getElementById(DivId).style.height = 0;
	document.getElementById(DivId).style.height = 0;
}

function HideContent(d) {
    document.getElementById(d).style.display = "none";
}

var intervalCounter;
function HideContentTimer(d) {
    intervalCounter = setInterval("doHideContent('" + d + "')", 5000);    
}

function ShowContentTimer(d) {
	document.getElementById(d).style.display = "block";
    intervalCounter = setInterval("doHideContent('" + d + "')", 3000);
}

function doHideContent(d) {
    document.getElementById(d).style.display = "none";
    clearInterval(intervalCounter);
}

function ShowContent(d) {
    document.getElementById(d).style.display = "block";
}

function ReverseDisplay(d) {
    if(document.getElementById(d).style.display == "none") { document.getElementById(d).style.display = "block"; }
    else { document.getElementById(d).style.display = "none"; }
}

function pop_up_news_image() {
    window.open("","frame","width=780,height=585,resizable=yes,status=no,scrollbars=yes")
}

function initialize() 
{
  if (GBrowserIsCompatible()) {
    	var map = new GMap2(document.getElementById("map_canvas"));
		map.setCenter(new GLatLng(41.018983, 28.968319), 7);
		map.addControl(new GSmallMapControl());
		map.addControl(new GMapTypeControl()); 
		var marker = new GMarker(map.getCenter(), {draggable: false});
		map.addOverlay(marker);
		map.openInfoWindow(map.getCenter(),
		document.createTextNode("Marmara Belediyeler Birliği"));
	}
}


//Textarea field max length control
function checkMaxFieldTextarea(field, maxlimit) {
    if (document.getElementById(field).value.length > maxlimit)
        document.getElementById(field).value = document.getElementById(field).value.substring(0, maxlimit);
}
//Textarea field max length control


function swapActivityLink(count, cDiv)
{
    clearInterval(rotateIntervalCounter);
    for(i = 0; i<count; i++)
        document.getElementById('link-activity-' + i).style.display = 'none'

    for (i = 0; i < count; i++) 
    {
        document.getElementById('pager-link-activity-' + i).style.textDecoration = 'none';
        document.getElementById('pager-link-activity-' + i).style.color = '#FFFFFF';
    }
        
    document.getElementById('link-activity-' + cDiv).style.display = 'block';
    document.getElementById('pager-link-activity-' + cDiv).style.textDecoration = 'none';
    document.getElementById('pager-link-activity-' + cDiv).style.color = '#EF081F';
}

var rotateActivityNumber = 0;
var rotateIntervalCounter;

function rotateActivity(count)
{
    rotateIntervalCounter = setInterval("swapActivityLink2('" + count + "')", 3000);
    rotateActivityNumber++;
}

function swapActivityLink2(count)
{
    if(count == rotateActivityNumber)
        rotateActivityNumber = 0;

    for (i = 0; i < count; i++) 
    {
        document.getElementById('link-activity-' + i).style.display = 'none'
        document.getElementById('pager-link-activity-' + i).style.color = '#FFFFFF';
    }
        
    for(i = 0; i<count; i++)
        document.getElementById('pager-link-activity-' + i).style.textDecoration='none';
        
    document.getElementById('link-activity-' + rotateActivityNumber).style.display = 'block';
    document.getElementById('pager-link-activity-' + rotateActivityNumber).style.color = '#EF081F';
     document.getElementById('pager-link-activity-' + rotateActivityNumber).style.textDecoration = 'none';
    
    rotateActivityNumber++;
}


