
// define report vars
var report_type = '';
var report_text = '';
var report_object_id = '';
var report_image_id = '';
var report_url = '';
function closeAddReport(){
	_id('addreport_status').innerHTML = '';
	_id('addreport_popup').style.left = '-500px';
	hide('addreport_popup');
}
function displayAddReport(report_type_show){
	// fileReport($site_id,$type,$object_id,$reporter_id=null,$text=null,$image_id=null,$url=null)
	hide('addreport_status');
	show('addreport_content');
	_id('report_type_show').innerHTML = report_type_show;
	_id('addreport_popup').style.top = getScrollHeight()+100+'px';
	_id('addreport_popup').style.left = '180px';
	show('addreport_popup');
}
// specific report function for each content type
// sets up report vars correctly

function reportPageComment(object_id){
	report_type  = 'pageComment';
	report_text = _id('page_comment_text_'+object_id).innerHTML;
	report_object_id = object_id;
	report_image_id = null;
	report_url = document.URL;//'/page.php?id='+report_object_id;
	displayAddReport('Anmäl denna kommentar?');
}

function reportBlogComment(object_id){
	report_type  = 'blogComment';
	report_text = _id('blog_comment_text_'+object_id).innerHTML;
	report_object_id = object_id;
	report_image_id = null;
	report_url = document.URL;
	displayAddReport('Anmäl denna bloggkommentar?');
}

function reportBlogEntry(object_id){
	report_type  = 'blogEntry';
	report_text = _id('blog_entry_hdl_'+object_id).innerHTML + ' ' + _id('blog_entry_text_'+object_id).innerHTML;
	report_object_id = object_id;
	report_image_id = _id('blog_entry_imgid_'+object_id).innerHTML;
	report_url = 'http://'+window.location.hostname+'/blogg/blogginlagg.php?entry_id='+object_id;
	displayAddReport('Anmäl detta blogginlägg?');
}

function reportImage(object_id){
	report_type  = 'image';
	report_text = _id('image_text_'+object_id).innerHTML;
	report_object_id = object_id;
	report_image_id = object_id;
	report_url = document.URL;
	displayAddReport('Anmäl denna bild?');
}

function reportUserWall(object_id){
	report_type  = 'userWall';
	report_text = _id('wall_text_'+object_id).innerHTML;
	report_object_id = object_id;
	report_image_id = null;
	report_url = document.URL;
	displayAddReport('Anmäl detta inlägg?');
}

function reportPublicWall(object_id){
	report_type  = 'publicWall';
	report_text = _id('wall_text_'+object_id).innerHTML;
	report_object_id = object_id;
	report_image_id = null;
	report_url = document.URL;
	displayAddReport('Anmäl detta inlägg?');
}

function reportForum(object_id, parent){
	if(parent){ 
		report_type  = 'forumPost'; 
	}else{
		report_type  = 'forumThread'; 
	}
	report_text = _id('forum_text_'+object_id).innerHTML;
	report_object_id = object_id;
	report_image_id = null;
	report_url = document.URL;
	displayAddReport('Anmäl detta foruminlägg?');
}

function reportImageComment(object_id){
	report_type  = 'imageComment';
	report_text = _id('image_comment_text_'+object_id).innerHTML;
	report_object_id = object_id;
	report_image_id = null;
	report_url = document.URL;
	displayAddReport('Anmäl denna bildkommentar?');
}


