
function mailClose ()
{
	var fade = document.getElementById ( 'fade' );
	var mail = document.getElementById ( 'contact_us_container' );
	fade.style.visibility = 'hidden';
	mail.style.visibility = 'hidden';
}

function showContactUs()
{
	var fade = document.getElementById ( 'fade' );
	var mail = document.getElementById ( 'contact_us_container' );
	fade.style.visibility = 'visible';
	fade.style.opacity = 0.6;
	fade.style.filter = 'alpha(opacity=' + 50 + ')';
	
	mail.style.visibility = 'visible';
	
	$('contact_us_container').innerHTML = 'Loading...';	
	new Ajax.Request ('/contacts/contact_us.php',
		{
			method: 'get',
			encoding: 'utf-8',
			asynchronous: false,
			onSuccess: function(transport) {
				$('contact_us_container').innerHTML = transport.responseText;
			}
		}
		);
}

function showDesignerForSeason(seasonId)
{
        //alert(seasonId);
	$('container_designer_for_season').innerHTML = 'Loading...';	
	new Ajax.Request ('/fashion/designer_list_for_season.php?seasonId='+seasonId,
		{
			method: 'get',
			encoding: 'utf-8',
			asynchronous: false,
			onSuccess: function(transport) {
				$('container_designer_for_season').innerHTML = transport.responseText;
			}
		}
		);
}
function showDesignerForCity(cityId)
{
        //alert(seasonId);
	$('container_designer_for_city').innerHTML = 'Loading...';	
	new Ajax.Request ('/fashion/designer_list_for_city.php?cityId='+cityId,
		{
			method: 'get',
			encoding: 'utf-8',
			asynchronous: false,
			onSuccess: function(transport) {
				$('container_designer_for_city').innerHTML = transport.responseText;
			}
		}
		);
}
function showMonthForIssue(issueId) {
        //alert(issueId);
	$('container_month_for_issue').innerHTML = '';	
	new Ajax.Request ('/magazine/get_month.php?issueId='+issueId,
		{
			method: 'get',
			encoding: 'utf-8',
			asynchronous: false,
			onSuccess: function(transport) {
				$('container_month_for_issue').innerHTML = transport.responseText;
			}
		}
		);
}
function closeMonthForIssue() {
	$('container_month_for_issue').innerHTML = '';	
}

function showSimilar(tag) {
	$('container_similar').innerHTML = '';	
	new Ajax.Request ('/test/get_list_similar.php?tags='+tag,
		{
			method: 'get',
			encoding: 'utf-8',
			asynchronous: false,
			onSuccess: function(transport) {
				$('container_similar').innerHTML = transport.responseText;
			}
		}
		);
}

function showSlideShow(url)
{
    $('SlideShowBg').style.display = 'block';
    $('SlideShowDiv').style.visibility = 'visible';
    var wHeight = document.viewport.getHeight();
    var wWidth = document.viewport.getWidth();
    //alert(wWidth+'x'+wHeight);
    var y = wHeight / 2 - 340;
    y = y < 10 ? 10 : y;
    var x = wWidth / 2 - 460;
    x = x < 10 ? 10 : x;
    $('SlideShowDiv').style.top = y+'px';
    $('SlideShowDiv').style.left = x+'px';
   $('ImagePopup').src = url;
}

function SlideShowClose()
{
    try {
	$('SlideShowBg').style.display = 'none';
	$('SlideShowDiv').style.visibility = 'hidden';
	$('ImagePopup').src = '/images/1.gif';
    } catch(e) {;}
}

function CheckSlideShow4Close()
{
    //alert($('ImagePopup').src);
    
    if ($('ImagePopup').src.indexOf("play=close") > 0) 
    {
	SlideShowClose();
    }
}

function CheckSlideShowKeyESC(r)
{
    if (r.keyCode == Event.KEY_ESC) 
    {
	SlideShowClose();
    }

}